![]() |
VR-Forces Developer's Guide
|
Command which can be given to the dynamic terrain system to perform some change. This class is a simple interface to a key/value dictionary.
See DtDynamicTerrainChange::CreateBuilder().
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).

Public Types | |
| enum | TypeEnum { UnknownType, StringType, DoubleType, IntType, BoolType } |
Public Member Functions | |
| DtString | print () const |
| virtual | ~DtDynamicTerrainChange () |
| virtual DtDynamicTerrainChange * | clone () const |
| virtual const DtDynamicTerrainGeometry * | geometry () const =0 |
| virtual unsigned int | size () const =0 |
| virtual DtString | key (unsigned int index=0) const =0 |
| virtual TypeEnum | type (unsigned int index=0) const |
| template<typename T > | |
| boost::optional< T > | getValue (const DtString &key) const |
| 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 |
| template<> | |
| boost::optional< DtString > | getValue (const DtString &key) const |
| template<> | |
| boost::optional< double > | getValue (const DtString &key) const |
| template<> | |
| boost::optional< int > | getValue (const DtString &key) const |
| template<> | |
| boost::optional< bool > | getValue (const DtString &key) const |
| virtual boost::optional< DtString > | stringValue (const DtString &key) const =0 |
| virtual boost::optional< double > | doubleValue (const DtString &key) const =0 |
| virtual boost::optional< int > | intValue (const DtString &key) const =0 |
| virtual boost::optional< bool > | boolValue (const DtString &key) const =0 |
| DtString | stringValue (const DtString &key, const DtString &def) const |
| 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) |
| static TypeEnum | ToEnum (const DtString &str) |
| static Builder * | CreateBuilder () |
| static DtDynamicTerrainChange * | Merge (const DtDynamicTerrainChange &data1, const DtDynamicTerrainChange &data2) |
| static DtDynamicTerrainChange * | Create (DtDynamicTerrainGeometry *geometry, const DtString &key, const DtString &value) |
| static DtDynamicTerrainChange * | Create (DtDynamicTerrainGeometry *geometry, const DtString &key, double value) |
| static DtDynamicTerrainChange * | Create (DtDynamicTerrainGeometry *geometry, const DtString &key, int value) |
| static DtDynamicTerrainChange * | Create (DtDynamicTerrainGeometry *geometry, const DtString &ket, bool value) |
|
virtual |
Virtual destructor.
Get printable value of type enum.
Get type enum from readable string value.
| DtString makVrv::DtDynamicTerrainChange::print | ( | ) | const |
Print for debugging.
|
static |
Factory functions. These all create a dictionary with a single key/value Ownership returned to caller.
|
static |
Factory functions. These all create a dictionary with a single key/value Ownership returned to caller.
|
static |
Factory functions. These all create a dictionary with a single key/value Ownership returned to caller.
|
static |
Factory functions. These all create a dictionary with a single key/value Ownership returned to caller.
|
static |
Builder object for constructing data. DtDynamicTerrainChange *p = CreateBuilder() ->addKeyValue("key1", value1)->addKeyValue("key2", value2);.
|
static |
Merge the attributes from each dictionary into a single dictionary. Repeated attributes will be overwritten by the second.
|
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.
|
pure virtual |
Return the number of attributes (key/value pairs) in this dictionary.
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.
| index | Index of the key/value pair to return. |
| Value | of the key of the key/value pair. |
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.
| index | Index of the key/value pair type to return. |
| Type | of the value of the key/value pair. |
|
pure virtual |
Get the value of the attribute the a specific key.
|
pure virtual |
Get the value of the attribute the a specific key.
|
pure virtual |
Get the value of the attribute the a specific key.
|
pure virtual |
Get the value of the attribute the a specific key.
| 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.
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.
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.
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.
| boost::optional<T> makVrv::DtDynamicTerrainChange::getValue | ( | const DtString & | key | ) | const |
Accessor function which will call the correct virtual function for the template parameter.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
inline |
|
inline |
|
inline |
|
inline |