IpePathSegment Class Reference
[Ipe Objects]

A segment on an IpeSubPath. More...

List of all members.

Public Types

Public Member Functions

Friends


Detailed Description

A segment on an IpeSubPath.

A segment is either an elliptic arc, a straight segment, a quadratic Bezier spline, a cubic Bezier spline, or a B-spline curve, depending on its Type(). This is a lightweight object, created on the fly by IpeSegmentSubPath::Segment(). There is no public constructor, so the only way to create such an object is through that method.

The Type() is one of the following:


Member Function Documentation

TType IpePathSegment::Type (  )  const [inline]

Type of segment.

int IpePathSegment::NumCP (  )  const [inline]

Number of control points.

IpeVector IpePathSegment::CP ( int  i  )  const [inline]

Return control point.

IpeVector IpePathSegment::Last (  )  const [inline]

Return last control point.

IpeMatrix IpePathSegment::Matrix (  )  const [inline]

Matrix (if Type() == EArc).

IpeBezier IpePathSegment::Bezier (  )  const

Return segment as IpeBezier.

Panics if segment is not a quadratic or cubic Bezier spline.

IpeArc IpePathSegment::Arc (  )  const

Return segment as IpeArc.

Panics if segment is not an arc.

void IpePathSegment::Beziers ( std::vector< IpeBezier > &  bez  )  const

Convert B-spline to a sequence of Bezier splines.

void IpePathSegment::Draw ( IpePainter painter  )  const

Draw the segment.

Current position of the painter is already on first control point.

void IpePathSegment::AddToBBox ( IpeRect box,
const IpeMatrix m 
) const

Add segment to bounding box.

Does not assume that first control point has already been added. Centers of arcs are included in the bbox, to make sure snapping finds them.

double IpePathSegment::Distance ( const IpeVector v,
const IpeMatrix m,
double  bound 
) const

Return distance to the segment.

void IpePathSegment::SnapVtx ( const IpeVector mouse,
const IpeMatrix m,
IpeVector pos,
double &  bound 
) const

Snap to vertex of the segment.

The method assumes that the first control point has already been tested.


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