Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions
EggNurbsSurface Class Reference

A parametric NURBS surface. More...

Inheritance diagram for EggNurbsSurface:
EggSurface EggPrimitive EggNode EggAttributes EggRenderMode EggNamedObject MemoryBase EggObject

List of all members.

Public Member Functions

 EggNurbsSurface (EggNurbsSurface const copy)
 EggNurbsSurface (string name)
 EggNurbsSurface ()
EggVertex getCv (int ui, int vi)
 Returns the control vertex at the indicate U, V position.
int getNumCvs ()
 Returns the total number of control vertices that should* be defined for the surface.
int getNumUCvs ()
 Returns the number of control vertices that should be present in the U direction.
int getNumUKnots ()
 Returns the number of knots in the U direction.
int getNumVCvs ()
 Returns the number of control vertices that should be present in the V direction.
int getNumVKnots ()
 Returns the number of knots in the V direction.
int getUDegree ()
 Returns the degree of the surface in the U direction.
int getUIndex (int vertex_index)
 Returns the U index number of the given vertex within the EggPrimitive's linear list of vertices.
double getUKnot (int k)
 Returns the nth knot value defined in the U direction.
list getUKnots ()
int getUOrder ()
 Returns the order of the surface in the U direction.
int getVDegree ()
 Returns the degree of the surface in the V direction.
int getVertexIndex (int ui, int vi)
 Returns the index number within the EggPrimitive's list of the control vertex at position ui, vi.
int getVIndex (int vertex_index)
 Returns the V index number of the given vertex within the EggPrimitive's linear list of vertices.
double getVKnot (int k)
 Returns the nth knot value defined in the V direction.
list getVKnots ()
int getVOrder ()
 Returns the order of the surface in the V direction.
bool isClosedU ()
 Returns true if the surface appears to be closed in the U direction.
bool isClosedV ()
 Returns true if the surface appears to be closed in the V direction.
bool isValid ()
 Returns true if the NURBS parameters are all internally consistent (e.g.
EggNurbsSurface operator= (EggNurbsSurface const copy)
 setCv (int ui, int vi, EggVertex vertex)
 Redefines the control vertex associated with a particular u, v coordinate pair.
 setNumUKnots (int num)
 Directly changes the number of knots in the U direction.
 setNumVKnots (int num)
 Directly changes the number of knots in the V direction.
 setUKnot (int k, double value)
 Resets the value of the indicated knot as indicated.
 setUOrder (int u_order)
 Directly changes the order in the U direction to the indicated value (which must be an integer in the range 1 <= u_order <= 4).
 setup (int u_order, int v_order, int num_u_knots, int num_v_knots)
 Prepares a new surface definition with the indicated order and number of knots in each dimension.
 setVKnot (int k, double value)
 Resets the value of the indicated knot as indicated.
 setVOrder (int v_order)
 Directly changes the order in the V direction to the indicated value (which must be an integer in the range 1 <= v_order <= 4).

Static Public Member Functions

static TypeHandle getClassType ()

Detailed Description

A parametric NURBS surface.


Constructor & Destructor Documentation


Member Function Documentation

static TypeHandle getClassType ( ) [static]

Reimplemented from EggSurface.

EggVertex getCv ( int  ui,
int  vi 
)

Returns the control vertex at the indicate U, V position.

int getNumCvs ( )

Returns the total number of control vertices that should* be defined for the surface.

This is determined by the number of knots and the order, in each direction; it does not necessarily reflect the number of vertices that have actually been added to the surface. (However, if the number of vertices in the surface are wrong, the surface is invalid.)

int getNumUCvs ( )

Returns the number of control vertices that should be present in the U direction.

This is determined by the number of knots and the order; it does not necessarily reflect the number of vertices that have actually been added to the surface. (However, if the number of vertices in the surface are wrong, the surface is invalid.)

int getNumUKnots ( )

Returns the number of knots in the U direction.

int getNumVCvs ( )

Returns the number of control vertices that should be present in the V direction.

This is determined by the number of knots and the order; it does not necessarily reflect the number of vertices that have actually been added to the surface. (However, if the number of vertices in the surface are wrong, the surface is invalid.)

int getNumVKnots ( )

Returns the number of knots in the V direction.

int getUDegree ( )

Returns the degree of the surface in the U direction.

For a typical NURBS, the degree is 3.

int getUIndex ( int  vertex_index)

Returns the U index number of the given vertex within the EggPrimitive's linear list of vertices.

An EggNurbsSurface maps a linear list of vertices to its 2-d mesh; this returns the U index number that corresponds to the nth vertex in the list.

double getUKnot ( int  k)

Returns the nth knot value defined in the U direction.

list getUKnots ( )
int getUOrder ( )

Returns the order of the surface in the U direction.

The order is the degree of the NURBS equation plus 1; for a typical NURBS, the order is 4. With this implementation of NURBS, the order must be in the range [1, 4].

int getVDegree ( )

Returns the degree of the surface in the V direction.

for a typical NURBS, the degree is 3.

int getVertexIndex ( int  ui,
int  vi 
)

Returns the index number within the EggPrimitive's list of the control vertex at position ui, vi.

int getVIndex ( int  vertex_index)

Returns the V index number of the given vertex within the EggPrimitive's linear list of vertices.

An EggNurbsSurface maps a linear list of vertices to its 2-d mesh; this returns the V index number that corresponds to the nth vertex in the list.

double getVKnot ( int  k)

Returns the nth knot value defined in the V direction.

list getVKnots ( )
int getVOrder ( )

Returns the order of the surface in the V direction.

The order is the degree of the NURBS equation plus 1; for a typical NURBS, the order is 4. With this implementation of NURBS, the order must be in the range [1, 4].

bool isClosedU ( )

Returns true if the surface appears to be closed in the U direction.

Since the Egg syntax does not provide a means for explicit indication of closure, this has to be guessed at by examining the surface itself.

bool isClosedV ( )

Returns true if the surface appears to be closed in the V direction.

Since the Egg syntax does not provide a means for explicit indication of closure, this has to be guessed at by examining the surface itself.

bool isValid ( )

Returns true if the NURBS parameters are all internally consistent (e.g.

it has the right number of vertices to match its number of knots and order in each dimension), or false otherwise.

EggNurbsSurface operator= ( EggNurbsSurface const  copy)
setCv ( int  ui,
int  vi,
EggVertex  vertex 
)

Redefines the control vertex associated with a particular u, v coordinate pair.

This is just a shorthand to access the EggPrimitive's normal vertex assignment for a 2-d control vertex.

setNumUKnots ( int  num)

Directly changes the number of knots in the U direction.

This will either add zero-valued knots onto the end, or truncate knot values from the end, depending on whether the list is being increased or decreased. If possible, it is preferable to use the setup() method instead of directly setting the number of knots, as this may result in an invalid surface.

setNumVKnots ( int  num)

Directly changes the number of knots in the V direction.

This will either add zero-valued knots onto the end, or truncate knot values from the end, depending on whether the list is being increased or decreased. If possible, it is preferable to use the setup() method instead of directly setting the number of knots, as this may result in an invalid surface.

setUKnot ( int  k,
double  value 
)

Resets the value of the indicated knot as indicated.

k must be in the range 0 <= k < get_num_u_knots(), and the value must be in the range get_u_knot(k - 1) <= value <= get_u_knot(k + 1).

setUOrder ( int  u_order)

Directly changes the order in the U direction to the indicated value (which must be an integer in the range 1 <= u_order <= 4).

If possible, it is preferable to use the setup() method instead of this method, since changing the order directly may result in an invalid surface.

setup ( int  u_order,
int  v_order,
int  num_u_knots,
int  num_v_knots 
)

Prepares a new surface definition with the indicated order and number of knots in each dimension.

This also implies a particular number of vertices in each dimension as well (the number of knots minus the order), but it is up to the user to add the correct number of vertices to the surface by repeatedly calling push_back().

setVKnot ( int  k,
double  value 
)

Resets the value of the indicated knot as indicated.

k must be in the range 0 <= k < get_num_v_knots(), and the value must be in the range get_v_knot(k - 1) <= value <= get_v_knot(k + 1).

setVOrder ( int  v_order)

Directly changes the order in the V direction to the indicated value (which must be an integer in the range 1 <= v_order <= 4).

If possible, it is preferable to use the setup() method instead of this method, since changing the order directly may result in an invalid surface.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties