Ipelib
|
#include <ipegeo.h>
Public Member Functions | |
Arc () | |
Arc (const Matrix &m, Angle alpha, Angle beta) | |
Arc (const Matrix &m) | |
Arc (const Matrix &m0, const Vector &begp, const Vector &endp) | |
bool | isEllipse () const |
double | distance (const Vector &v, double bound) const |
double | distance (const Vector &v, double bound, Vector &pos, Angle &angle) const |
Rect | bbox () const |
Vector | beginp () const |
Vector | endp () const |
void | intersect (const Line &l, std::vector< Vector > &result) const |
void | intersect (const Segment &s, std::vector< Vector > &result) const |
void | intersect (const Arc &a, std::vector< Vector > &result) const |
void | intersect (const Bezier &b, std::vector< Vector > &result) const |
Public Attributes | |
Matrix | iM |
Angle | iAlpha |
Angle | iBeta |
An arc of an ellipse.
The ellipse is represented using the matrix that transforms the unit circle x^2 + y^2 = 1 to the desired ellipse. The arc coordinate system is the coordinate system of this unit circle.
A full ellipse is described by iAlpha = 0, iBeta = IpeTwoPi.
An elliptic arc is the image of the circular arc from iAlpha to iBeta (in increasing angle in arc coordinate system).
|
inline |
Construct unit circle.
|
inline |
Construct an ellipse.
Construct arc for ellipse defined by m, from begp to endp.
This assumes that m has been correctly computed such that begb and endp already lie on the ellipse.
References endp(), iAlpha, iBeta, iM, and ipe::Matrix::inverse().
|
inline |
Is this an entire ellipse?
Referenced by bbox(), distance(), ipe::Painter::doDrawArc(), and ipe::CairoPainter::doDrawArc().
double Arc::distance | ( | const Vector & | v, |
double | bound | ||
) | const |
This doesn't really compute the distance, but a reasonable approximation.
Referenced by ipe::Ellipse::distance(), ipe::Snap::setEdge(), ipe::CurveSegment::snapBnd(), and ipe::Ellipse::snapBnd().
Like distance(), but sets pos to point on arc and angle to its angle in arc coordinates. angle and pos are not modified if result is larger than bound.
References ipe::Vector::angle(), iAlpha, iBeta, iM, ipe::Matrix::inverse(), isEllipse(), ipe::Angle::liesBetween(), and ipe::Vector::normalized().
Rect Arc::bbox | ( | ) | const |
Return a tight bounding box.
References ipe::Rect::addPoint(), iAlpha, iBeta, iM, ipe::Linear::inverse(), isEllipse(), ipe::Angle::liesBetween(), and ipe::Matrix::linear().
Referenced by intersect().
|
inline |
Return begin point of arc.
Referenced by ipe::Path::drawArrow(), and intersect().
|
inline |
Return end point of arc.
Referenced by Arc(), ipe::Path::drawArrow(), and intersect().
Compute intersection points of Arc with Line.
References ipe::Vector::angle(), ipe::Line::dir(), iAlpha, iBeta, iM, ipe::Matrix::inverse(), ipe::Line::iP, ipe::Angle::liesBetween(), and ipe::Matrix::linear().
Referenced by intersect().
Compute intersection points of Arc with Segment.
References intersect(), ipe::Segment::iP, ipe::Segment::iQ, ipe::Segment::line(), and ipe::size().
Compute intersection points of Arc with Bezier.
References ipe::Rect::addPoint(), bbox(), iM, intersect(), ipe::Bezier::iV, ipe::Bezier::straight(), and ipe::Bezier::subdivide().
Matrix ipe::Arc::iM |
Referenced by Arc(), bbox(), beginp(), distance(), ipe::Painter::doDrawArc(), ipe::CairoPainter::doDrawArc(), endp(), intersect(), ipe::Matrix::operator*(), and ipe::Snap::setEdge().
Angle ipe::Arc::iAlpha |
Referenced by Arc(), bbox(), beginp(), distance(), ipe::Painter::doDrawArc(), ipe::CairoPainter::doDrawArc(), intersect(), isEllipse(), and ipe::Matrix::operator*().
Angle ipe::Arc::iBeta |
Referenced by Arc(), bbox(), distance(), ipe::Painter::doDrawArc(), ipe::CairoPainter::doDrawArc(), endp(), intersect(), isEllipse(), and ipe::Matrix::operator*().