VR-Forces 4.0.4 Class Documentation
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Attributes | Friends
makVrv::DtVisualizerDefinition Class Reference

A definition of a visualizer. More...

List of all members.

Public Types

typedef std::map< std::string,
DtVisualizerAttribute * > 
SortedAttributeMap
 A map of sorted visualizer attributes.

Public Member Functions

const std::string & schemaName () const
 Get the schema name the visualizer definition was created for.
int numberOfAttributes () const
 Get the number of attributes.
DtVisualizerAttributefindAttribute (int index)
 Find an attribute by index.
void getAttributes (SortedAttributeMap &map) const
 Get all the attributes for this definition, filling them into a single map.
DtVisualizerAttributefindAttribute (const std::string &name)
 Find an attribute by name.
const DtVisualizerAttributefindAttribute (const std::string &name) const
 Find an attribute by name.
DtVisualizerAttributefindOrCreateLocalAttribute (const std::string &name)
 Find an attribute by name, If this attribute exists and it local it is returned.
void setAttribute (const std::string &name, std::auto_ptr< DtVisualizerAttribute > attribute)
 At an attribute by name. If the attribute does not already.
void removeAttribute (const std::string &name, bool localOnly)
 Remove an attribute, if localOnly, then it will only remove the attribute if it is local to this definition.
bool attributeLocal (const std::string &name) const
 Check if an attributes value is local to this definition.
bool attributeInherited (const std::string &name) const
 Check if an attributes value is inherited.
bool attributeOverridden (const std::string &name) const
 Check if an attribute value is overriding another value.
DtVisualizerDefinitionfindParent ()
 Find the parent definition which this definition inherits from.
const DtVisualizerDefinitionfindParent () const
 Find the parent definition which this definition inherits from.
unsigned int numberOfChildren () const
 Get the number of child definitions which inherit from this definition.
DtVisualizerDefinitionfindChild (unsigned int index)
 Find a child definition by index.
const DtVisualizerDefinitionfindChild (unsigned int index) const
 Find a child definition by index.
int findChildIndex (const DtVisualizerDefinition *child) const
 Get the index of a child definition.

Protected Member Functions

 DtVisualizerDefinition (const std::string &schemaName)
 Create a top level definition.
 DtVisualizerDefinition (const std::string &schemaName, DtVisualizerDefinition *parent)
 Create an inherited definition.
DtVisualizerDefinitionclone (DtVisualizerDefinition *parent) const
 Create a clone of this visualizer definition with a new parent.
 ~DtVisualizerDefinition ()
 Delete a definition.
void setParent (DtVisualizerDefinition *parent)
 Called internally to change the parent.
void addChild (DtVisualizerDefinition *)
 Called internally to add a child.
void removeChild (DtVisualizerDefinition *)
 Called internally to remove a child.

Private Types

typedef boost::unordered_map
< std::string,
DtVisualizerAttribute * > 
AttributeMap
typedef std::vector
< DtVisualizerDefinition * > 
DefinitionList

Private Attributes

DtVisualizerDefinitionmyParent
DefinitionList myChildren
std::string mySchemaName
AttributeMap myAttributes

Friends

class DtVisualizerDefinitionSet
 Use the DtVisualizerDefinitionSet interface to create and destroy visualizer definitions.

Detailed Description

A definition of a visualizer.

Visualizer definition are always members of a visualizer definition set, and are create and destroyed using the DtVisualizerDefinitionSet functions.


Member Typedef Documentation

A map of sorted visualizer attributes.

typedef boost::unordered_map<std::string,DtVisualizerAttribute*> makVrv::DtVisualizerDefinition::AttributeMap [private]

Constructor & Destructor Documentation

makVrv::DtVisualizerDefinition::DtVisualizerDefinition ( const std::string &  schemaName) [protected]

Create a top level definition.

makVrv::DtVisualizerDefinition::DtVisualizerDefinition ( const std::string &  schemaName,
DtVisualizerDefinition parent 
) [protected]

Create an inherited definition.

Delete a definition.


Member Function Documentation

const std::string& makVrv::DtVisualizerDefinition::schemaName ( ) const

Get the schema name the visualizer definition was created for.

Get the number of attributes.

This includes inherited attributes.

Warning:
This function can be very slow.

Find an attribute by index.

This attribute may be from an inherited definition. This index may not be constant if attributes are added or removed. This attribute should not be deleted and may be invalid if any other call on a definition is made.

Warning:
This function can be very slow.
Returns:
0 if there is no attribute at that index.

Get all the attributes for this definition, filling them into a single map.

The intent of this map is for quicker iteration over all attributes.

Warning:
The contents of this map may be come invalid if attributes are added or removed from visualizer definitions. Do NOT cache contents

Find an attribute by name.

This attribute may be from an inherited definition.

Returns:
an instance of the attribute. This attribute should not be deleted and may be invalid if any other call on a definition is made.
0 if there is no attribute with the name.
const DtVisualizerAttribute* makVrv::DtVisualizerDefinition::findAttribute ( const std::string &  name) const

Find an attribute by name.

This attribute may be from an inherited definition.

Returns:
an instance of the attribute. This attribute should not be deleted and may be invalid if any other call on a definition is made.
0 if there is no attribute with the name.

Find an attribute by name, If this attribute exists and it local it is returned.

If the attribute is found and it is inherited a local copy will be created. If the attribute is not found

Returns:
0 if the attribute is not found with the name.
void makVrv::DtVisualizerDefinition::setAttribute ( const std::string &  name,
std::auto_ptr< DtVisualizerAttribute attribute 
)

At an attribute by name. If the attribute does not already.

void makVrv::DtVisualizerDefinition::removeAttribute ( const std::string &  name,
bool  localOnly 
)

Remove an attribute, if localOnly, then it will only remove the attribute if it is local to this definition.

bool makVrv::DtVisualizerDefinition::attributeLocal ( const std::string &  name) const

Check if an attributes value is local to this definition.

Returns:
true if the attribute exists in this definition.
false if the attribute does not exist, or is defined in a parent definition.
bool makVrv::DtVisualizerDefinition::attributeInherited ( const std::string &  name) const

Check if an attributes value is inherited.

Returns:
true if the attribute exists in a parent definition.
false if the attribute does not exist, or is defined in this instance.
bool makVrv::DtVisualizerDefinition::attributeOverridden ( const std::string &  name) const

Check if an attribute value is overriding another value.

Returns:
true if the attribute exists in this definition and overrides an attribute in one of the parent definitions.
false if the attribute does not exist, or is inherited.

Find the parent definition which this definition inherits from.

Returns:
0 if there is not parent.

Find the parent definition which this definition inherits from.

Returns:
0 if there is not parent.

Get the number of child definitions which inherit from this definition.

Find a child definition by index.

Returns:
0 if there is no child at that index.

Find a child definition by index.

Returns:
0 if there is no child at that index.

Get the index of a child definition.

The index of the child may change if any children are removed.

Returns:
-1 if the definition passed in is not a child.

Create a clone of this visualizer definition with a new parent.

Called internally to change the parent.

Called internally to add a child.

Called internally to remove a child.


Friends And Related Function Documentation

friend class DtVisualizerDefinitionSet [friend]

Use the DtVisualizerDefinitionSet interface to create and destroy visualizer definitions.


Member Data Documentation


The documentation for this class was generated from the following file:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)