X3DTK::X3D::Cylinder
node, you can access and modify the radius attribute by X3DTK::X3D::Cylinder::getRadius
and X3DTK::X3D::Cylinder::setRadius
.X3DTK::X3DAbstractNode::setChild
is provided.X3DTK::SFType
singleton.
Here is an example for a new MyNode node belonging to the MyComponent of the X3D scene graph, which has a floating atomic attribute called length, an X3DTK::X3DGeometryNode
child and an X3DTK::MFNode
children:
// Passing the three strings indicating the name of the node (found in an X3D file), the name of the component and of the scene graph. define(Recorder<MyNode>::getTypeName("MyNode", "MyComponent", "X3D")); // The address of the member is given as well as the initialisation value. define(Recorder<MyNode, SFFloat>::getAttribute("length", &MyNode::_length, 1.0f)); // The child is named child. define(Recorder<MyNode, X3DGeometryNode>::getSFNode("child", &MyNode::_child)); // The children are named children. define(Recorder<MyNode, X3DNode>::getMFNode("children", &MyNode::_children));
X3DTK::X3DAbstractNode::removeChildren
must be called if the node has children.X3DTK::X3DAbstractNode::clone
method is provided.MyNode
, a DFS walk will traverse child first and then children.