cinder::Path2d Class Reference

#include <Path2d.h>

List of all members.

Public Types

enum  SegmentType {
  MOVETO, LINETO, QUADTO, CUBICTO,
  CLOSE
}

Public Member Functions

 Path2d ()
 Path2d (const BSpline< Vec2f > &spline, float subdivisionStep=0.01f)
void moveTo (const Vec2f &p)
 Sets the start point of the path to p. This is the only legal first command, and only legal as the first command.
void moveTo (float x, float y)
 Sets the start point of the path to (x, y ). This is the only legal first command, and only legal as the first command.
void lineTo (const Vec2f &p)
void lineTo (float x, float y)
void quadTo (const Vec2f &p1, const Vec2f &p2)
void quadTo (float x1, float y1, float x2, float y2)
void curveTo (const Vec2f &p1, const Vec2f &p2, const Vec2f &p3)
void curveTo (float x1, float y1, float x2, float y2, float x3, float y3)
void arc (const Vec2f &center, float radius, float startRadians, float endRadians, bool forward=true)
void arc (float centerX, float centerY, float radius, float startRadians, float endRadians, bool forward=true)
void arcTo (const Vec2f &p, const Vec2f &t, float radius)
void arcTo (float x, float y, float tanX, float tanY, float radius)
void close ()
 Closes the path, by drawing a straight line from the first to the last point. This is only legal as the last command.
bool isClosed () const
void reverse ()
 Reverses the order of the path's points, inverting its winding order.
bool empty () const
void clear ()
size_t getNumSegments () const
size_t getNumPoints () const
Vec2f getPosition (float t) const
 Returns the point on the curve at parameter t, which lies in the range [0,1]
Vec2f getSegmentPosition (size_t segment, float t) const
 Returns the point in segment # segment in the range [0,getNumSegments()) at parameter t in the range [0,1]
std::vector< Vec2fsubdivide (float approximationScale=1.0f) const
const Vec2fgetPoint (size_t point) const
const Vec2fgetCurrentPoint () const
void setPoint (size_t index, const Vec2f &p)
void removeSegment (size_t segment)
SegmentType getSegmentType (size_t segment) const
Rectf calcBoundingBox () const
 Returns the bounding box around all control points. As with Shape2d, note this is not necessarily the bounding box of the Path's shape.

Static Public Attributes

static const int sSegmentTypePointCounts [] = { 0, 1, 2, 3, 0 }

Friends

class Shape2d

Member Enumeration Documentation

Enumerator:
MOVETO 
LINETO 
QUADTO 
CUBICTO 
CLOSE 

Constructor & Destructor Documentation

cinder::Path2d::Path2d (  )
cinder::Path2d::Path2d ( const BSpline< Vec2f > &  spline,
float  subdivisionStep = 0.01f 
) [explicit]

Member Function Documentation

void cinder::Path2d::moveTo ( const Vec2f p )

Sets the start point of the path to p. This is the only legal first command, and only legal as the first command.

void cinder::Path2d::moveTo ( float  x,
float  y 
)

Sets the start point of the path to (x, y ). This is the only legal first command, and only legal as the first command.

void cinder::Path2d::lineTo ( const Vec2f p )
void cinder::Path2d::lineTo ( float  x,
float  y 
)
void cinder::Path2d::quadTo ( const Vec2f p1,
const Vec2f p2 
)
void cinder::Path2d::quadTo ( float  x1,
float  y1,
float  x2,
float  y2 
)
void cinder::Path2d::curveTo ( const Vec2f p1,
const Vec2f p2,
const Vec2f p3 
)
void cinder::Path2d::curveTo ( float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3 
)
void cinder::Path2d::arc ( const Vec2f center,
float  radius,
float  startRadians,
float  endRadians,
bool  forward = true 
)
void cinder::Path2d::arc ( float  centerX,
float  centerY,
float  radius,
float  startRadians,
float  endRadians,
bool  forward = true 
)
void cinder::Path2d::arcTo ( const Vec2f p,
const Vec2f t,
float  radius 
)
void cinder::Path2d::arcTo ( float  x,
float  y,
float  tanX,
float  tanY,
float  radius 
)
void cinder::Path2d::close (  )

Closes the path, by drawing a straight line from the first to the last point. This is only legal as the last command.

bool cinder::Path2d::isClosed (  ) const
void cinder::Path2d::reverse (  )

Reverses the order of the path's points, inverting its winding order.

bool cinder::Path2d::empty (  ) const
void cinder::Path2d::clear (  )
size_t cinder::Path2d::getNumSegments (  ) const
size_t cinder::Path2d::getNumPoints (  ) const
Vec2f cinder::Path2d::getPosition ( float  t ) const

Returns the point on the curve at parameter t, which lies in the range [0,1]

Vec2f cinder::Path2d::getSegmentPosition ( size_t  segment,
float  t 
) const

Returns the point in segment # segment in the range [0,getNumSegments()) at parameter t in the range [0,1]

vector< Vec2f > cinder::Path2d::subdivide ( float  approximationScale = 1.0f ) const
const Vec2f& cinder::Path2d::getPoint ( size_t  point ) const
const Vec2f& cinder::Path2d::getCurrentPoint (  ) const
void cinder::Path2d::setPoint ( size_t  index,
const Vec2f p 
)
void cinder::Path2d::removeSegment ( size_t  segment )
SegmentType cinder::Path2d::getSegmentType ( size_t  segment ) const
Rectf cinder::Path2d::calcBoundingBox (  ) const

Returns the bounding box around all control points. As with Shape2d, note this is not necessarily the bounding box of the Path's shape.


Friends And Related Function Documentation

friend class Shape2d [friend]

Member Data Documentation

const int cinder::Path2d::sSegmentTypePointCounts = { 0, 1, 2, 3, 0 } [static]

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