dtCore::StateAttributeCollector Class Reference

#include <stateattributecollector.h>

List of all members.

Public Types

typedef std::map< std::string,
dtCore::RefPtr< osg::Material > > 
MaterialNodeMap
typedef std::map< std::string,
dtCore::RefPtr< osg::Program > > 
ProgramNodeMap
typedef std::map< std::string,
dtCore::RefPtr< osg::Texture > > 
TextureNodeMap
typedef unsigned StateAttribFlag

Public Member Functions

 StateAttributeCollector ()
 Blank Constructor that is defined to do nothing.
 StateAttributeCollector (osg::Node *nodeToLoad, StateAttributeCollector::StateAttribFlag mask, const std::string &nodeNameIgnored="")
 Constructor that when called will automatically generate the state attribute maps that you request.
void CollectStateAttributes (osg::Node *nodeToLoad, StateAttributeCollector::StateAttribFlag mask, const std::string &nodeNameIgnored="")
 Function that when called will automatically generate the state attribute maps that you request.
void ClearAll ()
 Function that is defined to clear all the maps of their contents.
const osg::Material * GetMaterial (const std::string &name) const
 Function that is used to request a CONST pointer to a Materials State Attribute.
const osg::Program * GetProgram (const std::string &name) const
 Function that is used to request a CONST pointer to a Program State Attribute.
const osg::Texture * GetTexture (const std::string &name) const
 Function that is used to request a CONST pointer to a Texture State Attribute.
osg::Material * GetMaterial (const std::string &name)
 Function that is used to request a pointer to a Materials State Attribute.
osg::Program * GetProgram (const std::string &name)
 Function that is used to request a pointer to a Program State Attribute.
osg::Texture * GetTexture (const std::string &name)
 Function that is used to request a pointer to a Texture State Attribute.
void AddMaterial (const std::string &name, osg::Material &materialObject)
 Function that is used to add a Material StateAttribute to the Material map.
void AddProgram (const std::string &name, osg::Program &programObject)
 Function that is used to add a Program StateAttribute to the Program map.
void AddTexture (const std::string &name, osg::Texture &textureObject)
 Function that is used to add a Texture StateAttribute to the Texture map.
const
StateAttributeCollector::MaterialNodeMap
GetMaterialMap () const
 Function that returns a CONST map populated with Material StateAttributes.
const
StateAttributeCollector::ProgramNodeMap
GetProgramMap () const
 Function that returns a CONST map populated with Program StateAttributes.
const
StateAttributeCollector::TextureNodeMap
GetTextureMap () const
 Function that returns a CONST map populated with Texture StateAttributes.
StateAttributeCollector::MaterialNodeMapGetMaterialMap ()
 Function that returns a map populated with Material StateAttributes.
StateAttributeCollector::ProgramNodeMapGetProgramMap ()
 Function that returns a map populated with Program StateAttributes.
StateAttributeCollector::TextureNodeMapGetTextureMap ()
 Function that returns a map populated with Texture StateAttributes.

Static Public Attributes

static const StateAttribFlag MaterialFlag = dtUtil::Bits::Add(0,1)
static const StateAttribFlag ProgramFlag = dtUtil::Bits::Add(0,2)
static const StateAttribFlag TextureFlag = dtUtil::Bits::Add(0,4)
static const StateAttribFlag AllAttributes

Protected Member Functions

virtual ~StateAttributeCollector ()
 Destructor.


Member Typedef Documentation

typedef std::map<std::string, dtCore::RefPtr<osg::Material> > dtCore::StateAttributeCollector::MaterialNodeMap

typedef std::map<std::string, dtCore::RefPtr<osg::Program> > dtCore::StateAttributeCollector::ProgramNodeMap

typedef std::map<std::string, dtCore::RefPtr<osg::Texture> > dtCore::StateAttributeCollector::TextureNodeMap

typedef unsigned dtCore::StateAttributeCollector::StateAttribFlag


Constructor & Destructor Documentation

dtCore::StateAttributeCollector::StateAttributeCollector (  ) 

Blank Constructor that is defined to do nothing.

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

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

Constructor that when called will automatically generate the state attribute maps that you request.

Parameters:
nodeToLoad The starting node who's state attributes you would like to explore.
mask The different types of state attributes you want to collect off of the loaded node.
nodeNameIgnored The name of a state attribute that you do not want to collect.

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

Destructor.


Member Function Documentation

void dtCore::StateAttributeCollector::CollectStateAttributes ( osg::Node *  nodeToLoad,
StateAttributeCollector::StateAttribFlag  mask,
const std::string &  nodeNameIgnored = "" 
)

Function that when called will automatically generate the state attribute maps that you request.

Parameters:
nodeToLoad The starting node who's state attributes you would like to explore.
mask The different types of state attributes you want to collect off of the loaded node.
nodeNameIgnored The name of a state attribute 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 ClearAllMaps function

void dtCore::StateAttributeCollector::ClearAll (  ) 

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

const osg::Material * dtCore::StateAttributeCollector::GetMaterial ( const std::string &  name  )  const

Function that is used to request a CONST pointer to a Materials State Attribute.

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

const osg::Program * dtCore::StateAttributeCollector::GetProgram ( const std::string &  name  )  const

Function that is used to request a CONST pointer to a Program State Attribute.

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

const osg::Texture * dtCore::StateAttributeCollector::GetTexture ( const std::string &  name  )  const

Function that is used to request a CONST pointer to a Texture State Attribute.

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

osg::Material * dtCore::StateAttributeCollector::GetMaterial ( const std::string &  name  ) 

Function that is used to request a pointer to a Materials State Attribute.

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

osg::Program * dtCore::StateAttributeCollector::GetProgram ( const std::string &  name  ) 

Function that is used to request a pointer to a Program State Attribute.

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

osg::Texture * dtCore::StateAttributeCollector::GetTexture ( const std::string &  name  ) 

Function that is used to request a pointer to a Texture State Attribute.

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

void dtCore::StateAttributeCollector::AddMaterial ( const std::string &  name,
osg::Material &  materialObject 
)

Function that is used to add a Material StateAttribute to the Material map.

Parameters:
name A String that represents the name of the StateAttribute
materialObject The Material StateAttribute that you wish to add to the map

void dtCore::StateAttributeCollector::AddProgram ( const std::string &  name,
osg::Program &  programObject 
)

Function that is used to add a Program StateAttribute to the Program map.

Parameters:
name A String that represents the name of the StateAttribute
materialObject The Program StateAttribute that you wish to add to the map

void dtCore::StateAttributeCollector::AddTexture ( const std::string &  name,
osg::Texture &  textureObject 
)

Function that is used to add a Texture StateAttribute to the Texture map.

Parameters:
name A String that represents the name of the StateAttribute
materialObject The Texture StateAttribute that you wish to add to the map

const StateAttributeCollector::MaterialNodeMap & dtCore::StateAttributeCollector::GetMaterialMap (  )  const

Function that returns a CONST map populated with Material StateAttributes.

Returns:
A CONST map with the names of Material StateAttributes and osg Material StateAttributes

const StateAttributeCollector::ProgramNodeMap & dtCore::StateAttributeCollector::GetProgramMap (  )  const

Function that returns a CONST map populated with Program StateAttributes.

Returns:
A CONST map with the names of Program StateAttributes and osg Program StateAttributes

const StateAttributeCollector::TextureNodeMap & dtCore::StateAttributeCollector::GetTextureMap (  )  const

Function that returns a CONST map populated with Texture StateAttributes.

Returns:
A CONST map with the names of Texture StateAttributes and osg Texture StateAttributes

StateAttributeCollector::MaterialNodeMap & dtCore::StateAttributeCollector::GetMaterialMap (  ) 

Function that returns a map populated with Material StateAttributes.

Returns:
A map with the names of Material StateAttributes and osg Material StateAttributes

StateAttributeCollector::ProgramNodeMap & dtCore::StateAttributeCollector::GetProgramMap (  ) 

Function that returns a map populated with Program StateAttributes.

Returns:
A map with the names of Program StateAttributes and osg Program StateAttributes

StateAttributeCollector::TextureNodeMap & dtCore::StateAttributeCollector::GetTextureMap (  ) 

Function that returns a map populated with Texture StateAttributes.

Returns:
A map with the names of Texture StateAttributes and osg Texture StateAttributes


Member Data Documentation

const StateAttributeCollector::StateAttribFlag dtCore::StateAttributeCollector::MaterialFlag = dtUtil::Bits::Add(0,1) [static]

const StateAttributeCollector::StateAttribFlag dtCore::StateAttributeCollector::ProgramFlag = dtUtil::Bits::Add(0,2) [static]

const StateAttributeCollector::StateAttribFlag dtCore::StateAttributeCollector::TextureFlag = dtUtil::Bits::Add(0,4) [static]

const StateAttributeCollector::StateAttribFlag dtCore::StateAttributeCollector::AllAttributes [static]

Initial value:


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