#include <Path2d.h>
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 ¢er, 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< Vec2f > | subdivide (float approximationScale=1.0f) const |
| void | scale (const Vec2f &amount, Vec2f scaleCenter=Vec2f::zero()) |
| Scales the Path2d by amount.x on X and amount.y on Y around the center scaleCenter. | |
| void | transform (const MatrixAffine2f &matrix) |
| Transforms the Path2d by matrix. | |
| Path2d | transformCopy (const MatrixAffine2f &matrix) const |
| Returns a copy transformed by matrix. | |
| const std::vector< Vec2f > & | getPoints () const |
| std::vector< Vec2f > & | getPoints () |
| const Vec2f & | getPoint (size_t point) const |
| Vec2f & | getPoint (size_t point) |
| const Vec2f & | getCurrentPoint () const |
| void | setPoint (size_t index, const Vec2f &p) |
| SegmentType | getSegmentType (size_t segment) const |
| const std::vector< SegmentType > & | getSegments () const |
| std::vector< SegmentType > & | getSegments () |
| void | removeSegment (size_t segment) |
| 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. | |
| Rectf | calcPreciseBoundingBox () const |
| Returns the precise bounding box around the curve itself. Slower to calculate than calcBoundingBox(). | |
| bool | contains (const Vec2f &pt) const |
| Returns whether the point pt is contained within the boundaries of the path. | |
Static Public Member Functions | |
| static int | calcQuadraticBezierMonotoneRegions (const Vec2f p[3], float resultT[2]) |
| static Vec2f | calcQuadraticBezierPos (const Vec2f p[3], float t) |
| static int | calcCubicBezierMonotoneRegions (const Vec2f p[4], float resultT[4]) |
| static Vec2f | calcCubicBezierPos (const Vec2f p[4], float t) |
Static Public Attributes | |
| static const int | sSegmentTypePointCounts [] = { 0, 1, 2, 3, 0 } |
Friends | |
| class | Shape2d |
| std::ostream & | operator<< (std::ostream &out, const Path2d &p) |
| cinder::Path2d::Path2d | ( | const BSpline< Vec2f > & | spline, |
| float | subdivisionStep = 0.01f |
||
| ) | [explicit] |
| 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 |
| void cinder::Path2d::scale | ( | const Vec2f & | amount, |
| Vec2f | scaleCenter = Vec2f::zero() |
||
| ) |
Scales the Path2d by amount.x on X and amount.y on Y around the center scaleCenter.
| void cinder::Path2d::transform | ( | const MatrixAffine2f & | matrix | ) |
Transforms the Path2d by matrix.
| Path2d cinder::Path2d::transformCopy | ( | const MatrixAffine2f & | matrix | ) | const |
Returns a copy transformed by matrix.
| const std::vector<Vec2f>& cinder::Path2d::getPoints | ( | ) | const |
| std::vector<Vec2f>& cinder::Path2d::getPoints | ( | ) |
| const Vec2f& cinder::Path2d::getPoint | ( | size_t | point | ) | const |
| Vec2f& cinder::Path2d::getPoint | ( | size_t | point | ) |
| const Vec2f& cinder::Path2d::getCurrentPoint | ( | ) | const |
| void cinder::Path2d::setPoint | ( | size_t | index, |
| const Vec2f & | p | ||
| ) |
| SegmentType cinder::Path2d::getSegmentType | ( | size_t | segment | ) | const |
| const std::vector<SegmentType>& cinder::Path2d::getSegments | ( | ) | const |
| std::vector<SegmentType>& cinder::Path2d::getSegments | ( | ) |
| void cinder::Path2d::removeSegment | ( | size_t | segment | ) |
| 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.
| Rectf cinder::Path2d::calcPreciseBoundingBox | ( | ) | const |
Returns the precise bounding box around the curve itself. Slower to calculate than calcBoundingBox().
| bool cinder::Path2d::contains | ( | const Vec2f & | pt | ) | const |
Returns whether the point pt is contained within the boundaries of the path.
| int cinder::Path2d::calcQuadraticBezierMonotoneRegions | ( | const Vec2f | p[3], |
| float | resultT[2] | ||
| ) | [static] |
| Vec2f cinder::Path2d::calcQuadraticBezierPos | ( | const Vec2f | p[3], |
| float | t | ||
| ) | [static] |
| int cinder::Path2d::calcCubicBezierMonotoneRegions | ( | const Vec2f | p[4], |
| float | resultT[4] | ||
| ) | [static] |
| Vec2f cinder::Path2d::calcCubicBezierPos | ( | const Vec2f | p[4], |
| float | t | ||
| ) | [static] |
friend class Shape2d [friend] |
| std::ostream& operator<< | ( | std::ostream & | out, |
| const Path2d & | p | ||
| ) | [friend] |
const int cinder::Path2d::sSegmentTypePointCounts = { 0, 1, 2, 3, 0 } [static] |