kig
kigpainter.cpp
Go to the documentation of this file.
631 void KigPainter::drawAngle( const Coordinate& point, double startangle, double angle, int radius )
633 const int startangleDegrees = static_cast<int>( Goniometry::convert( startangle, Goniometry::Rad, Goniometry::Deg ) );
634 const int angleDegrees = static_cast<int>( Goniometry::convert( angle, Goniometry::Rad, Goniometry::Deg ) );
666 const int startangleDegrees = static_cast<int>( Goniometry::convert( startangle, Goniometry::Rad, Goniometry::Deg ) );
672 rightAnglePolygon << QPoint( halfSide, 0 ) << QPoint( halfSide, -halfSide ) << QPoint( 0, -halfSide );
961 const int startangle = static_cast<int>( Goniometry::convert( 16 * dstartangle, Goniometry::Rad, Goniometry::Deg ) );
962 const int angle = static_cast<int>( Goniometry::convert( 16 * dangle, Goniometry::Rad, Goniometry::Deg ) );
967 Coordinate b = center + radius * Coordinate( cos( dstartangle + dangle ), sin( dstartangle + dangle ));
void calcRayBorderPoints(const Coordinate &a, Coordinate &b, const Rect &r)
this does the same as the above function, but only for b.
Definition: common.cpp:131
Qt::PenStyle style() const
a CoordinateSystem is what the user sees: it is kept by KigPart to show the user a grid...
Definition: coordinate_system.h:60
QRect normalized() const
QPoint topRight() const
void setWholeWinOverlay()
this is called by some drawing functions that modify the 'entire' screen, i.e.
Definition: kigpainter.cpp:494
void fillRect(const QRectF &rectangle, const QBrush &brush)
void drawCircle(const Coordinate ¢er, double radius)
draw a circle...
Definition: kigpainter.cpp:84
void drawText(const Rect &r, const QString &s, int textFlags=0)
draw text...
Definition: kigpainter.cpp:192
void setBackground(const QBrush &brush)
int right() const
QRect window() const
Qt::BrushStyle style() const
Definition: goniometry.h:31
void drawPolyline(const QPointF *points, int pointCount)
void circleOverlayRecurse(const Coordinate ¢re, double radius, const Rect ¤tRect)
Definition: kigpainter.cpp:354
QPoint bottomRight() const
void translate(int dx, int dy)
QPoint bottomLeft() const
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule)
void setAlpha(int alpha)
int height() const
const Rect boundingRect(const Rect &r, const QString &s, int f=0) const
Definition: kigpainter.cpp:212
void drawVector(const Coordinate &a, const Coordinate &b)
draw a vector ( with an arrow etc.
Definition: kigpainter.cpp:692
void drawLine(const QLineF &line)
void setPoint(int index, int x, int y)
void drawPolygon(const std::vector< QPoint > &pts, Qt::FillRule fillRule=Qt::OddEvenFill)
draw a polygon defined by the points in pts...
Definition: kigpainter.cpp:303
int x() const
int y() const
ScreenInfo is a simple utility class that maps a region of the document onto a region of the screen...
Definition: screeninfo.h:31
bool isNull() const
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
const QColor & color() const
virtual const Coordinate getPoint(double param, const KigDocument &) const =0
void drawRect(const QRectF &rectangle)
QColor color() const
void drawLine(const Coordinate &p1, const Coordinate &p2)
draw a line...
Definition: kigpainter.cpp:187
void setFont(const QFont &font)
void drawPoint(const QPointF &position)
QRectF boundingRect(const QRectF &rectangle, int flags, const QString &text)
void drawArc(const QRectF &rectangle, int startAngle, int spanAngle)
int top() const
void drawFilledRect(const QRect &)
draws a rect filled up with a pattern of cyan lines...
Definition: kigpainter.cpp:523
void setPen(const QColor &color)
void drawEllipse(const QRectF &rectangle)
void setWidth(int c)
setting this to -1 means to use the default width for the object being drawn.
Definition: kigpainter.cpp:232
An ObjectHolder represents an object as it is known to the document.
Definition: object_holder.h:40
void setWidth(int width)
void drawArc(const Coordinate ¢er, double radius, double startangle, double angle)
draw the arc ( a part of a circle ), of the circle with center center, radius radius, with size angle, starting at the angle startAngle.
Definition: kigpainter.cpp:957
void setBrush(const QBrush &brush)
void drawText(const QPointF &position, const QString &text)
const T * constData() const
void putPoints(int index, int nPoints, int firstx, int firsty,...)
void drawTextFrame(const Rect &frame, const QString &s, bool needframe)
Definition: kigpainter.cpp:933
void setContains(Coordinate p)
this makes sure p is in the rect, extending it if necessary...
Definition: rect.cc:240
void drawGrid(const CoordinateSystem &c, bool showGrid=true, bool showAxes=true)
Definition: kigpainter.cpp:507
static double convert(const double angle, const Goniometry::System from, const Goniometry::System to)
The most useful method of this class: convert the specified angle from the system from to the system ...
Definition: goniometry.cc:87
virtual void drawGrid(KigPainter &p, bool showgrid=true, bool showaxes=true) const =0
const QBrush & brush() const
const Rect simpleBoundingRect(const Coordinate &c, const QString &s)
Definition: kigpainter.cpp:573
void drawObject(const ObjectHolder *o, bool sel)
draw an object ( by calling its draw function.
Definition: kigpainter.cpp:513
QRect viewport() const
void drawSimpleText(const Coordinate &c, const QString &s)
Definition: kigpainter.cpp:563
Definition: goniometry.h:31
QMatrix & rotate(qreal degrees)
void draw(KigPainter &p, bool selected) const
Draw this object on the given KigPainter.
Definition: object_holder.cc:78
void calcBorderPoints(Coordinate &p1, Coordinate &p2, const Rect &r)
this sets p1 and p2 to p1' and p2' so that p1'p2' is the same line as p1p2, and so that p1' and p2' a...
Definition: common.cpp:82
int width() const
int width() const
void setHeight(int height)
void circleOverlay(const Coordinate ¢re, double radius)
adds a number of rects to mOverlay so that the rects entirely contain the circle...
Definition: kigpainter.cpp:419
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
void segmentOverlay(const Coordinate &p1, const Coordinate &p2)
adds some rects to mOverlay, so that they cover the segment p1p2 completely...
Definition: kigpainter.cpp:429
QRect toScreenEnlarge(const Rect &r) const
Definition: kigpainter.cpp:550
void translate(int dx, int dy)
QPoint topLeft() const
void moveCenter(const QPoint &position)
void drawAngle(const Coordinate &point, double startangle, double angle, int radius)
draw the angle with center point, with size angle, starting at the angle startAngle.
Definition: kigpainter.cpp:631
void drawRightAngle(const Coordinate &point, double startangle, int diagonal)
draw the angle with center point, with size angle, starting at the angle startAngle.
Definition: kigpainter.cpp:664
void map(int x, int y, int *tx, int *ty) const
const QPen & pen() const
void drawObjects(const std::vector< ObjectHolder * > &os, bool sel)
Definition: kigpainter.cpp:518
void drawSegment(const Coordinate &from, const Coordinate &to)
draw a segment...
Definition: kigpainter.cpp:94
KigPainter(const ScreenInfo &r, QPaintDevice *device, const KigDocument &doc, bool needOverlay=true)
construct a new KigPainter: the ScreenInfo is used to map the document coordinates to the widget coor...
Definition: kigpainter.cpp:48
void drawArea(const std::vector< Coordinate > &pts, bool border=true)
draw an area defined by the points in pts filled with the set color...
Definition: kigpainter.cpp:327
This class represents a curve: something which is composed of points, like a line, a circle, a locus.
Definition: curve_imp.h:27
void drawTextStd(const QPoint &p, const QString &s)
draws text in a standard manner, convenience function...
Definition: kigpainter.cpp:531
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.