A part of a curve. More...
#include <CurvePart.h>
Public Member Functions | |
CurvePart () | |
Creates a new CurvePart. | |
virtual | ~CurvePart () |
Deletes this CurvePart. | |
virtual CurveId | getId () const |
Returns the original curve's Id. | |
virtual CurveId | getParentId () const |
Returns the original curve's parent. | |
virtual int | getType () const |
Returns the original curve's type. | |
virtual float | getWidth () const |
Returns the original curve's width. | |
virtual CurvePtr | getCurve () const |
Returns the original curve. | |
virtual int | getEnd () const =0 |
Returns the end index of this curve part inside the original curve. | |
virtual vec2d | getXY (int i) const =0 |
Returns the coordinates of a point at a given index. | |
vec2d | getXY (const vec2d &start, int offset) const |
Returns the coordinates of a point at a given index starting from a given Point. | |
virtual bool | getIsControl (int i) const |
Checks if a point is a control Point. | |
virtual float | getS (int i) const =0 |
Returns the i'th point S coordinate. | |
virtual box2d | getBounds () const =0 |
Returns the curve part's bounding box. | |
virtual bool | canClip (int i) const |
Checks if a point is clipable. | |
virtual CurvePart * | clip (int start, int end) const =0 |
Returns a sub-curvePart clipped from this one. | |
void | clip (const box2d &clip, vector< CurvePart * > &result) const |
Clips this curve part with the given rectangle. | |
bool | equals (CurvePtr c) const |
Returns true if this equals a given Curve. | |
Static Public Member Functions | |
static void | clip (const vector< CurvePart * > &paths, const box2d &clip, vector< CurvePart * > &result) |
Clips a set of curve parts. |
A part of a curve.
This part is defined by a curve, and by two indexes that give the start and end points of this curve part inside the whole curve.
proland::CurvePart::CurvePart | ( | ) |
Creates a new CurvePart.
virtual proland::CurvePart::~CurvePart | ( | ) | [virtual] |
Deletes this CurvePart.
virtual bool proland::CurvePart::canClip | ( | int | i | ) | const [virtual] |
Checks if a point is clipable.
i | the rank of the point to check. |
Reimplemented in proland::BasicCurvePart.
static void proland::CurvePart::clip | ( | const vector< CurvePart * > & | paths, | |
const box2d & | clip, | |||
vector< CurvePart * > & | result | |||
) | [static] |
Clips a set of curve parts.
paths | the curve parts that must be clipped. | |
clip | the clip region. | |
result | where the resulting curve parts must be stored. |
void proland::CurvePart::clip | ( | const box2d & | clip, | |
vector< CurvePart * > & | result | |||
) | const |
Clips this curve part with the given rectangle.
This results in a set of curve parts that are added to the given list. Note that the curve width is NOT taken into account.
clip | the clip region. | |
result | where the resulting curve parts must be stored. |
virtual CurvePart* proland::CurvePart::clip | ( | int | start, | |
int | end | |||
) | const [pure virtual] |
Returns a sub-curvePart clipped from this one.
start | the starting index of the new curve inside the current one. | |
end | the ending index of the new curve inside the current one. |
Implemented in proland::BasicCurvePart, and proland::LineCurvePart.
bool proland::CurvePart::equals | ( | CurvePtr | c | ) | const |
Returns true if this equals a given Curve.
c | the curve to compare with. |
virtual box2d proland::CurvePart::getBounds | ( | ) | const [pure virtual] |
Returns the curve part's bounding box.
Implemented in proland::BasicCurvePart, and proland::LineCurvePart.
virtual CurvePtr proland::CurvePart::getCurve | ( | ) | const [virtual] |
Returns the original curve.
Reimplemented in proland::BasicCurvePart.
virtual int proland::CurvePart::getEnd | ( | ) | const [pure virtual] |
Returns the end index of this curve part inside the original curve.
Implemented in proland::BasicCurvePart, and proland::LineCurvePart.
virtual CurveId proland::CurvePart::getId | ( | ) | const [virtual] |
Returns the original curve's Id.
Reimplemented in proland::BasicCurvePart.
virtual bool proland::CurvePart::getIsControl | ( | int | i | ) | const [virtual] |
Checks if a point is a control Point.
i | the rank of the vertex to check. |
Reimplemented in proland::BasicCurvePart, and proland::LineCurvePart.
virtual CurveId proland::CurvePart::getParentId | ( | ) | const [virtual] |
Returns the original curve's parent.
Reimplemented in proland::BasicCurvePart.
virtual float proland::CurvePart::getS | ( | int | i | ) | const [pure virtual] |
Returns the i'th point S coordinate.
i | the rank of the vertex to get the coordinates from. |
Implemented in proland::BasicCurvePart, and proland::LineCurvePart.
virtual int proland::CurvePart::getType | ( | ) | const [virtual] |
Returns the original curve's type.
Reimplemented in proland::BasicCurvePart.
virtual float proland::CurvePart::getWidth | ( | ) | const [virtual] |
Returns the original curve's width.
Reimplemented in proland::BasicCurvePart.
vec2d proland::CurvePart::getXY | ( | const vec2d & | start, | |
int | offset | |||
) | const |
Returns the coordinates of a point at a given index starting from a given Point.
start | the starting position (start or end point). | |
offset | the rank of the vertex to return. |
virtual vec2d proland::CurvePart::getXY | ( | int | i | ) | const [pure virtual] |
Returns the coordinates of a point at a given index.
i | the rank of the vertex to return. |
Implemented in proland::BasicCurvePart, and proland::LineCurvePart.