Public Member Functions
cinder::Shape2d Class Reference

#include <Shape2d.h>

List of all members.

Public Member Functions

void moveTo (const Vec2f &p)
void moveTo (float x, float y)
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 ()
bool empty () const
void clear ()
size_t getNumContours () const
const Path2dgetContour (size_t i) const
Path2dgetContour (size_t i)
const std::vector< Path2d > & getContours () const
std::vector< Path2d > & getContours ()
const Vec2fgetCurrentPoint () const
void append (const Shape2d &shape)
 Appends the contours of shape to this shape.
void appendContour (const Path2d &contour)
void removeContour (size_t i)
void scale (const Vec2f &amount, Vec2f scaleCenter=Vec2f::zero())
 Scales the Shape2d by amount.x on X and amount.y on Y around the center scaleCenter.
void transform (const MatrixAffine2f &matrix)
 Transforms the Shape2d by matrix.
Shape2d transformCopy (const MatrixAffine2f &matrix) const
 Returns a copy transformed by matrix.
Rectf calcBoundingBox () const
 Returns the bounding box of the Shape's control points. Note that this is not necessarily the bounding box of the path's shape.
Rectf calcPreciseBoundingBox () const
 Returns the precise bounding box of the Shape's curves. Slower to calculate than calcBoundingBox().
bool contains (const Vec2f &pt) const
 Returns whether the point pt is contained within the boundaries of the shape.
template<typename IT >
void iterate (IT &it)
 Iterates all of the contours and points of a Shape2d.

Member Function Documentation

void cinder::Shape2d::moveTo ( const Vec2f p)
void cinder::Shape2d::moveTo ( float  x,
float  y 
)
void cinder::Shape2d::lineTo ( const Vec2f p)
void cinder::Shape2d::lineTo ( float  x,
float  y 
)
void cinder::Shape2d::quadTo ( const Vec2f p1,
const Vec2f p2 
)
void cinder::Shape2d::quadTo ( float  x1,
float  y1,
float  x2,
float  y2 
)
void cinder::Shape2d::curveTo ( const Vec2f p1,
const Vec2f p2,
const Vec2f p3 
)
void cinder::Shape2d::curveTo ( float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3 
)
void cinder::Shape2d::arc ( const Vec2f center,
float  radius,
float  startRadians,
float  endRadians,
bool  forward = true 
)
void cinder::Shape2d::arc ( float  centerX,
float  centerY,
float  radius,
float  startRadians,
float  endRadians,
bool  forward = true 
)
void cinder::Shape2d::arcTo ( const Vec2f p,
const Vec2f t,
float  radius 
)
void cinder::Shape2d::arcTo ( float  x,
float  y,
float  tanX,
float  tanY,
float  radius 
)
bool cinder::Shape2d::empty ( ) const
const Path2d& cinder::Shape2d::getContour ( size_t  i) const
const std::vector<Path2d>& cinder::Shape2d::getContours ( ) const
void cinder::Shape2d::append ( const Shape2d shape)

Appends the contours of shape to this shape.

void cinder::Shape2d::appendContour ( const Path2d contour)
void cinder::Shape2d::removeContour ( size_t  i)
void cinder::Shape2d::scale ( const Vec2f amount,
Vec2f  scaleCenter = Vec2f::zero() 
)

Scales the Shape2d by amount.x on X and amount.y on Y around the center scaleCenter.

void cinder::Shape2d::transform ( const MatrixAffine2f matrix)

Transforms the Shape2d by matrix.

Returns a copy transformed by matrix.

Returns the bounding box of the Shape's control points. Note that this is not necessarily the bounding box of the path's shape.

Returns the precise bounding box of the Shape's curves. Slower to calculate than calcBoundingBox().

bool cinder::Shape2d::contains ( const Vec2f pt) const

Returns whether the point pt is contained within the boundaries of the shape.

template<typename IT >
void cinder::Shape2d::iterate ( IT &  it)

Iterates all of the contours and points of a Shape2d.

Expects a template parameter that implements

 bool operator()( Path2d::SegmentType type, Vec2f *points, Vec2f *previousPoint ) 

. Functor should return false to cease iteration. A SegmentType of type CLOSE receives &mPoints[0] for its points parameters.


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