H3D::X3D::DEFNodes Class Reference

Provides a mapping between defined DEF names in X3D and the nodes they refer to. More...

#include <DEFNodes.h>

List of all members.

Public Types

typedef map< const string,
Node * >::const_iterator 
const_iterator

Public Member Functions

 ~DEFNodes ()
 Destructor. unrefs all the nodes in the map.
const_iterator begin ()
 Returns a const_iterator to the first element in the DEFNodes struct.
const_iterator end ()
 Returns a const_iterator to the end element in the DEFNodes struct.
void addNode (const string &def_name, Node *def_node)
 Adds a DEF name/Node * pair to the structure.
void removeNode (const string &def_name)
 Removes a DEF name/Node * pair from the structure.
void merge (DEFNodes *dn)
 Add the entries from another DEFNodes structure do this one.
void clear ()
 Removes all the entries in the map.
NodegetNode (const string &def_name)
 Get the node by its DEF name.
template<class NodeType>
void getNode (const string &def_name, NodeType *&return_node)
 Get the node by its DEF name.


Detailed Description

Provides a mapping between defined DEF names in X3D and the nodes they refer to.


Member Function Documentation

void H3D::X3D::DEFNodes::addNode const string &  def_name,
Node def_node
[inline]
 

Adds a DEF name/Node * pair to the structure.

Parameters:
def_name The DEF name of the node.
def_node The Node assiciated with the given DEF name.

template<class NodeType>
void H3D::X3D::DEFNodes::getNode const string &  def_name,
NodeType *&  return_node
[inline]
 

Get the node by its DEF name.

Parameters:
def_name The DEF name of the node as specified in the X3D input.
return_node This pointer ref will be set to the the Node with the given DEF name. NULL if no such node exists.
Exceptions:
InvalidNodeType Thrown when the DEF Node type is not a subclass of the type of return_node.

Node* H3D::X3D::DEFNodes::getNode const string &  def_name  )  [inline]
 

Get the node by its DEF name.

Parameters:
def_name The DEF name of the node as specified in the X3D input.
Returns:
The Node with the given DEF name. NULL if no such node exists.

void H3D::X3D::DEFNodes::merge DEFNodes dn  )  [inline]
 

Add the entries from another DEFNodes structure do this one.

If an entry already exists it will be replaced.

void H3D::X3D::DEFNodes::removeNode const string &  def_name  )  [inline]
 

Removes a DEF name/Node * pair from the structure.

Parameters:
def_name The DEF name to remove.


Generated on Thu Aug 24 12:40:35 2006 for H3D API by  doxygen 1.4.5