Home | Hierarchy | Members | Alphabetical | Related Pages |
#include <nurbssurface.h>
Inherits Node.
Public Member Functions | |
NurbsSurface (const char *name="") | |
virtual | ~NurbsSurface () |
virtual unsigned int | nbFields () const |
virtual FieldHandle | field (const std::string &n) |
virtual FieldHandle | field (unsigned int i) |
virtual bool | isSetToDefaultValue (unsigned int i) const |
virtual unsigned int | nbEventsIn () const |
virtual EventInHandle | eventIn (const std::string &n) |
virtual EventInHandle | eventIn (unsigned int i) |
virtual unsigned int | nbEventsOut () const |
virtual EventOutHandle | eventOut (const std::string &n) |
virtual EventOutHandle | eventOut (unsigned int i) |
const char * | typeName () const |
virtual Node * | duplicate () const |
virtual Node * | duplicate (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< MFVec3f > | set_controlPoint |
EventIn< SFNode > | set_texCoord |
EventIn< SFInt32 > | set_uTessellation |
EventIn< SFInt32 > | set_vTessellation |
EventIn< MFFloat > | set_weight |
Events Out | |
EventOut< MFVec3f > | controlPoint_changed |
EventOut< SFNode > | texCoord_changed |
EventOut< SFInt32 > | uTessellation_changed |
EventOut< SFInt32 > | vTessellation_changed |
EventOut< MFFloat > | weight_changed |
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.
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
unsigned int nbFields | ( | ) | const [inline, virtual] |
Returns the number of fields (exposed or not) for this node type.
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:
Implements Node.
wrl::Node::FieldHandle field | ( | 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:
Implements Node.
bool isSetToDefaultValue | ( | 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.
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:
Implements Node.
wrl::Node::EventInHandle eventIn | ( | 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.
unsigned int nbEventsOut | ( | ) | const [inline, virtual] |
Returns the number of events out for this node type.
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:
Implements Node.
wrl::Node::EventOutHandle eventOut | ( | 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:
Implements Node.
const char * typeName | ( | ) | const [inline, virtual] |
Returns "NurbsSurface"
. Useful for printing.
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.
See Detailed Description for meaning of this field. Default value is set to MFVec3f default value
See Detailed Description for meaning of this field. Default value is set to SFNode default value
See Detailed Description for meaning of this field. Default value is set to
uTessellation = 0;
See Detailed Description for meaning of this field. Default value is set to
vTessellation = 0;
See Detailed Description for meaning of this field. Default value is set to MFFloat default value
See Detailed Description for meaning of this field. Default value is set to
ccw = true;
See Detailed Description for meaning of this field. Default value is set to
solid = true;
See Detailed Description for meaning of this field. Default value is set to
uDimension = 0;
See Detailed Description for meaning of this field. Default value is set to MFFloat default value
See Detailed Description for meaning of this field. Default value is set to
uOrder = 3;
See Detailed Description for meaning of this field. Default value is set to
vDimension = 0;
See Detailed Description for meaning of this field. Default value is set to MFFloat default value
See Detailed Description for meaning of this field. Default value is set to
vOrder = 3;
Set event associated to exposedField controlPoint
Set event associated to exposedField texCoord
Set event associated to exposedField uTessellation
Set event associated to exposedField vTessellation
Set event associated to exposedField weight
Changed event associated to exposedField controlPoint
Changed event associated to exposedField texCoord
Changed event associated to exposedField uTessellation
Changed event associated to exposedField vTessellation
Changed event associated to exposedField weight
Generated on 5 Jan 2007 with
![]() |
|