XdkWrl: CoordinateDeformer Class Reference

Home | Hierarchy | Members | Alphabetical | Related Pages

# CoordinateDeformer Class Reference
[Standard Node Types]

`#include <coordinatedeformer.h>`

Inherits Node.

List of all members.

## Public Member Functions
| CoordinateDeformer (const char *name="")
virtual | ~CoordinateDeformer ()
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.
MFNode | children
MFVec3f | controlPoint
MFNode | inputCoord
MFNode | inputTransform
MFNode | outputCoord
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.
SFVec3f | bboxCenter
SFVec3f | bboxSize
SFInt32 | uDimension
MFFloat | uKnot
SFInt32 | uOrder
SFInt32 | vDimension
MFFloat | vKnot
SFInt32 | vOrder
SFInt32 | wDimension
MFFloat | wKnot
SFInt32 | wOrder
Events In
EventIn< MFNode > | addChildren
EventIn< MFNode > | removeChildren
EventIn< MFNode > | set_children
EventIn< MFVec3f > | set_controlPoint
EventIn< MFNode > | set_inputCoord
EventIn< MFNode > | set_inputTransform
EventIn< MFNode > | set_outputCoord
EventIn< MFFloat > | set_weight
Events Out
EventOut< MFNode > | children_changed
EventOut< MFVec3f > | controlPoint_changed
EventOut< MFNode > | inputCoord_changed
EventOut< MFNode > | inputTransform_changed
EventOut< MFNode > | outputCoord_changed
EventOut< MFFloat > | weight_changed

## Detailed Description

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

## 6.14 CoordinateDeformer

CoordinateDeformer allows a free form deformation on a set of MFVec3f Coordinate nodes by using a NURBS volume. Conceptually, a set of input Coordinate nodes is placed into a non-uniform grid volume. If the grid control points are animated or deformed the output Coordinate nodes are updated accordingly.

The input to the deformer is a list of Coordinate nodes, where each Coordinate node defines a 3D parameter (u,v,w) for evaluation. The corresponding Cartesian output value is computed from the NURBS control grid. The children node contains a scene graph that typically consists of IndexedFaceSet nodes referring to a deformed Coordinate node in outputCoords.

The uDimension, vDimension, wDimension, controlPoint, weight, uKnot, vKnot, wKnot, uOrder, vOrder, and wOrder fields define the NURBS in three dimensions. The definition is similar to the NurbsSurface node.

The inputCoord field, if specified, shall contain a set of Coordinate nodes.

The outputCoord field, shall contain a set of Coordinate nodes. The number of nodes shall be equal to the number of nodes in inputCoord. The nodes themselves should be distinct from nodes in inputCoords.

The inputTransform field, if specified, shall contain a set of Transform nodes, the number of nodes shall be equal to the number of nodes in inputCoord.

By animating the controlPoint field, IndexedFaceSet nodes using a Coordinate node from outputCoords are deformed over time. Similarly, the point field in an input Coordinate node can be animated. By changing a Transform node in the inputTransform parameter, geometry can be moved through the deformation space (space warp).

CoordinateDeformer is a group node and shall be part of the transform hierarchy if evaluation is required. Points in the Coordinate node contained in outputCoord are recomputed and updated whenever the points of the inputCoord Coordinate are changed, any exposedField of the CoordinateDeformer itself is changed, or if any of the supplied inputTransform nodes are changed. Implementations may defer or even skip evaluation until the CoordinateDeformer node is displayed; i.e., if the node is not currently part of the traversed scene graph, or the node is not being rendered because the bounding box of the node (or the bounding box computed from the controlPoint list) falls outside the view frustum.

In some respects, CoordinateDeformer is a special version of a CoordinateInterpolator. The CoordinateDeformer is a group node in order to make the animation locatable in the scene graph at a certain 3D position. Normally, VRML interpolators do not define a bounding box and so are not culled from the scene. This behaviour may be achieved explicitly by routing the output of a VisibilitySensor to the controlling TimeSensor node.

    Example:
    DEF FFD CoordinateDeformer {
      controlPoint [ ... ]
      inputCoord DEF inputCoord Coordinate { point [ ... ] }
      outputCoord DEF outputCoord Coordinate { point [ ... ] }
      children Shape {
        geometry IndexedFaceSet {
          coord USE outputCoord
            coordIndex [ ... ] }
        }
      }

The following is additional code to animate the FFD node:

    DEF Timer TimeSensor {}
    DEF FFDGridInterpolator CoordinateInterpolator { ... }
    ROUTE FFDGridInterpolator.value_changed TO FFD.set_controlPoint
    ROUTE Timer.fraction_changed TO FFDGridInterpolator.set_fraction

If a given input coordinate value (optionally transformed by the corresponding Transform node) exceeds the parametric range of one of the knot vectors, the corresponding output coordinate value will be left unchanged. This is useful to deform only a subset of the coordinates or to animate different parts of the coordinate node using different CoordinateDeformer nodes.

## Constructor & Destructor Documentation

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

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

      bboxCenter.setXYZ(0,0,0);
      bboxSize.setXYZ(-1,-1,-1);
      uDimension = 0;
      uOrder = 2;
      vDimension = 0;
      vOrder = 2;
      wDimension = 0;
      wOrder = 2;

~CoordinateDeformer | ( |  | ) | `[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:

- children
- controlPoint
- inputCoord
- inputTransform
- outputCoord
- weight
- bboxCenter
- bboxSize
- uDimension
- uKnot
- uOrder
- vDimension
- vKnot
- vOrder
- wDimension
- wKnot
- wOrder

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 : children
- 1 : controlPoint
- 2 : inputCoord
- 3 : inputTransform
- 4 : outputCoord
- 5 : weight
- 6 : bboxCenter
- 7 : bboxSize
- 8 : uDimension
- 9 : uKnot
- 10 : uOrder
- 11 : vDimension
- 12 : vKnot
- 13 : vOrder
- 14 : wDimension
- 15 : wKnot
- 16 : wOrder 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:

- addChildren
- removeChildren
- set_children
- set_controlPoint
- set_inputCoord
- set_inputTransform
- set_outputCoord
- set_weight

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. Here is how `i` is related to fields:

- 0 : addChildren
- 1 : removeChildren
- 2 : set_children
- 3 : set_controlPoint
- 4 : set_inputCoord
- 5 : set_inputTransform
- 6 : set_outputCoord
- 7 : set_weight

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:

- children_changed
- controlPoint_changed
- inputCoord_changed
- inputTransform_changed
- outputCoord_changed
- weight_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 : children_changed
- 1 : controlPoint_changed
- 2 : inputCoord_changed
- 3 : inputTransform_changed
- 4 : outputCoord_changed
- 5 : weight_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 `"CoordinateDeformer"`. 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

MFNode children

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

MFVec3f controlPoint

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

MFNode inputCoord

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

MFNode inputTransform

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

MFNode outputCoord

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

MFFloat weight

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

SFVec3f bboxCenter

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

           bboxCenter.setXYZ(0,0,0);

SFVec3f bboxSize

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

           bboxSize.setXYZ(-1,-1,-1);

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 = 2;

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 = 2;

SFInt32 wDimension

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

           wDimension = 0;

MFFloat wKnot

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

SFInt32 wOrder

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

           wOrder = 2;

EventIn<MFNode> addChildren

See Detailed Description for meaning of this event.

EventIn<MFNode> removeChildren

See Detailed Description for meaning of this event.

EventIn<MFNode> set_children

Set event associated to exposedField children

EventIn<MFVec3f> set_controlPoint

Set event associated to exposedField controlPoint

EventIn<MFNode> set_inputCoord

Set event associated to exposedField inputCoord

EventIn<MFNode> set_inputTransform

Set event associated to exposedField inputTransform

EventIn<MFNode> set_outputCoord

Set event associated to exposedField outputCoord

EventIn<MFFloat> set_weight

Set event associated to exposedField weight

EventOut<MFNode> children_changed

Changed event associated to exposedField children

EventOut<MFVec3f> controlPoint_changed

Changed event associated to exposedField controlPoint

EventOut<MFNode> inputCoord_changed

Changed event associated to exposedField inputCoord

EventOut<MFNode> inputTransform_changed

Changed event associated to exposedField inputTransform

EventOut<MFNode> outputCoord_changed

Changed event associated to exposedField outputCoord

EventOut<MFFloat> weight_changed

Changed event associated to exposedField weight

Generated on 5 Jan 2007 with version 1.5.1. |