Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

NurbsMatrixVector Class Reference

This encapsulates a series of matrices that are used to represent the sequential segments of a NurbsCurveEvaluator. More...

#include <nurbsMatrixVector.h>

List of all members.

Public Member Functions

 NurbsMatrixVector ()
 ~NurbsMatrixVector ()
int get_num_segments () const
 Returns the number of piecewise continuous segments in the curve.

float get_start_t () const
 Returns the first legal value of t on the curve.

float get_end_t () const
 Returns the last legal value of t on the curve.

int get_vertex_index (int segment) const
 Returns the vertex index of the nth segment.

float get_from (int segment) const
 Returns the t value of the beginning of this segment.

float get_to (int segment) const
 Returns the t value of the end of this segment.

const LMatrix4f & get_matrix (int segment) const
 Returns the matrix associated with the nth segment.

float scale_t (int segment, float t) const
 Scales the value of t into the range [0, 1] corresponding to [from, to].

void clear ()
 Removes all the segments from the curve.

void append_segment (int order, int vertex_index, const float knots[])
 Computes a NURBS basis for one segment of the curve and appends it to the set of basis matrices.

void compose_segment (const NurbsMatrixVector &basis, int segment, const LMatrix4f &geom)
 Appends a new segment to the vector by composing the indicated geometry matrix with the indicated basis matrix from the given vector.


Private Types

typedef pvector< SegmentSegments

Static Private Member Functions

LVecBase4f nurbs_blending_function (int order, int i, int j, const float knots[])
 Recursively computes the appropriate blending function for the indicated knot vector.


Private Attributes

Segments _segments


Detailed Description

This encapsulates a series of matrices that are used to represent the sequential segments of a NurbsCurveEvaluator.

This is not related to NurbsCurve, ClassicNurbsCurve, CubicCurveseg or any of the ParametricCurve-derived objects in this module. It is a completely parallel implementation of NURBS curves, and will probably eventually replace the whole ParametricCurve class hierarchy.

Definition at line 55 of file nurbsMatrixVector.h.


Member Typedef Documentation

typedef pvector<Segment> NurbsMatrixVector::Segments [private]
 

Definition at line 88 of file nurbsMatrixVector.h.


Constructor & Destructor Documentation

NurbsMatrixVector::NurbsMatrixVector  )  [inline]
 

Definition at line 31 of file nurbsMatrixVector.I.

References INLINE.

NurbsMatrixVector::~NurbsMatrixVector  )  [inline]
 

Definition at line 42 of file nurbsMatrixVector.I.

References _segments, and INLINE.


Member Function Documentation

void NurbsMatrixVector::append_segment int  order,
int  vertex_index,
const float  knots[]
 

Computes a NURBS basis for one segment of the curve and appends it to the set of basis matrices.

Definition at line 48 of file nurbsMatrixVector.cxx.

void NurbsMatrixVector::clear  ) 
 

Removes all the segments from the curve.

Definition at line 33 of file nurbsMatrixVector.cxx.

References nassertv.

void NurbsMatrixVector::compose_segment const NurbsMatrixVector &  basis,
int  segment,
const LMatrix4f &  geom
 

Appends a new segment to the vector by composing the indicated geometry matrix with the indicated basis matrix from the given vector.

Definition at line 91 of file nurbsMatrixVector.cxx.

References nurbs_blending_function().

float NurbsMatrixVector::get_end_t  )  const [inline]
 

Returns the last legal value of t on the curve.

Definition at line 85 of file nurbsMatrixVector.I.

References _segments, INLINE, and nassertr.

Referenced by NurbsCurveResult::get_start_t().

float NurbsMatrixVector::get_from int  segment  )  const [inline]
 

Returns the t value of the beginning of this segment.

Definition at line 117 of file nurbsMatrixVector.I.

References _segments, INLINE, nassertr, and t.

Referenced by NurbsCurveResult::eval_segment_tangent(), and NurbsCurveResult::eval_tangent().

const LMatrix4f & NurbsMatrixVector::get_matrix int  segment  )  const [inline]
 

Returns the matrix associated with the nth segment.

Definition at line 145 of file nurbsMatrixVector.I.

int NurbsMatrixVector::get_num_segments  )  const [inline]
 

Returns the number of piecewise continuous segments in the curve.

Definition at line 56 of file nurbsMatrixVector.I.

References _segments, and nassertr.

float NurbsMatrixVector::get_start_t  )  const [inline]
 

Returns the first legal value of t on the curve.

Usually this is 0.0.

Definition at line 71 of file nurbsMatrixVector.I.

References _segments, INLINE, and nassertr.

Referenced by NurbsCurveResult::~NurbsCurveResult().

float NurbsMatrixVector::get_to int  segment  )  const [inline]
 

Returns the t value of the end of this segment.

Definition at line 131 of file nurbsMatrixVector.I.

Referenced by NurbsCurveResult::eval_segment_tangent(), and NurbsCurveResult::eval_tangent().

int NurbsMatrixVector::get_vertex_index int  segment  )  const [inline]
 

Returns the vertex index of the nth segment.

This is the index number of the first associated control vertex within the source NurbsCurveEvaluator object.

Definition at line 103 of file nurbsMatrixVector.I.

References _segments.

LVecBase4f NurbsMatrixVector::nurbs_blending_function int  order,
int  i,
int  j,
const float  knots[]
[static, private]
 

Recursively computes the appropriate blending function for the indicated knot vector.

Definition at line 116 of file nurbsMatrixVector.cxx.

Referenced by compose_segment().

float NurbsMatrixVector::scale_t int  segment,
float  t
const [inline]
 

Scales the value of t into the range [0, 1] corresponding to [from, to].

Returns the scaled value.

Definition at line 163 of file nurbsMatrixVector.I.

Referenced by NurbsCurveResult::eval_point(), and NurbsCurveResult::get_end_t().


Member Data Documentation

Segments NurbsMatrixVector::_segments [private]
 

Definition at line 89 of file nurbsMatrixVector.h.

Referenced by get_end_t(), get_from(), get_num_segments(), get_start_t(), get_vertex_index(), and ~NurbsMatrixVector().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:52:47 2003 for Panda by doxygen1.3