Panda3D
|
The result of a NurbsSurfaceEvaluator. More...
#include "nurbsSurfaceResult.h"
Public Member Functions | |
NurbsSurfaceResult (const NurbsBasisVector &u_basis, const NurbsBasisVector &v_basis, const LVecBase4 vecs[], const NurbsVertex *verts, int num_u_vertices, int num_v_vertices) | |
The constructor automatically builds up the result as the product of the indicated set of basis matrices and the indicated table of control vertex positions. More... | |
PN_stdfloat | eval_extended_point (PN_stdfloat u, PN_stdfloat v, int d) |
Evaluates the surface in n-dimensional space according to the extended vertices associated with the surface in the indicated dimension. More... | |
bool | eval_extended_points (PN_stdfloat u, PN_stdfloat v, int d, PN_stdfloat result[], int num_values) |
Simultaneously performs eval_extended_point on a contiguous sequence of dimensions. More... | |
bool | eval_normal (PN_stdfloat u, PN_stdfloat v, LVecBase3 &normal) |
Computes the normal to the surface at the indicated point in parametric time. More... | |
bool | eval_point (PN_stdfloat u, PN_stdfloat v, LVecBase3 &point) |
Computes the point on the surface corresponding to the indicated value in parametric time. More... | |
PN_stdfloat | eval_segment_extended_point (int ui, int vi, PN_stdfloat u, PN_stdfloat v, int d) const |
Evaluates the surface in n-dimensional space according to the extended vertices associated with the surface in the indicated dimension. More... | |
void | eval_segment_extended_points (int ui, int vi, PN_stdfloat u, PN_stdfloat v, int d, PN_stdfloat result[], int num_values) const |
Simultaneously performs eval_extended_point on a contiguous sequence of dimensions. More... | |
void | eval_segment_normal (int ui, int vi, PN_stdfloat u, PN_stdfloat v, LVecBase3 &normal) const |
As eval_segment_point, but computes the normal to the surface at the indicated point. More... | |
void | eval_segment_point (int ui, int vi, PN_stdfloat u, PN_stdfloat v, LVecBase3 &point) const |
Evaluates the point on the surface corresponding to the indicated value in parametric time within the indicated surface segment. More... | |
PN_stdfloat | get_end_u () const |
Returns the last legal value of u on the surface. More... | |
PN_stdfloat | get_end_v () const |
Returns the last legal value of v on the surface. More... | |
int | get_num_u_segments () const |
Returns the number of piecewise continuous segments within the surface in the U direction. More... | |
int | get_num_v_segments () const |
Returns the number of piecewise continuous segments within the surface in the V direction. More... | |
PN_stdfloat | get_segment_u (int ui, PN_stdfloat u) const |
Accepts a u value in the range [0, 1], and assumed to be relative to the indicated segment (as in eval_segment_point()), and returns the corresponding u value in the entire surface (as in eval_point()). More... | |
PN_stdfloat | get_segment_v (int vi, PN_stdfloat v) const |
Accepts a v value in the range [0, 1], and assumed to be relative to the indicated segment (as in eval_segment_point()), and returns the corresponding v value in the entire surface (as in eval_point()). More... | |
PN_stdfloat | get_start_u () const |
Returns the first legal value of u on the surface. More... | |
PN_stdfloat | get_start_v () const |
Returns the first legal value of v on the surface. More... | |
![]() | |
int | get_ref_count () const |
Returns the current reference count. More... | |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. More... | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More... | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More... | |
void | ref () const |
Explicitly increments the reference count. More... | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
virtual bool | unref () const |
Explicitly decrements the reference count. More... | |
void | weak_ref (WeakPointerToVoid *ptv) |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref (WeakPointerToVoid *ptv) |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
Additional Inherited Members | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
The result of a NurbsSurfaceEvaluator.
This object represents a surface in a particular coordinate space. It can return the point and/or normal to the surface at any point.
Definition at line 32 of file nurbsSurfaceResult.h.
NurbsSurfaceResult::NurbsSurfaceResult | ( | const NurbsBasisVector & | u_basis, |
const NurbsBasisVector & | v_basis, | ||
const LVecBase4 | vecs[], | ||
const NurbsVertex * | verts, | ||
int | num_u_vertices, | ||
int | num_v_vertices | ||
) |
The constructor automatically builds up the result as the product of the indicated set of basis matrices and the indicated table of control vertex positions.
Definition at line 27 of file nurbsSurfaceResult.cxx.
References eval_segment_point(), NurbsBasisVector::get_basis(), NurbsBasisVector::get_num_segments(), NurbsBasisVector::get_order(), NurbsBasisVector::get_vertex_index(), and NurbsBasisVector::transpose().
|
inline |
Evaluates the surface in n-dimensional space according to the extended vertices associated with the surface in the indicated dimension.
Definition at line 116 of file nurbsSurfaceResult.I.
References eval_extended_points(), eval_segment_extended_point(), and NurbsBasisVector::scale_t().
Referenced by eval_normal().
|
inline |
Simultaneously performs eval_extended_point on a contiguous sequence of dimensions.
The dimensions evaluated are d through (d + num_values - 1); the results are filled into the num_values elements in the indicated result array.
Definition at line 137 of file nurbsSurfaceResult.I.
References eval_segment_extended_points(), get_num_u_segments(), and NurbsBasisVector::scale_t().
Referenced by eval_extended_point().
|
inline |
Computes the normal to the surface at the indicated point in parametric time.
This normal vector will not necessarily be normalized, and could be zero. See also eval_point().
Definition at line 96 of file nurbsSurfaceResult.I.
References eval_extended_point(), eval_segment_normal(), and NurbsBasisVector::scale_t().
Referenced by eval_point().
|
inline |
Computes the point on the surface corresponding to the indicated value in parametric time.
Returns true if the u, v values are valid, false otherwise.
Definition at line 75 of file nurbsSurfaceResult.I.
References eval_normal(), eval_segment_point(), and NurbsBasisVector::scale_t().
Referenced by get_end_v().
PN_stdfloat NurbsSurfaceResult::eval_segment_extended_point | ( | int | ui, |
int | vi, | ||
PN_stdfloat | u, | ||
PN_stdfloat | v, | ||
int | d | ||
) | const |
Evaluates the surface in n-dimensional space according to the extended vertices associated with the surface in the indicated dimension.
Definition at line 173 of file nurbsSurfaceResult.cxx.
References eval_segment_extended_points(), NurbsBasisVector::get_basis(), NurbsVertex::get_extended_vertex(), NurbsBasisVector::get_order(), and NurbsBasisVector::get_vertex_index().
Referenced by eval_extended_point(), and eval_segment_normal().
void NurbsSurfaceResult::eval_segment_extended_points | ( | int | ui, |
int | vi, | ||
PN_stdfloat | u, | ||
PN_stdfloat | v, | ||
int | d, | ||
PN_stdfloat | result[], | ||
int | num_values | ||
) | const |
Simultaneously performs eval_extended_point on a contiguous sequence of dimensions.
The dimensions evaluated are d through (d + num_values - 1); the results are filled into the num_values elements in the indicated result array.
Definition at line 219 of file nurbsSurfaceResult.cxx.
References NurbsBasisVector::get_basis(), get_end_u(), get_end_v(), NurbsVertex::get_extended_vertex(), NurbsBasisVector::get_from(), NurbsBasisVector::get_num_segments(), NurbsBasisVector::get_order(), get_start_u(), get_start_v(), NurbsBasisVector::get_to(), and NurbsBasisVector::get_vertex_index().
Referenced by eval_extended_points(), eval_segment_extended_point(), and SheetNode::reset_bound().
void NurbsSurfaceResult::eval_segment_normal | ( | int | ui, |
int | vi, | ||
PN_stdfloat | u, | ||
PN_stdfloat | v, | ||
LVecBase3 & | normal | ||
) | const |
As eval_segment_point, but computes the normal to the surface at the indicated point.
The normal vector will not necessarily be normalized, and could be zero.
Definition at line 143 of file nurbsSurfaceResult.cxx.
References eval_segment_extended_point().
Referenced by eval_normal(), eval_segment_point(), and SheetNode::reset_bound().
void NurbsSurfaceResult::eval_segment_point | ( | int | ui, |
int | vi, | ||
PN_stdfloat | u, | ||
PN_stdfloat | v, | ||
LVecBase3 & | point | ||
) | const |
Evaluates the point on the surface corresponding to the indicated value in parametric time within the indicated surface segment.
u and v should be in the range [0, 1].
The surface is internally represented as a number of connected (or possibly unconnected) piecewise continuous segments. The exact number of segments for a particular surface depends on the knot vector, and is returned by get_num_segments(). Normally, eval_point() is used to evaluate a point along the continuous surface, but when you care more about local continuity, you can use eval_segment_point() to evaluate the points along each segment.
Definition at line 118 of file nurbsSurfaceResult.cxx.
References eval_segment_normal().
Referenced by eval_point(), NurbsSurfaceResult(), and SheetNode::reset_bound().
|
inline |
Returns the last legal value of u on the surface.
Definition at line 42 of file nurbsSurfaceResult.I.
References NurbsBasisVector::get_end_t(), and get_start_v().
Referenced by eval_segment_extended_points(), and get_start_u().
|
inline |
Returns the last legal value of v on the surface.
Definition at line 63 of file nurbsSurfaceResult.I.
References eval_point(), and NurbsBasisVector::get_end_t().
Referenced by eval_segment_extended_points(), and get_start_v().
|
inline |
Returns the number of piecewise continuous segments within the surface in the U direction.
This number is usually not important unless you plan to call eval_segment_point().
Definition at line 160 of file nurbsSurfaceResult.I.
References NurbsBasisVector::get_num_segments(), and get_num_v_segments().
Referenced by eval_extended_points(), and SheetNode::reset_bound().
|
inline |
Returns the number of piecewise continuous segments within the surface in the V direction.
This number is usually not important unless you plan to call eval_segment_point().
Definition at line 173 of file nurbsSurfaceResult.I.
References NurbsBasisVector::get_num_segments(), and get_segment_u().
Referenced by get_num_u_segments(), and SheetNode::reset_bound().
|
inline |
Accepts a u value in the range [0, 1], and assumed to be relative to the indicated segment (as in eval_segment_point()), and returns the corresponding u value in the entire surface (as in eval_point()).
Definition at line 186 of file nurbsSurfaceResult.I.
References NurbsBasisVector::get_from(), get_segment_v(), and NurbsBasisVector::get_to().
Referenced by get_num_v_segments(), and SheetNode::reset_bound().
|
inline |
Accepts a v value in the range [0, 1], and assumed to be relative to the indicated segment (as in eval_segment_point()), and returns the corresponding v value in the entire surface (as in eval_point()).
Definition at line 199 of file nurbsSurfaceResult.I.
References NurbsBasisVector::get_from(), NurbsBasisVector::get_num_segments(), and NurbsBasisVector::get_to().
Referenced by get_segment_u(), and SheetNode::reset_bound().
|
inline |
Returns the first legal value of u on the surface.
Usually this is 0.0.
Definition at line 32 of file nurbsSurfaceResult.I.
References get_end_u(), and NurbsBasisVector::get_start_t().
Referenced by eval_segment_extended_points().
|
inline |
Returns the first legal value of v on the surface.
Usually this is 0.0.
Definition at line 53 of file nurbsSurfaceResult.I.
References get_end_v(), and NurbsBasisVector::get_start_t().
Referenced by eval_segment_extended_points(), and get_end_u().