proland::CurvePart Class Reference
[graph]

A part of a curve. More...

#include <CurvePart.h>

Inheritance diagram for proland::CurvePart:
proland::BasicCurvePart proland::LineCurvePart

List of all members.

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 CurvePartclip (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.

Detailed Description

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.

Author:
Antoine Begault

Constructor & Destructor Documentation

proland::CurvePart::CurvePart (  ) 

Creates a new CurvePart.

virtual proland::CurvePart::~CurvePart (  )  [virtual]

Deletes this CurvePart.


Member Function Documentation

virtual bool proland::CurvePart::canClip ( int  i  )  const [virtual]

Checks if a point is clipable.

Parameters:
i the rank of the point to check.
Returns:
true if the i'th point is clipable.

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.

Parameters:
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.

Parameters:
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.

Parameters:
start the starting index of the new curve inside the current one.
end the ending index of the new curve inside the current one.
Returns:
a new CurvePart, containing the nodes in range [start - end] from this.

Implemented in proland::BasicCurvePart, and proland::LineCurvePart.

bool proland::CurvePart::equals ( CurvePtr  c  )  const

Returns true if this equals a given Curve.

Parameters:
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.

Parameters:
i the rank of the vertex to check.
Returns:
true if the i'th vertex is a control point.

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.

Parameters:
i the rank of the vertex to get the coordinates from.
Returns:
the pseudo curvilinear coordinate of the i'th point.

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.

Parameters:
start the starting position (start or end point).
offset the rank of the vertex to return.
Returns:
the XY coords of the i'th vertex.
virtual vec2d proland::CurvePart::getXY ( int  i  )  const [pure virtual]

Returns the coordinates of a point at a given index.

Parameters:
i the rank of the vertex to return.
Returns:
the XY coords of the i'th vertex.

Implemented in proland::BasicCurvePart, and proland::LineCurvePart.


Generated on Sat May 12 09:42:47 2012 for proland by  doxygen 1.6.1