VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions
makVrv::DtDynamicTerrainChange Class Reference

Command which can be given to the dynamic terrain system to perform some change. More...

Inheritance diagram for makVrv::DtDynamicTerrainChange:
Inheritance graph
[legend]

Public Types

enum  TypeEnum {
  UnknownType, StringType, DoubleType, IntType,
  BoolType
}
 Enumeration representing the type of an attribute. More...

Public Member Functions

DtString print () const
 Print for debugging.
virtual ~DtDynamicTerrainChange ()
 Virtual destructor.
virtual DtDynamicTerrainChangeclone () const
 Create a clone of this object.
virtual const
DtDynamicTerrainGeometry
geometry () const =0
virtual unsigned int size () const =0
 Return the number of attributes (key/value pairs) in this dictionary.
virtual DtString key (unsigned int index=0) const =0
 Get the key of the nth key/value pair.
virtual TypeEnum type (unsigned int index=0) const
 Return the type of the nth attribute attribute.
template<typename T >
boost::optional< T > getValue (const DtString &key) const
 Accessor function which will call the correct virtual function for the template parameter.
virtual Builder * setGeometry (DtDynamicTerrainGeometry *)=0
virtual Builder * setGeometry (const DtDynamicTerrainGeometry *)=0
virtual Builder * addAllFrom (const DtDynamicTerrainChange &)=0
virtual Builder * addAllFrom (const DtDynamicTerrainChange *)
virtual Builder * addKeyValue (const DtString &key, const DtString &value)=0
virtual Builder * addKeyValue (const DtString &key, double value)=0
virtual Builder * addKeyValue (const DtString &key, int value)=0
virtual Builder * addKeyValue (const DtString &key, bool value)=0
virtual boost::optional< DtStringstringValue (const DtString &key) const =0
 Get the value of the attribute the a specific key.
virtual boost::optional< doubledoubleValue (const DtString &key) const =0
virtual boost::optional< intintValue (const DtString &key) const =0
virtual boost::optional< boolboolValue (const DtString &key) const =0
DtString stringValue (const DtString &key, const DtString &def) const
 Get the value of the attribute at a specific index.
double doubleValue (const DtString &key, double def) const
int intValue (const DtString &key, int def) const
bool boolValue (const DtString &key, bool def) const

Static Public Member Functions

static DtString ToString (TypeEnum t)
 Get printable value of type enum.
static TypeEnum ToEnum (const DtString &str)
 Get type enum from readable string value.
static Builder * CreateBuilder ()
 Builder object for constructing data.
static DtDynamicTerrainChangeMerge (const DtDynamicTerrainChange &data1, const DtDynamicTerrainChange &data2)
 Merge the attributes from each dictionary into a single dictionary.
static DtDynamicTerrainChangeCreate (DtDynamicTerrainGeometry *geometry, const DtString &key, const DtString &value)
 Factory functions.
static DtDynamicTerrainChangeCreate (DtDynamicTerrainGeometry *geometry, const DtString &key, double value)
static DtDynamicTerrainChangeCreate (DtDynamicTerrainGeometry *geometry, const DtString &key, int value)
static DtDynamicTerrainChangeCreate (DtDynamicTerrainGeometry *geometry, const DtString &ket, bool value)

Detailed Description

Command which can be given to the dynamic terrain system to perform some change.

See DtDynamicTerrainChange::CreateBuilder().

This class is a simple interface to a key/value dictionary.

These objects can be backed by anything but are treated as constant objects by the system. The terrain world (DtDynamicTerrainWorld) is generic enough to use the data in any incoming change requests to call the state change functionality on the right feature objects.

The terrain world never actually calls any of the data member functions, only the features themselves. In this way drivers (writers of code that inserts change requests or code that inserts features) only need to agree amongst themselves about what the data mean. This allows the features to respond to a wide varied of data. Simple features like switch nodes and DOF nodes can respond to direct commands (i.e. state=1 or rotation=90) or they can use configuration to respond to higher levels commands (i.e. damage=true or state=open), or (and most importantly for the simulation) they can respond to generic events (i.e. event=explosion,force=50 or event=ditch,width=10).

Member Enumeration Documentation

Enumeration representing the type of an attribute.

UnknownType is a catchall for values that have some unique backing or don't exist.

Enumerator:
UnknownType 
StringType 
DoubleType 
IntType 
BoolType 

Constructor & Destructor Documentation

virtual makVrv::DtDynamicTerrainChange::~DtDynamicTerrainChange ( )
virtual

Virtual destructor.

Member Function Documentation

static DtString makVrv::DtDynamicTerrainChange::ToString ( TypeEnum  t)
static

Get printable value of type enum.

static TypeEnum makVrv::DtDynamicTerrainChange::ToEnum ( const DtString str)
static

Get type enum from readable string value.

DtString makVrv::DtDynamicTerrainChange::print ( ) const

Print for debugging.

static DtDynamicTerrainChange* makVrv::DtDynamicTerrainChange::Create ( DtDynamicTerrainGeometry geometry,
const DtString key,
const DtString value 
)
static

Factory functions.

These all create a dictionary with a single key/value Ownership returned to caller.

static DtDynamicTerrainChange* makVrv::DtDynamicTerrainChange::Create ( DtDynamicTerrainGeometry geometry,
const DtString key,
double  value 
)
static
static DtDynamicTerrainChange* makVrv::DtDynamicTerrainChange::Create ( DtDynamicTerrainGeometry geometry,
const DtString key,
int  value 
)
static
static DtDynamicTerrainChange* makVrv::DtDynamicTerrainChange::Create ( DtDynamicTerrainGeometry geometry,
const DtString ket,
bool  value 
)
static
static Builder* makVrv::DtDynamicTerrainChange::CreateBuilder ( )
static

Builder object for constructing data.

DtDynamicTerrainChange *p = CreateBuilder() ->addKeyValue("key1", value1)->addKeyValue("key2", value2);

static DtDynamicTerrainChange* makVrv::DtDynamicTerrainChange::Merge ( const DtDynamicTerrainChange data1,
const DtDynamicTerrainChange data2 
)
static

Merge the attributes from each dictionary into a single dictionary.

Repeated attributes will be overwritten by the second.

virtual DtDynamicTerrainChange* makVrv::DtDynamicTerrainChange::clone ( ) const
virtual

Create a clone of this object.

Ownership returned to caller. Default implementation will create an object backed by a map. UnknownType values will not be included.

virtual const DtDynamicTerrainGeometry* makVrv::DtDynamicTerrainChange::geometry ( ) const
pure virtual
virtual unsigned int makVrv::DtDynamicTerrainChange::size ( ) const
pure virtual

Return the number of attributes (key/value pairs) in this dictionary.

virtual DtString makVrv::DtDynamicTerrainChange::key ( unsigned int  index = 0) const
pure virtual

Get the key of the nth key/value pair.

Calling this function with an index greater than or equal to the value returned by size() should return an empty string.

Parameters
indexIndex of the key/value pair to return.
Return values
Valueof the key of the key/value pair.
virtual TypeEnum makVrv::DtDynamicTerrainChange::type ( unsigned int  index = 0) const
virtual

Return the type of the nth attribute attribute.

Calling this function with an index greater than or equal to the value returned by attributeCount() should return UnknownType.

Parameters
indexIndex of the key/value pair type to return.
Return values
Typeof the value of the key/value pair.
virtual boost::optional<DtString> makVrv::DtDynamicTerrainChange::stringValue ( const DtString key) const
pure virtual

Get the value of the attribute the a specific key.

virtual boost::optional<double> makVrv::DtDynamicTerrainChange::doubleValue ( const DtString key) const
pure virtual
virtual boost::optional<int> makVrv::DtDynamicTerrainChange::intValue ( const DtString key) const
pure virtual
virtual boost::optional<bool> makVrv::DtDynamicTerrainChange::boolValue ( const DtString key) const
pure virtual
DtString makVrv::DtDynamicTerrainChange::stringValue ( const DtString key,
const DtString def 
) const

Get the value of the attribute at a specific index.

fixme - implement Convenience functions which substitute a default a value doesn't exist. Not virtual b/c these just call directly into the virtual versions and the implementations of the two sets of functions are must be consistent. Implement one of the above functions to change the functionality.

double makVrv::DtDynamicTerrainChange::doubleValue ( const DtString key,
double  def 
) const
int makVrv::DtDynamicTerrainChange::intValue ( const DtString key,
int  def 
) const
bool makVrv::DtDynamicTerrainChange::boolValue ( const DtString key,
bool  def 
) const
boost::optional< bool > makVrv::DtDynamicTerrainChange::getValue< bool > ( const DtString key) const
inline

Accessor function which will call the correct virtual function for the template parameter.

virtual Builder* makVrv::DtDynamicTerrainChange::setGeometry ( DtDynamicTerrainGeometry )
pure virtual
virtual Builder* makVrv::DtDynamicTerrainChange::setGeometry ( const DtDynamicTerrainGeometry )
pure virtual
virtual Builder* makVrv::DtDynamicTerrainChange::addAllFrom ( const DtDynamicTerrainChange )
pure virtual
virtual Builder* makVrv::DtDynamicTerrainChange::addAllFrom ( const DtDynamicTerrainChange )
virtual
virtual Builder* makVrv::DtDynamicTerrainChange::addKeyValue ( const DtString key,
const DtString value 
)
pure virtual
virtual Builder* makVrv::DtDynamicTerrainChange::addKeyValue ( const DtString key,
double  value 
)
pure virtual
virtual Builder* makVrv::DtDynamicTerrainChange::addKeyValue ( const DtString key,
int  value 
)
pure virtual
virtual Builder* makVrv::DtDynamicTerrainChange::addKeyValue ( const DtString key,
bool  value 
)
pure virtual

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

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)