dtCore::NodeCollector Class Reference

#include <nodecollector.h>

List of all members.

Public Types

typedef std::map< std::string,
dtCore::RefPtr< osg::Group > > 
GroupNodeMap
typedef std::map< std::string,
dtCore::RefPtr
< osgSim::DOFTransform > > 
TransformNodeMap
typedef std::map< std::string,
dtCore::RefPtr
< osg::MatrixTransform > > 
MatrixTransformNodeMap
typedef std::map< std::string,
dtCore::RefPtr< osg::Switch > > 
SwitchNodeMap
typedef std::map< std::string,
dtCore::RefPtr< osg::Geode > > 
GeodeNodeMap
typedef unsigned NodeFlag

Public Member Functions

 NodeCollector ()
 Blank Constructor that is defined to do nothing.
 NodeCollector (osg::Node *nodeToLoad, NodeCollector::NodeFlag mask, const std::string &nodeNameIgnored="")
 Constructor that when called will automatically generate the node maps or geode maps that you request.
void CollectNodes (osg::Node *NodeToLoad, NodeCollector::NodeFlag mask, const std::string &nodeNamesIgnored="")
 Function that when called will automatically generate the node maps or geode maps that you request.
void ClearAll ()
 Function that is defined to clear all the maps of their contents.
const osg::Group * GetGroup (const std::string &name) const
 Function that is used to request a CONST pointer to a Group Node.
const osgSim::DOFTransform * GetDOFTransform (const std::string &name) const
 Function that is used to request a CONST pointer to a DOFTransform Node.
const osg::MatrixTransform * GetMatrixTransform (const std::string &name) const
 Function that is used to request a CONST pointer to a MatrixTransform Node.
const osg::Switch * GetSwitch (const std::string &name) const
 Function that is used to request a CONST pointer to a Switch Node.
const osg::Geode * GetGeode (const std::string &name) const
 Function that is used to request a CONST pointer to a Geode Node.
osg::Group * GetGroup (const std::string &name)
 Function that is used to request a pointer to a Group Node.
osgSim::DOFTransform * GetDOFTransform (const std::string &name)
 Function that is used to request a pointer to a DOFTransform Node.
osg::MatrixTransform * GetMatrixTransform (const std::string &name)
 Function that is used to request a pointer to a MatrixTransform Node.
osg::Switch * GetSwitch (const std::string &name)
 Function that is used to request a pointer to a Switch Node.
osg::Geode * GetGeode (const std::string &name)
 Function that is used to request a CONST pointer to a Geode Node.
void AddGroup (const std::string &name, osg::Group &node)
 Function that is used to add a Group Node to the Group Node map.
void RemoveGroup (const std::string &name)
 Function that is used to remove a Group Node to the Group Node map.
void AddDOFTransform (const std::string &name, osgSim::DOFTransform &node)
 Function that is used to add a DOFTransform Node to the DOFTransform Node map.
void RemoveDOFTransform (const std::string &name)
 Function that is used to remove a DOF Transform Node to the DOF Transform Node map.
void AddMatrixTransform (const std::string &name, osg::MatrixTransform &node)
 Function that is used to add a MatrixTransform Node to the MatrixTransform Node map.
void RemoveMatrixTransform (const std::string &name)
 Function that is used to remove a Matrix Transform Node to the Matrix Transform Node map.
void AddSwitch (const std::string &name, osg::Switch &node)
 Function that is used to add a Switch Node to the Switch Node map.
void RemoveSwitch (const std::string &name)
 Function that is used to remove a Switch Node to the Switch Node map.
void AddGeode (const std::string &name, osg::Geode &node)
 Function that is used to add a Geode Node to the Geode Node map.
void RemoveGeode (const std::string &name)
 Function that is used to remove a Geode Node to the Geode Node map.
const NodeCollector::GroupNodeMapGetGroupNodeMap () const
 Function that returns a CONST Group map.
const
NodeCollector::TransformNodeMap
GetTransformNodeMap () const
 Function that returns a CONST Transform map.
const
NodeCollector::MatrixTransformNodeMap
GetMatrixTransformNodeMap () const
 Function that returns CONST a MatrixTransform map.
const
NodeCollector::SwitchNodeMap
GetSwitchNodeMap () const
 Function that returns a CONST Switch map.
const NodeCollector::GeodeNodeMapGetGeodeNodeMap () const
 Function that returns CONST a Geode map.
NodeCollector::GroupNodeMapGetGroupNodeMap ()
 Function that returns a Group map.
NodeCollector::TransformNodeMapGetTransformNodeMap ()
 Function that returns a Transform map.
NodeCollector::MatrixTransformNodeMapGetMatrixTransformNodeMap ()
 Function that returns a MatrixTransform map.
NodeCollector::SwitchNodeMapGetSwitchNodeMap ()
 Function that returns a Switch map.
NodeCollector::GeodeNodeMapGetGeodeNodeMap ()
 Function that returns a Geode map.

Static Public Attributes

static const NodeFlag GroupFlag = dtUtil::Bits::Add(0,1)
static const NodeFlag DOFTransformFlag = dtUtil::Bits::Add(0,2)
static const NodeFlag MatrixTransformFlag = dtUtil::Bits::Add(0,4)
static const NodeFlag SwitchFlag = dtUtil::Bits::Add(0,8)
static const NodeFlag GeodeFlag = dtUtil::Bits::Add(0,16)
static const NodeFlag AllNodeTypes

Protected Member Functions

virtual ~NodeCollector ()
 Destructor.


Member Typedef Documentation

typedef std::map<std::string, dtCore::RefPtr <osg::Group> > dtCore::NodeCollector::GroupNodeMap

typedef std::map<std::string, dtCore::RefPtr <osgSim::DOFTransform> > dtCore::NodeCollector::TransformNodeMap

typedef std::map<std::string, dtCore::RefPtr <osg::MatrixTransform> > dtCore::NodeCollector::MatrixTransformNodeMap

typedef std::map<std::string, dtCore::RefPtr<osg::Switch> > dtCore::NodeCollector::SwitchNodeMap

typedef std::map<std::string, dtCore::RefPtr<osg::Geode> > dtCore::NodeCollector::GeodeNodeMap

typedef unsigned dtCore::NodeCollector::NodeFlag


Constructor & Destructor Documentation

dtCore::NodeCollector::NodeCollector (  ) 

Blank Constructor that is defined to do nothing.

Note:
If this is used then you must call use the CollectNodes function in order to generate any maps with this class.

dtCore::NodeCollector::NodeCollector ( osg::Node *  nodeToLoad,
NodeCollector::NodeFlag  mask,
const std::string &  nodeNameIgnored = "" 
)

Constructor that when called will automatically generate the node maps or geode maps that you request.

Parameters:
nodeToLoad The starting node who's children you wish to traverse.
mask The different types of nodes you want to collect off of the loaded node.
nodeNameIgnored The name of a node that you do not want to collect.

dtCore::NodeCollector::~NodeCollector (  )  [protected, virtual]

Destructor.


Member Function Documentation

void dtCore::NodeCollector::CollectNodes ( osg::Node *  NodeToLoad,
NodeCollector::NodeFlag  mask,
const std::string &  nodeNamesIgnored = "" 
)

Function that when called will automatically generate the node maps or geode maps that you request.

Parameters:
nodeToLoad The starting node who's children you wish to traverse.
mask The different types of nodes you want to collect off of the loaded node.
nodeNameIgnored The name of a node that you do not want to collect.
Note:
This function was originally intended to be used in conjunction with the blank constructor or after a call of the ClearAllNodes function

void dtCore::NodeCollector::ClearAll (  ) 

Function that is defined to clear all the maps of their contents.

const osg::Group * dtCore::NodeCollector::GetGroup ( const std::string &  name  )  const

Function that is used to request a CONST pointer to a Group Node.

Parameters:
name A String that represents the name of the node you are looking for
Returns:
A CONST pointer to the node you were looking for or NULL if the node was not found

const osgSim::DOFTransform * dtCore::NodeCollector::GetDOFTransform ( const std::string &  name  )  const

Function that is used to request a CONST pointer to a DOFTransform Node.

Parameters:
name A String that represents the name of the node you are looking for
Returns:
A CONST pointer to the node you were looking for or NULL if the node was not found

const osg::MatrixTransform * dtCore::NodeCollector::GetMatrixTransform ( const std::string &  name  )  const

Function that is used to request a CONST pointer to a MatrixTransform Node.

Parameters:
name A String that represents the name of the node you are looking for
Returns:
A CONST pointer to the node you were looking for or NULL if the node was not found

const osg::Switch * dtCore::NodeCollector::GetSwitch ( const std::string &  name  )  const

Function that is used to request a CONST pointer to a Switch Node.

Parameters:
name A String that represents the name of the node you are looking for
Returns:
A CONST pointer to the node you were looking for or NULL if the node was not found

const osg::Geode * dtCore::NodeCollector::GetGeode ( const std::string &  name  )  const

Function that is used to request a CONST pointer to a Geode Node.

Parameters:
name A String that represents the name of the node you are looking for
Returns:
A CONST pointer to the node you were looking for or NULL if the node was not found

osg::Group * dtCore::NodeCollector::GetGroup ( const std::string &  name  ) 

Function that is used to request a pointer to a Group Node.

Parameters:
name A String that represents the name of the node you are looking for
Returns:
A pointer to the node you were looking for or NULL if the node was not found

osgSim::DOFTransform * dtCore::NodeCollector::GetDOFTransform ( const std::string &  name  ) 

Function that is used to request a pointer to a DOFTransform Node.

Parameters:
name A String that represents the name of the node you are looking for
Returns:
A pointer to the node you were looking for or NULL if the node was not found

osg::MatrixTransform * dtCore::NodeCollector::GetMatrixTransform ( const std::string &  name  ) 

Function that is used to request a pointer to a MatrixTransform Node.

Parameters:
name A String that represents the name of the node you are looking for
Returns:
A pointer to the node you were looking for or NULL if the node was not found

osg::Switch * dtCore::NodeCollector::GetSwitch ( const std::string &  name  ) 

Function that is used to request a pointer to a Switch Node.

Parameters:
name A String that represents the name of the node you are looking for
Returns:
A pointer to the node you were looking for or NULL if the node was not found

osg::Geode * dtCore::NodeCollector::GetGeode ( const std::string &  name  ) 

Function that is used to request a CONST pointer to a Geode Node.

Parameters:
name A String that represents the name of the node you are looking for
Returns:
A CONST pointer to the node you were looking for or NULL if the node was not found

void dtCore::NodeCollector::AddGroup ( const std::string &  name,
osg::Group &  node 
)

Function that is used to add a Group Node to the Group Node map.

Parameters:
name A String that represents the name of the Node
node The Group Node that you wish to add to the map

void dtCore::NodeCollector::RemoveGroup ( const std::string &  name  ) 

Function that is used to remove a Group Node to the Group Node map.

Parameters:
name A String that represents the name of the Node

void dtCore::NodeCollector::AddDOFTransform ( const std::string &  name,
osgSim::DOFTransform &  node 
)

Function that is used to add a DOFTransform Node to the DOFTransform Node map.

Parameters:
name A String that represents the name of the Node
node The DOFTransform Node that you wish to add to the map

void dtCore::NodeCollector::RemoveDOFTransform ( const std::string &  name  ) 

Function that is used to remove a DOF Transform Node to the DOF Transform Node map.

Parameters:
name A String that represents the name of the Node

void dtCore::NodeCollector::AddMatrixTransform ( const std::string &  name,
osg::MatrixTransform &  node 
)

Function that is used to add a MatrixTransform Node to the MatrixTransform Node map.

Parameters:
name A String that represents the name of the Node
node The MatrixTransform Node that you wish to add to the map

void dtCore::NodeCollector::RemoveMatrixTransform ( const std::string &  name  ) 

Function that is used to remove a Matrix Transform Node to the Matrix Transform Node map.

Parameters:
name A String that represents the name of the Node

void dtCore::NodeCollector::AddSwitch ( const std::string &  name,
osg::Switch &  node 
)

Function that is used to add a Switch Node to the Switch Node map.

Parameters:
name A String that represents the name of the Node
node The Switch Node that you wish to add to the map

void dtCore::NodeCollector::RemoveSwitch ( const std::string &  name  ) 

Function that is used to remove a Switch Node to the Switch Node map.

Parameters:
name A String that represents the name of the Node

void dtCore::NodeCollector::AddGeode ( const std::string &  name,
osg::Geode &  node 
)

Function that is used to add a Geode Node to the Geode Node map.

Parameters:
name A String that represents the name of the Node
node The Geode Node that you wish to add to the map

void dtCore::NodeCollector::RemoveGeode ( const std::string &  name  ) 

Function that is used to remove a Geode Node to the Geode Node map.

Parameters:
name A String that represents the name of the Node

const NodeCollector::GroupNodeMap & dtCore::NodeCollector::GetGroupNodeMap (  )  const

Function that returns a CONST Group map.

Returns:
A map with the names of Group Nodes and osg Group Nodes

const NodeCollector::TransformNodeMap & dtCore::NodeCollector::GetTransformNodeMap (  )  const

Function that returns a CONST Transform map.

Returns:
A map with the names of Transform Nodes and osg Transform Nodes

const NodeCollector::MatrixTransformNodeMap & dtCore::NodeCollector::GetMatrixTransformNodeMap (  )  const

Function that returns CONST a MatrixTransform map.

Returns:
A map with the names of MatrixTransform Nodes and osg MatrixTransform Nodes

const NodeCollector::SwitchNodeMap & dtCore::NodeCollector::GetSwitchNodeMap (  )  const

Function that returns a CONST Switch map.

Returns:
A map with the names of Switch Nodes and osg Switch Nodes

const NodeCollector::GeodeNodeMap & dtCore::NodeCollector::GetGeodeNodeMap (  )  const

Function that returns CONST a Geode map.

Returns:
A map with the names of Geode Nodes and osg Geode Nodes

NodeCollector::GroupNodeMap & dtCore::NodeCollector::GetGroupNodeMap (  ) 

Function that returns a Group map.

Returns:
A map with the names of Group Nodes and osg Group Nodes

NodeCollector::TransformNodeMap & dtCore::NodeCollector::GetTransformNodeMap (  ) 

Function that returns a Transform map.

Returns:
A map with the names of Transform Nodes and osg Transform Nodesa

NodeCollector::MatrixTransformNodeMap & dtCore::NodeCollector::GetMatrixTransformNodeMap (  ) 

Function that returns a MatrixTransform map.

Returns:
A map with the names of MatrixTransform Nodes and osg MatrixTransform Nodes

NodeCollector::SwitchNodeMap & dtCore::NodeCollector::GetSwitchNodeMap (  ) 

Function that returns a Switch map.

Returns:
A map with the names of Switch Nodes and osg Switch Nodes

NodeCollector::GeodeNodeMap & dtCore::NodeCollector::GetGeodeNodeMap (  ) 

Function that returns a Geode map.

Returns:
A map with the names of Geode Nodes and osg Geode Nodes


Member Data Documentation

const NodeCollector::NodeFlag dtCore::NodeCollector::GroupFlag = dtUtil::Bits::Add(0,1) [static]

const NodeCollector::NodeFlag dtCore::NodeCollector::DOFTransformFlag = dtUtil::Bits::Add(0,2) [static]

const NodeCollector::NodeFlag dtCore::NodeCollector::MatrixTransformFlag = dtUtil::Bits::Add(0,4) [static]

const NodeCollector::NodeFlag dtCore::NodeCollector::SwitchFlag = dtUtil::Bits::Add(0,8) [static]

const NodeCollector::NodeFlag dtCore::NodeCollector::GeodeFlag = dtUtil::Bits::Add(0,16) [static]

const NodeCollector::NodeFlag dtCore::NodeCollector::AllNodeTypes [static]

Initial value:


http://www.delta3d.org
2.0.0 generated 14 Feb 2008