VR-Forces 5.0.2 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
makVrv::DtDynamicTerrainChange Class Referenceabstract

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).

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

Public Types

enum  TypeEnum {
  UnknownType, StringType, DoubleType, IntType,
  BoolType
}
 

Public Member Functions

DtString print () const
 
virtual ~DtDynamicTerrainChange ()
 
virtual DtDynamicTerrainChangeclone () 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< DtStringgetValue (const DtString &key) const
 
template<>
boost::optional< doublegetValue (const DtString &key) const
 
template<>
boost::optional< intgetValue (const DtString &key) const
 
template<>
boost::optional< boolgetValue (const DtString &key) const
 
virtual boost::optional< DtStringstringValue (const DtString &key) const =0
 
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
 
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 DtDynamicTerrainChangeMerge (const DtDynamicTerrainChange &data1, const DtDynamicTerrainChange &data2)
 
static DtDynamicTerrainChangeCreate (DtDynamicTerrainGeometry *geometry, const DtString &key, const DtString &value)
 
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)
 

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

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,
int  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 ket,
bool  value 
)
static

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

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

Get the value of the attribute the a specific key.

virtual boost::optional<int> makVrv::DtDynamicTerrainChange::intValue ( const DtString key) const
pure virtual

Get the value of the attribute the a specific key.

virtual boost::optional<bool> makVrv::DtDynamicTerrainChange::boolValue ( const DtString key) const
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.

double makVrv::DtDynamicTerrainChange::doubleValue ( const DtString key,
double  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.

int makVrv::DtDynamicTerrainChange::intValue ( const DtString key,
int  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.

bool makVrv::DtDynamicTerrainChange::boolValue ( const DtString key,
bool  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.

template<typename T >
boost::optional<T> makVrv::DtDynamicTerrainChange::getValue ( const DtString key) const

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
template<>
boost::optional<DtString> makVrv::DtDynamicTerrainChange::getValue ( const DtString key) const
inline
template<>
boost::optional<double> makVrv::DtDynamicTerrainChange::getValue ( const DtString key) const
inline
template<>
boost::optional<int> makVrv::DtDynamicTerrainChange::getValue ( const DtString key) const
inline
template<>
boost::optional<bool> makVrv::DtDynamicTerrainChange::getValue ( const DtString key) const
inline

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

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)