#include <Curve.h>

Public Member Functions | |
| Curve (void) | |
| virtual | ~Curve (void) |
| virtual void | createProperties (void) |
| virtual const string | getTypeName (bool ofComponent=false) const |
| virtual void | onUpdate (void) |
| virtual void | clear (void) |
| must be implemented | |
| void | addKnot (const T &knot, int index=-1, bool rebuild=true) |
| must be implemented | |
| void | removeKnot (unsigned int index, bool rebuild=true) |
| T & | getKnot (unsigned int index) |
| const T & | getKnot (unsigned int index) const |
| unsigned int | getNumKnots (void) const |
| vector< T > & | getKnots (void) |
| const vector< T > & | getKnots (void) const |
| T & | getPoint (unsigned int index) |
| const T & | getPoint (unsigned int index) const |
| unsigned int | getNumPoints (void) const |
| vector< T > & | getPoints (void) |
| const vector< T > & | getPoints (void) const |
| T & | getTangent (unsigned int index) |
| const T & | getTangent (unsigned int index) const |
| unsigned int | getNumTangents (void) const |
| vector< T > & | getTangents (void) |
| const vector< T > & | getTangents (void) const |
Static Public Member Functions | |
| static PropertyPtr | create (const XMLNodePtr &xml=XMLNodePtr()) |
Protected Attributes | |
| vector< T > | m_knots |
| vector< T > | m_points |
| vector< T > | m_tangents |
Definition at line 14 of file Curve.h.
| RenderTools::Curve< T >::Curve | ( | void | ) | [inline] |
| RenderTools::Curve< T >::~Curve | ( | void | ) | [inline, virtual] |
| void RenderTools::Curve< T >::addKnot | ( | const T & | knot, | |
| int | index = -1, |
|||
| bool | rebuild = true | |||
| ) | [inline] |
| void RenderTools::Curve< T >::clear | ( | void | ) | [inline, virtual] |
| static PropertyPtr RenderTools::Curve< T >::create | ( | const XMLNodePtr & | xml = XMLNodePtr() |
) | [static] |
Reimplemented from RenderTools::AbstractCurve.
| void RenderTools::Curve< T >::createProperties | ( | void | ) | [inline, virtual] |
| const T & RenderTools::Curve< T >::getKnot | ( | unsigned int | index | ) | const [inline] |
| T & RenderTools::Curve< T >::getKnot | ( | unsigned int | index | ) | [inline] |
| const vector< T > & RenderTools::Curve< T >::getKnots | ( | void | ) | const [inline] |
| vector< T >& RenderTools::Curve< T >::getKnots | ( | void | ) |
| unsigned int RenderTools::Curve< T >::getNumKnots | ( | void | ) | const [inline] |
| unsigned int RenderTools::Curve< T >::getNumPoints | ( | void | ) | const [inline] |
| unsigned int RenderTools::Curve< T >::getNumTangents | ( | void | ) | const [inline] |
| const T & RenderTools::Curve< T >::getPoint | ( | unsigned int | index | ) | const [inline] |
| T & RenderTools::Curve< T >::getPoint | ( | unsigned int | index | ) | [inline] |
| const vector< T > & RenderTools::Curve< T >::getPoints | ( | void | ) | const [inline] |
| vector< T >& RenderTools::Curve< T >::getPoints | ( | void | ) |
| const T & RenderTools::Curve< T >::getTangent | ( | unsigned int | index | ) | const [inline] |
| T & RenderTools::Curve< T >::getTangent | ( | unsigned int | index | ) | [inline] |
| const vector< T > & RenderTools::Curve< T >::getTangents | ( | void | ) | const [inline] |
| vector< T >& RenderTools::Curve< T >::getTangents | ( | void | ) |
| const string RenderTools::Curve< T >::getTypeName | ( | bool | ofComponent = false |
) | const [inline, virtual] |
| void RenderTools::Curve< T >::onUpdate | ( | void | ) | [inline, virtual] |
a closed curve needs three or more knotpoints
points & tangents is what we calculate here
don't need to do anything
except add the beginning to the end if closed
subdivide the curve given by m_knots
start a new iteration with an empty curve
keep the last point
keep the new curve
store the smoothed curve
calculate the tangents for each point
interpolate and store in m_points
find the four vertices 'surrounding' [i] and [i+1]
we look at segment i, i+1
if we're on the last point
if closed, bridge the gap
if open, don't start a new segment
check if we're on the first segment
wrap around to the last point
extend the first segment 'backwards'
take the previous point
this is the actual segment we want to process
check if we're on the last segment
if closed, wrap to the beginning
else extend the last segment by itself
take the next knot-point
process v1->v2
make sure we don't include the endpoint
if we're not processing the last segment (open or closed)
average & interpolate the tangents
TODO: make sure we don't get degenerate tangents
Implements RenderTools::UpdateInterface.
| void RenderTools::Curve< T >::removeKnot | ( | unsigned int | index, | |
| bool | rebuild = true | |||
| ) | [inline] |
vector<T> RenderTools::Curve< T >::m_knots [protected] |
vector<T> RenderTools::Curve< T >::m_points [protected] |
vector<T> RenderTools::Curve< T >::m_tangents [protected] |
1.5.8