Panda3D
|
This encapsulates a series of matrices that are used to represent the sequential segments of a NurbsCurveEvaluator. More...
#include "nurbsBasisVector.h"
Public Member Functions | |
void | append_segment (int vertex_index, const PN_stdfloat knots[]) |
Computes a NURBS basis for one segment of the curve and appends it to the set of basis matrices. | |
void | clear (int order) |
Removes all the segments from the curve. | |
const LMatrix4 & | get_basis (int segment) const |
Returns the basis matrix associated with the nth segment. | |
PN_stdfloat | get_end_t () const |
Returns the last legal value of t on the curve. | |
PN_stdfloat | get_from (int segment) const |
Returns the t value of the beginning of this segment. | |
int | get_num_segments () const |
Returns the number of piecewise continuous segments in the curve. | |
int | get_order () const |
Returns the order of the segments in the curve. | |
PN_stdfloat | get_start_t () const |
Returns the first legal value of t on the curve. | |
PN_stdfloat | get_to (int segment) const |
Returns the t value of the end of this segment. | |
int | get_vertex_index (int segment) const |
Returns the vertex index of the nth segment. | |
PN_stdfloat | scale_t (int segment, PN_stdfloat t) const |
Scales the value of t into the range [0, 1] corresponding to [from, to]. | |
void | transpose () |
Transposes the basis matrices stored in the vector. | |
This encapsulates a series of matrices that are used to represent the sequential segments of a NurbsCurveEvaluator.
This is not related to NurbsCurve, 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 33 of file nurbsBasisVector.h.
|
inline |
Definition at line 17 of file nurbsBasisVector.I.
|
inline |
Definition at line 25 of file nurbsBasisVector.I.
void NurbsBasisVector::append_segment | ( | int | vertex_index, |
const PN_stdfloat | knots[] ) |
Computes a NURBS basis for one segment of the curve and appends it to the set of basis matrices.
Definition at line 29 of file nurbsBasisVector.cxx.
void NurbsBasisVector::clear | ( | int | order | ) |
Removes all the segments from the curve.
Definition at line 19 of file nurbsBasisVector.cxx.
|
inline |
Returns the basis matrix associated with the nth segment.
This is the pure matrix based on the knot vector over the segment; it does not depend on the control vertices.
Definition at line 97 of file nurbsBasisVector.I.
Referenced by NurbsCurveResult::NurbsCurveResult(), NurbsSurfaceResult::NurbsSurfaceResult(), NurbsCurveResult::eval_segment_extended_point(), NurbsSurfaceResult::eval_segment_extended_point(), NurbsCurveResult::eval_segment_extended_points(), and NurbsSurfaceResult::eval_segment_extended_points().
|
inline |
Returns the last legal value of t on the curve.
Definition at line 57 of file nurbsBasisVector.I.
Referenced by NurbsCurveResult::get_end_t(), NurbsSurfaceResult::get_end_u(), and NurbsSurfaceResult::get_end_v().
|
inline |
Returns the t value of the beginning of this segment.
Definition at line 77 of file nurbsBasisVector.I.
Referenced by NurbsCurveResult::adaptive_sample(), NurbsCurveResult::get_segment_t(), NurbsSurfaceResult::get_segment_u(), and NurbsSurfaceResult::get_segment_v().
|
inline |
Returns the number of piecewise continuous segments in the curve.
Definition at line 40 of file nurbsBasisVector.I.
Referenced by NurbsCurveResult::NurbsCurveResult(), NurbsSurfaceResult::NurbsSurfaceResult(), NurbsCurveResult::adaptive_sample(), NurbsCurveResult::eval_segment_extended_point(), NurbsCurveResult::eval_segment_extended_points(), NurbsCurveEvaluator::get_num_segments(), NurbsCurveResult::get_num_segments(), NurbsSurfaceEvaluator::get_num_u_segments(), NurbsSurfaceResult::get_num_u_segments(), NurbsSurfaceEvaluator::get_num_v_segments(), and NurbsSurfaceResult::get_num_v_segments().
|
inline |
Returns the order of the segments in the curve.
Definition at line 32 of file nurbsBasisVector.I.
Referenced by NurbsCurveResult::NurbsCurveResult(), NurbsSurfaceResult::NurbsSurfaceResult(), NurbsCurveResult::eval_segment_extended_point(), NurbsSurfaceResult::eval_segment_extended_point(), NurbsCurveResult::eval_segment_extended_points(), and NurbsSurfaceResult::eval_segment_extended_points().
|
inline |
Returns the first legal value of t on the curve.
Usually this is 0.0.
Definition at line 48 of file nurbsBasisVector.I.
Referenced by NurbsCurveResult::get_start_t(), NurbsSurfaceResult::get_start_u(), and NurbsSurfaceResult::get_start_v().
|
inline |
Returns the t value of the end of this segment.
Definition at line 86 of file nurbsBasisVector.I.
Referenced by NurbsCurveResult::get_segment_t(), NurbsSurfaceResult::get_segment_u(), and NurbsSurfaceResult::get_segment_v().
|
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 68 of file nurbsBasisVector.I.
Referenced by NurbsCurveResult::NurbsCurveResult(), NurbsSurfaceResult::NurbsSurfaceResult(), NurbsCurveResult::eval_segment_extended_point(), NurbsSurfaceResult::eval_segment_extended_point(), NurbsCurveResult::eval_segment_extended_points(), and NurbsSurfaceResult::eval_segment_extended_points().
|
inline |
Scales the value of t into the range [0, 1] corresponding to [from, to].
Returns the scaled value.
Definition at line 107 of file nurbsBasisVector.I.
Referenced by NurbsCurveResult::eval_extended_point(), NurbsSurfaceResult::eval_extended_point(), NurbsCurveResult::eval_extended_points(), NurbsSurfaceResult::eval_extended_points(), NurbsSurfaceResult::eval_normal(), NurbsCurveResult::eval_point(), NurbsSurfaceResult::eval_point(), and NurbsCurveResult::eval_tangent().
void NurbsBasisVector::transpose | ( | ) |
Transposes the basis matrices stored in the vector.
Definition at line 63 of file nurbsBasisVector.cxx.
Referenced by NurbsSurfaceResult::NurbsSurfaceResult().