ipe::SubPath Class Referenceabstract
Ipe Geometry

`#include <ipeshape.h>`

Inherited by ipe::ClosedSpline, ipe::Curve, and ipe::Ellipse.

## Public Types

enum | Type { ECurve , EEllipse , EClosedSpline }

## Public Member Functions

virtual | ~SubPath ()=0
virtual Type | type () const =0
virtual bool | closed () const
virtual const Ellipse * | asEllipse () const
virtual const ClosedSpline * | asClosedSpline () const
virtual const Curve * | asCurve () const
virtual void | save (Stream &stream) const =0
virtual void | draw (Painter &painter) const =0
virtual void | addToBBox (Rect &box, const Matrix &m, bool cp) const =0
virtual double | distance (const Vector &v, const Matrix &m, double bound) const =0
virtual void | snapVtx (const Vector &mouse, const Matrix &m, Vector &pos, double &bound, bool cp) const =0
virtual void | snapBnd (const Vector &mouse, const Matrix &m, Vector &pos, double &bound) const =0

## Detailed Description

A subpath of a Path.

A subpath is either open, or closed. There are two special kinds of closed subpaths, namely ellipses and closed B-splines.

## Member Enumeration Documentation

## Type

enum ipe::SubPath::Type

The subpath types.

Enumerator
ECurve |
EEllipse |
EClosedSpline |

## Constructor & Destructor Documentation

## ~SubPath()

SubPath::~SubPath | ( |  | ) |

pure virtual

Implementation of pure virtual destructor.

## Member Function Documentation

## type()

virtual Type ipe::SubPath::type | ( |  | ) | const

pure virtual

Return type of this subpath.

Implemented in ipe::Ellipse, ipe::ClosedSpline, and ipe::Curve.

Referenced by ipe::Shape::isSegment().

## closed()

bool SubPath::closed | ( |  | ) | const

virtual

Is this subpath closed?

Default implementation returns `true`.

Reimplemented in ipe::Curve.

Referenced by ipe::Shape::isSegment().

## asEllipse()

const Ellipse * SubPath::asEllipse | ( |  | ) | const

virtual

Return this object as an Ellipse, or nullptr if it's not an ellipse.

Reimplemented in ipe::Ellipse.

## asClosedSpline()

const ClosedSpline * SubPath::asClosedSpline | ( |  | ) | const

virtual

Return this object as an ClosedSpline, or nullptr if it's not a closed spline.

Reimplemented in ipe::ClosedSpline.

## asCurve()

const Curve * SubPath::asCurve | ( |  | ) | const

virtual

Return this object as an Curve, or else nullptr.

Reimplemented in ipe::Curve.

Referenced by ipe::Path::draw(), ipe::Shape::isSegment(), and ipe::Shape::load().

## save()

virtual void ipe::SubPath::save | ( | Stream & | stream | ) | const

pure virtual

Save subpath to XML stream.

Implemented in ipe::Ellipse, ipe::ClosedSpline, and ipe::Curve.

Referenced by ipe::Shape::save().

## draw()

virtual void ipe::SubPath::draw | ( | Painter & | painter | ) | const

pure virtual

Draw subpath (does not call drawPath()).

Implemented in ipe::Ellipse, ipe::ClosedSpline, and ipe::Curve.

Referenced by ipe::Shape::draw().

## addToBBox()

virtual void ipe::SubPath::addToBBox | ( | Rect & | box,
|  | const Matrix & | m,
|  | bool | cp
| ) |  | const

pure virtual

Add subpath to box.

Implemented in ipe::Ellipse, ipe::ClosedSpline, and ipe::Curve.

Referenced by ipe::Shape::addToBBox().

## distance()

virtual double ipe::SubPath::distance | ( | const Vector & | v,
|  | const Matrix & | m,
|  | double | bound
| ) |  | const

pure virtual

Return distance from v to subpath transformed by m.

Implemented in ipe::Ellipse, ipe::ClosedSpline, and ipe::Curve.

Referenced by ipe::Shape::distance().

## snapVtx()

virtual void ipe::SubPath::snapVtx | ( | const Vector & | mouse,
|  | const Matrix & | m,
|  | Vector & | pos,
|  | double & | bound,
|  | bool | cp
| ) |  | const

pure virtual

Snap to vertex.

Implemented in ipe::Ellipse, ipe::ClosedSpline, and ipe::Curve.

Referenced by ipe::Shape::snapVtx().

## snapBnd()

virtual void ipe::SubPath::snapBnd | ( | const Vector & | mouse,
|  | const Matrix & | m,
|  | Vector & | pos,
|  | double & | bound
| ) |  | const

pure virtual

Snap to boundary of subpath.

Implemented in ipe::Ellipse, ipe::ClosedSpline, and ipe::Curve.

Referenced by ipe::Shape::snapBnd().

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

- ipeshape.h
- ipeshape.cpp