VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Attributes | Friends
makVrv::DtVisualizerDefinition Class Reference

A definition of a visualizer. More...

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 std::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.

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.

makVrv::DtVisualizerDefinition::~DtVisualizerDefinition ( )
protected

Delete a definition.

Member Function Documentation

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

Get the schema name the visualizer definition was created for.

int makVrv::DtVisualizerDefinition::numberOfAttributes ( ) const

Get the number of attributes.

This includes inherited attributes.

Warning
This function can be very slow.
DtVisualizerAttribute* makVrv::DtVisualizerDefinition::findAttribute ( int  index)

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.
void makVrv::DtVisualizerDefinition::getAttributes ( SortedAttributeMap map) const

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
DtVisualizerAttribute* makVrv::DtVisualizerDefinition::findAttribute ( const std::string &  name)

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.
DtVisualizerAttribute* makVrv::DtVisualizerDefinition::findOrCreateLocalAttribute ( const std::string &  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.
DtVisualizerDefinition* makVrv::DtVisualizerDefinition::findParent ( )

Find the parent definition which this definition inherits from.

Returns
0 if there is not parent.
const DtVisualizerDefinition* makVrv::DtVisualizerDefinition::findParent ( ) const

Find the parent definition which this definition inherits from.

Returns
0 if there is not parent.
unsigned int makVrv::DtVisualizerDefinition::numberOfChildren ( ) const

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

DtVisualizerDefinition* makVrv::DtVisualizerDefinition::findChild ( unsigned int  index)

Find a child definition by index.

Returns
0 if there is no child at that index.
const DtVisualizerDefinition* makVrv::DtVisualizerDefinition::findChild ( unsigned int  index) const

Find a child definition by index.

Returns
0 if there is no child at that index.
int makVrv::DtVisualizerDefinition::findChildIndex ( const DtVisualizerDefinition child) const

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.
DtVisualizerDefinition* makVrv::DtVisualizerDefinition::clone ( DtVisualizerDefinition parent) const
protected

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

void makVrv::DtVisualizerDefinition::setParent ( DtVisualizerDefinition parent)
protected

Called internally to change the parent.

void makVrv::DtVisualizerDefinition::addChild ( DtVisualizerDefinition )
protected

Called internally to add a child.

void makVrv::DtVisualizerDefinition::removeChild ( DtVisualizerDefinition )
protected

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

DtVisualizerDefinition* makVrv::DtVisualizerDefinition::myParent
private
DefinitionList makVrv::DtVisualizerDefinition::myChildren
private
std::string makVrv::DtVisualizerDefinition::mySchemaName
private
AttributeMap makVrv::DtVisualizerDefinition::myAttributes
private

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

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)