Panda3D
Classes | Public Member Functions | List of all members
NurbsBasisVector Class Reference

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. More...
 
void clear (int order)
 Removes all the segments from the curve. More...
 
const LMatrix4get_basis (int segment) const
 Returns the basis matrix associated with the nth segment. More...
 
PN_stdfloat get_end_t () const
 Returns the last legal value of t on the curve. More...
 
PN_stdfloat get_from (int segment) const
 Returns the t value of the beginning of this segment. More...
 
int get_num_segments () const
 Returns the number of piecewise continuous segments in the curve. More...
 
int get_order () const
 Returns the order of the segments in the curve. More...
 
PN_stdfloat get_start_t () const
 Returns the first legal value of t on the curve. More...
 
PN_stdfloat get_to (int segment) const
 Returns the t value of the end of this segment. More...
 
int get_vertex_index (int segment) const
 Returns the vertex index of the nth segment. More...
 
PN_stdfloat scale_t (int segment, PN_stdfloat t) const
 Scales the value of t into the range [0, 1] corresponding to [from, to]. More...
 
void transpose ()
 Transposes the basis matrices stored in the vector. More...
 

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, 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 37 of file nurbsBasisVector.h.

Member Function Documentation

◆ append_segment()

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 35 of file nurbsBasisVector.cxx.

References transpose(), and LVecBase4f::zero().

Referenced by clear(), NurbsCurveEvaluator::normalize_knots(), and NurbsSurfaceEvaluator::normalize_v_knots().

◆ clear()

void NurbsBasisVector::clear ( int  order)

Removes all the segments from the curve.

Definition at line 23 of file nurbsBasisVector.cxx.

References append_segment().

Referenced by NurbsCurveEvaluator::normalize_knots(), and NurbsSurfaceEvaluator::normalize_v_knots().

◆ get_basis()

const LMatrix4 & NurbsBasisVector::get_basis ( int  segment) const
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 123 of file nurbsBasisVector.I.

References LMatrix4f::ident_mat(), and scale_t().

Referenced by NurbsSurfaceResult::eval_segment_extended_point(), NurbsCurveResult::eval_segment_extended_point(), NurbsSurfaceResult::eval_segment_extended_points(), NurbsCurveResult::eval_segment_extended_points(), get_to(), NurbsCurveResult::NurbsCurveResult(), and NurbsSurfaceResult::NurbsSurfaceResult().

◆ get_end_t()

PN_stdfloat NurbsBasisVector::get_end_t ( ) const
inline

Returns the last legal value of t on the curve.

Definition at line 74 of file nurbsBasisVector.I.

References get_vertex_index().

Referenced by NurbsCurveResult::get_end_t(), NurbsSurfaceResult::get_end_u(), NurbsSurfaceResult::get_end_v(), and get_start_t().

◆ get_from()

PN_stdfloat NurbsBasisVector::get_from ( int  segment) const
inline

◆ get_num_segments()

int NurbsBasisVector::get_num_segments ( ) const
inline

◆ get_order()

int NurbsBasisVector::get_order ( ) const
inline

◆ get_start_t()

PN_stdfloat NurbsBasisVector::get_start_t ( ) const
inline

Returns the first legal value of t on the curve.

Usually this is 0.0.

Definition at line 63 of file nurbsBasisVector.I.

References get_end_t().

Referenced by get_num_segments(), NurbsCurveResult::get_start_t(), NurbsSurfaceResult::get_start_u(), and NurbsSurfaceResult::get_start_v().

◆ get_to()

PN_stdfloat NurbsBasisVector::get_to ( int  segment) const
inline

◆ get_vertex_index()

int NurbsBasisVector::get_vertex_index ( int  segment) const
inline

◆ scale_t()

PN_stdfloat NurbsBasisVector::scale_t ( int  segment,
PN_stdfloat  t 
) const
inline

◆ transpose()

void NurbsBasisVector::transpose ( )

Transposes the basis matrices stored in the vector.

Definition at line 71 of file nurbsBasisVector.cxx.

Referenced by append_segment(), and NurbsSurfaceResult::NurbsSurfaceResult().


The documentation for this class was generated from the following files: