H3D API
2.4.1
|
The ToggleGroup node enables you to enable/disable haptics and graphics rendering of its children nodes. More...
#include <H3D/ToggleGroup.h>
Public Member Functions | |
ToggleGroup (Inst< AddChildren > _addChildren=0, Inst< RemoveChildren > _removeChildren=0, Inst< MFChild > _children=0, Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0, Inst< SFBool > _hapticsOn=0, Inst< SFBool > _graphicsOn=0, Inst< MFBool > _hapticsOnDevice=0, Inst< SFBool > _traverseOn=0) | |
Constructor. | |
virtual void | traverseSG (TraverseInfo &ti) |
Haptics is disabled if hapticsOn is false. | |
virtual void | render () |
Only renders children if graphicsOn is true. | |
virtual bool | lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result) |
Detect intersection between a line segment and the Node. More... | |
virtual void | closestPoint (const Vec3f &p, NodeIntersectResult &result) |
Find closest point on Node to p. More... | |
virtual bool | movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result) |
Detect collision between a moving sphere and the Node. More... | |
![]() | |
X3DGroupingNode (Inst< AddChildren > _addChildren=0, Inst< RemoveChildren > _removeChildren=0, Inst< MFChild > _children=0, Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0) | |
Constructor. | |
virtual | ~X3DGroupingNode () |
Destructor. | |
virtual void | initialize () |
Sets up the bound field using the bboxCenter and bboxSize fields. More... | |
![]() | |
X3DChildNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
![]() | |
X3DNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
X3DMetadataObject * | getMetadataByName (const string &_name) |
Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More... | |
![]() | |
Node () | |
Constructor. | |
virtual Node * | clone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL) |
Returns a new instance of this node type with the same state as this one. More... | |
virtual | ~Node () |
Destructor. | |
X3DPrototypeInstance * | getProtoInstanceParent () |
If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More... | |
void | setProtoInstanceParent (X3DPrototypeInstance *p) |
Set the X3DPrototypeInstance this node is the the root node if applicaple. | |
virtual string | defaultXMLContainerField () |
Returns the default xml containerField attribute value. More... | |
virtual Field * | getField (const string &_name) const |
return a pointer to the field specified by name within this instance | |
int | addDestructCallback (void(*func)(Node *, void *), void *args) |
Add a callback function to be run on destruction of node. More... | |
int | removeDestructCallback (void(*func)(Node *, void *), void *args) |
Add a callback function to be run on destruction of node. More... | |
![]() | |
H3DBoundedObject (Inst< SFBound > _bound=0) | |
Constructor. | |
![]() | |
H3DDisplayListObject (Inst< DisplayList > _displayList=0) | |
Constructor. | |
Public Attributes | |
H3DUniquePtr< SFBool > | hapticsOn |
The hapticsOn field specifies if nodes in the children field of this group should be rendered haptically or not. More... | |
H3DUniquePtr< SFBool > | graphicsOn |
The graphicsOn field specifies if nodes in the children field of this group should be rendered graphically or not. More... | |
H3DUniquePtr< MFBool > | hapticsOnDevice |
The hapticsOnDevice field specifies, per device, if nodes in the children field of this group should be rendered haptically for that device or not. More... | |
H3DUniquePtr< SFBool > | traverseOn |
If set to false the children nodes of this node will not be traversed at all. More... | |
![]() | |
bool | use_union_bound |
if true a route will be set up between the bound field of the nodes in children and the bound field of the grouping node. More... | |
H3DUniquePtr< AddChildren > | addChildren |
The addChildren event appends nodes to the children field of a grouping node. More... | |
H3DUniquePtr< RemoveChildren > | removeChildren |
The removeChildren event removes nodes from the children field of the grouping node . More... | |
H3DUniquePtr< MFChild > | children |
The nodes that are grouped together by this node. More... | |
![]() | |
H3DUniquePtr< SFNode > | metadata |
Meta data about the node. More... | |
![]() | |
H3DUniquePtr< SFVec3f > | bboxCenter |
Specifies a the center of an axis-aligned bounding box enclosing the node. More... | |
H3DUniquePtr< SFVec3f > | bboxSize |
Specifies a the size of an axis-aligned bounding box enclosing the node. More... | |
![]() | |
H3DUniquePtr< SFBound > | bound |
The field containing the bound object. More... | |
![]() | |
H3DUniquePtr< DisplayList > | displayList |
The DisplayList instance handling the OpenGL caching of this object. | |
Static Public Attributes | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
Additional Inherited Members | |
![]() | |
typedef std::map< Node *, Node * > | DeepCopyMap |
A map type used during a deep copy clone() to map from original nodes to cloned nodes. | |
![]() | |
static unsigned int | nrNodesAlive () |
Returns the nr of nodes currently alive, i.e. nodes created but not destructed. | |
static int | nrNodesCreated () |
Returns the number of nodes created in total since the start of the program. | |
![]() | |
void | cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for the clone() method. More... | |
![]() | |
static Node * | getClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for nodes that implement clone() More... | |
![]() | |
bool | children_multi_pass_transparency |
Will be set in traverseSG to indicate if any of the children enables multi-pass transparency. More... | |
vector< H3DRenderStateObject * > | render_states |
A vector of all the H3DRenderStatesObject within this X3DGroupingNode. | |
vector< ClipPlane * > | clip_planes |
A vector of only ClipPlane children of this X3DGroupingNode. | |
The ToggleGroup node enables you to enable/disable haptics and graphics rendering of its children nodes.
The hapticsOn field specifies if nodes in the children field of this group should be rendered haptically or not. The field is ignored if the hapticsOnDevice is non-empty.
The hapticsOnDevice field specifies, per device, if nodes in the children field of this group should be rendered haptically for that device or not. If more devices are used than the number of values in hapticsEnabled the last value of hapticsEnabled will be used for all devices with an index bigger than available values. If hapticsOnDevice is empty the hapticsOn field is used to control haptics for all devices.
The graphicsOn field specifies if nodes in the children field of this group should be rendered graphically or not.
Examples:
|
virtual |
Find closest point on Node to p.
Calls lineIntersect for its children only if graphicsOn is true. A setting in the parameter result can override this default behaviour.
p | The point to find the closest point to. |
result | A struct containing various results of closest points such as which geometries the closest points where detected on. |
Reimplemented from H3D::X3DGroupingNode.
References H3D::X3DGroupingNode::closestPoint(), H3D::Node::NodeIntersectResult::collide_invisible, and graphicsOn.
|
virtual |
Detect intersection between a line segment and the Node.
Calls lineIntersect for its children only if graphicsOn is true. A setting in the parameter result can override this default behaviour.
from | The start of the line segment. |
to | The end of the line segment. |
result | Contains info about the closest intersection for every object that intersects the line. |
Reimplemented from H3D::X3DGroupingNode.
References H3D::Node::NodeIntersectResult::collide_invisible, graphicsOn, and H3D::X3DGroupingNode::lineIntersect().
|
virtual |
Detect collision between a moving sphere and the Node.
Only nodes to which collision is possible will return true Calls movingSphereIntersect for its children only if graphicsOn is true. A setting in the parameter result can override this default behaviour.
radius | The radius of the sphere |
from | The start position of the sphere |
to | The end position of the sphere. |
result | A struct containing various results of intersections such as which geometries intersected the moving sphere. |
Reimplemented from H3D::X3DGroupingNode.
References H3D::Node::NodeIntersectResult::collide_invisible, graphicsOn, and H3D::X3DGroupingNode::movingSphereIntersect().
H3DUniquePtr< SFBool > H3D::ToggleGroup::graphicsOn |
The graphicsOn field specifies if nodes in the children field of this group should be rendered graphically or not.
Default value: TRUE /n Access type: inputOutput
Referenced by closestPoint(), lineIntersect(), movingSphereIntersect(), render(), ToggleGroup(), and traverseSG().
H3DUniquePtr< SFBool > H3D::ToggleGroup::hapticsOn |
The hapticsOn field specifies if nodes in the children field of this group should be rendered haptically or not.
A value of TRUE indicates that children will be rendered for all haptics devices for which the hapticsEnabled field specifies TRUE. By default all devices. If FALSE haptics will be disabled for all devices. The hapticsOn field is ignored if the hapticsOnDevice field is non-empty.
Default value: TRUE /n Access type: inputOutput
Referenced by ToggleGroup(), and traverseSG().
H3DUniquePtr< MFBool > H3D::ToggleGroup::hapticsOnDevice |
The hapticsOnDevice field specifies, per device, if nodes in the children field of this group should be rendered haptically for that device or not.
If more devices are used than the number of values in hapticsEnabled the last value of hapticsEnabled will be used for all devices with an index bigger than available values.
If hapticsOnDevice is empty the hapticsOn field is used to control haptics for all devices.
Access type: inputOutput
Referenced by traverseSG().
H3DUniquePtr< SFBool > H3D::ToggleGroup::traverseOn |
If set to false the children nodes of this node will not be traversed at all.
Access type: inputOutput
Default value: true
Referenced by ToggleGroup(), and traverseSG().