Ipelib
|
#include <ipepainter.h>
Inherited by DecorationPainter, IpeQtPainter, ipe::BBoxPainter, ipe::CairoPainter, and ipe::PdfPainter.
Classes | |
struct | State |
Public Member Functions | |
Painter (const Cascade *style) | |
virtual | ~Painter () |
void | setAttributeMap (const AttributeMap *map) |
Attribute | lookup (Kind kind, Attribute sym) const |
void | transform (const Matrix &m) |
void | untransform (TTransformations trans) |
void | translate (const Vector &v) |
void | push () |
void | pop () |
void | pushMatrix () |
void | popMatrix () |
void | newPath () |
void | moveTo (const Vector &v) |
void | lineTo (const Vector &v) |
void | curveTo (const Vector &v1, const Vector &v2, const Vector &v3) |
void | curveTo (const Bezier &bezier) |
void | rect (const Rect &re) |
void | drawEllipse () |
void | drawArc (const Arc &arc) |
void | closePath () |
void | drawPath (TPathMode mode) |
void | drawBitmap (Bitmap bitmap) |
void | drawText (const Text *text) |
void | drawSymbol (Attribute symbol) |
void | addClipPath () |
void | setStroke (Attribute color) |
void | setFill (Attribute color) |
void | setPen (Attribute pen) |
void | setDashStyle (Attribute dash) |
void | setLineCap (TLineCap cap) |
void | setLineJoin (TLineJoin join) |
void | setFillRule (TFillRule rule) |
void | setSymStroke (Attribute color) |
void | setSymFill (Attribute color) |
void | setSymPen (Attribute wid) |
void | setOpacity (Attribute opaq) |
void | setStrokeOpacity (Attribute opaq) |
void | setTiling (Attribute til) |
void | setGradient (Attribute grad) |
const Cascade * | cascade () const |
Color | stroke () const |
Color | fill () const |
const Matrix & | matrix () const |
Fixed | pen () const |
String | dashStyle () const |
void | dashStyle (std::vector< double > &dashes, double &offset) const |
TLineCap | lineCap () const |
TLineJoin | lineJoin () const |
TFillRule | fillRule () const |
Color | symStroke () const |
Color | symFill () const |
Fixed | symPen () const |
Fixed | opacity () const |
Fixed | strokeOpacity () const |
Attribute | tiling () const |
Attribute | gradient () const |
const State & | state () const |
void | setState (const State &state) |
Protected Member Functions | |
virtual void | doPush () |
virtual void | doPop () |
virtual void | doNewPath () |
virtual void | doMoveTo (const Vector &v) |
virtual void | doLineTo (const Vector &v) |
virtual void | doCurveTo (const Vector &v1, const Vector &v2, const Vector &v3) |
virtual void | doDrawArc (const Arc &arc) |
virtual void | doClosePath () |
virtual void | doDrawPath (TPathMode mode) |
virtual void | doDrawBitmap (Bitmap bitmap) |
virtual void | doDrawText (const Text *text) |
virtual void | doDrawSymbol (Attribute symbol) |
virtual void | doAddClipPath () |
void | drawArcAsBezier (double alpha) |
Protected Attributes | |
std::list< State > | iState |
std::list< Matrix > | iMatrix |
const Cascade * | iCascade |
const AttributeMap * | iAttributeMap |
int | iInPath |
Interface for drawing.
Painter-derived classes are used for drawing to the screen and for generating PDF and Postscript output.
The Painter maintains a stack of graphics states, which includes stroke and fill color, line width, dash style, miter limit, line cap and line join. It also maintains a separate stack of transformation matrices. The Painter class takes care of maintaining the stacks, and setting of the attributes in the current graphics state.
Setting an attribute with a symbolic value is resolved immediately using the stylesheet Cascade attached to the Painter, so calling the stroke() or fill() methods of Painter will return the current absolute color.
It's okay to set symbolic attributes that the stylesheet does not define - they are set to a default absolute value (black, solid, etc.).
The painter is either in "general" or in "path construction" mode. The newPath() member starts path construction mode. In this mode, only the path construction operators (moveTo, lineTo, curveTo, rect, drawArc, closePath), the transformation operators (transform, untransform, translate), and the matrix stack operators (pushMatrix, popMatrix) are admissible. The path is drawn using drawPath, this ends path construction mode. Path construction operators cannot be used in general mode.
The graphics state for a path must be set before starting path construction mode, that is, before calling newPath().
Derived classes need to implement the doXXX functions for drawing paths, images, and texts. The transformation matrix has already been applied to the coordinates passed to the doXXX functions.
Painter::Painter | ( | const Cascade * | style | ) |
Constructor takes a (cascaded) style sheet, which is not owned.
The initial graphics state contains all default attributes.
References ipe::EPen, ipe::Cascade::fillRule(), ipe::Cascade::find(), iAttributeMap, iCascade, ipe::Painter::State::iDashStyle, ipe::Painter::State::iFill, ipe::Painter::State::iFillRule, ipe::Painter::State::iGradient, iInPath, ipe::Painter::State::iLineCap, ipe::Painter::State::iLineJoin, iMatrix, ipe::Painter::State::iOpacity, ipe::Painter::State::iPen, iState, ipe::Painter::State::iStroke, ipe::Painter::State::iStrokeOpacity, ipe::Painter::State::iSymFill, ipe::Painter::State::iSymPen, ipe::Painter::State::iSymStroke, ipe::Painter::State::iTiling, ipe::Cascade::lineCap(), ipe::Cascade::lineJoin(), ipe::Attribute::NORMAL(), ipe::Attribute::number(), and state().
|
virtual |
Virtual destructor.
void Painter::setAttributeMap | ( | const AttributeMap * | map | ) |
Set a new attribute map.
References iAttributeMap.
Referenced by ipe::CanvasBase::drawObjects(), ipe::Thumbnail::render(), and ipe::Thumbnail::saveRender().
Lookup a symbolic attribute.
Uses first the attribute map and then the stylesheet.
References ipe::Cascade::find(), iAttributeMap, iCascade, ipe::Attribute::isSymbolic(), and ipe::AttributeMap::map().
Referenced by ipe::Reference::draw(), setDashStyle(), setFill(), setOpacity(), setPen(), setStroke(), setStrokeOpacity(), setSymFill(), setSymPen(), and setSymStroke().
void Painter::transform | ( | const Matrix & | m | ) |
Concatenate a matrix to current transformation matrix.
References iMatrix, and matrix().
Referenced by doDrawArc(), ipe::PdfPainter::doDrawText(), ipe::CairoPainter::doDrawText(), ipe::Group::draw(), ipe::Reference::draw(), ipe::Text::draw(), ipe::TransformTool::draw(), ipe::Image::draw(), ipe::Path::draw(), ipe::Path::drawArrow(), ipe::CanvasBase::drawObjects(), Canvas::drawRect(), ipe::Group::drawSimple(), ipe::Reference::drawSimple(), ipe::Text::drawSimple(), ipe::Image::drawSimple(), ipe::Path::drawSimple(), ipe::Thumbnail::render(), and ipe::Thumbnail::saveRender().
void Painter::untransform | ( | TTransformations | trans | ) |
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. Only the operations allowed in allowed are applied.
References ipe::Matrix::a, ipe::ETransformationsAffine, ipe::ETransformationsRigidMotions, iMatrix, ipe::Linear::inverse(), matrix(), and ipe::Matrix::translation().
Referenced by ipe::Group::draw(), ipe::Reference::draw(), ipe::Text::draw(), ipe::Image::draw(), ipe::Path::draw(), ipe::Path::drawArrow(), ipe::Group::drawSimple(), ipe::Reference::drawSimple(), ipe::Text::drawSimple(), ipe::Image::drawSimple(), and ipe::Path::drawSimple().
void Painter::translate | ( | const Vector & | v | ) |
Concatenate a translation to current transformation matrix.
References ipe::Matrix::a, iMatrix, matrix(), ipe::Vector::x, and ipe::Vector::y.
Referenced by ipe::PdfPainter::doDrawText(), ipe::CairoPainter::doDrawText(), ipe::Reference::draw(), ipe::Text::draw(), ipe::PanTool::draw(), ipe::Path::drawArrow(), ipe::Reference::drawSimple(), and ipe::Text::drawSimple().
void Painter::push | ( | ) |
Save current graphics state.
Cannot be called in path construction mode.
References doPush(), iInPath, iState, and state().
Referenced by ipe::Group::draw(), ipe::Reference::draw(), ipe::Text::draw(), ipe::Image::draw(), ipe::Path::draw(), ipe::Path::drawArrow(), ipe::Group::drawSimple(), and ipe::Reference::drawSimple().
void Painter::pop | ( | ) |
Restore previous graphics state.
Cannot be called in path construction mode.
References doPop(), iInPath, and iState.
Referenced by ipe::Group::draw(), ipe::Reference::draw(), ipe::Text::draw(), ipe::Image::draw(), ipe::Path::draw(), ipe::Path::drawArrow(), ipe::Group::drawSimple(), and ipe::Reference::drawSimple().
void Painter::pushMatrix | ( | ) |
Save current transformation matrix.
References iMatrix, and matrix().
Referenced by doDrawArc(), ipe::PdfPainter::doDrawText(), ipe::Group::draw(), ipe::Reference::draw(), ipe::Text::draw(), ipe::Image::draw(), ipe::Path::draw(), ipe::Path::drawArrow(), ipe::CanvasBase::drawObjects(), Canvas::drawRect(), ipe::Group::drawSimple(), ipe::Reference::drawSimple(), ipe::Text::drawSimple(), ipe::Image::drawSimple(), ipe::Path::drawSimple(), ipe::Thumbnail::render(), and ipe::Thumbnail::saveRender().
void Painter::popMatrix | ( | ) |
Restore previous transformation matrix.
References iMatrix.
Referenced by doDrawArc(), ipe::PdfPainter::doDrawText(), ipe::Group::draw(), ipe::Reference::draw(), ipe::Text::draw(), ipe::Image::draw(), ipe::Path::draw(), ipe::Path::drawArrow(), ipe::CanvasBase::drawObjects(), Canvas::drawRect(), ipe::Group::drawSimple(), ipe::Reference::drawSimple(), ipe::Text::drawSimple(), ipe::Image::drawSimple(), ipe::Path::drawSimple(), ipe::Thumbnail::render(), and ipe::Thumbnail::saveRender().
void Painter::newPath | ( | ) |
Enter path construction mode.
References doNewPath(), iInPath, and iState.
Referenced by ipe::Group::draw(), ipe::PanTool::draw(), ipe::SelectTool::draw(), ipe::Path::draw(), ipe::Path::drawArrow(), ipe::Group::drawSimple(), ipe::Reference::drawSimple(), ipe::Text::drawSimple(), ipe::Image::drawSimple(), and ipe::Path::drawSimple().
void Painter::moveTo | ( | const Vector & | v | ) |
Start a new subpath.
References doMoveTo(), iInPath, and matrix().
Referenced by doDrawArc(), ipe::ClosedSpline::draw(), ipe::Curve::draw(), ipe::Path::drawArrow(), ipe::Reference::drawSimple(), ipe::Text::drawSimple(), and rect().
void Painter::lineTo | ( | const Vector & | v | ) |
Add line segment to current subpath.
References doLineTo(), iInPath, and matrix().
Referenced by ipe::CurveSegment::draw(), ipe::Path::drawArrow(), ipe::Reference::drawSimple(), ipe::Text::drawSimple(), and rect().
Add a Bezier segment to current subpath.
References doCurveTo(), iInPath, and matrix().
Referenced by curveTo(), ipe::CurveSegment::draw(), ipe::ClosedSpline::draw(), and drawArcAsBezier().
|
inline |
Overloaded function.
Assumes current position is bezier.iV
[0]
References curveTo(), and ipe::Bezier::iV.
void Painter::rect | ( | const Rect & | re | ) |
Add a rectangle subpath to the path.
This is implemented in terms of moveTo() and lineTo().
References ipe::Rect::bottomLeft(), ipe::Rect::bottomRight(), closePath(), lineTo(), moveTo(), ipe::Rect::topLeft(), and ipe::Rect::topRight().
Referenced by ipe::PanTool::draw(), ipe::SelectTool::draw(), and ipe::Image::drawSimple().
void ipe::Painter::drawEllipse | ( | ) |
void Painter::drawArc | ( | const Arc & | arc | ) |
Add an elliptic arc to current path.
Assumes the current point is arc.beginp().
References doDrawArc(), and iInPath.
Referenced by ipe::CurveSegment::draw(), ipe::Ellipse::draw(), ipe::SelectTool::draw(), and ipe::Path::drawArrow().
void Painter::closePath | ( | ) |
Close the current subpath.
References doClosePath(), and iInPath.
Referenced by ipe::ClosedSpline::draw(), ipe::Curve::draw(), ipe::SelectTool::draw(), ipe::Path::drawArrow(), ipe::Text::drawSimple(), and rect().
void Painter::drawPath | ( | TPathMode | mode | ) |
Fill and/or stroke a path.
As in PDF, a "path" can consist of several subpaths. Whether it is filled or stroked depends on mode.
References doDrawPath(), and iInPath.
Referenced by ipe::PanTool::draw(), ipe::SelectTool::draw(), ipe::Path::draw(), ipe::Path::drawArrow(), ipe::Reference::drawSimple(), ipe::Text::drawSimple(), ipe::Image::drawSimple(), and ipe::Path::drawSimple().
void Painter::drawBitmap | ( | Bitmap | bitmap | ) |
Render a bitmap.
Assumes the transformation matrix has been set up to map the unit square to the image area on the paper.
References doDrawBitmap(), and iInPath.
Referenced by ipe::Image::draw().
void Painter::drawText | ( | const Text * | text | ) |
Render a text object.
Stroke color is already set, and the origin is the lower-left corner of the text box (not the reference point!).
References doDrawText(), and iInPath.
Referenced by ipe::Text::draw().
void Painter::drawSymbol | ( | Attribute | symbol | ) |
Render a symbol.
The current coordinate system is already the symbol coordinate system. If the symbol is parameterized, then sym-stroke, sym-fill, and sym-pen are already set.
References doDrawSymbol(), and iInPath.
Referenced by ipe::Reference::draw(), and ipe::Thumbnail::saveRender().
void Painter::addClipPath | ( | ) |
Add current path as clip path.
References doAddClipPath(), and iInPath.
Referenced by ipe::Group::draw(), and ipe::Group::drawSimple().
void Painter::setStroke | ( | Attribute | color | ) |
Set stroke color, resolving symbolic color and "sym-x" colors.
References ipe::Attribute::color(), ipe::EColor, iInPath, iState, lookup(), ipe::Attribute::SYM_FILL(), and ipe::Attribute::SYM_STROKE().
Referenced by ipe::Text::draw(), ipe::PanTool::draw(), ipe::SelectTool::draw(), ipe::TransformTool::draw(), ipe::Path::draw(), ipe::Path::drawArrow(), and ipe::CanvasBase::drawTool().
void Painter::setFill | ( | Attribute | color | ) |
Set fill color, resolving symbolic color.
References ipe::Attribute::color(), ipe::EColor, iInPath, iState, lookup(), ipe::Attribute::SYM_FILL(), and ipe::Attribute::SYM_STROKE().
Referenced by ipe::Path::draw(), and ipe::Path::drawArrow().
void Painter::setPen | ( | Attribute | pen | ) |
Set pen, resolving symbolic value.
References ipe::EPen, iInPath, iState, lookup(), ipe::Attribute::number(), pen(), and ipe::Attribute::SYM_PEN().
Referenced by ipe::Path::draw(), and ipe::CanvasBase::drawTool().
void Painter::setDashStyle | ( | Attribute | dash | ) |
Set dash style, resolving symbolic value.
References ipe::EDashStyle, iInPath, iState, lookup(), and ipe::Attribute::string().
Referenced by ipe::Path::draw().
void Painter::setLineCap | ( | TLineCap | cap | ) |
Set line cap.
If cap is EDefaultCap, the current setting remains unchanged.
References ipe::EDefaultCap, iInPath, and iState.
Referenced by ipe::Path::draw().
void Painter::setLineJoin | ( | TLineJoin | join | ) |
Set line join.
If join is EDefaultJoin, the current setting remains unchanged.
References ipe::EDefaultJoin, iInPath, and iState.
Referenced by ipe::Path::draw().
void Painter::setFillRule | ( | TFillRule | rule | ) |
Set fill rule (wind or even-odd).
If the rule is EDefaultRule, the current setting remains unchanged.
References ipe::EDefaultRule, iInPath, and iState.
Referenced by ipe::Path::draw().
void Painter::setSymStroke | ( | Attribute | color | ) |
Set symbol stroke color, resolving symbolic color.
References ipe::Attribute::color(), ipe::EColor, iInPath, iState, lookup(), ipe::Attribute::SYM_FILL(), and ipe::Attribute::SYM_STROKE().
Referenced by ipe::Reference::draw(), and ipe::Path::drawArrow().
void Painter::setSymFill | ( | Attribute | color | ) |
Set symbol fill color, resolving symbolic color.
References ipe::Attribute::color(), ipe::EColor, iInPath, iState, lookup(), ipe::Attribute::SYM_FILL(), and ipe::Attribute::SYM_STROKE().
Referenced by ipe::Reference::draw(), and ipe::Path::drawArrow().
void Painter::setSymPen | ( | Attribute | wid | ) |
Set symbol pen, resolving symbolic pen.
References ipe::EPen, iInPath, iState, lookup(), ipe::Attribute::number(), pen(), and ipe::Attribute::SYM_PEN().
Referenced by ipe::Reference::draw(), and ipe::Path::drawArrow().
void Painter::setOpacity | ( | Attribute | opaq | ) |
Set opacity.
References ipe::EOpacity, iInPath, iState, lookup(), and ipe::Attribute::number().
Referenced by ipe::Text::draw(), ipe::Image::draw(), and ipe::Path::draw().
void Painter::setStrokeOpacity | ( | Attribute | opaq | ) |
Set stroke opacity.
References ipe::EOpacity, iInPath, iState, lookup(), and ipe::Attribute::number().
Referenced by ipe::Path::draw().
void Painter::setTiling | ( | Attribute | tiling | ) |
Set tiling pattern.
If tiling is not normal
, resets the gradient pattern.
References iInPath, ipe::Attribute::isNormal(), iState, ipe::Attribute::NORMAL(), and tiling().
Referenced by ipe::Path::draw().
void Painter::setGradient | ( | Attribute | grad | ) |
Set gradient fill.
If grad is not normal
, resets the tiling pattern.
References iInPath, ipe::Attribute::isNormal(), iState, and ipe::Attribute::NORMAL().
Referenced by ipe::Path::draw().
|
inline |
Return style sheet cascade.
References iCascade.
Referenced by ipe::CairoPainter::doDrawPath(), doDrawSymbol(), ipe::PdfPainter::doDrawSymbol(), ipe::BBoxPainter::doDrawText(), ipe::Reference::draw(), ipe::Path::drawArrow(), and ipe::Reference::drawSimple().
|
inline |
Return current stroke color.
References iState.
Referenced by ipe::CairoPainter::doDrawPath(), ipe::CairoPainter::doDrawText(), and ipe::Path::drawArrow().
|
inline |
|
inline |
Return current transformation matrix.
References iMatrix.
Referenced by curveTo(), ipe::CairoPainter::doDrawArc(), ipe::PdfPainter::doDrawBitmap(), ipe::BBoxPainter::doDrawBitmap(), ipe::CairoPainter::doDrawBitmap(), ipe::PdfPainter::doDrawPath(), ipe::CairoPainter::doDrawPath(), ipe::PdfPainter::doDrawText(), ipe::BBoxPainter::doDrawText(), ipe::CairoPainter::doDrawText(), ipe::Group::draw(), ipe::Path::draw(), ipe::CairoPainter::executeStream(), lineTo(), moveTo(), pushMatrix(), transform(), translate(), and untransform().
|
inline |
Return current pen.
References iState.
Referenced by ipe::BBoxPainter::doDrawPath(), ipe::CairoPainter::doDrawPath(), ipe::Path::drawArrow(), setPen(), and setSymPen().
|
inline |
Return current dash style (always absolute attribute).
References iState.
Referenced by dashStyle(), and ipe::CairoPainter::doDrawPath().
void Painter::dashStyle | ( | std::vector< double > & | dashes, |
double & | offset | ||
) | const |
Return dashstyle as a double sequence.
References dashStyle(), ipe::Lex::eos(), ipe::String::find(), ipe::Lex::getDouble(), and ipe::String::substr().
|
inline |
|
inline |
|
inline |
Return current fill rule.
References iState.
Referenced by ipe::PdfPainter::doDrawPath(), and ipe::CairoPainter::doDrawPath().
|
inline |
Return current symbol stroke color.
References iState.
|
inline |
Return current opacity.
References iState.
Referenced by ipe::CairoPainter::doDrawBitmap(), ipe::CairoPainter::doDrawPath(), ipe::CairoPainter::doDrawText(), and ipe::CairoPainter::executeStream().
|
inline |
|
inline |
Return current tiling.
References iState.
Referenced by ipe::CairoPainter::doDrawPath(), and setTiling().
|
inline |
|
inline |
Return full current graphics state.
References iState.
Referenced by ipe::PdfPainter::doPush(), Painter(), ipe::PdfPainter::PdfPainter(), push(), and setState().
void Painter::setState | ( | const State & | state | ) |
|
protectedvirtual |
Perform graphics state push on output medium.
Reimplemented in ipe::CairoPainter, ipe::BBoxPainter, and ipe::PdfPainter.
Referenced by push().
|
protectedvirtual |
Perform graphics state pop on output medium.
Reimplemented in ipe::CairoPainter, ipe::BBoxPainter, and ipe::PdfPainter.
Referenced by pop().
|
protectedvirtual |
Perform new path operator.
Reimplemented in ipe::BBoxPainter, ipe::PsPainter, and ipe::PdfPainter.
Referenced by newPath().
|
protectedvirtual |
Perform moveto operator.
The transformation matrix has already been applied.
Reimplemented in ipe::CairoPainter, ipe::BBoxPainter, and ipe::PdfPainter.
Referenced by moveTo().
|
protectedvirtual |
Perform lineto operator.
The transformation matrix has already been applied.
Reimplemented in ipe::CairoPainter, ipe::BBoxPainter, and ipe::PdfPainter.
Referenced by lineTo().
|
protectedvirtual |
Perform curveto operator.
The transformation matrix has already been applied.
Reimplemented in ipe::CairoPainter, ipe::BBoxPainter, and ipe::PdfPainter.
Referenced by curveTo().
|
protectedvirtual |
Draw an elliptic arc.
The default implementations calls drawArcAsBezier(). The transformation matrix has not yet been applied to arc.
Reimplemented in ipe::CairoPainter.
References drawArcAsBezier(), ipe::Arc::iAlpha, ipe::Arc::iBeta, ipe::Arc::iM, ipe::Arc::isEllipse(), moveTo(), ipe::Angle::normalize(), popMatrix(), pushMatrix(), and transform().
Referenced by drawArc().
|
protectedvirtual |
Perform closepath operator.
Reimplemented in ipe::CairoPainter, and ipe::PdfPainter.
Referenced by closePath().
|
protectedvirtual |
Actually draw the path.
Reimplemented in ipe::CairoPainter, ipe::BBoxPainter, ipe::PsPainter, and ipe::PdfPainter.
Referenced by drawPath().
|
protectedvirtual |
Draw a bitmap.
Reimplemented in ipe::CairoPainter, ipe::BBoxPainter, ipe::PsPainter, and ipe::PdfPainter.
Referenced by drawBitmap().
|
protectedvirtual |
Draw a text object.
Reimplemented in ipe::CairoPainter, ipe::BBoxPainter, and ipe::PdfPainter.
Referenced by drawText().
|
protectedvirtual |
Draw a symbol.
The default implementation calls the draw method of the object. Only PDF drawing overrides this to reuse a PDF XForm.
Reimplemented in ipe::PdfPainter.
References cascade(), ipe::Object::draw(), ipe::ESymbol, ipe::Cascade::findSymbol(), iAttributeMap, ipe::Symbol::iObject, and ipe::AttributeMap::map().
Referenced by drawSymbol().
|
protectedvirtual |
Add a clip path.
Reimplemented in ipe::CairoPainter, ipe::BBoxPainter, ipe::PsPainter, and ipe::PdfPainter.
Referenced by addClipPath().
|
protected |
Draw an arc of the unit circle of length alpha.
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.
alpha is normalized to [0, 2 pi], and applied starting from the point (1,0).
The function generates a sequence of Bezier splines as 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.
References curveTo().
Referenced by doDrawArc().
|
protected |
Referenced by dashStyle(), ipe::PdfPainter::doDrawPath(), ipe::PdfPainter::drawAttributes(), ipe::PdfPainter::drawOpacity(), fill(), fillRule(), gradient(), lineCap(), lineJoin(), newPath(), opacity(), Painter(), pen(), pop(), push(), setDashStyle(), setFill(), setFillRule(), setGradient(), setLineCap(), setLineJoin(), setOpacity(), setPen(), setState(), setStroke(), setStrokeOpacity(), setSymFill(), setSymPen(), setSymStroke(), setTiling(), state(), stroke(), strokeOpacity(), symFill(), symPen(), symStroke(), and tiling().
|
protected |
Referenced by matrix(), Painter(), popMatrix(), pushMatrix(), transform(), translate(), and untransform().
|
protected |
Referenced by cascade(), ipe::PdfPainter::doDrawPath(), lookup(), and Painter().
|
protected |
Referenced by doDrawSymbol(), ipe::PdfPainter::doDrawSymbol(), lookup(), Painter(), and setAttributeMap().
|
protected |
Referenced by addClipPath(), closePath(), curveTo(), drawArc(), drawBitmap(), drawPath(), drawSymbol(), drawText(), lineTo(), moveTo(), newPath(), Painter(), pop(), push(), setDashStyle(), setFill(), setFillRule(), setGradient(), setLineCap(), setLineJoin(), setOpacity(), setPen(), setStroke(), setStrokeOpacity(), setSymFill(), setSymPen(), setSymStroke(), and setTiling().