x3d::SFNode Class ReferenceAll the non-abstract nodes in the X3D set derive once from SFNode.
More...
#include <node.h>
Inheritance diagram for x3d::SFNode:
[legend]Collaboration diagram for x3d::SFNode:
[legend]List of all members.
Detailed Description
All the non-abstract nodes in the X3D set derive once from SFNode.
Constructor & Destructor Documentation
x3d::SFNode::~SFNode |
( |
|
) |
[virtual] |
|
|
Destructor...
The SFNode destructor is virtual so it needs to be declared. It does nothing otherwise. |
Member Function Documentation
void x3d::SFNode::Event_Destroyed |
( |
|
) |
[private] |
|
|
Notify all the listeners that the node is being destroyed.
This function is called whenever the node destructor is reached. This signals to the listener that the node cannot be used anymore (trying to do so will usually end up in a crash.)
This mechanism will enable listeners to remove nodes which are not in use anymore. However, this will work only if all the listeners keep bare pointers to the nodes (versus smart pointers).
- Note:
- This function will call the listener before the listener is removed from the list of listener in the node. This is fortunate since the listener may then be destroyed since it has a reference count which could drop to zero once the node completly goes away.
- See also:
- RegisterListener
UnregisterListener
Event_FieldChanged
|
void x3d::SFNode::Event_FieldChanged |
( |
const FieldInfo * |
info |
) |
[protected] |
|
|
Notify all the listeners that the specified field changed.
- Parameters:
-
[in] | info | The field name, type and data pointer. |
Whenever you attach an object to a node and you need to know that the node changed, you need to add a listener to the node. This listener is then called with FieldChanged() events to let you know that the data in the node has changed.
This function will automatically be called by all the set_...() functions of the node (and the SetChild(), SetFieldByName/Index() etc.)
If the node is being destroyed, another event will be called. This one will not be called.
- Warning:
- Changing the value (again) of the very field that generated an Event_FieldChanged() call, will generate another Event_FieldChanged() call from within the first call. In other words, it is recursive. One good thing about that you can write a piece of code like this and it will work:
void MyObj::Event_FieldChanged(SFNode *node, const FieldInfo *info)
{
if(f_in_field_changed) {
return;
}
if(info->f_data.f_SFInt32 < 32) {
SFInt32 new_value = 32;
f_in_field_changed = true;
node->SetFieldByName(info->f_name, &new_value);
f_in_field_changed = false;
}
}
- Note:
- The field info cannot be changed. If you need to adjust the value of the field, you will have to call the corresponding set function and another Event_FieldChanged() will be generated (so watch out for infinite loops.) Rational: if you had, say, three listener and the last one decides that the value should be 5 instead of 3, then the first and second listeners would not know that the value was 5 now. In that regard, infinite loops can be generated if listener A says it needs 5 when it is 3 and listener B says it needs 3 when it is 5.
- See also:
- RegisterListener
UnregisterListener
Event_Destroy
|
bool x3d::SFNode::FieldHasDefaultValue |
( |
field_t |
name |
) |
const [virtual] |
|
|
Test to know whether a field is currently set to its default value.
This function searches the specified field and test to know whether it is currently set to its default value. This is useful whenever saving to an XML file or some other format to avoid saving fields which are anyway set to their defaults. Also, the rendering process can make use of this to avoid changing the environment if it is not necessary.
- Note:
- A required field (i.e. marked as #REQUIRED in the DTD) does not have a default value and thus this function will always return false for these fields.
- Parameters:
-
[in] | name | The name of the field to query in numeric form |
- Returns:
- true if the field could be found and has a default value.
- See also:
- bool SFNode::GetFieldByName(field_t name, FieldInfo *info) const; bool SFNode::GetFieldByIndex(int idx, FieldInfo *info) const; bool SFNode::FieldHasDefaultValue(field_t name) const field_t GetField(const char *name);
Reimplemented in x3d::X3DNode, x3d::X3DChildNode, x3d::X3DBindableNode, x3d::X3DPrototypeInstance, x3d::ProtoInstance, x3d::MetadataDouble, x3d::MetadataFloat, x3d::MetadataInteger, x3d::MetadataSet, x3d::MetadataString, x3d::X3D, x3d::Scene, x3d::head, x3d::component, x3d::meta, x3d::connect, x3d::IMPORT, x3d::EXPORT, x3d::ExternProtoDeclare, x3d::field, x3d::fieldValue, x3d::IS, x3d::ProtoBody, x3d::ProtoDeclare, x3d::ProtoInterface, x3d::ROUTE, x3d::X3DGroupingNode, x3d::EspduTransform, x3d::ReceiverPdu, x3d::SignalPdu, x3d::TransmitterPdu, x3d::X3DBackgroundNode, x3d::Background, x3d::Fog, x3d::TextureBackground, x3d::X3DEnvironmentalSensorNode, x3d::ProximitySensor, x3d::VisibilitySensor, x3d::X3DGeometricPropertyNode, x3d::X3DCoordinateNode, x3d::GeoCoordinate, x3d::X3DGeometryNode, x3d::GeoElevationGrid, x3d::GeoLocation, x3d::GeoLOD, x3d::X3DInfoNode, x3d::GeoMetadata, x3d::GeoOrigin, x3d::X3DInterpolatorNode, x3d::GeoPositionInterpolator, x3d::X3DPointingDeviceSensorNode, x3d::X3DTouchSensorNode, x3d::GeoTouchSensor, x3d::GeoViewpoint, x3d::Arc2D, x3d::ArcClose2D, x3d::Circle2D, x3d::Disk2D, x3d::Polyline2D, x3d::Polypoint2D, x3d::Rectangle2D, x3d::TriangleSet2D, x3d::Box, x3d::Cone, x3d::Cylinder, x3d::ElevationGrid, x3d::Extrusion, x3d::X3DComposedGeometryNode, x3d::IndexedFaceSet, x3d::Sphere, x3d::Group, x3d::StaticGroup, x3d::Switch, x3d::Transform, x3d::WorldInfo, x3d::HAnimDisplacer, x3d::HAnimHumanoid, x3d::HAnimJoint, x3d::HAnimSegment, x3d::HAnimSite, x3d::ColorInterpolator, x3d::CoordinateInterpolator, x3d::CoordinateInterpolator2D, x3d::NormalInterpolator, x3d::OrientationInterpolator, x3d::PositionInterpolator, x3d::PositionInterpolator2D, x3d::ScalarInterpolator, x3d::X3DKeyDeviceSensorNode, x3d::KeySensor, x3d::StringSensor, x3d::X3DLightNode, x3d::DirectionalLight, x3d::PointLight, x3d::SpotLight, x3d::Billboard, x3d::Collision, x3d::LOD, x3d::NavigationInfo, x3d::Viewpoint, x3d::X3DNetworkSensorNode, x3d::Anchor, x3d::Inline, x3d::LoadSensor, x3d::X3DNurbsControlCurveNode, x3d::X3DParametricGeometryNode, x3d::X3DNurbsSurfaceGeometryNode, x3d::Contour2D, x3d::ContourPolyline2D, x3d::CoordinateDouble, x3d::NurbsCurve, x3d::NurbsCurve2D, x3d::NurbsOrientationInterpolator, x3d::NurbsPatchSurface, x3d::NurbsPositionInterpolator, x3d::NurbsSet, x3d::NurbsSurfaceInterpolator, x3d::NurbsSweptSurface, x3d::NurbsSwungSurface, x3d::NurbsTextureCoordinate, x3d::NurbsTrimmedSurface, x3d::X3DDragSensorNode, x3d::CylinderSensor, x3d::PlaneSensor, x3d::SphereSensor, x3d::TouchSensor, x3d::X3DColorNode, x3d::X3DNormalNode, x3d::Color, x3d::ColorRGBA, x3d::Coordinate, x3d::IndexedLineSet, x3d::IndexedTriangleFanSet, x3d::IndexedTriangleSet, x3d::IndexedTriangleStripSet, x3d::LineSet, x3d::Normal, x3d::PointSet, x3d::TriangleFanSet, x3d::TriangleSet, x3d::TriangleStripSet, x3d::X3DScriptNode, x3d::Script, x3d::X3DAppearanceChildNode, x3d::X3DAppearanceNode, x3d::X3DMaterialNode, x3d::X3DShapeNode, x3d::Appearance, x3d::FillProperties, x3d::LineProperties, x3d::Material, x3d::Shape, x3d::X3DSoundNode, x3d::X3DTimeDependentNode, x3d::X3DSoundSourceNode, x3d::AudioClip, x3d::Sound, x3d::X3DFontStyleNode, x3d::FontStyle, x3d::Text, x3d::X3DTextureCoordinateNode, x3d::X3DTextureNode, x3d::X3DTexture2DNode, x3d::X3DTextureTransformNode, x3d::X3DTextureTransform2DNode, x3d::ImageTexture, x3d::MovieTexture, x3d::MovieSound, x3d::MultiTexture, x3d::MultiTextureCoordinate, x3d::MultiTextureTransform, x3d::PixelTexture, x3d::TextureCoordinate, x3d::TextureCoordinateGenerator, x3d::TextureTransform, x3d::TimeSensor, x3d::X3DSequencerNode, x3d::X3DTriggerNode, x3d::BooleanFilter, x3d::BooleanSequencer, x3d::BooleanToggle, x3d::BooleanTrigger, x3d::IntegerSequencer, x3d::IntegerTrigger, and x3d::TimeTrigger. |
field_t x3d::SFNode::GetDefaultContainerField |
( |
void |
|
) |
const [virtual] |
|
|
Get the name of the default container (SFNode or MFNode) for children nodes.
This function returns the numeric name of the container field to use for children which are not given a specific place to be saved to. This is mainly for I/O purposes, whenever you are loading a file, you usually need to know where to save a new node in its parent.
Each node has a default field name where it is supposed to be saved in its parent node. Many nodes will return "children".
If no name is specified, this function returns FLD_INVALID. This means a saved node must specified the name of the container field otherwise the child cannot be saved in the parent.
- Returns:
- a field_t with the name of the field in which to save this node in its parent node
- See also:
- const char *SFNodeGetDefaultContainerFieldName(void) const;
Reimplemented in x3d::X3DNode, x3d::X3DChildNode, x3d::X3DBindableNode, x3d::X3DPrototypeInstance, x3d::ProtoInstance, x3d::MetadataDouble, x3d::MetadataFloat, x3d::MetadataInteger, x3d::MetadataSet, x3d::MetadataString, x3d::X3D, x3d::Scene, x3d::head, x3d::component, x3d::meta, x3d::connect, x3d::IMPORT, x3d::EXPORT, x3d::ExternProtoDeclare, x3d::field, x3d::fieldValue, x3d::IS, x3d::ProtoBody, x3d::ProtoDeclare, x3d::ProtoInterface, x3d::ROUTE, x3d::X3DGroupingNode, x3d::EspduTransform, x3d::ReceiverPdu, x3d::SignalPdu, x3d::TransmitterPdu, x3d::X3DBackgroundNode, x3d::Background, x3d::Fog, x3d::TextureBackground, x3d::X3DEnvironmentalSensorNode, x3d::ProximitySensor, x3d::VisibilitySensor, x3d::X3DGeometricPropertyNode, x3d::X3DCoordinateNode, x3d::GeoCoordinate, x3d::X3DGeometryNode, x3d::GeoElevationGrid, x3d::GeoLocation, x3d::GeoLOD, x3d::X3DInfoNode, x3d::GeoMetadata, x3d::GeoOrigin, x3d::X3DInterpolatorNode, x3d::GeoPositionInterpolator, x3d::X3DPointingDeviceSensorNode, x3d::X3DTouchSensorNode, x3d::GeoTouchSensor, x3d::GeoViewpoint, x3d::Arc2D, x3d::ArcClose2D, x3d::Circle2D, x3d::Disk2D, x3d::Polyline2D, x3d::Polypoint2D, x3d::Rectangle2D, x3d::TriangleSet2D, x3d::Box, x3d::Cone, x3d::Cylinder, x3d::ElevationGrid, x3d::Extrusion, x3d::X3DComposedGeometryNode, x3d::IndexedFaceSet, x3d::Sphere, x3d::Group, x3d::StaticGroup, x3d::Switch, x3d::Transform, x3d::WorldInfo, x3d::HAnimDisplacer, x3d::HAnimHumanoid, x3d::HAnimJoint, x3d::HAnimSegment, x3d::HAnimSite, x3d::ColorInterpolator, x3d::CoordinateInterpolator, x3d::CoordinateInterpolator2D, x3d::NormalInterpolator, x3d::OrientationInterpolator, x3d::PositionInterpolator, x3d::PositionInterpolator2D, x3d::ScalarInterpolator, x3d::X3DKeyDeviceSensorNode, x3d::KeySensor, x3d::StringSensor, x3d::X3DLightNode, x3d::DirectionalLight, x3d::PointLight, x3d::SpotLight, x3d::Billboard, x3d::Collision, x3d::LOD, x3d::NavigationInfo, x3d::Viewpoint, x3d::X3DNetworkSensorNode, x3d::Anchor, x3d::Inline, x3d::LoadSensor, x3d::X3DNurbsControlCurveNode, x3d::X3DParametricGeometryNode, x3d::X3DNurbsSurfaceGeometryNode, x3d::Contour2D, x3d::ContourPolyline2D, x3d::CoordinateDouble, x3d::NurbsCurve, x3d::NurbsCurve2D, x3d::NurbsOrientationInterpolator, x3d::NurbsPatchSurface, x3d::NurbsPositionInterpolator, x3d::NurbsSet, x3d::NurbsSurfaceInterpolator, x3d::NurbsSweptSurface, x3d::NurbsSwungSurface, x3d::NurbsTextureCoordinate, x3d::NurbsTrimmedSurface, x3d::X3DDragSensorNode, x3d::CylinderSensor, x3d::PlaneSensor, x3d::SphereSensor, x3d::TouchSensor, x3d::X3DColorNode, x3d::X3DNormalNode, x3d::Color, x3d::ColorRGBA, x3d::Coordinate, x3d::IndexedLineSet, x3d::IndexedTriangleFanSet, x3d::IndexedTriangleSet, x3d::IndexedTriangleStripSet, x3d::LineSet, x3d::Normal, x3d::PointSet, x3d::TriangleFanSet, x3d::TriangleSet, x3d::TriangleStripSet, x3d::X3DScriptNode, x3d::Script, x3d::X3DAppearanceChildNode, x3d::X3DAppearanceNode, x3d::X3DMaterialNode, x3d::X3DShapeNode, x3d::Appearance, x3d::FillProperties, x3d::LineProperties, x3d::Material, x3d::Shape, x3d::X3DSoundNode, x3d::X3DTimeDependentNode, x3d::X3DSoundSourceNode, x3d::AudioClip, x3d::Sound, x3d::X3DFontStyleNode, x3d::FontStyle, x3d::Text, x3d::X3DTextureCoordinateNode, x3d::X3DTextureNode, x3d::X3DTexture2DNode, x3d::X3DTextureTransformNode, x3d::X3DTextureTransform2DNode, x3d::ImageTexture, x3d::MovieTexture, x3d::MovieSound, x3d::MultiTexture, x3d::MultiTextureCoordinate, x3d::MultiTextureTransform, x3d::PixelTexture, x3d::TextureCoordinate, x3d::TextureCoordinateGenerator, x3d::TextureTransform, x3d::TimeSensor, x3d::X3DSequencerNode, x3d::X3DTriggerNode, x3d::BooleanFilter, x3d::BooleanSequencer, x3d::BooleanToggle, x3d::BooleanTrigger, x3d::IntegerSequencer, x3d::IntegerTrigger, and x3d::TimeTrigger. |
const char * x3d::SFNode::GetDefaultContainerFieldName |
( |
void |
|
) |
const [virtual] |
|
|
Get the name of the default container (SFNode or MFNode) for children nodes.
This function returns the textual name of the container field to use for children which do not have a specific place to be. This is mainly for I/O purposes, whenever you are loading a file, you usually need to know where to save a new node in its parent.
Each node has a default field name where it is supposed to be saved in its parent node. Many nodes will return "children".
If no name is specified, this function returns a null pointer. This means a saved node must specified the name of the container field otherwise the child cannot be saved in the parent.
If all you need is the numeric name, use the GetDefaultContainerFieldName() instead, it will be a lot faster.
- Returns:
- the name of the container field as a static const string an empty string or a null pointer
- See also:
- field_t SFNode::GetDefaultContainerField(void) const;
Reimplemented in x3d::X3DNode, x3d::X3DChildNode, x3d::X3DBindableNode, x3d::X3DPrototypeInstance, x3d::ProtoInstance, x3d::MetadataDouble, x3d::MetadataFloat, x3d::MetadataInteger, x3d::MetadataSet, x3d::MetadataString, x3d::X3D, x3d::Scene, x3d::head, x3d::component, x3d::meta, x3d::connect, x3d::IMPORT, x3d::EXPORT, x3d::ExternProtoDeclare, x3d::field, x3d::fieldValue, x3d::IS, x3d::ProtoBody, x3d::ProtoDeclare, x3d::ProtoInterface, x3d::ROUTE, x3d::X3DGroupingNode, x3d::EspduTransform, x3d::ReceiverPdu, x3d::SignalPdu, x3d::TransmitterPdu, x3d::X3DBackgroundNode, x3d::Background, x3d::Fog, x3d::TextureBackground, x3d::X3DEnvironmentalSensorNode, x3d::ProximitySensor, x3d::VisibilitySensor, x3d::X3DGeometricPropertyNode, x3d::X3DCoordinateNode, x3d::GeoCoordinate, x3d::X3DGeometryNode, x3d::GeoElevationGrid, x3d::GeoLocation, x3d::GeoLOD, x3d::X3DInfoNode, x3d::GeoMetadata, x3d::GeoOrigin, x3d::X3DInterpolatorNode, x3d::GeoPositionInterpolator, x3d::X3DPointingDeviceSensorNode, x3d::X3DTouchSensorNode, x3d::GeoTouchSensor, x3d::GeoViewpoint, x3d::Arc2D, x3d::ArcClose2D, x3d::Circle2D, x3d::Disk2D, x3d::Polyline2D, x3d::Polypoint2D, x3d::Rectangle2D, x3d::TriangleSet2D, x3d::Box, x3d::Cone, x3d::Cylinder, x3d::ElevationGrid, x3d::Extrusion, x3d::X3DComposedGeometryNode, x3d::IndexedFaceSet, x3d::Sphere, x3d::Group, x3d::StaticGroup, x3d::Switch, x3d::Transform, x3d::WorldInfo, x3d::HAnimDisplacer, x3d::HAnimHumanoid, x3d::HAnimJoint, x3d::HAnimSegment, x3d::HAnimSite, x3d::ColorInterpolator, x3d::CoordinateInterpolator, x3d::CoordinateInterpolator2D, x3d::NormalInterpolator, x3d::OrientationInterpolator, x3d::PositionInterpolator, x3d::PositionInterpolator2D, x3d::ScalarInterpolator, x3d::X3DKeyDeviceSensorNode, x3d::KeySensor, x3d::StringSensor, x3d::X3DLightNode, x3d::DirectionalLight, x3d::PointLight, x3d::SpotLight, x3d::Billboard, x3d::Collision, x3d::LOD, x3d::NavigationInfo, x3d::Viewpoint, x3d::X3DNetworkSensorNode, x3d::Anchor, x3d::Inline, x3d::LoadSensor, x3d::X3DNurbsControlCurveNode, x3d::X3DParametricGeometryNode, x3d::X3DNurbsSurfaceGeometryNode, x3d::Contour2D, x3d::ContourPolyline2D, x3d::CoordinateDouble, x3d::NurbsCurve, x3d::NurbsCurve2D, x3d::NurbsOrientationInterpolator, x3d::NurbsPatchSurface, x3d::NurbsPositionInterpolator, x3d::NurbsSet, x3d::NurbsSurfaceInterpolator, x3d::NurbsSweptSurface, x3d::NurbsSwungSurface, x3d::NurbsTextureCoordinate, x3d::NurbsTrimmedSurface, x3d::X3DDragSensorNode, x3d::CylinderSensor, x3d::PlaneSensor, x3d::SphereSensor, x3d::TouchSensor, x3d::X3DColorNode, x3d::X3DNormalNode, x3d::Color, x3d::ColorRGBA, x3d::Coordinate, x3d::IndexedLineSet, x3d::IndexedTriangleFanSet, x3d::IndexedTriangleSet, x3d::IndexedTriangleStripSet, x3d::LineSet, x3d::Normal, x3d::PointSet, x3d::TriangleFanSet, x3d::TriangleSet, x3d::TriangleStripSet, x3d::X3DScriptNode, x3d::Script, x3d::X3DAppearanceChildNode, x3d::X3DAppearanceNode, x3d::X3DMaterialNode, x3d::X3DShapeNode, x3d::Appearance, x3d::FillProperties, x3d::LineProperties, x3d::Material, x3d::Shape, x3d::X3DSoundNode, x3d::X3DTimeDependentNode, x3d::X3DSoundSourceNode, x3d::AudioClip, x3d::Sound, x3d::X3DFontStyleNode, x3d::FontStyle, x3d::Text, x3d::X3DTextureCoordinateNode, x3d::X3DTextureNode, x3d::X3DTexture2DNode, x3d::X3DTextureTransformNode, x3d::X3DTextureTransform2DNode, x3d::ImageTexture, x3d::MovieTexture, x3d::MovieSound, x3d::MultiTexture, x3d::MultiTextureCoordinate, x3d::MultiTextureTransform, x3d::PixelTexture, x3d::TextureCoordinate, x3d::TextureCoordinateGenerator, x3d::TextureTransform, x3d::TimeSensor, x3d::X3DSequencerNode, x3d::X3DTriggerNode, x3d::BooleanFilter, x3d::BooleanSequencer, x3d::BooleanToggle, x3d::BooleanTrigger, x3d::IntegerSequencer, x3d::IntegerTrigger, and x3d::TimeTrigger. |
bool x3d::SFNode::GetFieldByIndex |
( |
int |
idx, |
|
|
FieldInfo * |
info |
|
) |
const [virtual] |
|
|
Get the content of a field using its index.
This function searches the specified field at the specified index and returns a pointer to its content, its type and its name in the provided info parameter.
This is used to enumerate all the fields of a node. The index starts at 0 and increases until the function returns false.
- Warning:
- Note that you can then read and write in the field. It is not adviced that you write in the field unless you know exactly what you are doing. You should instead use the set_ and get_ functions to read and write fields. This generic function is provided mainly for I/O operations.
- Note:
- The info are not modified if no field is found at the specified index.
- Parameters:
-
[in] | idx | The index of the field to query |
[in,out] | info | The structure where the information about the field is saved |
- Returns:
- true if the field was found, false when the index is out of range
- See also:
- bool SFNode::GetFieldByName(field_t name, FieldInfo *info) const; int SFNode::GetFieldCount(void) const; field_t GetField(const char *name);
Reimplemented in x3d::X3DNode, x3d::X3DChildNode, x3d::X3DBindableNode, x3d::X3DPrototypeInstance, x3d::ProtoInstance, x3d::MetadataDouble, x3d::MetadataFloat, x3d::MetadataInteger, x3d::MetadataSet, x3d::MetadataString, x3d::X3D, x3d::Scene, x3d::head, x3d::component, x3d::meta, x3d::connect, x3d::IMPORT, x3d::EXPORT, x3d::ExternProtoDeclare, x3d::field, x3d::fieldValue, x3d::IS, x3d::ProtoBody, x3d::ProtoDeclare, x3d::ProtoInterface, x3d::ROUTE, x3d::X3DGroupingNode, x3d::EspduTransform, x3d::ReceiverPdu, x3d::SignalPdu, x3d::TransmitterPdu, x3d::X3DBackgroundNode, x3d::Background, x3d::Fog, x3d::TextureBackground, x3d::X3DEnvironmentalSensorNode, x3d::ProximitySensor, x3d::VisibilitySensor, x3d::X3DGeometricPropertyNode, x3d::X3DCoordinateNode, x3d::GeoCoordinate, x3d::X3DGeometryNode, x3d::GeoElevationGrid, x3d::GeoLocation, x3d::GeoLOD, x3d::X3DInfoNode, x3d::GeoMetadata, x3d::GeoOrigin, x3d::X3DInterpolatorNode, x3d::GeoPositionInterpolator, x3d::X3DPointingDeviceSensorNode, x3d::X3DTouchSensorNode, x3d::GeoTouchSensor, x3d::GeoViewpoint, x3d::Arc2D, x3d::ArcClose2D, x3d::Circle2D, x3d::Disk2D, x3d::Polyline2D, x3d::Polypoint2D, x3d::Rectangle2D, x3d::TriangleSet2D, x3d::Box, x3d::Cone, x3d::Cylinder, x3d::ElevationGrid, x3d::Extrusion, x3d::X3DComposedGeometryNode, x3d::IndexedFaceSet, x3d::Sphere, x3d::Group, x3d::StaticGroup, x3d::Switch, x3d::Transform, x3d::WorldInfo, x3d::HAnimDisplacer, x3d::HAnimHumanoid, x3d::HAnimJoint, x3d::HAnimSegment, x3d::HAnimSite, x3d::ColorInterpolator, x3d::CoordinateInterpolator, x3d::CoordinateInterpolator2D, x3d::NormalInterpolator, x3d::OrientationInterpolator, x3d::PositionInterpolator, x3d::PositionInterpolator2D, x3d::ScalarInterpolator, x3d::X3DKeyDeviceSensorNode, x3d::KeySensor, x3d::StringSensor, x3d::X3DLightNode, x3d::DirectionalLight, x3d::PointLight, x3d::SpotLight, x3d::Billboard, x3d::Collision, x3d::LOD, x3d::NavigationInfo, x3d::Viewpoint, x3d::X3DNetworkSensorNode, x3d::Anchor, x3d::Inline, x3d::LoadSensor, x3d::X3DNurbsControlCurveNode, x3d::X3DParametricGeometryNode, x3d::X3DNurbsSurfaceGeometryNode, x3d::Contour2D, x3d::ContourPolyline2D, x3d::CoordinateDouble, x3d::NurbsCurve, x3d::NurbsCurve2D, x3d::NurbsOrientationInterpolator, x3d::NurbsPatchSurface, x3d::NurbsPositionInterpolator, x3d::NurbsSet, x3d::NurbsSurfaceInterpolator, x3d::NurbsSweptSurface, x3d::NurbsSwungSurface, x3d::NurbsTextureCoordinate, x3d::NurbsTrimmedSurface, x3d::X3DDragSensorNode, x3d::CylinderSensor, x3d::PlaneSensor, x3d::SphereSensor, x3d::TouchSensor, x3d::X3DColorNode, x3d::X3DNormalNode, x3d::Color, x3d::ColorRGBA, x3d::Coordinate, x3d::IndexedLineSet, x3d::IndexedTriangleFanSet, x3d::IndexedTriangleSet, x3d::IndexedTriangleStripSet, x3d::LineSet, x3d::Normal, x3d::PointSet, x3d::TriangleFanSet, x3d::TriangleSet, x3d::TriangleStripSet, x3d::X3DScriptNode, x3d::Script, x3d::X3DAppearanceChildNode, x3d::X3DAppearanceNode, x3d::X3DMaterialNode, x3d::X3DShapeNode, x3d::Appearance, x3d::FillProperties, x3d::LineProperties, x3d::Material, x3d::Shape, x3d::X3DSoundNode, x3d::X3DTimeDependentNode, x3d::X3DSoundSourceNode, x3d::AudioClip, x3d::Sound, x3d::X3DFontStyleNode, x3d::FontStyle, x3d::Text, x3d::X3DTextureCoordinateNode, x3d::X3DTextureNode, x3d::X3DTexture2DNode, x3d::X3DTextureTransformNode, x3d::X3DTextureTransform2DNode, x3d::ImageTexture, x3d::MovieTexture, x3d::MovieSound, x3d::MultiTexture, x3d::MultiTextureCoordinate, x3d::MultiTextureTransform, x3d::PixelTexture, x3d::TextureCoordinate, x3d::TextureCoordinateGenerator, x3d::TextureTransform, x3d::TimeSensor, x3d::X3DSequencerNode, x3d::X3DTriggerNode, x3d::BooleanFilter, x3d::BooleanSequencer, x3d::BooleanToggle, x3d::BooleanTrigger, x3d::IntegerSequencer, x3d::IntegerTrigger, and x3d::TimeTrigger. |
bool x3d::SFNode::GetFieldByName |
( |
field_t |
name, |
|
|
FieldInfo * |
info |
|
) |
const [virtual] |
|
|
Get the content of a field using its name.
This function searches the specified field and returns a pointer to its content, its type and its name in the provided info parameter.
- Warning:
- Note that you can then read and write in the field. It is not adviced that you write in the field unless you know exactly what you are doing. You should instead use the set_ and get_ functions to read and write fields. This generic function is provided mainly for I/O operations.
- Parameters:
-
[in] | name | The name of the field to query in numeric form |
[in,out] | info | The structure where the information about the field is saved |
- Returns:
- true if the field was found
- See also:
- bool SFNode::GetFieldByIndex(int idx, FieldInfo *info) const; field_t GetField(const char *name);
Reimplemented in x3d::X3DNode, x3d::X3DChildNode, x3d::X3DBindableNode, x3d::X3DPrototypeInstance, x3d::ProtoInstance, x3d::MetadataDouble, x3d::MetadataFloat, x3d::MetadataInteger, x3d::MetadataSet, x3d::MetadataString, x3d::X3D, x3d::Scene, x3d::head, x3d::component, x3d::meta, x3d::connect, x3d::IMPORT, x3d::EXPORT, x3d::ExternProtoDeclare, x3d::field, x3d::fieldValue, x3d::IS, x3d::ProtoBody, x3d::ProtoDeclare, x3d::ProtoInterface, x3d::ROUTE, x3d::X3DGroupingNode, x3d::EspduTransform, x3d::ReceiverPdu, x3d::SignalPdu, x3d::TransmitterPdu, x3d::X3DBackgroundNode, x3d::Background, x3d::Fog, x3d::TextureBackground, x3d::X3DEnvironmentalSensorNode, x3d::ProximitySensor, x3d::VisibilitySensor, x3d::X3DGeometricPropertyNode, x3d::X3DCoordinateNode, x3d::GeoCoordinate, x3d::X3DGeometryNode, x3d::GeoElevationGrid, x3d::GeoLocation, x3d::GeoLOD, x3d::X3DInfoNode, x3d::GeoMetadata, x3d::GeoOrigin, x3d::X3DInterpolatorNode, x3d::GeoPositionInterpolator, x3d::X3DPointingDeviceSensorNode, x3d::X3DTouchSensorNode, x3d::GeoTouchSensor, x3d::GeoViewpoint, x3d::Arc2D, x3d::ArcClose2D, x3d::Circle2D, x3d::Disk2D, x3d::Polyline2D, x3d::Polypoint2D, x3d::Rectangle2D, x3d::TriangleSet2D, x3d::Box, x3d::Cone, x3d::Cylinder, x3d::ElevationGrid, x3d::Extrusion, x3d::X3DComposedGeometryNode, x3d::IndexedFaceSet, x3d::Sphere, x3d::Group, x3d::StaticGroup, x3d::Switch, x3d::Transform, x3d::WorldInfo, x3d::HAnimDisplacer, x3d::HAnimHumanoid, x3d::HAnimJoint, x3d::HAnimSegment, x3d::HAnimSite, x3d::ColorInterpolator, x3d::CoordinateInterpolator, x3d::CoordinateInterpolator2D, x3d::NormalInterpolator, x3d::OrientationInterpolator, x3d::PositionInterpolator, x3d::PositionInterpolator2D, x3d::ScalarInterpolator, x3d::X3DKeyDeviceSensorNode, x3d::KeySensor, x3d::StringSensor, x3d::X3DLightNode, x3d::DirectionalLight, x3d::PointLight, x3d::SpotLight, x3d::Billboard, x3d::Collision, x3d::LOD, x3d::NavigationInfo, x3d::Viewpoint, x3d::X3DNetworkSensorNode, x3d::Anchor, x3d::Inline, x3d::LoadSensor, x3d::X3DNurbsControlCurveNode, x3d::X3DParametricGeometryNode, x3d::X3DNurbsSurfaceGeometryNode, x3d::Contour2D, x3d::ContourPolyline2D, x3d::CoordinateDouble, x3d::NurbsCurve, x3d::NurbsCurve2D, x3d::NurbsOrientationInterpolator, x3d::NurbsPatchSurface, x3d::NurbsPositionInterpolator, x3d::NurbsSet, x3d::NurbsSurfaceInterpolator, x3d::NurbsSweptSurface, x3d::NurbsSwungSurface, x3d::NurbsTextureCoordinate, x3d::NurbsTrimmedSurface, x3d::X3DDragSensorNode, x3d::CylinderSensor, x3d::PlaneSensor, x3d::SphereSensor, x3d::TouchSensor, x3d::X3DColorNode, x3d::X3DNormalNode, x3d::Color, x3d::ColorRGBA, x3d::Coordinate, x3d::IndexedLineSet, x3d::IndexedTriangleFanSet, x3d::IndexedTriangleSet, x3d::IndexedTriangleStripSet, x3d::LineSet, x3d::Normal, x3d::PointSet, x3d::TriangleFanSet, x3d::TriangleSet, x3d::TriangleStripSet, x3d::X3DScriptNode, x3d::Script, x3d::X3DAppearanceChildNode, x3d::X3DAppearanceNode, x3d::X3DMaterialNode, x3d::X3DShapeNode, x3d::Appearance, x3d::FillProperties, x3d::LineProperties, x3d::Material, x3d::Shape, x3d::X3DSoundNode, x3d::X3DTimeDependentNode, x3d::X3DSoundSourceNode, x3d::AudioClip, x3d::Sound, x3d::X3DFontStyleNode, x3d::FontStyle, x3d::Text, x3d::X3DTextureCoordinateNode, x3d::X3DTextureNode, x3d::X3DTexture2DNode, x3d::X3DTextureTransformNode, x3d::X3DTextureTransform2DNode, x3d::ImageTexture, x3d::MovieTexture, x3d::MovieSound, x3d::MultiTexture, x3d::MultiTextureCoordinate, x3d::MultiTextureTransform, x3d::PixelTexture, x3d::TextureCoordinate, x3d::TextureCoordinateGenerator, x3d::TextureTransform, x3d::TimeSensor, x3d::X3DSequencerNode, x3d::X3DTriggerNode, x3d::BooleanFilter, x3d::BooleanSequencer, x3d::BooleanToggle, x3d::BooleanTrigger, x3d::IntegerSequencer, x3d::IntegerTrigger, and x3d::TimeTrigger. |
int x3d::SFNode::GetFieldCount |
( |
void |
|
) |
const [virtual] |
|
|
Get the number of fields available at this level.
This function returns the total number of fields this node supports. This can be used with a for() loop to query all the fields. It is also used internally to determine how to decrement the index to call the super class GetFieldByIndex() function.
In user defined types you need to call your super class GetFieldCount() and add the number of fields you offer:
- Returns:
- the total number of fields in this node and all its super classes
- See also:
- bool SFNode::GetFieldByIndex(int idx, FieldInfo *info) const; field_t GetField(const char *name);
Reimplemented in x3d::X3DNode, x3d::X3DChildNode, x3d::X3DBindableNode, x3d::X3DPrototypeInstance, x3d::ProtoInstance, x3d::MetadataDouble, x3d::MetadataFloat, x3d::MetadataInteger, x3d::MetadataSet, x3d::MetadataString, x3d::X3D, x3d::Scene, x3d::head, x3d::component, x3d::meta, x3d::connect, x3d::IMPORT, x3d::EXPORT, x3d::ExternProtoDeclare, x3d::field, x3d::fieldValue, x3d::IS, x3d::ProtoBody, x3d::ProtoDeclare, x3d::ProtoInterface, x3d::ROUTE, x3d::X3DGroupingNode, x3d::EspduTransform, x3d::ReceiverPdu, x3d::SignalPdu, x3d::TransmitterPdu, x3d::X3DBackgroundNode, x3d::Background, x3d::Fog, x3d::TextureBackground, x3d::X3DEnvironmentalSensorNode, x3d::ProximitySensor, x3d::VisibilitySensor, x3d::X3DGeometricPropertyNode, x3d::X3DCoordinateNode, x3d::GeoCoordinate, x3d::X3DGeometryNode, x3d::GeoElevationGrid, x3d::GeoLocation, x3d::GeoLOD, x3d::X3DInfoNode, x3d::GeoMetadata, x3d::GeoOrigin, x3d::X3DInterpolatorNode, x3d::GeoPositionInterpolator, x3d::X3DPointingDeviceSensorNode, x3d::X3DTouchSensorNode, x3d::GeoTouchSensor, x3d::GeoViewpoint, x3d::Arc2D, x3d::ArcClose2D, x3d::Circle2D, x3d::Disk2D, x3d::Polyline2D, x3d::Polypoint2D, x3d::Rectangle2D, x3d::TriangleSet2D, x3d::Box, x3d::Cone, x3d::Cylinder, x3d::ElevationGrid, x3d::Extrusion, x3d::X3DComposedGeometryNode, x3d::IndexedFaceSet, x3d::Sphere, x3d::Group, x3d::StaticGroup, x3d::Switch, x3d::Transform, x3d::WorldInfo, x3d::HAnimDisplacer, x3d::HAnimHumanoid, x3d::HAnimJoint, x3d::HAnimSegment, x3d::HAnimSite, x3d::ColorInterpolator, x3d::CoordinateInterpolator, x3d::CoordinateInterpolator2D, x3d::NormalInterpolator, x3d::OrientationInterpolator, x3d::PositionInterpolator, x3d::PositionInterpolator2D, x3d::ScalarInterpolator, x3d::X3DKeyDeviceSensorNode, x3d::KeySensor, x3d::StringSensor, x3d::X3DLightNode, x3d::DirectionalLight, x3d::PointLight, x3d::SpotLight, x3d::Billboard, x3d::Collision, x3d::LOD, x3d::NavigationInfo, x3d::Viewpoint, x3d::X3DNetworkSensorNode, x3d::Anchor, x3d::Inline, x3d::LoadSensor, x3d::X3DNurbsControlCurveNode, x3d::X3DParametricGeometryNode, x3d::X3DNurbsSurfaceGeometryNode, x3d::Contour2D, x3d::ContourPolyline2D, x3d::CoordinateDouble, x3d::NurbsCurve, x3d::NurbsCurve2D, x3d::NurbsOrientationInterpolator, x3d::NurbsPatchSurface, x3d::NurbsPositionInterpolator, x3d::NurbsSet, x3d::NurbsSurfaceInterpolator, x3d::NurbsSweptSurface, x3d::NurbsSwungSurface, x3d::NurbsTextureCoordinate, x3d::NurbsTrimmedSurface, x3d::X3DDragSensorNode, x3d::CylinderSensor, x3d::PlaneSensor, x3d::SphereSensor, x3d::TouchSensor, x3d::X3DColorNode, x3d::X3DNormalNode, x3d::Color, x3d::ColorRGBA, x3d::Coordinate, x3d::IndexedLineSet, x3d::IndexedTriangleFanSet, x3d::IndexedTriangleSet, x3d::IndexedTriangleStripSet, x3d::LineSet, x3d::Normal, x3d::PointSet, x3d::TriangleFanSet, x3d::TriangleSet, x3d::TriangleStripSet, x3d::X3DScriptNode, x3d::Script, x3d::X3DAppearanceChildNode, x3d::X3DAppearanceNode, x3d::X3DMaterialNode, x3d::X3DShapeNode, x3d::Appearance, x3d::FillProperties, x3d::LineProperties, x3d::Material, x3d::Shape, x3d::X3DSoundNode, x3d::X3DTimeDependentNode, x3d::X3DSoundSourceNode, x3d::AudioClip, x3d::Sound, x3d::X3DFontStyleNode, x3d::FontStyle, x3d::Text, x3d::X3DTextureCoordinateNode, x3d::X3DTextureNode, x3d::X3DTexture2DNode, x3d::X3DTextureTransformNode, x3d::X3DTextureTransform2DNode, x3d::ImageTexture, x3d::MovieTexture, x3d::MovieSound, x3d::MultiTexture, x3d::MultiTextureCoordinate, x3d::MultiTextureTransform, x3d::PixelTexture, x3d::TextureCoordinate, x3d::TextureCoordinateGenerator, x3d::TextureTransform, x3d::TimeSensor, x3d::X3DSequencerNode, x3d::X3DTriggerNode, x3d::BooleanFilter, x3d::BooleanSequencer, x3d::BooleanToggle, x3d::BooleanTrigger, x3d::IntegerSequencer, x3d::IntegerTrigger, and x3d::TimeTrigger. |
bool x3d::SFNode::GetFieldDefault |
( |
field_t |
name, |
|
|
FieldInfo * |
info |
|
) |
const [virtual] |
|
|
Get the default value of a field.
Ask the node to return the default value of a field. It can be used to reset the field to that value or compare with the current value to know whether it is the default.
Note that to compare the current value of a field to its default, you should use the FieldHasDefaultValue() function instead (it is much more efficient and it compares all the different types for you.)
The returned value is the same as what you get when calling the GetFieldByName() or GetFieldByIndex() functions.
- Note:
- A required field (i.e. marked as #REQUIRED in the DTD) does not have a default value. This function will therefore return false for these fields.
- Warning:
- The returned FieldInfo will point to a static constant variable with the default value. The f_data pointer of the FieldInfo is unfortunately not set as a constant since once in a while you want to be able to modify the content of a field (especially MFNode's). However, modifying the default will either fail with a bus error/segmentation fault or you will lose access to the true default. Note that objects will still be initialized with the proper default and the FieldHasDefaultValue() will still work properly since each function has its own copy of the default values.
- Parameters:
-
[in] | name | The name of the field to get the default of |
[in,out] | info | A FieldInfo structure pointer where the default value is saved. |
- Returns:
- true if the field could be found and has a default value.
- See also:
- bool SFNode::GetFieldByName(field_t name, FieldInfo *info) const; bool SFNode::GetFieldByIndex(int idx, FieldInfo *info) const; bool SFNode::FieldHasDefaultValue(field_t name) const field_t GetField(const char *name);
Reimplemented in x3d::X3DNode, x3d::X3DChildNode, x3d::X3DBindableNode, x3d::X3DPrototypeInstance, x3d::ProtoInstance, x3d::MetadataDouble, x3d::MetadataFloat, x3d::MetadataInteger, x3d::MetadataSet, x3d::MetadataString, x3d::X3D, x3d::Scene, x3d::head, x3d::component, x3d::meta, x3d::connect, x3d::IMPORT, x3d::EXPORT, x3d::ExternProtoDeclare, x3d::field, x3d::fieldValue, x3d::IS, x3d::ProtoBody, x3d::ProtoDeclare, x3d::ProtoInterface, x3d::ROUTE, x3d::X3DGroupingNode, x3d::EspduTransform, x3d::ReceiverPdu, x3d::SignalPdu, x3d::TransmitterPdu, x3d::X3DBackgroundNode, x3d::Background, x3d::Fog, x3d::TextureBackground, x3d::X3DEnvironmentalSensorNode, x3d::ProximitySensor, x3d::VisibilitySensor, x3d::X3DGeometricPropertyNode, x3d::X3DCoordinateNode, x3d::GeoCoordinate, x3d::X3DGeometryNode, x3d::GeoElevationGrid, x3d::GeoLocation, x3d::GeoLOD, x3d::X3DInfoNode, x3d::GeoMetadata, x3d::GeoOrigin, x3d::X3DInterpolatorNode, x3d::GeoPositionInterpolator, x3d::X3DPointingDeviceSensorNode, x3d::X3DTouchSensorNode, x3d::GeoTouchSensor, x3d::GeoViewpoint, x3d::Arc2D, x3d::ArcClose2D, x3d::Circle2D, x3d::Disk2D, x3d::Polyline2D, x3d::Polypoint2D, x3d::Rectangle2D, x3d::TriangleSet2D, x3d::Box, x3d::Cone, x3d::Cylinder, x3d::ElevationGrid, x3d::Extrusion, x3d::X3DComposedGeometryNode, x3d::IndexedFaceSet, x3d::Sphere, x3d::Group, x3d::StaticGroup, x3d::Switch, x3d::Transform, x3d::WorldInfo, x3d::HAnimDisplacer, x3d::HAnimHumanoid, x3d::HAnimJoint, x3d::HAnimSegment, x3d::HAnimSite, x3d::ColorInterpolator, x3d::CoordinateInterpolator, x3d::CoordinateInterpolator2D, x3d::NormalInterpolator, x3d::OrientationInterpolator, x3d::PositionInterpolator, x3d::PositionInterpolator2D, x3d::ScalarInterpolator, x3d::X3DKeyDeviceSensorNode, x3d::KeySensor, x3d::StringSensor, x3d::X3DLightNode, x3d::DirectionalLight, x3d::PointLight, x3d::SpotLight, x3d::Billboard, x3d::Collision, x3d::LOD, x3d::NavigationInfo, x3d::Viewpoint, x3d::X3DNetworkSensorNode, x3d::Anchor, x3d::Inline, x3d::LoadSensor, x3d::X3DNurbsControlCurveNode, x3d::X3DParametricGeometryNode, x3d::X3DNurbsSurfaceGeometryNode, x3d::Contour2D, x3d::ContourPolyline2D, x3d::CoordinateDouble, x3d::NurbsCurve, x3d::NurbsCurve2D, x3d::NurbsOrientationInterpolator, x3d::NurbsPatchSurface, x3d::NurbsPositionInterpolator, x3d::NurbsSet, x3d::NurbsSurfaceInterpolator, x3d::NurbsSweptSurface, x3d::NurbsSwungSurface, x3d::NurbsTextureCoordinate, x3d::NurbsTrimmedSurface, x3d::X3DDragSensorNode, x3d::CylinderSensor, x3d::PlaneSensor, x3d::SphereSensor, x3d::TouchSensor, x3d::X3DColorNode, x3d::X3DNormalNode, x3d::Color, x3d::ColorRGBA, x3d::Coordinate, x3d::IndexedLineSet, x3d::IndexedTriangleFanSet, x3d::IndexedTriangleSet, x3d::IndexedTriangleStripSet, x3d::LineSet, x3d::Normal, x3d::PointSet, x3d::TriangleFanSet, x3d::TriangleSet, x3d::TriangleStripSet, x3d::X3DScriptNode, x3d::Script, x3d::X3DAppearanceChildNode, x3d::X3DAppearanceNode, x3d::X3DMaterialNode, x3d::X3DShapeNode, x3d::Appearance, x3d::FillProperties, x3d::LineProperties, x3d::Material, x3d::Shape, x3d::X3DSoundNode, x3d::X3DTimeDependentNode, x3d::X3DSoundSourceNode, x3d::AudioClip, x3d::Sound, x3d::X3DFontStyleNode, x3d::FontStyle, x3d::Text, x3d::X3DTextureCoordinateNode, x3d::X3DTextureNode, x3d::X3DTexture2DNode, x3d::X3DTextureTransformNode, x3d::X3DTextureTransform2DNode, x3d::ImageTexture, x3d::MovieTexture, x3d::MovieSound, x3d::MultiTexture, x3d::MultiTextureCoordinate, x3d::MultiTextureTransform, x3d::PixelTexture, x3d::TextureCoordinate, x3d::TextureCoordinateGenerator, x3d::TextureTransform, x3d::TimeSensor, x3d::X3DSequencerNode, x3d::X3DTriggerNode, x3d::BooleanFilter, x3d::BooleanSequencer, x3d::BooleanToggle, x3d::BooleanTrigger, x3d::IntegerSequencer, x3d::IntegerTrigger, and x3d::TimeTrigger. |
const char * x3d::SFNode::GetNodeName |
( |
void |
|
) |
const [virtual] |
|
|
Get the textual name of a node.
The textual name of the node. This is also the name of the C++ class. it is used to load and save files in XML and VRML.
- Returns:
- a constant string (do not modify!)
- See also:
- field_t SFNode::GetNodeType(int idx) const;
Reimplemented in x3d::X3DNode, x3d::X3DChildNode, x3d::X3DBindableNode, x3d::X3DPrototypeInstance, x3d::ProtoInstance, x3d::MetadataDouble, x3d::MetadataFloat, x3d::MetadataInteger, x3d::MetadataSet, x3d::MetadataString, x3d::X3D, x3d::Scene, x3d::head, x3d::component, x3d::meta, x3d::connect, x3d::IMPORT, x3d::EXPORT, x3d::ExternProtoDeclare, x3d::field, x3d::fieldValue, x3d::IS, x3d::ProtoBody, x3d::ProtoDeclare, x3d::ProtoInterface, x3d::ROUTE, x3d::X3DGroupingNode, x3d::EspduTransform, x3d::ReceiverPdu, x3d::SignalPdu, x3d::TransmitterPdu, x3d::X3DBackgroundNode, x3d::Background, x3d::Fog, x3d::TextureBackground, x3d::X3DEnvironmentalSensorNode, x3d::ProximitySensor, x3d::VisibilitySensor, x3d::X3DGeometricPropertyNode, x3d::X3DCoordinateNode, x3d::GeoCoordinate, x3d::X3DGeometryNode, x3d::GeoElevationGrid, x3d::GeoLocation, x3d::GeoLOD, x3d::X3DInfoNode, x3d::GeoMetadata, x3d::GeoOrigin, x3d::X3DInterpolatorNode, x3d::GeoPositionInterpolator, x3d::X3DPointingDeviceSensorNode, x3d::X3DTouchSensorNode, x3d::GeoTouchSensor, x3d::GeoViewpoint, x3d::Arc2D, x3d::ArcClose2D, x3d::Circle2D, x3d::Disk2D, x3d::Polyline2D, x3d::Polypoint2D, x3d::Rectangle2D, x3d::TriangleSet2D, x3d::Box, x3d::Cone, x3d::Cylinder, x3d::ElevationGrid, x3d::Extrusion, x3d::X3DComposedGeometryNode, x3d::IndexedFaceSet, x3d::Sphere, x3d::Group, x3d::StaticGroup, x3d::Switch, x3d::Transform, x3d::WorldInfo, x3d::HAnimDisplacer, x3d::HAnimHumanoid, x3d::HAnimJoint, x3d::HAnimSegment, x3d::HAnimSite, x3d::ColorInterpolator, x3d::CoordinateInterpolator, x3d::CoordinateInterpolator2D, x3d::NormalInterpolator, x3d::OrientationInterpolator, x3d::PositionInterpolator, x3d::PositionInterpolator2D, x3d::ScalarInterpolator, x3d::X3DKeyDeviceSensorNode, x3d::KeySensor, x3d::StringSensor, x3d::X3DLightNode, x3d::DirectionalLight, x3d::PointLight, x3d::SpotLight, x3d::Billboard, x3d::Collision, x3d::LOD, x3d::NavigationInfo, x3d::Viewpoint, x3d::X3DNetworkSensorNode, x3d::Anchor, x3d::Inline, x3d::LoadSensor, x3d::X3DNurbsControlCurveNode, x3d::X3DParametricGeometryNode, x3d::X3DNurbsSurfaceGeometryNode, x3d::Contour2D, x3d::ContourPolyline2D, x3d::CoordinateDouble, x3d::NurbsCurve, x3d::NurbsCurve2D, x3d::NurbsOrientationInterpolator, x3d::NurbsPatchSurface, x3d::NurbsPositionInterpolator, x3d::NurbsSet, x3d::NurbsSurfaceInterpolator, x3d::NurbsSweptSurface, x3d::NurbsSwungSurface, x3d::NurbsTextureCoordinate, x3d::NurbsTrimmedSurface, x3d::X3DDragSensorNode, x3d::CylinderSensor, x3d::PlaneSensor, x3d::SphereSensor, x3d::TouchSensor, x3d::X3DColorNode, x3d::X3DNormalNode, x3d::Color, x3d::ColorRGBA, x3d::Coordinate, x3d::IndexedLineSet, x3d::IndexedTriangleFanSet, x3d::IndexedTriangleSet, x3d::IndexedTriangleStripSet, x3d::LineSet, x3d::Normal, x3d::PointSet, x3d::TriangleFanSet, x3d::TriangleSet, x3d::TriangleStripSet, x3d::X3DScriptNode, x3d::Script, x3d::X3DAppearanceChildNode, x3d::X3DAppearanceNode, x3d::X3DMaterialNode, x3d::X3DShapeNode, x3d::Appearance, x3d::FillProperties, x3d::LineProperties, x3d::Material, x3d::Shape, x3d::X3DSoundNode, x3d::X3DTimeDependentNode, x3d::X3DSoundSourceNode, x3d::AudioClip, x3d::Sound, x3d::X3DFontStyleNode, x3d::FontStyle, x3d::Text, x3d::X3DTextureCoordinateNode, x3d::X3DTextureNode, x3d::X3DTexture2DNode, x3d::X3DTextureTransformNode, x3d::X3DTextureTransform2DNode, x3d::ImageTexture, x3d::MovieTexture, x3d::MovieSound, x3d::MultiTexture, x3d::MultiTextureCoordinate, x3d::MultiTextureTransform, x3d::PixelTexture, x3d::TextureCoordinate, x3d::TextureCoordinateGenerator, x3d::TextureTransform, x3d::TimeSensor, x3d::X3DSequencerNode, x3d::X3DTriggerNode, x3d::BooleanFilter, x3d::BooleanSequencer, x3d::BooleanToggle, x3d::BooleanTrigger, x3d::IntegerSequencer, x3d::IntegerTrigger, and x3d::TimeTrigger. |
field_t x3d::SFNode::GetNodeType |
( |
int |
idx = 0 |
) |
const [virtual] |
|
|
Get the type of a node.
Get the type (such as FLD_TYPE_SCRIPT) of a node. The index can be used in order to query all the types. With index 0, only the top-most type is returned. Once all the types have been returned, the function returns FLD_INVALID.
The following example checks whether a node is of type grouping. Note that it is faster to use IsNodeType() in this case unless you want to test for several types.
for(;;) {
field_t t = node->GetNodeType();
if(t == FLD_INVALID) return ERROR;
if(t == FLD_GROUPING) return VALID;
}
- Parameters:
-
[in] | idx | the index of the node of which we want to get the type |
- Returns:
- a field_t with the corresponding node type
- See also:
- bool SFNode::IsNodeType(field_t type) const;
Reimplemented in x3d::X3DNode, x3d::X3DChildNode, x3d::X3DBindableNode, x3d::X3DPrototypeInstance, x3d::ProtoInstance, x3d::MetadataDouble, x3d::MetadataFloat, x3d::MetadataInteger, x3d::MetadataSet, x3d::MetadataString, x3d::X3D, x3d::Scene, x3d::head, x3d::component, x3d::meta, x3d::connect, x3d::IMPORT, x3d::EXPORT, x3d::ExternProtoDeclare, x3d::field, x3d::fieldValue, x3d::IS, x3d::ProtoBody, x3d::ProtoDeclare, x3d::ProtoInterface, x3d::ROUTE, x3d::X3DGroupingNode, x3d::EspduTransform, x3d::ReceiverPdu, x3d::SignalPdu, x3d::TransmitterPdu, x3d::X3DBackgroundNode, x3d::Background, x3d::Fog, x3d::TextureBackground, x3d::X3DEnvironmentalSensorNode, x3d::ProximitySensor, x3d::VisibilitySensor, x3d::X3DGeometricPropertyNode, x3d::X3DCoordinateNode, x3d::GeoCoordinate, x3d::X3DGeometryNode, x3d::GeoElevationGrid, x3d::GeoLocation, x3d::GeoLOD, x3d::X3DInfoNode, x3d::GeoMetadata, x3d::GeoOrigin, x3d::X3DInterpolatorNode, x3d::GeoPositionInterpolator, x3d::X3DPointingDeviceSensorNode, x3d::X3DTouchSensorNode, x3d::GeoTouchSensor, x3d::GeoViewpoint, x3d::Arc2D, x3d::ArcClose2D, x3d::Circle2D, x3d::Disk2D, x3d::Polyline2D, x3d::Polypoint2D, x3d::Rectangle2D, x3d::TriangleSet2D, x3d::Box, x3d::Cone, x3d::Cylinder, x3d::ElevationGrid, x3d::Extrusion, x3d::X3DComposedGeometryNode, x3d::IndexedFaceSet, x3d::Sphere, x3d::Group, x3d::StaticGroup, x3d::Switch, x3d::Transform, x3d::WorldInfo, x3d::HAnimDisplacer, x3d::HAnimHumanoid, x3d::HAnimJoint, x3d::HAnimSegment, x3d::HAnimSite, x3d::ColorInterpolator, x3d::CoordinateInterpolator, x3d::CoordinateInterpolator2D, x3d::NormalInterpolator, x3d::OrientationInterpolator, x3d::PositionInterpolator, x3d::PositionInterpolator2D, x3d::ScalarInterpolator, x3d::X3DKeyDeviceSensorNode, x3d::KeySensor, x3d::StringSensor, x3d::X3DLightNode, x3d::DirectionalLight, x3d::PointLight, x3d::SpotLight, x3d::Billboard, x3d::Collision, x3d::LOD, x3d::NavigationInfo, x3d::Viewpoint, x3d::X3DNetworkSensorNode, x3d::Anchor, x3d::Inline, x3d::LoadSensor, x3d::X3DNurbsControlCurveNode, x3d::X3DParametricGeometryNode, x3d::X3DNurbsSurfaceGeometryNode, x3d::Contour2D, x3d::ContourPolyline2D, x3d::CoordinateDouble, x3d::NurbsCurve, x3d::NurbsCurve2D, x3d::NurbsOrientationInterpolator, x3d::NurbsPatchSurface, x3d::NurbsPositionInterpolator, x3d::NurbsSet, x3d::NurbsSurfaceInterpolator, x3d::NurbsSweptSurface, x3d::NurbsSwungSurface, x3d::NurbsTextureCoordinate, x3d::NurbsTrimmedSurface, x3d::X3DDragSensorNode, x3d::CylinderSensor, x3d::PlaneSensor, x3d::SphereSensor, x3d::TouchSensor, x3d::X3DColorNode, x3d::X3DNormalNode, x3d::Color, x3d::ColorRGBA, x3d::Coordinate, x3d::IndexedLineSet, x3d::IndexedTriangleFanSet, x3d::IndexedTriangleSet, x3d::IndexedTriangleStripSet, x3d::LineSet, x3d::Normal, x3d::PointSet, x3d::TriangleFanSet, x3d::TriangleSet, x3d::TriangleStripSet, x3d::X3DScriptNode, x3d::Script, x3d::X3DAppearanceChildNode, x3d::X3DAppearanceNode, x3d::X3DMaterialNode, x3d::X3DShapeNode, x3d::Appearance, x3d::FillProperties, x3d::LineProperties, x3d::Material, x3d::Shape, x3d::X3DSoundNode, x3d::X3DTimeDependentNode, x3d::X3DSoundSourceNode, x3d::AudioClip, x3d::Sound, x3d::X3DFontStyleNode, x3d::FontStyle, x3d::Text, x3d::X3DTextureCoordinateNode, x3d::X3DTextureNode, x3d::X3DTexture2DNode, x3d::X3DTextureTransformNode, x3d::X3DTextureTransform2DNode, x3d::ImageTexture, x3d::MovieTexture, x3d::MovieSound, x3d::MultiTexture, x3d::MultiTextureCoordinate, x3d::MultiTextureTransform, x3d::PixelTexture, x3d::TextureCoordinate, x3d::TextureCoordinateGenerator, x3d::TextureTransform, x3d::TimeSensor, x3d::X3DSequencerNode, x3d::X3DTriggerNode, x3d::BooleanFilter, x3d::BooleanSequencer, x3d::BooleanToggle, x3d::BooleanTrigger, x3d::IntegerSequencer, x3d::IntegerTrigger, and x3d::TimeTrigger. |
field_t x3d::SFNode::GetTypeCount |
( |
void |
|
) |
const [virtual] |
|
|
Get the number of types a node represents at its top-level.
In order for the GetNodeType() function to work properly, we need to have a way to know how many types may be handled at a given level. This function is used for that purpose to decrement the index properly when calling a different level.
- Returns:
- a field_t with the corresponding node type
- See also:
- bool SFNode::IsNodeType(field_t type) const;
Reimplemented in x3d::X3DNode, x3d::X3DChildNode, x3d::X3DBindableNode, x3d::X3DPrototypeInstance, x3d::ProtoInstance, x3d::MetadataDouble, x3d::MetadataFloat, x3d::MetadataInteger, x3d::MetadataSet, x3d::MetadataString, x3d::X3D, x3d::Scene, x3d::head, x3d::component, x3d::meta, x3d::connect, x3d::IMPORT, x3d::EXPORT, x3d::ExternProtoDeclare, x3d::field, x3d::fieldValue, x3d::IS, x3d::ProtoBody, x3d::ProtoDeclare, x3d::ProtoInterface, x3d::ROUTE, x3d::X3DGroupingNode, x3d::EspduTransform, x3d::ReceiverPdu, x3d::SignalPdu, x3d::TransmitterPdu, x3d::X3DBackgroundNode, x3d::Background, x3d::Fog, x3d::TextureBackground, x3d::X3DEnvironmentalSensorNode, x3d::ProximitySensor, x3d::VisibilitySensor, x3d::X3DGeometricPropertyNode, x3d::X3DCoordinateNode, x3d::GeoCoordinate, x3d::X3DGeometryNode, x3d::GeoElevationGrid, x3d::GeoLocation, x3d::GeoLOD, x3d::X3DInfoNode, x3d::GeoMetadata, x3d::GeoOrigin, x3d::X3DInterpolatorNode, x3d::GeoPositionInterpolator, x3d::X3DPointingDeviceSensorNode, x3d::X3DTouchSensorNode, x3d::GeoTouchSensor, x3d::GeoViewpoint, x3d::Arc2D, x3d::ArcClose2D, x3d::Circle2D, x3d::Disk2D, x3d::Polyline2D, x3d::Polypoint2D, x3d::Rectangle2D, x3d::TriangleSet2D, x3d::Box, x3d::Cone, x3d::Cylinder, x3d::ElevationGrid, x3d::Extrusion, x3d::X3DComposedGeometryNode, x3d::IndexedFaceSet, x3d::Sphere, x3d::Group, x3d::StaticGroup, x3d::Switch, x3d::Transform, x3d::WorldInfo, x3d::HAnimDisplacer, x3d::HAnimHumanoid, x3d::HAnimJoint, x3d::HAnimSegment, x3d::HAnimSite, x3d::ColorInterpolator, x3d::CoordinateInterpolator, x3d::CoordinateInterpolator2D, x3d::NormalInterpolator, x3d::OrientationInterpolator, x3d::PositionInterpolator, x3d::PositionInterpolator2D, x3d::ScalarInterpolator, x3d::X3DKeyDeviceSensorNode, x3d::KeySensor, x3d::StringSensor, x3d::X3DLightNode, x3d::DirectionalLight, x3d::PointLight, x3d::SpotLight, x3d::Billboard, x3d::Collision, x3d::LOD, x3d::NavigationInfo, x3d::Viewpoint, x3d::X3DNetworkSensorNode, x3d::Anchor, x3d::Inline, x3d::LoadSensor, x3d::X3DNurbsControlCurveNode, x3d::X3DParametricGeometryNode, x3d::X3DNurbsSurfaceGeometryNode, x3d::Contour2D, x3d::ContourPolyline2D, x3d::CoordinateDouble, x3d::NurbsCurve, x3d::NurbsCurve2D, x3d::NurbsOrientationInterpolator, x3d::NurbsPatchSurface, x3d::NurbsPositionInterpolator, x3d::NurbsSet, x3d::NurbsSurfaceInterpolator, x3d::NurbsSweptSurface, x3d::NurbsSwungSurface, x3d::NurbsTextureCoordinate, x3d::NurbsTrimmedSurface, x3d::X3DDragSensorNode, x3d::CylinderSensor, x3d::PlaneSensor, x3d::SphereSensor, x3d::TouchSensor, x3d::X3DColorNode, x3d::X3DNormalNode, x3d::Color, x3d::ColorRGBA, x3d::Coordinate, x3d::IndexedLineSet, x3d::IndexedTriangleFanSet, x3d::IndexedTriangleSet, x3d::IndexedTriangleStripSet, x3d::LineSet, x3d::Normal, x3d::PointSet, x3d::TriangleFanSet, x3d::TriangleSet, x3d::TriangleStripSet, x3d::X3DScriptNode, x3d::Script, x3d::X3DAppearanceChildNode, x3d::X3DAppearanceNode, x3d::X3DMaterialNode, x3d::X3DShapeNode, x3d::Appearance, x3d::FillProperties, x3d::LineProperties, x3d::Material, x3d::Shape, x3d::X3DSoundNode, x3d::X3DTimeDependentNode, x3d::X3DSoundSourceNode, x3d::AudioClip, x3d::Sound, x3d::X3DFontStyleNode, x3d::FontStyle, x3d::Text, x3d::X3DTextureCoordinateNode, x3d::X3DTextureNode, x3d::X3DTexture2DNode, x3d::X3DTextureTransformNode, x3d::X3DTextureTransform2DNode, x3d::ImageTexture, x3d::MovieTexture, x3d::MovieSound, x3d::MultiTexture, x3d::MultiTextureCoordinate, x3d::MultiTextureTransform, x3d::PixelTexture, x3d::TextureCoordinate, x3d::TextureCoordinateGenerator, x3d::TextureTransform, x3d::TimeSensor, x3d::X3DSequencerNode, x3d::X3DTriggerNode, x3d::BooleanFilter, x3d::BooleanSequencer, x3d::BooleanToggle, x3d::BooleanTrigger, x3d::IntegerSequencer, x3d::IntegerTrigger, and x3d::TimeTrigger. |
bool x3d::SFNode::IsNodeType |
( |
field_t |
type |
) |
const [virtual] |
|
|
Test whether a node is of a certain type.
Nodes inherit of different classes. To know whether a node is derived of a specific class you can use dynamic_cast<typename>(node) where typename is the name of the derived class. This can be rather slow since the textual name is used to find the proper pointer. So if you do not need the pointer afterward, you should instead use this function. It will go through all the classes, but it only has to compare one integer to know whether it is of that class or not.
- Parameters:
-
[in] | type | one of the FLD_TYPE_... enumeration or a user registered type |
- Returns:
- true whenever the node is of that type
- See also:
- field_t SFNode::GetNodeType(int idx) const;
Reimplemented in x3d::X3DNode, x3d::X3DChildNode, x3d::X3DBindableNode, x3d::X3DPrototypeInstance, x3d::ProtoInstance, x3d::MetadataDouble, x3d::MetadataFloat, x3d::MetadataInteger, x3d::MetadataSet, x3d::MetadataString, x3d::X3D, x3d::Scene, x3d::head, x3d::component, x3d::meta, x3d::connect, x3d::IMPORT, x3d::EXPORT, x3d::ExternProtoDeclare, x3d::field, x3d::fieldValue, x3d::IS, x3d::ProtoBody, x3d::ProtoDeclare, x3d::ProtoInterface, x3d::ROUTE, x3d::X3DGroupingNode, x3d::EspduTransform, x3d::ReceiverPdu, x3d::SignalPdu, x3d::TransmitterPdu, x3d::X3DBackgroundNode, x3d::Background, x3d::Fog, x3d::TextureBackground, x3d::X3DEnvironmentalSensorNode, x3d::ProximitySensor, x3d::VisibilitySensor, x3d::X3DGeometricPropertyNode, x3d::X3DCoordinateNode, x3d::GeoCoordinate, x3d::X3DGeometryNode, x3d::GeoElevationGrid, x3d::GeoLocation, x3d::GeoLOD, x3d::X3DInfoNode, x3d::GeoMetadata, x3d::GeoOrigin, x3d::X3DInterpolatorNode, x3d::GeoPositionInterpolator, x3d::X3DPointingDeviceSensorNode, x3d::X3DTouchSensorNode, x3d::GeoTouchSensor, x3d::GeoViewpoint, x3d::Arc2D, x3d::ArcClose2D, x3d::Circle2D, x3d::Disk2D, x3d::Polyline2D, x3d::Polypoint2D, x3d::Rectangle2D, x3d::TriangleSet2D, x3d::Box, x3d::Cone, x3d::Cylinder, x3d::ElevationGrid, x3d::Extrusion, x3d::X3DComposedGeometryNode, x3d::IndexedFaceSet, x3d::Sphere, x3d::Group, x3d::StaticGroup, x3d::Switch, x3d::Transform, x3d::WorldInfo, x3d::HAnimDisplacer, x3d::HAnimHumanoid, x3d::HAnimJoint, x3d::HAnimSegment, x3d::HAnimSite, x3d::ColorInterpolator, x3d::CoordinateInterpolator, x3d::CoordinateInterpolator2D, x3d::NormalInterpolator, x3d::OrientationInterpolator, x3d::PositionInterpolator, x3d::PositionInterpolator2D, x3d::ScalarInterpolator, x3d::X3DKeyDeviceSensorNode, x3d::KeySensor, x3d::StringSensor, x3d::X3DLightNode, x3d::DirectionalLight, x3d::PointLight, x3d::SpotLight, x3d::Billboard, x3d::Collision, x3d::LOD, x3d::NavigationInfo, x3d::Viewpoint, x3d::X3DNetworkSensorNode, x3d::Anchor, x3d::Inline, x3d::LoadSensor, x3d::X3DNurbsControlCurveNode, x3d::X3DParametricGeometryNode, x3d::X3DNurbsSurfaceGeometryNode, x3d::Contour2D, x3d::ContourPolyline2D, x3d::CoordinateDouble, x3d::NurbsCurve, x3d::NurbsCurve2D, x3d::NurbsOrientationInterpolator, x3d::NurbsPatchSurface, x3d::NurbsPositionInterpolator, x3d::NurbsSet, x3d::NurbsSurfaceInterpolator, x3d::NurbsSweptSurface, x3d::NurbsSwungSurface, x3d::NurbsTextureCoordinate, x3d::NurbsTrimmedSurface, x3d::X3DDragSensorNode, x3d::CylinderSensor, x3d::PlaneSensor, x3d::SphereSensor, x3d::TouchSensor, x3d::X3DColorNode, x3d::X3DNormalNode, x3d::Color, x3d::ColorRGBA, x3d::Coordinate, x3d::IndexedLineSet, x3d::IndexedTriangleFanSet, x3d::IndexedTriangleSet, x3d::IndexedTriangleStripSet, x3d::LineSet, x3d::Normal, x3d::PointSet, x3d::TriangleFanSet, x3d::TriangleSet, x3d::TriangleStripSet, x3d::X3DScriptNode, x3d::Script, x3d::X3DAppearanceChildNode, x3d::X3DAppearanceNode, x3d::X3DMaterialNode, x3d::X3DShapeNode, x3d::Appearance, x3d::FillProperties, x3d::LineProperties, x3d::Material, x3d::Shape, x3d::X3DSoundNode, x3d::X3DTimeDependentNode, x3d::X3DSoundSourceNode, x3d::AudioClip, x3d::Sound, x3d::X3DFontStyleNode, x3d::FontStyle, x3d::Text, x3d::X3DTextureCoordinateNode, x3d::X3DTextureNode, x3d::X3DTexture2DNode, x3d::X3DTextureTransformNode, x3d::X3DTextureTransform2DNode, x3d::ImageTexture, x3d::MovieTexture, x3d::MovieSound, x3d::MultiTexture, x3d::MultiTextureCoordinate, x3d::MultiTextureTransform, x3d::PixelTexture, x3d::TextureCoordinate, x3d::TextureCoordinateGenerator, x3d::TextureTransform, x3d::TimeSensor, x3d::X3DSequencerNode, x3d::X3DTriggerNode, x3d::BooleanFilter, x3d::BooleanSequencer, x3d::BooleanToggle, x3d::BooleanTrigger, x3d::IntegerSequencer, x3d::IntegerTrigger, and x3d::TimeTrigger. |
|
Add a listener to the list of listeners of this node.
- Parameters:
-
[in] | listener | The listener to call whenever the given node has one of its field changed. |
The nodes will call the FieldChanged() function on each listener registered with a node. This notifies the listener that it may have to do some work to maintain its current state.
Listeners are used by the interpolators to know whenever a value changed and whenever they need to change their own value.
Environment Sensors (especially collision sensors) will be listening to different nodes to know when they need to trigger an event.
The render state object listen to all the nodes to know when their z coordinate changes, when they get hidden or shown, etc.
- Warning:
- Watch out for infinite loops.
The listener interface is NOT multi-thread safe. If you try to register and unregister listeners from different threads, chances are it will crash. It would also be a problem since the nodes generate direct calls to the listeners which means the listener could be called from any thread. We'll have to work on that at a later date.
- Note:
- If you register the same listener multiple times, it will get called multiple times. You will need to unregister a number of times equal to the number of calls to this registration function.
- See also:
- UnregisterListener
Event_FieldChanged
Event_Destroy
|
|
Set a child node in the proper parent container field.
This function is the same as field_t SFNode::SetChild(SFNode *child, const char *containerField, bool insert); with the container field in numerical form.
- Parameters:
-
[in] | child | The child node to save in this parent |
[in] | name | The numeric name of the field in the parent node where the child needs to be saved. If null or empty, use the default container field defined in the child node. |
[in] | insert | Whether to insert the node if the field in and MFNode or to replace all the nodes in that array with the child. This parameter defaults to true. |
- Returns:
- FLD_INVALID if the field could not be set, otherwise it returns the numeric name of the field (i.e. FLD_CHILDREN, FLD_FIELDS, etc.)
- See also:
- field_t SFNode::SetChild(SFNode *child, field_t name, bool insert)
|
field_t x3d::SFNode::SetChild |
( |
SFNode * |
child, |
|
|
const char * |
containerField, |
|
|
bool |
insert = true |
|
) |
|
|
|
Set a child node in the proper parent container field.
This function tries to determine where to save a child node in a parent node.
Most nodes can be a child of another node. Because in most cases, a node can only be the child of a restrained number of nodes, it is likely that this child can only be saved in a specific field in the parent node. This specific field is defined as the container field.
You can pass the name of the container field if you know it. Otherwise, the function asks the child for a default container field. If the container field name or the default child field are undefined, then the function fails.
If the container field is an array of nodes, then the child will be inserted by default. You can change this behavior and empty the existing list first by setting the insert flag to false.
- Parameters:
-
[in] | child | The child node to save in this parent |
[in] | containerField | The name of the field in the parent node where the child needs to be saved. If null or empty, use the default container field defined in the child node. |
[in] | insert | Whether to insert the node if the field in and MFNode or to replace all the nodes in that array with the child. This parameter defaults to true. |
- Returns:
- FLD_INVALID if the field could not be set, otherwise it returns the numeric name of the field (i.e. FLD_CHILDREN, FLD_FIELDS, etc.)
- See also:
- field_t SFNode::SetChild(SFNode *child, field_t name, bool insert)
|
field_t x3d::SFNode::SetFieldByName |
( |
const char * |
name, |
|
|
const char * |
data |
|
) |
|
|
|
Set the value of a field using its textual name and a string for the data.
This function is mainly to be used by I/O operations to change the value of a field from a string found in an input stream.
For other purposes, it is strongly advise that you make use of the get_ and set_ functions of the given class.
Note that the function will fail if the name is not a valid field name for this node or if the data is not a valid string for the type of the field.
- Note:
- You cannot set a node in a parent node using this function.
- Parameters:
-
[in] | name | The textual name of the field to set. |
[in] | data | A string pointer to the data to save in that field. The string needs to be of the proper type. |
- Returns:
- FLD_INVALID if the field could not be set, otherwise it returns the type accepted by the field (i.e. FLD_SFBOOL, FLD_SFSTRING, etc.)
- Bug:
- At this time, the data pointer is of type void* and there is therfore no way for sure to know whether the pointer passed is of the type expected by the field. This should be fine since this function is mainly to be used by I/O processes and no specialized code which can handle the fields using the proper get_ and set_ functions.
- See also:
- bool SFNode::SetFieldByName(field_t name, const void *data); StringToValue(); StringToMValue();
|
bool x3d::SFNode::SetFieldByName |
( |
field_t |
name, |
|
|
const void * |
data |
|
) |
[virtual] |
|
|
Set the value of a field using its numeric name.
This function is mainly to be used by I/O operations to change the value of a field from the value found in an input stream.
For other purposes, it is strongly advise that you make use of the get_ and set_ functions of the given class.
Also, if you are not sure about the datatype of a field, it is better to use the other SetFieldByName() function which will automatically determine the type of the field and set it accordingly.
- Attention:
- Enumeration fields are managed differently depending on the function that you use. This one will make that field look like an SFString. The data pointer is expected to point to an SFString or it will crash. Internally, the string will be transformed to the corresponding enumeration value. Note that if the field name is valid, but the enumeration name is not, then the function also returns false.
- Note:
- You cannot set a node in a parent node using this function.
- Parameters:
-
[in] | name | The name of the field to set. |
[in] | data | A pointer to the data to copy in the specified field. It MUST be of the right type of the system may crash. This is the same pointer as found the FieldInfo.f_data.f_any variable member. |
- Returns:
- true when a field of the specified name was found and set to the value defined by data
- Bug:
- At this time, the data pointer is of type void* and there is therfore no way for sure to know whether the pointer passed is of the type expected by the field. This should be fine since this function is mainly to be used by I/O processes and no specialized code which can handle the fields using the proper get_ and set_ functions.
- See also:
- field_t SFNode::SetFieldByName(const char *name, const char *data);
Reimplemented in x3d::X3DNode, x3d::X3DChildNode, x3d::X3DBindableNode, x3d::X3DPrototypeInstance, x3d::ProtoInstance, x3d::MetadataDouble, x3d::MetadataFloat, x3d::MetadataInteger, x3d::MetadataSet, x3d::MetadataString, x3d::X3D, x3d::Scene, x3d::head, x3d::component, x3d::meta, x3d::connect, x3d::IMPORT, x3d::EXPORT, x3d::ExternProtoDeclare, x3d::field, x3d::fieldValue, x3d::IS, x3d::ProtoBody, x3d::ProtoDeclare, x3d::ProtoInterface, x3d::ROUTE, x3d::X3DGroupingNode, x3d::EspduTransform, x3d::ReceiverPdu, x3d::SignalPdu, x3d::TransmitterPdu, x3d::X3DBackgroundNode, x3d::Background, x3d::Fog, x3d::TextureBackground, x3d::X3DEnvironmentalSensorNode, x3d::ProximitySensor, x3d::VisibilitySensor, x3d::X3DGeometricPropertyNode, x3d::X3DCoordinateNode, x3d::GeoCoordinate, x3d::X3DGeometryNode, x3d::GeoElevationGrid, x3d::GeoLocation, x3d::GeoLOD, x3d::X3DInfoNode, x3d::GeoMetadata, x3d::GeoOrigin, x3d::X3DInterpolatorNode, x3d::GeoPositionInterpolator, x3d::X3DPointingDeviceSensorNode, x3d::X3DTouchSensorNode, x3d::GeoTouchSensor, x3d::GeoViewpoint, x3d::Arc2D, x3d::ArcClose2D, x3d::Circle2D, x3d::Disk2D, x3d::Polyline2D, x3d::Polypoint2D, x3d::Rectangle2D, x3d::TriangleSet2D, x3d::Box, x3d::Cone, x3d::Cylinder, x3d::ElevationGrid, x3d::Extrusion, x3d::X3DComposedGeometryNode, x3d::IndexedFaceSet, x3d::Sphere, x3d::Group, x3d::StaticGroup, x3d::Switch, x3d::Transform, x3d::WorldInfo, x3d::HAnimDisplacer, x3d::HAnimHumanoid, x3d::HAnimJoint, x3d::HAnimSegment, x3d::HAnimSite, x3d::ColorInterpolator, x3d::CoordinateInterpolator, x3d::CoordinateInterpolator2D, x3d::NormalInterpolator, x3d::OrientationInterpolator, x3d::PositionInterpolator, x3d::PositionInterpolator2D, x3d::ScalarInterpolator, x3d::X3DKeyDeviceSensorNode, x3d::KeySensor, x3d::StringSensor, x3d::X3DLightNode, x3d::DirectionalLight, x3d::PointLight, x3d::SpotLight, x3d::Billboard, x3d::Collision, x3d::LOD, x3d::NavigationInfo, x3d::Viewpoint, x3d::X3DNetworkSensorNode, x3d::Anchor, x3d::Inline, x3d::LoadSensor, x3d::X3DNurbsControlCurveNode, x3d::X3DParametricGeometryNode, x3d::X3DNurbsSurfaceGeometryNode, x3d::Contour2D, x3d::ContourPolyline2D, x3d::CoordinateDouble, x3d::NurbsCurve, x3d::NurbsCurve2D, x3d::NurbsOrientationInterpolator, x3d::NurbsPatchSurface, x3d::NurbsPositionInterpolator, x3d::NurbsSet, x3d::NurbsSurfaceInterpolator, x3d::NurbsSweptSurface, x3d::NurbsSwungSurface, x3d::NurbsTextureCoordinate, x3d::NurbsTrimmedSurface, x3d::X3DDragSensorNode, x3d::CylinderSensor, x3d::PlaneSensor, x3d::SphereSensor, x3d::TouchSensor, x3d::X3DColorNode, x3d::X3DNormalNode, x3d::Color, x3d::ColorRGBA, x3d::Coordinate, x3d::IndexedLineSet, x3d::IndexedTriangleFanSet, x3d::IndexedTriangleSet, x3d::IndexedTriangleStripSet, x3d::LineSet, x3d::Normal, x3d::PointSet, x3d::TriangleFanSet, x3d::TriangleSet, x3d::TriangleStripSet, x3d::X3DScriptNode, x3d::Script, x3d::X3DAppearanceChildNode, x3d::X3DAppearanceNode, x3d::X3DMaterialNode, x3d::X3DShapeNode, x3d::Appearance, x3d::FillProperties, x3d::LineProperties, x3d::Material, x3d::Shape, x3d::X3DSoundNode, x3d::X3DTimeDependentNode, x3d::X3DSoundSourceNode, x3d::AudioClip, x3d::Sound, x3d::X3DFontStyleNode, x3d::FontStyle, x3d::Text, x3d::X3DTextureCoordinateNode, x3d::X3DTextureNode, x3d::X3DTexture2DNode, x3d::X3DTextureTransformNode, x3d::X3DTextureTransform2DNode, x3d::ImageTexture, x3d::MovieTexture, x3d::MovieSound, x3d::MultiTexture, x3d::MultiTextureCoordinate, x3d::MultiTextureTransform, x3d::PixelTexture, x3d::TextureCoordinate, x3d::TextureCoordinateGenerator, x3d::TextureTransform, x3d::TimeSensor, x3d::X3DSequencerNode, x3d::X3DTriggerNode, x3d::BooleanFilter, x3d::BooleanSequencer, x3d::BooleanToggle, x3d::BooleanTrigger, x3d::IntegerSequencer, x3d::IntegerTrigger, and x3d::TimeTrigger. |
|
Remove a listener from the list of listener of a node.
- Parameters:
-
[in] | listener | The listener to remove from the list of listener in this node. |
This function removes a listener which was added to a node using the RegisterListener() function.
- Note:
- You need to call the UnregisterListener() function the same number of times you called the RegisterListener() function. It is expected that you will anyway call the RegisterListener() only once with each listener.
- Returns:
- The function returns true whenever the listener was removed from the list. If the listener is not found, the function returns false.
- See also:
- RegisterListener
Event_FieldChanged
Event_Destroy
|
Member Data Documentation
The documentation for this class was generated from the following files:
|