Curve3D Class Reference

Superclass for 3-dimensional space curves. More...

#include <labelingmath.h>

Inheritance diagram for Curve3D:
Curve3DPolynomial

List of all members.

Public Member Functions

 Curve3D ()
 Default constructor.
virtual ~Curve3D ()
 Frees all allocated resources.
bool setCtrlPoints (std::vector< tgt::vec3 > &ctrlPoints, float curveLength=0.f)
 Sets the control points of the curve.
std::vector< tgt::vec3getCtrlPoints ()
 Returns the control point array.
virtual tgt::vec3 getCurvePoint (float t)=0
 Returns the curve point at parameter t.
virtual tgt::vec3 getTangent (float t)=0
 Returns the tangent vector at parameter t.
virtual float getTangentMagnitude (float t)=0
 Returns the length of the tangent vector at parameter t.
virtual float getSegmentLength (float t1, float t2)=0
 Returns the length of the curve segment between parameters t1 and t2.
virtual tgt::vec3 getNextPoint (float &curParam, float offset)=0
 Returns the curve point at parameter t that satisfies the following condition:

  • getSegmentLength(curParam, t) == offset.

virtual void shift (tgt::vec3 shiftVector)=0
 Shifts the whole curve by shiftVector:.

Protected Member Functions

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

Protected Attributes

std::vector< tgt::vec3ctrlPoints_
 The Curve's control points.
float paramScale_
 Scale and shift parameters for mapping parameter range of curve segment to [0;1].
float paramShift_

Detailed Description

Superclass for 3-dimensional space curves.

f(t) = ( x(t), y(t), z(t) ) The curve is determined by an array of control points.

Definition at line 56 of file labelingmath.h.


Member Function Documentation

virtual bool calcFunction ( float  curveLength = 0  )  [protected, pure 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;!]

Implemented in Curve3DPolynomial.

virtual tgt::vec3 getNextPoint ( float &  curParam,
float  offset 
) [pure 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.

Implemented in Curve3DPolynomial.

bool setCtrlPoints ( std::vector< tgt::vec3 > &  ctrlPoints,
float  curveLength = 0.f 
)

Sets the control points of the curve.

Internally the curve's parameters are calculated from these control points.

Parameters:
curveLength the length of the curve segment, whose parameter range range is mapped to [0;1]. The segment is centered around the control points. If no length is supplied, the segment runs from the first to the last control point (these points are only approximated, since this is a least-squares-fit)
Returns:
true, if parameter calculation was successful