Curve3DPolynomial Class Reference

Implementation of Curve3D. More...

#include <labelingmath.h>

Inheritance diagram for Curve3DPolynomial:
Curve3D

List of all members.

Public Member Functions

 Curve3DPolynomial (int degree)
 Creates the 3D polynomial.
virtual ~Curve3DPolynomial ()
 Destructor. Frees all allocated resources.
tgt::vec3 getCurvePoint (float t)
 Returns the curve point at parameter t.
tgt::vec3 getTangent (float t)
 Returns the tangent vector at parameter t.
float getTangentMagnitude (float t)
 Returns the length of the tangent vector at parameter t.
float getSegmentLength (float t1, float t2)
 Returns the length of the curve segment between parameters t1 and t2.
tgt::vec3 getNextPoint (float &curParam, float offset)
 Returns the curve point at parameter t that satisfies the following condition:

  • getSegmentLength(curParam, t) == offset.

void shift (tgt::vec3 shiftVector)
 Shifts the whole curve by shiftVector.
float * getCoefficientsX ()
 Returns coefficients of x(t) polynomial.
float * getCoefficientsY ()
 Returns coefficients of y(t) polynomial.
float * getCoefficientsZ ()
 Returns coefficients of z(t) polynomial.

Protected Member Functions

bool calcFunction (float curveLength=0)
 Calculates the curve from the prior set control points.

Protected Attributes

int degree_
int numCoeff_
Polynomial xfunc_
Polynomial yfunc_
Polynomial zfunc_

Detailed Description

Implementation of Curve3D.

Curve is a polynomial least-squares-fit to the control points.

Definition at line 212 of file labelingmath.h.


Constructor & Destructor Documentation

Curve3DPolynomial ( int  degree  ) 

Creates the 3D polynomial.

Parameters:
degree degree of polynomial

Definition at line 131 of file labelingmath.cpp.


Member Function Documentation

bool calcFunction ( float  curveLength = 0  )  [protected, virtual]

Calculates the curve from the prior set control points.

Parameters:
curveLength specifies the length of the curve segment whose parameter range is mapped to [0;!]

Implements Curve3D.

Definition at line 143 of file labelingmath.cpp.

tgt::vec3 getNextPoint ( float &  curParam,
float  offset 
) [virtual]

Returns the curve point at parameter t that satisfies the following condition:

  • getSegmentLength(curParam, t) == offset.

Note:
This is just an approximation.
Parameters:
c curParam is set to t afterwards.

Implements Curve3D.

Definition at line 237 of file labelingmath.cpp.