Home Hierarchy Members Alphabetical Related Pages

NurbsSurface Class Reference
[Standard Node Types]

#include <nurbssurface.h>

Inherits Node.

Inheritance diagram for NurbsSurface:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 NurbsSurface (const char *name="")
virtual ~NurbsSurface ()
virtual unsigned int nbFields () const
virtual FieldHandle field (const std::string &n)
virtual FieldHandle field (const unsigned int i)
virtual bool isSetToDefaultValue (const unsigned int i) const
virtual unsigned int nbEventsIn () const
virtual EventInHandle eventIn (const std::string &n)
virtual EventInHandle eventIn (const unsigned int i)
virtual unsigned int nbEventsOut () const
virtual EventOutHandle eventOut (const std::string &n)
virtual EventOutHandle eventOut (const unsigned int i)
const char * typeName () const
virtual Nodeduplicate () const
virtual Nodeduplicate (std::map< const Node *, Node * > &) const

Public Attributes

Exposed Fields
A field that is capable of receiving events via an eventIn to change its value(s), and generating events via an eventOut when its value(s) change.

MFVec3f controlPoint
SFNode texCoord
SFInt32 uTessellation
SFInt32 vTessellation
MFFloat weight
Fields
A property or attribute of a node. Each node type has a fixed set of fields. Fields may contain various kinds of data and one or many values. Each field has a default value.

SFBool ccw
SFBool solid
SFInt32 uDimension
MFFloat uKnot
SFInt32 uOrder
SFInt32 vDimension
MFFloat vKnot
SFInt32 vOrder
Events In
EventIn< MFVec3fset_controlPoint
EventIn< SFNodeset_texCoord
EventIn< SFInt32set_uTessellation
EventIn< SFInt32set_vTessellation
EventIn< MFFloatset_weight
Events Out
EventOut< MFVec3fcontrolPoint_changed
EventOut< SFNodetexCoord_changed
EventOut< SFInt32uTessellation_changed
EventOut< SFInt32vTessellation_changed
EventOut< MFFloatweight_changed

Detailed Description

Here is the documentation for this node type, from the ISO standard.

6.48 NurbsSurface

The NurbsSurface node is a geometry node defining a parametric surface.

uDimension and vDimension define the number of control points in the u and v dimensions. uOrder and vOrder define the order of surface. From a mathematical point of view, the surface is defined by polynomials of the degree order-1. The value of uOrder and vOrder shall be greater than or equal to 2. An implementation may limit uOrder and vOrder to a certain number. The most common orders are 3 (quadratic polynomial) and 4 (cubic polynomial), which are sufficient to achieve the desired curvature in most cases. The number of control points shall be at least equal to the order of the curve. The order defines the number of adjacent control points that influence a given control point.

controlPoint defines a set of control points of dimension:   uDimension × vDimension. This set of points defines a mesh similar to the grid of an ElevationGrid, where the points do not have a uniform spacing. Depending on the weight values and the order, this hull is approximated by the resulting surface. The number of uDimension points define a polyline in u-direction followed by further u-polylines with the v-parameter in ascending order. The number of control points shall be equal to or greater than the order. The control points are all defined as 3D vertices in the x, y, z domain. A closed B-Spline surface can be specified by repeating the limiting control points and by specifying a periodic knot vector.

The control vertex corresponding to the control point P[i, j] on the control grid is:

P[i,j].x = controlPoints[i + ( j × uDimension)].x
P[i,j].y = controlPoints[i + ( j × uDimension)].y
P[i,j].z = controlPoints[i + ( j × uDimension)].z
P[i,j].w = weight[ i + (j × uDimension)]

where 0 <= i < uDimension and 0 <= j < vDimension.

A weight value that shall be greater than zero is assigned to each controlPoint. The ordering of the values is equivalent to the ordering of the control point values. If the weight of a control point increased above 1 the point is more closely approximated by the surface. However the surface is not changed if all weights are multiplied by a common factor. The number of values shall be identical to the number of control points. If the length of the weight vector is 0, the default weight 1.0 is assumed for each control point.

As a result of the lack of a 4D Coordinate field type in VRML, the control points and the corresponding weight values are held in separate fields. This separation also allows independent animation of the controlPoint fields using a CoordinateInterpolator node.

uKnots and vKnots define the knot vector. The number of knots shall be equal to the number of control points plus the order of the curve. The order shall be non-decreasing. By setting successive knot values equal, the degree of continuity is decreased, which implies that the surface gets edges. In general, the curve or surface is of continuity Ck-1-m at a knot point, where k is the order and m is the number of consecutive knots being equal. If k is the order of the curve, k consecutive knots at the end or the beginning of the vector cause the curve to interpolate the last or the first control point respectively. Within the knot vector there may not be more than k-1 consecutive knots of equal value. If the length of a knot vector is 0, a default uniform knot vector is computed.

The uTessellation and vTessellation fields give hints to the surface tessellator by setting an absolute number of subdivision steps. These values shall be greater than or equal to the uOrder and vOrder fields, respectively. A value of 0 lets the browser choose a suitable tessellation. Interpretation of values below 0 is implementation dependent.

For an implementation subdividing the surface into an equal number of subdivision steps, tessellation values are interpreted in the following way:

a. if a tessellation value is greater than 0, the number of tessellation points is
tessellation+1;

b. if a tessellation value is smaller than 0, the number of tessellation points is
(-tessellation × (u/v)dimension)+1;

c. if a tessellation value is 0, the number of tessellation points is
(2 × (u/v)dimension)+1.

For implementations doing tessellations based on chord length, tessellation values less than zero are interpreted as the maximum chord length deviation in pixels. Implementations doing fully automatic tessellation may ignore the tessellation hint parameters.

texCoord may provide additional information on how to generate texture coordinates. There are three possible values:  a NULL node, a TextureCoordinate node, or a NurbsTextureSurface node. For the default case of a NULL node, texture coordinates in the unit square are generated automatically from the parametric subdivision. If either a TextureCoordinate node or a NurbsTextureSurface node is provided, a texture coordinate is computed given a (u, v) parameter of the NurbsSurface.

Subclause 4.6.3, Shapes and geometry, provides a description of the ccw and solid fields.


Constructor & Destructor Documentation

NurbsSurface const char *  name = ""  ) 
 

Construct a node with all its fields set to default value, which is equivalent to the code below:

  uTessellation = 0;
  vTessellation = 0;
  ccw = true;
  solid = true;
  uDimension = 0;
  uOrder = 3;
  vDimension = 0;
  vOrder = 3;

~NurbsSurface  )  [virtual]
 

Virtual destructor, does nothing


Member Function Documentation

wrl::Node * duplicate std::map< const Node *, Node * > &   )  const [virtual]
 

Implements Node.

wrl::Node * duplicate  )  const [virtual]
 

Returns a deep copy of this node, that is a fully independant node with all children (if any) also copied. This is mainly useful for instanciating protos.

Implements Node.

wrl::Node::EventInHandle eventIn const unsigned int  n  )  [virtual]
 

Return a handle on the i th event in of the node or a "unknown" typed handle if there is no such node. emarks This class has no eventIn. This function is useful, with nbEventsIn() if you want to traverse all events in of a Node.

Implements Node.

wrl::Node::EventInHandle eventIn const std::string &  n  )  [virtual]
 

Return a handle on the event in named n of the node or a "unknown" typed handle if there is no such event. Valid names are:

  • set_controlPoint
  • set_texCoord
  • set_uTessellation
  • set_vTessellation
  • set_weight

Implements Node.

wrl::Node::EventOutHandle eventOut const unsigned int  n  )  [virtual]
 

Return a handle on the i th event out of the node or a "unknown" typed handle if there is no such node. Here is how i is related to fields:

  • 0 : controlPoint_changed
  • 1 : texCoord_changed
  • 2 : uTessellation_changed
  • 3 : vTessellation_changed
  • 4 : weight_changed This function is useful, with nbEventsOut() if you want to traverse all events in of a Node.

Implements Node.

wrl::Node::EventOutHandle eventOut const std::string &  n  )  [virtual]
 

Return a handle on the event out named n of the node or a "unknown" typed handle if there is no such event. Valid names are:

  • controlPoint_changed
  • texCoord_changed
  • uTessellation_changed
  • vTessellation_changed
  • weight_changed

Implements Node.

wrl::Node::FieldHandle field const unsigned int  n  )  [virtual]
 

Return a handle on the i th field of the node or a "unknown" typed handle if there is no such node. Here is how i is related to fields:

  • 0 : controlPoint
  • 1 : texCoord
  • 2 : uTessellation
  • 3 : vTessellation
  • 4 : weight
  • 5 : ccw
  • 6 : solid
  • 7 : uDimension
  • 8 : uKnot
  • 9 : uOrder
  • 10 : vDimension
  • 11 : vKnot
  • 12 : vOrder This function is useful, with nbFields() if you want to traverse all fields of a Node.

Implements Node.

wrl::Node::FieldHandle field const std::string &  n  )  [virtual]
 

Return a handle on the field named n of the node or a "unknown" typed handle if there is no such field. Valid names are:

  • controlPoint
  • texCoord
  • uTessellation
  • vTessellation
  • weight
  • ccw
  • solid
  • uDimension
  • uKnot
  • uOrder
  • vDimension
  • vKnot
  • vOrder

Implements Node.

bool isSetToDefaultValue const unsigned int  i  )  const [virtual]
 

Implements Node.

unsigned int nbEventsIn  )  const [inline, virtual]
 

Returns the number of events in for this node type.

Implements Node.

unsigned int nbEventsOut  )  const [inline, virtual]
 

Returns the number of events out for this node type.

Implements Node.

unsigned int nbFields  )  const [inline, virtual]
 

Returns the number of fields (exposed or not) for this node type.

Implements Node.

const char * typeName  )  const [inline, virtual]
 

Returns "NurbsSurface". Useful for printing.

Implements Node.


Member Data Documentation

SFBool ccw
 

See Detailed Description for meaning of this field. Default value is set to

       ccw = true;

MFVec3f controlPoint
 

See Detailed Description for meaning of this field. Default value is set to MFVec3f default value

EventOut<MFVec3f> controlPoint_changed
 

Changed event associated to exposedField controlPoint

EventIn<MFVec3f> set_controlPoint
 

Set event associated to exposedField controlPoint

EventIn<SFNode> set_texCoord
 

Set event associated to exposedField texCoord

EventIn<SFInt32> set_uTessellation
 

Set event associated to exposedField uTessellation

EventIn<SFInt32> set_vTessellation
 

Set event associated to exposedField vTessellation

EventIn<MFFloat> set_weight
 

Set event associated to exposedField weight

SFBool solid
 

See Detailed Description for meaning of this field. Default value is set to

       solid = true;

SFNode texCoord
 

See Detailed Description for meaning of this field. Default value is set to SFNode default value

EventOut<SFNode> texCoord_changed
 

Changed event associated to exposedField texCoord

SFInt32 uDimension
 

See Detailed Description for meaning of this field. Default value is set to

       uDimension = 0;

MFFloat uKnot
 

See Detailed Description for meaning of this field. Default value is set to MFFloat default value

SFInt32 uOrder
 

See Detailed Description for meaning of this field. Default value is set to

       uOrder = 3;

SFInt32 uTessellation
 

See Detailed Description for meaning of this field. Default value is set to

EventOut<SFInt32> uTessellation_changed
 

Changed event associated to exposedField uTessellation

SFInt32 vDimension
 

See Detailed Description for meaning of this field. Default value is set to

       vDimension = 0;

MFFloat vKnot
 

See Detailed Description for meaning of this field. Default value is set to MFFloat default value

SFInt32 vOrder
 

See Detailed Description for meaning of this field. Default value is set to

       vOrder = 3;

SFInt32 vTessellation
 

See Detailed Description for meaning of this field. Default value is set to

EventOut<SFInt32> vTessellation_changed
 

Changed event associated to exposedField vTessellation

MFFloat weight
 

See Detailed Description for meaning of this field. Default value is set to MFFloat default value

EventOut<MFFloat> weight_changed
 

Changed event associated to exposedField weight


Generated on 24 Feb 2005 with doxygen version 1.3.9.1. Valid HTML 4.0! Valid CSS!