Ipelib
ipe::ClosedSpline Class Reference

#include <ipeshape.h>

Inherits ipe::SubPath.

Public Member Functions

 ClosedSpline (const std::vector< Vector > &v)
virtual Type type () const
virtual const ClosedSplineasClosedSpline () const
void beziers (std::vector< Bezier > &bez) const
virtual void save (Stream &stream) const
virtual void draw (Painter &painter) const
virtual void addToBBox (Rect &box, const Matrix &m, bool cp) const
virtual double distance (const Vector &v, const Matrix &m, double bound) const
virtual void snapVtx (const Vector &mouse, const Matrix &m, Vector &pos, double &bound, bool cp) const
virtual void snapBnd (const Vector &mouse, const Matrix &m, Vector &pos, double &bound) const
Public Member Functions inherited from ipe::SubPath
virtual ~SubPath ()=0
virtual bool closed () const
virtual const EllipseasEllipse () const
virtual const CurveasCurve () const

Public Attributes

std::vector< VectoriCP

Additional Inherited Members

Public Types inherited from ipe::SubPath
enum  Type { ECurve , EEllipse , EClosedSpline }

Detailed Description

A closed B-spline curve.

Constructor & Destructor Documentation

◆ ClosedSpline()

ClosedSpline::ClosedSpline ( const std::vector< Vector > & v)

References iCP.

Referenced by asClosedSpline().

Member Function Documentation

◆ type()

SubPath::Type ClosedSpline::type ( ) const
virtual

Return type of this subpath.

Implements ipe::SubPath.

References ipe::SubPath::EClosedSpline.

◆ asClosedSpline()

const ClosedSpline * ClosedSpline::asClosedSpline ( ) const
virtual

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

Reimplemented from ipe::SubPath.

References ClosedSpline().

◆ beziers()

void ClosedSpline::beziers ( std::vector< Bezier > & bez) const

References ipe::Bezier::closedSpline(), and iCP.

Referenced by addToBBox(), distance(), draw(), and snapBnd().

◆ save()

void ClosedSpline::save ( Stream & stream) const
virtual

Save subpath to XML stream.

Implements ipe::SubPath.

References iCP, and ipe::size().

◆ draw()

void ClosedSpline::draw ( Painter & painter) const
virtual

Draw subpath (does not call drawPath()).

Implements ipe::SubPath.

References beziers(), ipe::Painter::closePath(), ipe::Painter::curveTo(), and ipe::Painter::moveTo().

◆ addToBBox()

void ClosedSpline::addToBBox ( Rect & box,
const Matrix & m,
bool cp ) const
virtual

Add subpath to box.

Implements ipe::SubPath.

References ipe::Rect::addPoint(), ipe::Rect::addRect(), beziers(), and iCP.

◆ distance()

double ClosedSpline::distance ( const Vector & v,
const Matrix & m,
double bound ) const
virtual

Return distance from v to subpath transformed by m.

Implements ipe::SubPath.

References beziers(), and distance().

Referenced by distance().

◆ snapVtx()

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

Snap to vertex.

Implements ipe::SubPath.

References iCP.

◆ snapBnd()

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

Snap to boundary of subpath.

Implements ipe::SubPath.

References beziers().

Member Data Documentation

◆ iCP

std::vector<Vector> ipe::ClosedSpline::iCP

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