IpePainter-derived classes are used for drawing to the screen and for generating PDF output.
The IpePainter maintains a stack of graphics states, which includes stroke and fill color, line width, dash style, miter limit, line cap and line join, and the current transformation matrix. The IpePainter class takes care of maintaining this stack, and setting of the attributes in the current graphics state.
Setting an attribute with a symbolic value is resolved immediately using the IpeStyleSheet attached to the IpePainter, so calling the Stroke() or Fill() methods of IpePainter will return the current absolute color.
Attributes must not be changed after a path has been started. (Although this does not seem to be stated explicitely in the PDF Reference, Acrobat Reader 4 complains if the dash style is set after a path has been defined.)
Derived classes need to implement the functions for drawing paths, images, and texts.
A null color is drawn as if it was void. Ipe objects exploit this: only group objects ever need to explicitly contain a 'void' color.
A null dash style is drawn as solid.
A null line width is drawn as whatever is the standard of the drawing medium.
|
Constructor takes a (cascaded) style sheet, which is not owned. The initial graphics state contains null attributes and default line cap and line join. |
|
Virtual destructor.
|
|
Concatenate a matrix to current transformation matrix.
|
|
Reset transformation to original one, but with different origin/direction.
This changes the current transformation matrix to the one set before the first Push operation, but maintaining the current origin. If direct is |
|
Concatenate a translation to current transformation matrix.
|
|
Start a new open path.
|
|
Start a new closed path.
|
|
Add line segment to path.
|
|
Add a Bezier segment to path.
|
|
Overloaded function.
Assumes current position is |
|
Add a rectangle to the path. Has a default implementation in terms of LineTo, but derived classes can reimplement for efficiency. |
|
End open path.
|
|
End closed path.
|
|
Save current graphics state.
|
|
Restore previous graphics state.
|
|
Fill and/or stroke a path (depending on color). As in PDF, an "path" can consist of several components that are defined by sequences of BeginClosedPath() and EndClosedPath(). |
|
Render a bitmap. Assumes the transformation matrix has been set up to map the unit square to the image area on the paper. |
|
Render a text object. Stroke color is already set, and the origin is the lower-left corner of the text box. |
|
Draw the unit circle. PDF does not have an "arc" or "circle" primitive, so to draw an arc, circle, or ellipse, Ipe has to translate it into a sequence of Bezier curves. The approximation is based on the following: The unit circle arc from (1,0) to (cos a, sin a) be approximated by a Bezier spline with control points (1, 0), (1, beta) and their mirror images along the line with slope a/2, where beta = 4.0 * (1.0 - cos(a/2)) / (3 * sin(a/2)) Ipe draws circles by drawing four Bezier curves for the quadrants, and arcs by patching together quarter circle approximations with a piece computed from the formula above. This does not modify the transformation matrix. The path is generated as a sequence BeginClosedPath .. CurveTo .. EndClosedPath, but is not actually drawn (DrawPath is not called). |
|
Draw an arc of the unit circle of length alpha. alpha is normalized to [0, 2 pi], and applied starting from the point (1,0). The function works by generating a sequence of Bezier splines (see DrawEllipse for details of the transformation). It only generates calls to CurveTo. It is assumed that the caller has already executed a MoveTo to the beginning of the arc at (1,0). This function may modify the transformation matrix. |
|
Set stroke color, resolving symbolic color.
|
|
Set fill color, resolving symbolic color.
|
|
Set line width, resolving symbolic value.
|
|
Set dash style, resolving symbolic value.
|
|
Set line cap.
|
|
Set line join.
|
|
Set wind rule (wind or even-odd).
|
|
Set font size of text objects. Paradoxically, this isn't actually used to render text, but for saving Ipegroup objects! Text goes through the Pdflatex interface, and the visitor that scans for text objects and writes them to the Latex source file finds the text size information itself. |
|
Set size of mark objects.
|
|
Set shape of mark objects.
|
|
Return style sheet.
|
|
Return current stroke color (always absolute).
|
|
Return current fill color (always absolute).
|
|
Return current transformation matrix.
|
|
Return current line width (always absolute).
|
|
Return current dash style (always absolute).
|
|
Return current line cap.
|
|
Return current line join.
|
|
Return current wind rule.
|
|
Return current text font size.
|
|
Return current mark size.
|
|
Return current mark shape.
|
|
Return repository.
|