# NurbsSurfaceEvaluator

from pandac.PandaModules import NurbsSurfaceEvaluator

Class : NurbsSurfaceEvaluator
Description : This class is an abstraction for evaluating NURBS surfaces. 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.

## Inheritance:

NurbsSurfaceEvaluator: ReferenceCount
ReferenceCount:

## Methods of NurbsSurfaceEvaluator:

evaluate
getExtendedVertex
getNumUKnots
getNumUSegments
getNumUVertices
getNumVKnots
getNumVSegments
getNumVVertices
getUKnot
getUOrder
getVertex
getVertexSpace
getVKnot
getVOrder
normalizeUKnots
normalizeVKnots
output
reset
setExtendedVertex
setExtendedVertices
setUKnot
setUOrder
setVertex
setVertexSpace
setVKnot
setVOrder

## Methods of ReferenceCount:

getClassType
getRefCount
ref
testRefCountIntegrity
testRefCountNonzero
unref

evaluate PointerTo< NurbsSurfaceResult > NurbsSurfaceEvaluator::evaluate(NodePath const &rel_to = ((()))) const; Description: Returns a NurbsSurfaceResult object that represents the result of applying the knots to all of the current values of the vertices, transformed into the indicated coordinate space.

getExtendedVertex float NurbsSurfaceEvaluator::get_extended_vertex(int ui, int vi, int d) const; Description: Returns an n-dimensional vertex value. See set_extended_vertex(). This returns the value set for the indicated dimension, or 0.0 if nothing has been set.

getNumUKnots int NurbsSurfaceEvaluator::get_num_u_knots(void) const; Description: Returns the number of knot values in the surface in the U direction. This is based on the number of vertices and the order.

getNumUSegments int NurbsSurfaceEvaluator::get_num_u_segments(void) const; Description: Returns the number of piecewise continuous segments in the surface in the U direction. This is based on the knot vector.

getNumUVertices int NurbsSurfaceEvaluator::get_num_u_vertices(void) const; Description: Returns the number of control vertices in the U direction on the surface. This is the number passed to the last call to reset().

getNumVKnots int NurbsSurfaceEvaluator::get_num_v_knots(void) const; Description: Returns the number of knot values in the surface in the V direction. This is based on the number of vertices and the order.

getNumVSegments int NurbsSurfaceEvaluator::get_num_v_segments(void) const; Description: Returns the number of piecewise continuous segments in the surface in the V direction. This is based on the knot vector.

getNumVVertices int NurbsSurfaceEvaluator::get_num_v_vertices(void) const; Description: Returns the number of control vertices in the V direction on the surface. This is the number passed to the last call to reset().

getUKnot float NurbsSurfaceEvaluator::get_u_knot(int i) const; Description: Returns the value of the nth knot.

getUOrder int NurbsSurfaceEvaluator::get_u_order(void) const; Description: Returns the order of the surface in the U direction as set by a previous call to set_u_order().

getVertex LVecBase4f const &NurbsSurfaceEvaluator::get_vertex(int ui, int vi) const; Description: Returns the nth control vertex of the surface, relative to its indicated coordinate space. Description: Returns the nth control vertex of the surface, relative to the given coordinate space.

getVertexSpace NodePath NurbsSurfaceEvaluator::get_vertex_space(int ui, int vi, NodePath const &rel_to) const; Description: Returns the coordinate space of the nth control vertex of the surface, expressed as a NodePath.

getVKnot float NurbsSurfaceEvaluator::get_v_knot(int i) const; Description: Returns the value of the nth knot.

getVOrder int NurbsSurfaceEvaluator::get_v_order(void) const; Description: Returns the order of the surface in the V direction as set by a previous call to set_v_order().

normalizeUKnots void NurbsSurfaceEvaluator::normalize_u_knots(void); Description: Normalizes the knot sequence so that the parametric range of the surface in the U direction is 0 .. 1.

normalizeVKnots void NurbsSurfaceEvaluator::normalize_v_knots(void); Description: Normalizes the knot sequence so that the parametric range of the surface in the U direction is 0 .. 1.

output void NurbsSurfaceEvaluator::output(ostream &out) const; Description:

reset void NurbsSurfaceEvaluator::reset(int num_u_vertices, int num_v_vertices); Description: Resets all the vertices and knots to their default values, and sets the surface up with the indicated number of vertices. You must then call set_vertex() repeatedly to fill in all of the vertex values appropriately.

setExtendedVertex void NurbsSurfaceEvaluator::set_extended_vertex(int ui, int vi, int d, float value); Description: Sets an n-dimensional vertex value. This allows definition of a NURBS surface or surface in a sparse n-dimensional space, typically used for associating additional properties (like color or joint membership) with each vertex of a surface. The value d is an arbitrary integer value and specifies the dimension of question for this particular vertex. Any number of dimensions may be specified, and they need not be consecutive. If a value for a given dimension is not specified, is it implicitly 0.0. The value is implicitly scaled by the homogenous weight value--that is, the fourth component of the value passed to set_vertex(). This means the ordinary vertex must be set first, before the extended vertices can be set.

setExtendedVertices void NurbsSurfaceEvaluator::set_extended_vertices(int ui, int vi, int d, void *values[](unsigned int size), int num_values); Description: Simultaneously sets several extended values in the slots d through (d + num_values - 1) from the num_values elements of the indicated array. This is equivalent to calling set_extended_vertex() num_values times. See set_extended_vertex().

setUKnot void NurbsSurfaceEvaluator::set_u_knot(int i, float knot); Description: 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.

setUOrder void NurbsSurfaceEvaluator::set_u_order(int u_order); Filename: nurbsSurfaceEvaluator.I Created by: drose (10Oct03) PANDA 3D SOFTWARE Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved All use of this software is subject to the terms of the Panda 3d Software license. You should have received a copy of this license along with this source code; you will also find a current copy of the license at http://etc.cmu.edu/panda3d/docs/license/ . To contact the maintainers of this program write to panda3d-general@lists.sourceforge.net . Description: Sets the order of the surface in the U direction. 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 surface.

setVertex void NurbsSurfaceEvaluator::set_vertex(int ui, int vi, LVecBase4f const &vertex); Description: Sets the nth control vertex of the surface, as a vertex in 4-d homogeneous space. In this form, the first three components of the vertex should already have been scaled by the fourth component, which is the homogeneous weight. Description: Sets the nth control vertex of the surface. This flavor sets the vertex as a 3-d coordinate and a weight; the 3-d coordinate values are implicitly scaled up by the weight factor.

setVertexSpace void NurbsSurfaceEvaluator::set_vertex_space(int ui, int vi, NodePath const &space); Description: 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 surface. Description: 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 surface is evaluated.

setVKnot void NurbsSurfaceEvaluator::set_v_knot(int i, float knot); Description: 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.

setVOrder void NurbsSurfaceEvaluator::set_v_order(int v_order); Description: Sets the order of the surface in the V direction. 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 surface.

getClassType static TypeHandle ReferenceCount::get_class_type(void); Undocumented function.

getRefCount int ReferenceCount::get_ref_count(void) const; Description: Returns the current reference count.

ref void ReferenceCount::ref(void) const; Description: 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.

testRefCountIntegrity bool ReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise.

testRefCountNonzero bool ReferenceCount::test_ref_count_nonzero(void) const; Description: Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise.

unref bool ReferenceCount::unref(void) const; Description: 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 true if the new reference count is nonzero, false if it is zero.