Main Page | Class List | Class Members

osgchips::ChipBank Class Reference

Container of one chip mesh and multiple osgchips::ChipBank::Chip instances defining chip types. More...

List of all members.

Public Member Functions

ChipgetChip (unsigned int value)
ChipgetChip (const std::string &name)
bool unserialize (struct _xmlDoc *doc, osgDB::Registry *registry)
bool unserialize (const std::string &fileName, osgDB::Registry *registry)

Static Public Member Functions

ChipBankinstance ()


Detailed Description

Container of one chip mesh and multiple osgchips::ChipBank::Chip instances defining chip types.

Repository of osgchips::ChipBank::Chip objects that define the type of chip displayed by a given osgchips::Stack instance. osgchips::ChipBank is designed to have a single instance which is created and filled by reading a osgchips XML element (either from a file or from an in-memory XML document).

A chip is defined by


Member Function Documentation

Chip* osgchips::ChipBank::getChip const std::string &  name  )  [inline]
 

Return the chip whose symbolic name equals value.

Parameters:
name symbolic name, as defined by the /osgchips/chip@name attribute.
Returns:
an osgchip::ChipBank::Chip pointer or NULL if no existing chip matches the name.

Chip* osgchips::ChipBank::getChip unsigned int  value  )  [inline]
 

Return the chip whose numerical value equals value.

Parameters:
value [0-N] numerical value, as defined by the /osgchips/chip@value attribute.
Returns:
an osgchip::ChipBank::Chip pointer or NULL if no existing chip matches the value.

ChipBank* osgchips::ChipBank::instance  )  [static]
 

Get the osgchips::ChipBank singleton. It is created if necessary.

Returns:
a pointer to the osgchips::ChipBank singleton.

bool osgchips::ChipBank::unserialize const std::string &  fileName,
osgDB::Registry *  registry
 

Parse the fileName and interpret any osgchips XML element to fill the osgchips::ChipBank singleton. The registry can be obtained by the osgDB::Registry::instance() static method.

See the other prototype for more information.

Parameters:
fileName path name to a valid XML document.
registry a pointer to the OpenSceneGraph registry
Returns:
true on success, false on error.

bool osgchips::ChipBank::unserialize struct _xmlDoc *  doc,
osgDB::Registry *  registry
 

Look for an osgchips XML element and fill the osgchips::ChipBank singleton. The registry can be obtained by the osgDB::Registry::instance() static method.

It is not mandatory for the XML document to contain an osgchips element. The XML document may contain more than one osgchips element. Each element will add content to the osgchips::ChipBank singleton.

Parameters:
doc a valid libxml2 pointer to the in-memory representation of an XML document.
registry a pointer to the OpenSceneGraph registry
Returns:
true on success, false on error.


The documentation for this class was generated from the following file:
Generated on Wed Dec 15 14:45:58 2004 for osgchips by  doxygen 1.3.9.1