VR-Forces 4.2 Class Documentation
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtSimulationModelSet Class Reference

A simulation model set contains all the information that can be used to support a scenario either for simulation or visualization. More...

Inheritance diagram for DtSimulationModelSet:
Inheritance graph
[legend]

Public Member Functions

 DtSimulationModelSet ()
 default constructor
 DtSimulationModelSet (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL)
virtual ~DtSimulationModelSet ()
 destructor
 DtSimulationModelSet (const DtSimulationModelSet &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 copy constructor
DtSimulationModelSetoperator= (const DtSimulationModelSet &orig)
 assignment operator
virtual bool load (const DtFilename &)
 Loads simulation model set from specified filename.
virtual bool save (const DtFilename &, bool rebind=true)
 Saves simulation model set to specified filename.
const DtFilename & path () const
 The path that is used as the relative (or absolute) path to load all internal files from.
const DtFilename & filename () const
 Filename that this simulation model set was originally loaded from.
DtSimulationModelSetclone () const
virtual DtFilename modelSetDirectory () const
 Returns the value of the model-set-directory variable, if it is defined for this model set, else returns an empty string.
virtual bool setModelSetDirectory (const DtFilename &)
 Sets the model set directory if variable exists. If it does not, returns false.
const DtRwVariableBindingsoriginalVariableBindings () const
 Returns the original variable bindings before substitutions.
DtRwVariableBindingsoriginalVariableBindings ()
virtual void saveVariableBindingsToOpdFile ()
 Saves the current variable bindings to the .opd file.
const DtFilename & hostilityFile () const
void setHostilityFile (const DtFilename &s)
const DtFilename & opdFile () const
 Get/set object parameter database file.
void setOpdFile (const DtFilename &)
 Get/set object parameter database file.
const DtFilename & physicalWorldFile () const
 Get/set physical world file.
void setPhysicalWorldFile (const DtFilename &)
 Get/set physical world file.
const DtFilename & indirectArtilleryTypesFile () const
 Get/set indirect artillery types file.
void setIndirectArtilleryTypesFile (const DtFilename &)
 Get/set indirect artillery types file.
const DtFilename & commModelParameters () const
 Get/set communications model file.
void setCommModelParameters (const DtFilename &)
 Get/set communications model file.
const DtStringcomment () const
 Get/set comment that will be written to top of file when saving out.
void setComment (const DtString &)
 Get/set comment that will be written to top of file when saving out.
virtual DtFilename defaultComponentAttachmentFile () const
 Returns the first component attachment filename in the list.
DtComponentAttachmentListcomponentAttachmentFileList ()
 Returns the list of component attachment lookup files.
const DtComponentAttachmentListcomponentAttachmentFileList () const
 Returns the list of component attachment lookup files.
DtFilename getDataDirectory (bool warnOnFailure=true) const
 Returns the directory that the data files are in.
DtFilename getGuiDirectory (bool warnOnFailure=true) const
 Returns the directory that the gui files are in.
DtFilename getRecycleBin (bool warnOnFailure=true) const
 Returns the recycle bin.
DtFilename getRootDirectory (bool warnOnFailure=true) const
 Returns the directory that the data files are in.
DtFilename getScriptedMovementDirectory (bool warnOnFailure=true) const
 Returns the directory that the data files are in.
DtFilename getUIDirectory (bool warnOnFailure=true) const
 Returns the directory that the data files are in.
DtFilename getSystemDirectory (bool warnOnFailure=true) const
 Returns the directory that the data files are in.
DtFilename getParametersDirectory (bool warnOnFailure=true) const
 Returns the directory that the data files are in.
DtFilename getAmmoSelectDirectory (bool warnOnFailure=true) const
 Returns the directory that the data files are in.
DtFilename getHitDirectory (bool warnOnFailure=true) const
 Returns the directory that the data files are in.
DtFilename getDamageDirectory (bool warnOnFailure=true) const
 Returns the directory that the data files are in.
DtFilename getDetectionDirectory (bool warnOnFailure=true) const
 Returns the directory that the data files are in.
DtFilename getFormationDirectory (bool warnOnFailure=true) const
 Returns the directory that the data files are in.
const DtFilename & scenarioDataFile () const
 Returns the scenario data file containing spawn templates, force hostility relationships,.
void setScenarioDataFile (const DtFilename &n)
 Returns the scenario data file containing spawn templates, force hostility relationships,.
- Public Member Functions inherited from DtReaderWriter
 DtReaderWriter ()
 default constructor
 DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 real constructor Setting the readonly flag prevents object from writing itself to the stream.
 DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 copy constructor
 DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
const DtReaderWriteroperator= (const DtReaderWriter &orig)
 assignment operator
bool operator== (const DtReaderWriter &) const
 Equivalence operator.
bool operator!= (const DtReaderWriter &rhs)
virtual ~DtReaderWriter ()
 destructor
virtual void putSelf (FILE *fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 Top level call to write itself to file.
virtual void getSelf (DtlObjPtr args, const DtFilename &searchPath=DtFilename::nullFilename(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 Top level to read itself from an input stream.
virtual void writeSelf (FILE *fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 Called from putSelf, calls myRegistry.putSelf which in turn calls putSelf on each reader/writer in the registry.
virtual DtSymbolString name () const
 Accessor for name of this readable/writable object.
virtual void addAlias (const DtSymbolString &alias)
 Add an alias as an alternative name for this object.
virtual bool hasAlias (const DtSymbolString &alias)
virtual const aliasContaineraliases () const
virtual void setReadonly (bool flag)
 Set read-only flag.
virtual bool isReadonly () const
virtual bool variableIsBound () const
virtual void unbindVariable ()
 Sets the myVariableIsBound flag to false.
virtual void setName (const DtString &)
 Set the name of the object.
virtual const char * readerWriterType () const
 Used to supply a string type that this reader writer type is.
virtual DtString prettyPrint () const
 Routine to return a human readable form of the reader/writer variable.
virtual void bindVariables (DtVariableBindingsList variableBindings)
 Runs a variable binding pass on this reader writer and any of its children.
virtual std::list
< DtVariableNameType
unboundVariables () const
bool invalid () const
virtual bool hasChild (const DtReaderWriter *p) const
 Returns true if this variable has a child p in it's chain.
virtual void setValueSpecified (bool specified, bool recurse=false)
 The specified flags are used for optional values.
virtual bool valueSpecified () const
 The specified flags are used for optional values.
virtual bool isVariableReference () const
 Specifies whether or not this reader writer is really a variable that is specified elsewhere.
virtual void setIsVariableReference (bool value)
virtual void clearAllVariableReferenceFlags ()
 Clears out all variable reference flags from all readerwriter items in registry recursively.
virtual DtSymbolString variableName () const
 The variable name, if this object is a variable reference.
virtual void setVariableName (const DtSymbolString variableName)
 The variable name, if this object is a variable reference.
const DtReaderWriterRegistryregistry () const
 Collection of child DtReaderWriter nodes owned by this object.
DtReaderWriterRegistryregistry ()
 Collection of child DtReaderWriter nodes owned by this object.

Protected Member Functions

virtual DtString createSubstitutedPath (const DtFilename &, const DtString &modelSetDir)
 Creates a path (with filename) that will try and use the model-set-directory.
virtual void setupVariableSubstitutedPaths ()
virtual void substituteVariablePaths ()
virtual void resetVariables ()
virtual void placeOpdVariablesIntoVariableBindings ()
 Places the opd variables into the variable bindings for this class.
virtual DtReaderWriterreadOpdFile () const
 Returns a reader/writer which represents the contents of the .opd file, which will just be variable parameters.
virtual void substituteInVariables (const DtString &variable)
 Substitutes variables in variables.
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 Copies values from the specified DtReaderWriter.
virtual void bindLocalVariables (const DtVariableBindingsList &variableBindings)
 Checks to see if this RW object is a variable reference that can be bound using the provided bindings.
virtual void putData (FILE *fp, int indentLevel=0)
 Deriving class overrides these to get/put class specific data.
virtual DtlObjPtr getData (DtlObjPtr args, const DtFilename &searchPath, const DtVariableBindingsList &variableBindings)
 Deriving class overrides these to get/put class specific data.

Protected Attributes

DtRwString myOpdFile
DtRwString myPhysicalWorldFile
DtRwString myIndirectArtilleryTypesFile
DtRwString myCommModelParameters
DtRwString myHostilityFile
DtRwString myScenarioDataFile
DtFilename myPath
DtFilename myFilename
DtString myComment
DtFilename mySubOpdFile
 Substituted copies of name.
DtFilename mySubPhysicalWorldFile
DtFilename mySubIndirectArtilleryTypesFile
DtFilename mySubCommModelParameters
DtFilename mySubHostilityFile
DtFilename mySubScenarioDataFile
DtComponentAttachmentList myComponentAttachmentFileList
DtRwVariableBindingsmyOriginalVariableBindings
- Protected Attributes inherited from DtReaderWriter
const DtSymbolString myName
DtReaderWriterRegistry myRegistry
bool myValueSpecified
bool myReadOnlyFlag
bool myIsVariableReference
DtSymbolString myVariableName
bool myVariableIsBound
aliasContainer myAliases
 Container for the aliases which represent alternative names for the object.
bool myInvalid
 Set to true if there is a problem reading this item.

Additional Inherited Members

- Public Types inherited from DtReaderWriter
typedef std::vector
< DtSymbolString > 
aliasContainer
typedef std::vector
< DtSymbolString >::iterator 
aliasIter
typedef std::vector
< DtSymbolString >
::const_iterator 
aliasConstIter
typedef std::pair
< DtSymbolString, DtString
DtVariableNameType
typedef DtReaderWriterFactory *(* DtReaderWriterFactoryCreatorFcn )()
- Static Public Member Functions inherited from DtReaderWriter
static void putIndent (FILE *fp, int indentLevel)
static const
DtVariableBindingsList
nullVariableReference ()
static void setPostGetSelfCallback (DtGetSelfCallbackFcn fcn, void *usrData)
static void setPrePutSelfCallback (DtPutSelfCallbackFcn fcn, void *usrData)
static const DtFilename & appPath ()
 Gets the current working directory.
static void setFactoryCreatorFunction (DtReaderWriterFactoryCreatorFcn fcn)
 Sets the function to create the DtReaderWriterFactory.
static void createReaderWriterFactory ()
static DtReaderWriterFactoryfactory ()
- Static Protected Attributes inherited from DtReaderWriter
static DtString theUnspecifiedValue
static DtGetSelfCallbackInfo thePostGetSelfCallback
static DtPutSelfCallbackInfo thePrePutSelfCallback
static const DtVariableBindingsList theEmptyVariableBindingsList
static bool theCreatorFcnSet
static DtReaderWriterFactorytheFactory
static
DtReaderWriterFactoryCreatorFcn 
theFactoryCreatorFcn

Detailed Description

A simulation model set contains all the information that can be used to support a scenario either for simulation or visualization.

All files in this model set are defined to be relative to this file from where it was loaded. To get the complete path to a file, referece it as:

DtFilename::combine(simulationModelSet.path(), <file>) e.g: DtFilename::combine(simulationModelSet.path(), simulationModelSet.physicalWorldFile());

Constructor & Destructor Documentation

DtSimulationModelSet::DtSimulationModelSet ( )

default constructor

DtSimulationModelSet::DtSimulationModelSet ( const DtString name,
DtReaderWriterRegistry parentRegistry = NULL 
)
virtual DtSimulationModelSet::~DtSimulationModelSet ( )
virtual

destructor

DtSimulationModelSet::DtSimulationModelSet ( const DtSimulationModelSet orig,
DtReaderWriterRegistry parentRegistry = NULL 
)

copy constructor

Member Function Documentation

DtSimulationModelSet& DtSimulationModelSet::operator= ( const DtSimulationModelSet orig)

assignment operator

virtual bool DtSimulationModelSet::load ( const DtFilename &  )
virtual

Loads simulation model set from specified filename.

virtual bool DtSimulationModelSet::save ( const DtFilename &  ,
bool  rebind = true 
)
virtual

Saves simulation model set to specified filename.

Part of the save process will be to try and make directories that might be part of simulation model set items relative to the file and subsitute the model-set-directory variable (if specified)

If rebind is false, takes originally read in names and saves them out, versus substituting variable name in for newly set files

const DtFilename & DtSimulationModelSet::path ( ) const
inline

The path that is used as the relative (or absolute) path to load all internal files from.

References myPath.

const DtFilename & DtSimulationModelSet::opdFile ( ) const
inline

Get/set object parameter database file.

References mySubOpdFile.

void DtSimulationModelSet::setOpdFile ( const DtFilename &  f)
inline

Get/set object parameter database file.

References mySubOpdFile.

const DtFilename & DtSimulationModelSet::physicalWorldFile ( ) const
inline

Get/set physical world file.

References mySubPhysicalWorldFile.

void DtSimulationModelSet::setPhysicalWorldFile ( const DtFilename &  f)
inline

Get/set physical world file.

References mySubPhysicalWorldFile.

const DtFilename & DtSimulationModelSet::indirectArtilleryTypesFile ( ) const
inline

Get/set indirect artillery types file.

References mySubIndirectArtilleryTypesFile.

void DtSimulationModelSet::setIndirectArtilleryTypesFile ( const DtFilename &  f)
inline

Get/set indirect artillery types file.

References mySubIndirectArtilleryTypesFile.

const DtFilename & DtSimulationModelSet::commModelParameters ( ) const
inline

Get/set communications model file.

References mySubCommModelParameters.

void DtSimulationModelSet::setCommModelParameters ( const DtFilename &  f)
inline

Get/set communications model file.

References mySubCommModelParameters.

const DtString & DtSimulationModelSet::comment ( ) const
inline

Get/set comment that will be written to top of file when saving out.

References myComment.

void DtSimulationModelSet::setComment ( const DtString c)
inline

Get/set comment that will be written to top of file when saving out.

References myComment.

virtual DtFilename DtSimulationModelSet::defaultComponentAttachmentFile ( ) const
virtual

Returns the first component attachment filename in the list.

const DtFilename & DtSimulationModelSet::filename ( ) const
inline

Filename that this simulation model set was originally loaded from.

References myFilename.

Referenced by DtSimulationModelSetLoader::simulationModelSetFilename().

DtSimulationModelSet* DtSimulationModelSet::clone ( ) const
virtual DtFilename DtSimulationModelSet::modelSetDirectory ( ) const
virtual

Returns the value of the model-set-directory variable, if it is defined for this model set, else returns an empty string.

virtual bool DtSimulationModelSet::setModelSetDirectory ( const DtFilename &  )
virtual

Sets the model set directory if variable exists. If it does not, returns false.

DtComponentAttachmentList & DtSimulationModelSet::componentAttachmentFileList ( )
inline

Returns the list of component attachment lookup files.

References myComponentAttachmentFileList.

const DtComponentAttachmentList & DtSimulationModelSet::componentAttachmentFileList ( ) const
inline

Returns the list of component attachment lookup files.

References myComponentAttachmentFileList.

DtFilename DtSimulationModelSet::getDataDirectory ( bool  warnOnFailure = true) const

Returns the directory that the data files are in.

Routines that return directories that are referenced by the model set

DtFilename DtSimulationModelSet::getGuiDirectory ( bool  warnOnFailure = true) const

Returns the directory that the gui files are in.

DtFilename DtSimulationModelSet::getRecycleBin ( bool  warnOnFailure = true) const

Returns the recycle bin.

DtFilename DtSimulationModelSet::getRootDirectory ( bool  warnOnFailure = true) const

Returns the directory that the data files are in.

Routines that return directories that are referenced by the model set

DtFilename DtSimulationModelSet::getScriptedMovementDirectory ( bool  warnOnFailure = true) const

Returns the directory that the data files are in.

Routines that return directories that are referenced by the model set

DtFilename DtSimulationModelSet::getUIDirectory ( bool  warnOnFailure = true) const

Returns the directory that the data files are in.

Routines that return directories that are referenced by the model set

DtFilename DtSimulationModelSet::getSystemDirectory ( bool  warnOnFailure = true) const

Returns the directory that the data files are in.

Routines that return directories that are referenced by the model set

DtFilename DtSimulationModelSet::getParametersDirectory ( bool  warnOnFailure = true) const

Returns the directory that the data files are in.

Routines that return directories that are referenced by the model set

DtFilename DtSimulationModelSet::getAmmoSelectDirectory ( bool  warnOnFailure = true) const

Returns the directory that the data files are in.

Routines that return directories that are referenced by the model set

DtFilename DtSimulationModelSet::getHitDirectory ( bool  warnOnFailure = true) const

Returns the directory that the data files are in.

Routines that return directories that are referenced by the model set

DtFilename DtSimulationModelSet::getDamageDirectory ( bool  warnOnFailure = true) const

Returns the directory that the data files are in.

Routines that return directories that are referenced by the model set

DtFilename DtSimulationModelSet::getDetectionDirectory ( bool  warnOnFailure = true) const

Returns the directory that the data files are in.

Routines that return directories that are referenced by the model set

DtFilename DtSimulationModelSet::getFormationDirectory ( bool  warnOnFailure = true) const

Returns the directory that the data files are in.

Routines that return directories that are referenced by the model set

const DtRwVariableBindings* DtSimulationModelSet::originalVariableBindings ( ) const
inline

Returns the original variable bindings before substitutions.

DtRwVariableBindings* DtSimulationModelSet::originalVariableBindings ( )
inline
virtual void DtSimulationModelSet::saveVariableBindingsToOpdFile ( )
virtual

Saves the current variable bindings to the .opd file.

const DtFilename & DtSimulationModelSet::hostilityFile ( ) const
inline

References mySubHostilityFile.

void DtSimulationModelSet::setHostilityFile ( const DtFilename &  s)
inline

References mySubHostilityFile.

const DtFilename & DtSimulationModelSet::scenarioDataFile ( ) const
inline

Returns the scenario data file containing spawn templates, force hostility relationships,.

References mySubScenarioDataFile.

void DtSimulationModelSet::setScenarioDataFile ( const DtFilename &  n)
inline

Returns the scenario data file containing spawn templates, force hostility relationships,.

References mySubScenarioDataFile.

virtual DtString DtSimulationModelSet::createSubstitutedPath ( const DtFilename &  ,
const DtString modelSetDir 
)
protectedvirtual

Creates a path (with filename) that will try and use the model-set-directory.

virtual void DtSimulationModelSet::setupVariableSubstitutedPaths ( )
protectedvirtual
virtual void DtSimulationModelSet::substituteVariablePaths ( )
protectedvirtual
virtual void DtSimulationModelSet::resetVariables ( )
protectedvirtual
virtual void DtSimulationModelSet::placeOpdVariablesIntoVariableBindings ( )
protectedvirtual

Places the opd variables into the variable bindings for this class.

virtual DtReaderWriter* DtSimulationModelSet::readOpdFile ( ) const
protectedvirtual

Returns a reader/writer which represents the contents of the .opd file, which will just be variable parameters.

virtual void DtSimulationModelSet::substituteInVariables ( const DtString variable)
protectedvirtual

Substitutes variables in variables.

Member Data Documentation

DtRwString DtSimulationModelSet::myOpdFile
protected
DtRwString DtSimulationModelSet::myPhysicalWorldFile
protected
DtRwString DtSimulationModelSet::myIndirectArtilleryTypesFile
protected
DtRwString DtSimulationModelSet::myCommModelParameters
protected
DtRwString DtSimulationModelSet::myHostilityFile
protected
DtRwString DtSimulationModelSet::myScenarioDataFile
protected
DtFilename DtSimulationModelSet::myPath
protected

Referenced by path().

DtFilename DtSimulationModelSet::myFilename
protected

Referenced by filename().

DtString DtSimulationModelSet::myComment
protected

Referenced by comment(), and setComment().

DtFilename DtSimulationModelSet::mySubOpdFile
protected

Substituted copies of name.

Referenced by opdFile(), and setOpdFile().

DtFilename DtSimulationModelSet::mySubPhysicalWorldFile
protected
DtFilename DtSimulationModelSet::mySubIndirectArtilleryTypesFile
protected
DtFilename DtSimulationModelSet::mySubCommModelParameters
protected
DtFilename DtSimulationModelSet::mySubHostilityFile
protected

Referenced by hostilityFile(), and setHostilityFile().

DtFilename DtSimulationModelSet::mySubScenarioDataFile
protected
DtComponentAttachmentList DtSimulationModelSet::myComponentAttachmentFileList
protected
DtRwVariableBindings* DtSimulationModelSet::myOriginalVariableBindings
protected

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

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)