VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Attributes | Friends
makVrv::DtVisualizerDefinition Class Reference

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

Public Types

typedef std::map< std::string,
DtVisualizerAttribute * > 
SortedAttributeMap
 

Public Member Functions

bool isEqual (const DtVisualizerDefinition &) const
 
const std::string & schemaName () const
 
int numberOfAttributes () const
 
const DtVisualizerAttributefindAttribute (int index) const
 
void getAttributes (SortedAttributeMap &map) const
 
std::map< std::string,
DtVisualizerAttribute * > 
getAllAttributes ()
 
DtVisualizerAttributefindAttribute (const std::string &name)
 
const DtVisualizerAttributefindAttribute (const std::string &name) const
 
const DtVisualizerAttributefindAttributeLowercase (const std::string &name) const
 
DtVisualizerAttributefindOrCreateLocalAttribute (const std::string &name)
 
void setAttribute (const std::string &name, std::auto_ptr< DtVisualizerAttribute > attribute)
 
void removeAttribute (const std::string &name, bool localOnly)
 
bool attributeLocal (const std::string &name) const
 
bool attributeInherited (const std::string &name) const
 
bool attributeInheritedLowercase (const std::string &name) const
 
bool attributeOverridden (const std::string &name) const
 
bool attributeOverriddenLowercase (const std::string &name) const
 
DtVisualizerDefinitionfindParent ()
 
const DtVisualizerDefinitionfindParent () const
 
unsigned int numberOfChildren () const
 
DtVisualizerDefinitionfindChild (unsigned int index)
 
const DtVisualizerDefinitionfindChild (unsigned int index) const
 
int findChildIndex (const DtVisualizerDefinition *child) const
 

Static Public Member Functions

static DtVector toVector (const std::string &param)
 
static DtTaitBryan toTaitBryan (const std::string &param)
 

Protected Member Functions

 DtVisualizerDefinition (const std::string &schemaName)
 
 DtVisualizerDefinition (const std::string &schemaName, DtVisualizerDefinition *parent)
 
DtVisualizerDefinitionclone (DtVisualizerDefinition *parent) const
 
 ~DtVisualizerDefinition ()
 
void setParent (DtVisualizerDefinition *parent)
 
void addChild (DtVisualizerDefinition *)
 
void removeChild (DtVisualizerDefinition *)
 

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
 

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

bool makVrv::DtVisualizerDefinition::isEqual ( const DtVisualizerDefinition ) const

check if two visualizer definitions are equal we don't comapre the parent or children

Returns
true is those two element Definitions are identical
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.
const DtVisualizerAttribute* makVrv::DtVisualizerDefinition::findAttribute ( int  index) const

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
std::map<std::string, DtVisualizerAttribute*> makVrv::DtVisualizerDefinition::getAllAttributes ( )

Returns all attributes of the current Visual Definition.

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

Find an attribute by name without converting to lowercase (assume string is already lowercase) 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::attributeInheritedLowercase ( const std::string &  name) const

Check if an attributes value is inherited assuming name is already lowercase.

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.
bool makVrv::DtVisualizerDefinition::attributeOverriddenLowercase ( const std::string &  name) const

Check if an attribute value is overriding another value but assume name is already lowercase.

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.
static DtVector makVrv::DtVisualizerDefinition::toVector ( const std::string &  param)
static

Convert a visualizer definition vector string parameter (e.g. "0.1,0.2,0.3") to a DtVector.

static DtTaitBryan makVrv::DtVisualizerDefinition::toTaitBryan ( const std::string &  param)
static

Convert a visualizer definition tait bryan string parameter (e.g. "0.1,0.2,0.3") to a DtTaitBryan.

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 Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)