#include <nurbsCurveEvaluator.h>
Inheritance diagram for NurbsCurveEvaluator:
Public Member Functions | |
NurbsCurveEvaluator () | |
~NurbsCurveEvaluator () | |
void | set_order (int order) |
Sets the order of the curve. | |
int | get_order () const |
Returns the order of the curve as set by a previous call to set_order(). | |
void | reset (int num_vertices) |
Resets all the vertices and knots to their default values, and sets the curve up with the indicated number of vertices. | |
int | get_num_vertices () const |
Returns the number of control vertices in the curve. | |
void | set_vertex (int i, const LVecBase4f &vertex) |
Sets the nth control vertex of the curve. | |
void | set_vertex (int i, const LVecBase3f &vertex, float weight=1.0) |
Sets the nth control vertex of the curve. | |
const LVecBase4f & | get_vertex (int i) const |
Returns the nth control vertex of the curve, relative to its indicated coordinate space. | |
void | set_vertex_space (int i, const NodePath &space) |
Sets the coordinate space of the nth control vertex. | |
void | set_vertex_space (int i, const string &space) |
Sets the coordinate space of the nth control vertex. | |
NodePath | get_vertex_space (int i, const NodePath &rel_to) const |
Returns the coordinate space of the nth control vertex of the curve, expressed as a NodePath. | |
int | get_num_knots () const |
Returns the number of knot values in the curve. | |
void | set_knot (int i, float knot) |
Sets the value of the nth knot. | |
float | get_knot (int i) const |
Returns the value of the nth knot. | |
PointerTo< NurbsCurveResult > | evaluate (const NodePath &rel_to=NodePath()) const |
Returns a NurbsCurveResult object that represents the result of applying the knots to all of the current values of the vertices, transformed into the indicated coordinate space. | |
void | get_vertices (pvector< LVecBase4f > &verts, const NodePath &rel_to) const |
Fills the indicated vector with the set of vertices in the curve, transformed to the given space. | |
void | get_vertices (pvector< LPoint3f > &verts, const NodePath &rel_to) const |
Fills the indicated vector with the set of vertices in the curve, transformed to the given space. | |
int | get_ref_count () const |
Returns the current reference count. | |
int | ref () const |
Explicitly increments the reference count. | |
int | unref () const |
Explicitly decrements the reference count. | |
void | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
Private Types | |
typedef pvector< NurbsVertex > | Vertices |
typedef vector_float | Knots |
Private Member Functions | |
void | recompute_knots () |
Creates a default knot vector. | |
void | recompute_basis () |
Recomputes the basis matrices according to the knot vector. | |
Private Attributes | |
int | _order |
Vertices | _vertices |
bool | _knots_dirty |
Knots | _knots |
bool | _basis_dirty |
NurbsMatrixVector | _basis |
It accepts an array of vertices, each of which may be in a different coordinate space (as defined by a NodePath), as well as an optional knot vector.
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 65 of file nurbsCurveEvaluator.h.
|
Definition at line 104 of file nurbsCurveEvaluator.h. |
|
Definition at line 100 of file nurbsCurveEvaluator.h. |
|
Definition at line 32 of file nurbsCurveEvaluator.cxx. |
|
Definition at line 46 of file nurbsCurveEvaluator.cxx. References _basis_dirty, _knots_dirty, and _vertices. |
|
Returns a NurbsCurveResult object that represents the result of applying the knots to all of the current values of the vertices, transformed into the indicated coordinate space.
Definition at line 151 of file nurbsCurveEvaluator.cxx. Referenced by RopeNode::safe_to_transform(). |
|
|
Returns the value of the nth knot.
Definition at line 128 of file nurbsCurveEvaluator.cxx. |
|
Returns the number of knot values in the curve. This is based on the number of vertices and the order. Definition at line 193 of file nurbsCurveEvaluator.I. |
|
Returns the number of control vertices in the curve. This is the number passed to the last call to reset(). Definition at line 76 of file nurbsCurveEvaluator.I. |
|
Returns the order of the curve as set by a previous call to set_order().
Definition at line 59 of file nurbsCurveEvaluator.I. |
|
Returns the current reference count.
Definition at line 183 of file referenceCount.I. Referenced by RenderState::determine_bin_index(), RenderEffects::determine_show_bounds(), FontPool::ns_garbage_collect(), TexturePool::ns_garbage_collect(), MaterialPool::ns_get_material(), and TexturePool::ns_release_texture(). |
|
Returns the nth control vertex of the curve, relative to its indicated coordinate space.
Definition at line 119 of file nurbsCurveEvaluator.I. |
|
Returns the coordinate space of the nth control vertex of the curve, expressed as a NodePath.
Definition at line 88 of file nurbsCurveEvaluator.cxx. References recompute_knots(). |
|
Fills the indicated vector with the set of vertices in the curve, transformed to the given space. This flavor returns the vertices in 4-dimensional homogenous space. Definition at line 211 of file nurbsCurveEvaluator.cxx. References _knots_dirty. |
|
Fills the indicated vector with the set of vertices in the curve, transformed to the given space. This flavor returns the vertices in 4-dimensional homogenous space. Definition at line 180 of file nurbsCurveEvaluator.cxx. Referenced by set_knot(). |
|
|
Recomputes the basis matrices according to the knot vector.
Definition at line 273 of file nurbsCurveEvaluator.cxx. |
|
Creates a default knot vector.
Definition at line 236 of file nurbsCurveEvaluator.cxx. Referenced by get_vertex_space(). |
|
Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is the new reference count. Definition at line 225 of file referenceCount.I. Referenced by ClientDevice::ClientDevice(), EggGroupNode::find_textures(), EggGroupNode::r_apply_texmats(), EggGroupNode::r_flatten_transforms(), and EggGroupNode::reverse_vertex_ordering(). |
|
Resets all the vertices and knots to their default values, and sets the curve up with the indicated number of vertices. You must then call set_vertex() repeatedly to fill in all of the vertex values appropriately. Definition at line 66 of file nurbsCurveEvaluator.cxx. |
|
Sets the value of the nth knot. Each knot value should be greater than or equal to the preceding value. If no knot values are set, a default knot vector is supplied. Definition at line 111 of file nurbsCurveEvaluator.cxx. References get_vertices(). |
|
Sets the order of the curve. This resets the knot vector to the default knot vector for the number of vertices. The order must be 1, 2, 3, or 4, and the value is one more than the degree of the curve. Definition at line 42 of file nurbsCurveEvaluator.I. |
|
Sets the nth control vertex of the curve.
Definition at line 103 of file nurbsCurveEvaluator.I. |
|
Sets the nth control vertex of the curve.
Definition at line 89 of file nurbsCurveEvaluator.I. |
|
Sets the coordinate space of the nth control vertex. If this is not specified, or is set to an empty string, the nth control vertex is deemed to be in the coordinate space passed to evaluate(). This specifies the space as a string, which describes the path to find the node relative to the rel_to NodePath when the curve is evaluated. Definition at line 177 of file nurbsCurveEvaluator.I. |
|
Sets the coordinate space of the nth control vertex. If this is not specified, or is set to an empty NodePath, the nth control vertex is deemed to be in the coordinate space passed to evaluate(). This specifies the space as a fixed NodePath, which is always the same NodePath. Also see setting the space as a path string, which can specify a different NodePath for different instances of the curve. Definition at line 149 of file nurbsCurveEvaluator.I. |
|
Does some easy checks to make sure that the reference count isn't completely bogus.
Definition at line 328 of file referenceCount.I. References INLINE. Referenced by EggNode::determine_bin(), and ReferenceCount::~ReferenceCount(). |
|
Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is the new reference count. Definition at line 293 of file referenceCount.I. References INLINE. Referenced by RenderState::determine_bin_index(), and RenderEffects::determine_show_bounds(). |
|
Definition at line 108 of file nurbsCurveEvaluator.h. |
|
Definition at line 107 of file nurbsCurveEvaluator.h. Referenced by ~NurbsCurveEvaluator(). |
|
Definition at line 105 of file nurbsCurveEvaluator.h. |
|
Definition at line 103 of file nurbsCurveEvaluator.h. Referenced by get_vertices(), and ~NurbsCurveEvaluator(). |
|
Definition at line 98 of file nurbsCurveEvaluator.h. Referenced by set_order(). |
|
Definition at line 101 of file nurbsCurveEvaluator.h. Referenced by get_num_vertices(), get_order(), get_vertex(), reset(), set_vertex(), and ~NurbsCurveEvaluator(). |