# ipe::SubPath Class Reference
[Ipe Geometry]

A subpath of a Path. More...

`#include <ipeshape.h>`

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

List of all members.

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

enum ipe::SubPath::Type

The subpath types.

Enumerator:

  ECurve |
  EEllipse |
  EClosedSpline |

## Constructor & Destructor Documentation

SubPath::~SubPath | ( |  | ) | `[pure virtual]`

Implementation of pure virtual destructor.

## Member Function Documentation

virtual Type ipe::SubPath::type | ( |  | ) | const`[pure virtual]`

Return type of this subpath.

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

bool SubPath::closed | ( |  | ) | const`[virtual]`

Is this subpath closed?

Default implementation returns `true`.

Reimplemented in ipe::Curve.

const Ellipse * SubPath::asEllipse | ( |  | ) | const`[virtual]`

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

Reimplemented in ipe::Ellipse.

const ClosedSpline * SubPath::asClosedSpline | ( |  | ) | const`[virtual]`

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

Reimplemented in ipe::ClosedSpline.

const Curve * SubPath::asCurve | ( |  | ) | const`[virtual]`

Return this object as an Curve, or else 0.

Reimplemented in ipe::Curve.

virtual void ipe::SubPath::save | ( | Stream & | stream | ) | const`[pure virtual]`

Save subpath to XML stream.

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

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.

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.

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.

virtual void ipe::SubPath::snapVtx | ( | const Vector & | mouse,
|  | const Matrix & | m,
|  | Vector & | pos,
|  | double & | bound |
| ) |  |  | const`[pure virtual]`

Snap to vertex.

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

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.

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

- ipeshape.h
- ipeshape.cpp