Public Member Functions | Public Attributes | List of all members
ipe::Arc Class Reference

#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

Detailed Description

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).

Constructor & Destructor Documentation

◆ Arc() [1/4]

ipe::Arc::Arc ( )

Construct unit circle.

◆ Arc() [2/4]

ipe::Arc::Arc ( const Matrix m,
Angle  alpha,
Angle  beta 

Construct with given parameters.

◆ Arc() [3/4]

ipe::Arc::Arc ( const Matrix m)

Construct an ellipse.

◆ Arc() [4/4]

Arc::Arc ( const Matrix m,
const Vector begp,
const Vector endp 

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().

Member Function Documentation

◆ isEllipse()

bool ipe::Arc::isEllipse ( ) const

Is this an entire ellipse?

References iAlpha, and iBeta.

Referenced by bbox(), distance(), ipe::Painter::doDrawArc(), and ipe::CairoPainter::doDrawArc().

◆ distance() [1/2]

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().

◆ distance() [2/2]

double Arc::distance ( const Vector v,
double  bound,
Vector pos,
Angle angle 
) const

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().

◆ bbox()

Rect Arc::bbox ( ) const

◆ beginp()

Vector ipe::Arc::beginp ( ) const

Return begin point of arc.

References iAlpha, and iM.

Referenced by ipe::Path::drawArrow(), and intersect().

◆ endp()

Vector ipe::Arc::endp ( ) const

Return end point of arc.

References iBeta, and iM.

Referenced by Arc(), ipe::Path::drawArrow(), and intersect().

◆ intersect() [1/4]

void Arc::intersect ( const Line l,
std::vector< Vector > &  result 
) const

◆ intersect() [2/4]

void Arc::intersect ( const Segment s,
std::vector< Vector > &  result 
) const

Compute intersection points of Arc with Segment.

References intersect(), ipe::Segment::iP, ipe::Segment::iQ, ipe::Segment::line(), and ipe::size().

◆ intersect() [3/4]

void Arc::intersect ( const Arc a,
std::vector< Vector > &  result 
) const

Compute intersection points of Arc with Arc.

References bbox(), beginp(), endp(), and intersect().

◆ intersect() [4/4]

void Arc::intersect ( const Bezier b,
std::vector< Vector > &  result 
) const

Member Data Documentation

◆ iM

Matrix ipe::Arc::iM

◆ iAlpha

Angle ipe::Arc::iAlpha

◆ iBeta

Angle ipe::Arc::iBeta

The documentation for this class was generated from the following files: