![]() |
VR-Forces 5.0.1 Developer's Guide
|
The model definition manager is responsible to managing all of the model definitions the IG knows about. It will save and load definitions to/from files.

Public Types | |
| typedef std::map< std::string, DtModelDefinition > | DefinitionMap |
Public Member Functions | |
| virtual | ~DtModelDefinitionManager () |
| virtual void | loadDefinitions () |
| virtual bool | skipDefaultDefinitions () |
| virtual void | saveDefinitions () |
| virtual void | saveAllDefinitions () |
| virtual void | saveDefinitions (const std::string &) |
| virtual void | addDefinition (const DtModelDefinition &definition, bool autoSave=true) |
| virtual void | destroyDefinition (const DtModelDefinition &def) |
| DtModelDefinition * | findDefinition (const std::string &modelName) const |
| const DefinitionMap & | definitions () const |
| DefinitionMap & | definitions () |
| void | renameDefinition (const std::string &oldModelName, const std::string &newModelName) |
| const std::string & | modelFilename () const |
| void | setModelFilename (const std::string &extension) |
| bool | modelInstancingEnabled () const |
| void | setModelInstancingEnabled (bool enabled) |
| void | clearModelInstancingCache () |
| void | clear () |
| virtual void | merge (const DtModelDefinitionManager &) |
| virtual bool | loadModelDefinitions (const std::string &filename, bool merge=true) |
| virtual bool | loadModelDefinition (const std::string &filename) |
| virtual bool | exportToFile (const std::vector< std::string > &defs, const std::string &filename) const |
| virtual bool | schemaInUse (const std::string &) const |
| virtual bool | schemaInUse (const std::string &, std::vector< std::string > &) const |
| virtual void | backup () |
| virtual bool | mergeModelDefinitions (const std::string &fileOrDirName) |
| virtual bool | modifiedSinceStartup () |
| virtual void | addToModifiedDefinitionsMap (DtModelDefinition modelDefinition) |
| virtual void | addToAddedDefinitionsMap (DtModelDefinition modelDefinition) |
| virtual void | addToDeletedDefinitionsMap (DtModelDefinition modelDefinition) |
| virtual void | resetModifiedFlags () |
| virtual int | getNumOfDefinitionsExcludeTerrain () |
| const DtSettingsBackup * | settingsBackup () const |
| DtSettingsBackup * | settingsBackup () |
| virtual DtModelDefinitionManager & | operator= (const DtModelDefinitionManager &) |
| void | setAutoSave (bool b) |
| bool | autoSave () const |
| virtual void | removeNonPersistentItems () |
Static Public Member Functions | |
| static bool | getFloatParameterValueFromDefinition (const std::string ¶mName, const DtModelDefinition &definition, float &result) |
| static bool | getVectorParameterValueFromDefinition (const std::string ¶mName, const DtModelDefinition &definition, float(&result)[3]) |
| static bool | getColorParameterValueFromDefinition (const std::string ¶mName, const DtModelDefinition &definition, float(&result)[4]) |
Protected Member Functions | |
| DtModelDefinitionManager (DtDe &) | |
| DtModelDefinitionManager (const DtModelDefinitionManager &) | |
| template<typename Archive > | |
| void | serialize (Archive &ar, unsigned int version) |
Private Member Functions | |
| bool | loadModelDefinitionsFromXML (const std::string &filename, bool shouldMerge) |
| bool | loadModelDefinitionsFromBinary (const std::string &filename, bool shouldMerge) |
Friends | |
| class | DtModelDefinitionManagerCreator |
| class | DtModelDefinitionManagerBackup |
| class | boost::serialization::access |
| typedef std::map<std::string, DtModelDefinition> makVrv::DtModelDefinitionManager::DefinitionMap |
|
virtual |
DTOR.
|
protected |
CTOR.
|
protected |
|
static |
Utility function for reading a float for the specified attribute, by name, from the provided model definition. This function returns true if the float parameter value was successfully retrieved from the provided model definition. False otherwise.
|
static |
Utility function for reading a Vec3 for the specified attribute, by name, from the provided model definition. This function returns true if the Vec3 parameter value was successfully retrieved from the provided model definition. False otherwise.
|
static |
Utility function for reading a Vec4 for the specified attribute, by name, from the provided model definition. This function returns true if the Vec4 parameter value was successfully retrieved from the provided model definition. False otherwise.
|
virtual |
Load all the models in a given directory.
|
virtual |
Should we skip the default model definitions for example, if –noAppDataModelDefs is on the command line.
|
virtual |
Save all of the model definitions to a directory.
|
virtual |
Saves out all model definitions to each of of their perspective file locations.
|
virtual |
Run through all files in directory and assign the matching definitions to each file.
|
virtual |
Add a model definition. The definition itself will only be copied. If autoSave is true and myAutoSave is true, saves out definitions to file.
| DtInvalidInput | if the definition's name is empty. |
|
virtual |
Remove and destroy a definition.
| DtModelDefinition* makVrv::DtModelDefinitionManager::findDefinition | ( | const std::string & | modelName | ) | const |
Find a a model definition.
| 0 | If no definition with the input name is found. |
| const DefinitionMap& makVrv::DtModelDefinitionManager::definitions | ( | ) | const |
Get a const ref to the map of definitions used for iteration.
| DefinitionMap& makVrv::DtModelDefinitionManager::definitions | ( | ) |
| void makVrv::DtModelDefinitionManager::renameDefinition | ( | const std::string & | oldModelName, |
| const std::string & | newModelName | ||
| ) |
renames model definition
| const std::string& makVrv::DtModelDefinitionManager::modelFilename | ( | ) | const |
Set the model filename. The default is "Model Definitions.ommx".
| void makVrv::DtModelDefinitionManager::setModelFilename | ( | const std::string & | extension | ) |
Set the model filename.
| bool makVrv::DtModelDefinitionManager::modelInstancingEnabled | ( | ) | const |
Set if model instance sharing is enabled.
| void makVrv::DtModelDefinitionManager::setModelInstancingEnabled | ( | bool | enabled | ) |
Set if model instance sharing is enabled.
| void makVrv::DtModelDefinitionManager::clearModelInstancingCache | ( | ) |
Clears the cache of all model definitions.
| void makVrv::DtModelDefinitionManager::clear | ( | ) |
Clears out entire manager.
|
virtual |
Merges contents of supplied model definition manager into this one. Model definitions that exist will be replaced by model definitions in the merging manager. Ones that do not exist will be added. No model definitions will be removed as part of this operation.
|
virtual |
Load a specific model definition manager file.
| true | if the model was loaded. |
| false | if the model definition manager file was not loaded (if the file was unable to be opened). When the load is complete, and merge is true, will call merge on the resultant model definition manager to place contents into this manager |
|
virtual |
Load a specific model file.
| true | if the model was loaded. |
| false | if the model was not loaded (if the file was unable to be opened) |
|
virtual |
Exports the named definitions to the specified file. The file can then be imported via the loadModelDefinitions() method.
|
virtual |
Returns true if the schema is in use by and model definition.
|
virtual |
true if schema is in use and the vector of model defs for those that do
|
virtual |
Backs up model definitions to backup manager.
Reimplemented in DtVrfModelDefinitionManager.
|
virtual |
merge in model definitions from a file or directory
|
virtual |
return whether the model definitions have modified since start up
|
virtual |
add a model definition to the modifiedDefinitions map
|
virtual |
add a model definition to the addedDefinitions map
|
virtual |
add a model definition to the deletedDefinitions map
|
virtual |
reset the flags about the modification after you have save it.
|
virtual |
exclude the definition that has terrain schema
|
inline |
|
inline |
|
virtual |
Assignment operator.
|
inline |
Sets whether or not to automatically save model definition manager on any change. Default is true.
|
inline |
|
virtual |
Removes items that are not persistent. These items should not be saved to disk or backed-up.
|
inlineprotected |
|
private |
|
private |
|
friend |
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |