XdkWrl: NurbsCurve Class Reference

Home | Hierarchy | Members | Alphabetical | Related Pages

# NurbsCurve Class Reference
[Standard Node Types]

`#include <nurbscurve.h>`

Inherits Node.

List of all members.

## Public Member Functions
| NurbsCurve (const char *name="")
virtual | ~NurbsCurve ()
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
MFFloat | weight
SFInt32 | tessellation
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.
MFFloat | knot
SFInt32 | order
Events In
EventIn< MFVec3f > | set_controlPoint
EventIn< MFFloat > | set_weight
EventIn< SFInt32 > | set_tessellation
Events Out
EventOut< MFVec3f > | controlPoint_changed
EventOut< MFFloat > | weight_changed
EventOut< SFInt32 > | tessellation_changed

## Detailed Description

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

## 6.44 NurbsCurve

The NurbsCurve node is a geometry node defining a parametric curve.

Order defines the order of curve. From a mathematical point of view, the curve is defined by a polynomial of the degree order-1. The value of Order shall be greater than or equal to 2. An implementation may limit Order 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.

The control points define a piecewise linear curve, where the points do not have a uniform spacing. Depending on the weight value and the order, this piecewise linear curve is approximated by the resulting parametric curve. 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 curve can be specified by repeating the limiting control points and by specifying a periodic knot vector.

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 curve. However the curve 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.

knots defines 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 curve has corners. In general, the curve 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 tessellation field gives a hint to the curve tessellator by setting an absolute number of subdivision steps. These values shall be greater than or equal to the Order field. A value of 0 indicates that 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:

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

if a tessellation value is smaller than 0, the number of tessellation points is
(-tessellation × (number of control points)+1;

if a tessellation value is 0, the number of tessellation points is
(2 × (number of control points)+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.

## Constructor & Destructor Documentation

NurbsCurve | ( | const char * | name = `""` | ) |

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

      tessellation = 0;
      order = 3;

~NurbsCurve | ( |  | ) | `[virtual]`

Virtual destructor, does nothing

## Member Function Documentation

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:

- controlPoint
- weight
- tessellation
- knot
- order

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:

- 0 : controlPoint
- 1 : weight
- 2 : tessellation
- 3 : knot
- 4 : order This function is useful, with nbFields() if you want to traverse all fields of a Node.

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:

- set_controlPoint
- set_weight
- set_tessellation

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:

- controlPoint_changed
- weight_changed
- tessellation_changed

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:

- 0 : controlPoint_changed
- 1 : weight_changed
- 2 : tessellation_changed This function is useful, with nbEventsOut() if you want to traverse all events in of a Node.

Implements Node.

const char * typeName | ( |  | ) | const`[inline, virtual]`

Returns `"NurbsCurve"`. 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.

virtual Node* duplicate | ( | std::map< const Node *, Node * > & |  | ) | const`[virtual]`

Implements Node.

## Member Data Documentation

MFVec3f controlPoint

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

MFFloat weight

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

SFInt32 tessellation

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

           tessellation = 0;

MFFloat knot

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

SFInt32 order

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

           order = 3;

EventIn<MFVec3f> set_controlPoint

Set event associated to exposedField controlPoint

EventIn<MFFloat> set_weight

Set event associated to exposedField weight

EventIn<SFInt32> set_tessellation

Set event associated to exposedField tessellation

EventOut<MFVec3f> controlPoint_changed

Changed event associated to exposedField controlPoint

EventOut<MFFloat> weight_changed

Changed event associated to exposedField weight

EventOut<SFInt32> tessellation_changed

Changed event associated to exposedField tessellation

Generated on 5 Jan 2007 with version 1.5.1. |