Panda3D
Public Member Functions | Static Public Member Functions

NurbsSurfaceEvaluator Class Reference

This class is an abstraction for evaluating NURBS surfaces. More...

Inheritance diagram for NurbsSurfaceEvaluator:
ReferenceCount MemoryBase

List of all members.

Public Member Functions

 NurbsSurfaceEvaluator ()
NurbsSurfaceResult evaluate (NodePath const rel_to)
 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.
NurbsSurfaceResult evaluate ()
 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.
float getExtendedVertex (int ui, int vi, int d)
 Returns an n-dimensional vertex value.
int getNumUKnots ()
 Returns the number of knot values in the surface in the U direction.
int getNumUSegments ()
 Returns the number of piecewise continuous segments in the surface in the U direction.
int getNumUVertices ()
 Returns the number of control vertices in the U direction on the surface.
int getNumVKnots ()
 Returns the number of knot values in the surface in the V direction.
int getNumVSegments ()
 Returns the number of piecewise continuous segments in the surface in the V direction.
int getNumVVertices ()
 Returns the number of control vertices in the V direction on the surface.
int getRefCount ()
 Returns the current reference count.
float getUKnot (int i)
 Returns the value of the nth knot.
list getUKnots ()
int getUOrder ()
 Returns the order of the surface in the U direction as set by a previous call to set_u_order().
VBase4 const getVertex (int ui, int vi)
 Returns the nth control vertex of the surface, relative to its indicated coordinate space.
VBase4 getVertex (int ui, int vi, NodePath const rel_to)
 Returns the nth control vertex of the surface, relative to the given coordinate space.
NodePath getVertexSpace (int ui, int vi, NodePath const rel_to)
 Returns the coordinate space of the nth control vertex of the surface, expressed as a NodePath.
float getVKnot (int i)
 Returns the value of the nth knot.
list getVKnots ()
int getVOrder ()
 Returns the order of the surface in the V direction as set by a previous call to set_v_order().
 normalizeUKnots ()
 Normalizes the knot sequence so that the parametric range of the surface in the U direction is 0 .
 normalizeVKnots ()
 Normalizes the knot sequence so that the parametric range of the surface in the U direction is 0 .
 output (ostream out)
 ref ()
 Explicitly increments the reference count.
 reset (int num_u_vertices, int num_v_vertices)
 Resets all the vertices and knots to their default values, and sets the surface up with the indicated number of vertices.
 setExtendedVertex (int ui, int vi, int d, float value)
 Sets an n-dimensional vertex value.
 setUKnot (int i, float knot)
 Sets the value of the nth knot.
 setUOrder (int u_order)
 Sets the order of the surface in the U direction.
 setVertex (int ui, int vi, VBase3 const vertex, float weight)
 Sets the nth control vertex of the surface.
 setVertex (int ui, int vi, VBase3 const vertex)
 Sets the nth control vertex of the surface.
 setVertex (int ui, int vi, VBase4 const vertex)
 Sets the nth control vertex of the surface, as a vertex in 4-d homogeneous space.
 setVertexSpace (int ui, int vi, string space)
 Sets the coordinate space of the nth control vertex.
 setVertexSpace (int ui, int vi, NodePath const space)
 Sets the coordinate space of the nth control vertex.
 setVKnot (int i, float knot)
 Sets the value of the nth knot.
 setVOrder (int v_order)
 Sets the order of the surface in the V direction.
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus.
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
bool unref ()
 Explicitly decrements the reference count.

Static Public Member Functions

static TypeHandle getClassType ()

Detailed 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.


Constructor & Destructor Documentation


Member Function Documentation

NurbsSurfaceResult evaluate ( NodePath const  rel_to)

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.

NurbsSurfaceResult evaluate ( )

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.

static TypeHandle getClassType ( ) [static, inherited]

Reimplemented in NodeReferenceCount, TypedReferenceCount, VirtualFile, VirtualFileComposite, VirtualFileMount, VirtualFileMountMultifile, VirtualFileMountSystem, VirtualFileSimple, HTTPChannel, VirtualFileHTTP, VirtualFileMountHTTP, VrpnClient, ClientBase, PGItem, PandaNode, PGButton, PGTop, PGEntry, PGMouseWatcherBackground, MouseWatcherRegion, PGMouseWatcherParameter, TypedWritableReferenceCount, PGVirtualFrame, PGSliderBar, PGScrollFrame, PGWaitBar, FilterProperties, AudioSound, AudioManager, BamCacheRecord, CallbackObject, CachedTypedWritableReferenceCount, ClockObject, CopyOnWriteObject, NodeCachedReferenceCount, PythonCallbackObject, LerpFunctor, IntLerpFunctor, FloatLerpFunctor, SimpleLerpFunctorPoint2, SimpleLerpFunctorPoint3, SimpleLerpFunctorPoint4, SimpleLerpFunctorVBase2, SimpleLerpFunctorVBase3, SimpleLerpFunctorVBase4, SimpleLerpFunctorVec2, SimpleLerpFunctorVec3, SimpleLerpFunctorVec4, IntQueryLerpFunctor, FloatQueryLerpFunctor, SimpleQueryLerpFunctorPoint2, SimpleQueryLerpFunctorPoint3, SimpleQueryLerpFunctorPoint4, SimpleQueryLerpFunctorVBase2, SimpleQueryLerpFunctorVBase3, SimpleQueryLerpFunctorVBase4, SimpleQueryLerpFunctorVec2, SimpleQueryLerpFunctorVec3, SimpleQueryLerpFunctorVec4, MultiLerpFunctor, LerpBlendType, EaseInBlendType, EaseOutBlendType, EaseInOutBlendType, NoBlendType, Lerp, AutonomousLerp, ButtonThrower, DataNode, MouseInterfaceNode, DriveInterface, MouseSubregion, MouseWatcherGroup, MouseWatcher, Trackball, Transform2SG, TextFont, DynamicTextPage, Texture, DynamicTextFont, GeomTextGlyph, Geom, StaticTextFont, TextNode, ParametricCurve, CubicCurveseg, PiecewiseCurve, HermiteCurve, NurbsCurve, RopeNode, SheetNode, BoundingVolume, GeometricBoundingVolume, FiniteBoundingVolume, BoundingBox, BoundingHexahedron, BoundingLine, BoundingPlane, BoundingSphere, OmniBoundingVolume, DisplayRegionBase, GraphicsOutputBase, GraphicsStateGuardianBase, InternalName, GeomVertexArrayFormat, GeomVertexFormat, GeomVertexArrayData, GeomVertexArrayDataHandle, VertexTransform, TransformTable, TransformBlendTable, VertexSlider, SliderTable, GeomVertexData, AnimateVerticesRequest, AsyncTask, GeomPrimitive, TextureStage, GeomLines, GeomLinestrips, GeomPoints, GeomTriangles, GeomTrifans, GeomTristrips, Material, Lens, OrthographicLens, MatrixLens, PerspectiveLens, Shader, TextureReloadRequest, UserVertexSlider, UserVertexTransform, VideoTexture, AsyncTaskBase, AsyncTaskChain, AsyncTaskManager, AsyncTaskPause, AsyncTaskSequence, EventStoreValueBase, EventStoreTypedRefCount, Event, PointerEventList, PythonTask, Thread, ExternalThread, MainThread, PythonThread, WindowHandle.OSHandle, WindowHandle, OSHandle, DisplayRegion, GraphicsDevice, GraphicsPipe, GraphicsStateGuardian, StereoDisplayRegion, GraphicsOutput, GraphicsBuffer, GraphicsWindow, NativeWindowHandle, ParasiteBuffer, AnalogNode, ButtonNode, DialNode, MouseAndKeyboard, TrackerNode, VirtualMouse, CollisionHandler, CollisionSolid, CollisionNode, CollisionEntry, CollisionHandlerEvent, CollisionHandlerHighestEvent, CollisionHandlerPhysical, CollisionHandlerFloor, CollisionHandlerGravity, CollisionHandlerPusher, CollisionHandlerFluidPusher, CollisionHandlerQueue, CollisionDSSolid, CollisionBox, CollisionSphere, CollisionInvSphere, CollisionRay, CollisionLine, CollisionPlane, CollisionPolygon, CollisionParabola, CollisionFloorMesh, CollisionSegment, CollisionTube, CollisionVisualizer, CharacterJoint, MovingPartMatrix, CharacterSlider, MovingPartScalar, CharacterVertexSlider, JointVertexTransform, Character, PartBundleNode, CharacterJointBundle, PartBundle, CharacterJointEffect, RenderEffect, AnimGroup, AnimBundle, AnimBundleNode, PartGroup, AnimControl, AnimChannelBase, AnimChannelACMatrixSwitchType, AnimChannelACScalarSwitchType, AnimChannelMatrixDynamic, AnimChannelMatrixXfmTable, AnimChannelScalarDynamic, AnimChannelScalarTable, AnimPreloadTable, BindAnimRequest, ModelLoadRequest, MovingPartBase, MovingPartACMatrixSwitchType, MovingPartACScalarSwitchType, FFMpegTexture, FrameRateMeter, SceneGraphAnalyzerMeter, MovieTexture, NodeVertexTransform, RigidBodyCombiner, PipeOcclusionCullTraverser, CullTraverser, MovieVideo, MovieVideoCursor, MovieAudio, MovieAudioCursor, InkblotVideo, InkblotVideoCursor, FfmpegVideo, FfmpegVideoCursor, FfmpegAudio, FfmpegAudioCursor, MicrophoneAudio, UserDataAudio, UserDataAudioCursor, TransformState, RenderAttrib, RenderModeAttrib, TexMatrixAttrib, RenderState, AlphaTestAttrib, AntialiasAttrib, RenderEffects, TransparencyAttrib, AudioVolumeAttrib, AuxBitplaneAttrib, AuxSceneData, BillboardEffect, LensNode, Camera, PlaneNode, ClipPlaneAttrib, ColorAttrib, ColorBlendAttrib, ColorScaleAttrib, ColorWriteAttrib, CompassEffect, CullBinAttrib, CullFaceAttrib, GeomNode, DecalEffect, DepthOffsetAttrib, DepthTestAttrib, DepthWriteAttrib, EventStorePandaNode, Fog, FogAttrib, Light, LightAttrib, LightRampAttrib, PandaLoader, MaterialAttrib, ModelFlattenRequest, ModelNode, ModelRoot, TextureAttrib, TexGenAttrib, PolylightNode, PolylightEffect, ShaderInput, ShaderAttrib, ShowBoundsEffect, TexProjectorEffect, ScissorEffect, PosLerpFunctor, HprLerpFunctor, ScaleLerpFunctor, ColorLerpFunctor, PosHprLerpFunctor, HprScaleLerpFunctor, PosHprScaleLerpFunctor, ColorScaleLerpFunctor, PortalNode, RescaleNormalAttrib, ScissorAttrib, ShadeModelAttrib, StencilAttrib, UvScrollNode, LightNode, AmbientLight, CallbackNode, LightLensNode, DirectionalLight, LODNode, FadeLODNode, PointLight, SelectiveChildNode, SequenceNode, Spotlight, SwitchNode, RecorderBase, MouseRecorder, RecorderController, and SocketStreamRecorder.

float getExtendedVertex ( int  ui,
int  vi,
int  d 
)

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.

int getNumUKnots ( )

Returns the number of knot values in the surface in the U direction.

This is based on the number of vertices and the order.

int getNumUSegments ( )

Returns the number of piecewise continuous segments in the surface in the U direction.

This is based on the knot vector.

int getNumUVertices ( )

Returns the number of control vertices in the U direction on the surface.

This is the number passed to the last call to reset().

int getNumVKnots ( )

Returns the number of knot values in the surface in the V direction.

This is based on the number of vertices and the order.

int getNumVSegments ( )

Returns the number of piecewise continuous segments in the surface in the V direction.

This is based on the knot vector.

int getNumVVertices ( )

Returns the number of control vertices in the V direction on the surface.

This is the number passed to the last call to reset().

int getRefCount ( ) [inherited]

Returns the current reference count.

float getUKnot ( int  i)

Returns the value of the nth knot.

list getUKnots ( )
int getUOrder ( )

Returns the order of the surface in the U direction as set by a previous call to set_u_order().

VBase4 const getVertex ( int  ui,
int  vi 
)

Returns the nth control vertex of the surface, relative to its indicated coordinate space.

VBase4 getVertex ( int  ui,
int  vi,
NodePath const  rel_to 
)

Returns the nth control vertex of the surface, relative to the given coordinate space.

NodePath getVertexSpace ( int  ui,
int  vi,
NodePath const  rel_to 
)

Returns the coordinate space of the nth control vertex of the surface, expressed as a NodePath.

float getVKnot ( int  i)

Returns the value of the nth knot.

list getVKnots ( )
int getVOrder ( )

Returns the order of the surface in the V direction as set by a previous call to set_v_order().

normalizeUKnots ( )

Normalizes the knot sequence so that the parametric range of the surface in the U direction is 0 .

. 1.

normalizeVKnots ( )

Normalizes the knot sequence so that the parametric range of the surface in the U direction is 0 .

. 1.

output ( ostream  out)
ref ( ) [inherited]

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.

reset ( int  num_u_vertices,
int  num_v_vertices 
)

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 ( int  ui,
int  vi,
int  d,
float  value 
)

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.

setUKnot ( int  i,
float  knot 
)

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 ( int  u_order)

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 ( int  ui,
int  vi,
VBase3 const  vertex,
float  weight 
)

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.

setVertex ( int  ui,
int  vi,
VBase4 const  vertex 
)

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.

setVertex ( int  ui,
int  vi,
VBase3 const  vertex 
)

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 ( int  ui,
int  vi,
NodePath const  space 
)

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.

setVertexSpace ( int  ui,
int  vi,
string  space 
)

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 ( int  i,
float  knot 
)

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 ( int  v_order)

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.

bool testRefCountIntegrity ( ) [inherited]

Does some easy checks to make sure that the reference count isn't completely bogus.

Returns true if ok, false otherwise.

Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.

bool testRefCountNonzero ( ) [inherited]

Does some easy checks to make sure that the reference count isn't zero, or completely bogus.

Returns true if ok, false otherwise.

bool unref ( ) [inherited]

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.) 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.

Reimplemented in GeomVertexArrayFormat, and GeomVertexFormat.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties