![]() |
VR-Forces 4.0.4 Class Documentation
|
The model definition manager is responsible to managing all of the model definitions the IG knows about. More...
Public Types | |
| typedef std::map< std::string, DtModelDefinition > | DefinitionMap |
Public Member Functions | |
| virtual | ~DtModelDefinitionManager () |
| DTOR. | |
| virtual void | loadDefinitions () |
| Load all the models in a given directory. | |
| virtual void | saveDefinitions () |
| Save all of the model definitions to a directory. | |
| virtual void | saveDefinitions (const std::string &) |
| virtual void | addDefinition (const DtModelDefinition &definition, bool autoSave=true) |
| Add a model definition. | |
| virtual void | destroyDefinition (const DtModelDefinition &def) |
| Remove and destroy a definition. | |
| DtModelDefinition * | findDefinition (const std::string &modelName) const |
| Find a a model definition. | |
| const DefinitionMap & | definitions () const |
| Get a const ref to the map of definitions used for iteration. | |
| DefinitionMap & | definitions () |
| const std::string & | modelFilename () const |
| Set the model filename. The default is "Model Definitions.ommx". | |
| void | setModelFilename (const std::string &extension) |
| Set the model filename. | |
| bool | modelInstancingEnabled () const |
| Set if model instance sharing is enabled. | |
| void | setModelInstancingEnabled (bool enabled) |
| Set if model instance sharing is enabled. | |
| void | clearModelInstancingCache () |
| Clears the cache of all model definitions. | |
| void | clear () |
| Clears out entire manager. | |
| virtual void | merge (const DtModelDefinitionManager &) |
| Merges contents of supplied model definition manager into this one. | |
| virtual bool | loadModelDefinitions (const std::string &filename, bool merge=true) |
| Load a specific model definition manager file. | |
| virtual bool | loadModelDefinition (const std::string &filename) |
| Load a specific model file. | |
| virtual bool | exportToFile (const std::vector< std::string > &defs, const std::string &filename) const |
| Exports the named definitions to the specified file. | |
| virtual bool | schemaInUse (const std::string &) const |
| Returns true if the schema is in use by and model definition. | |
| virtual bool | schemaInUse (const std::string &, std::vector< std::string > &) const |
| true if schema is in use and the vector of model defs for those that do | |
| virtual void | backup () |
| Backs up model definitions to backup manager. | |
| const DtSettingsBackup * | settingsBackup () const |
| DtSettingsBackup * | settingsBackup () |
| virtual DtModelDefinitionManager & | operator= (const DtModelDefinitionManager &) |
| Assignment operator. | |
| void | setAutoSave (bool b) |
| Sets whether or not to automatically save model definition mananger on any change. Default is true. | |
| bool | autoSave () const |
| virtual void | removeNonPersistentItems () |
| Removes items that are not persistent. These items should not be saved to disk or backed-up. | |
Protected Member Functions | |
| DtModelDefinitionManager (DtDe &) | |
| CTOR. | |
| DtModelDefinitionManager (const DtModelDefinitionManager &) | |
| template<typename Archive > | |
| void | serialize (Archive &ar, unsigned int version) |
Protected Attributes | |
| DtDe & | myDe |
| DefinitionMap | myDefinitions |
| std::string | myModelFileName |
| bool | myAutoSave |
| bool | myModelInstancingFlag |
| DtModelDefinitionManagerSignaler & | mySignaler |
| DtModelDefinitionManagerBackup * | myBackup |
Friends | |
| class | DtModelDefinitionManagerCreator |
| class | DtModelDefinitionManagerBackup |
| class | boost::serialization::access |
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.
| typedef std::map<std::string,DtModelDefinition> makVrv::DtModelDefinitionManager::DefinitionMap |
| virtual makVrv::DtModelDefinitionManager::~DtModelDefinitionManager | ( | ) | [virtual] |
DTOR.
| makVrv::DtModelDefinitionManager::DtModelDefinitionManager | ( | DtDe & | ) | [protected] |
CTOR.
| makVrv::DtModelDefinitionManager::DtModelDefinitionManager | ( | const DtModelDefinitionManager & | ) | [protected] |
| virtual void makVrv::DtModelDefinitionManager::loadDefinitions | ( | ) | [virtual] |
Load all the models in a given directory.
| virtual void makVrv::DtModelDefinitionManager::saveDefinitions | ( | ) | [virtual] |
Save all of the model definitions to a directory.
| virtual void makVrv::DtModelDefinitionManager::saveDefinitions | ( | const std::string & | ) | [virtual] |
| virtual void makVrv::DtModelDefinitionManager::addDefinition | ( | const DtModelDefinition & | definition, |
| bool | autoSave = true |
||
| ) | [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 void makVrv::DtModelDefinitionManager::destroyDefinition | ( | const DtModelDefinition & | def | ) | [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.
| 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.
Set if model instance sharing is enabled.
| void makVrv::DtModelDefinitionManager::setModelInstancingEnabled | ( | bool | enabled | ) |
Set if model instance sharing is enabled.
Clears the cache of all model definitions.
Clears out entire manager.
| virtual void makVrv::DtModelDefinitionManager::merge | ( | const DtModelDefinitionManager & | ) | [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 bool makVrv::DtModelDefinitionManager::loadModelDefinitions | ( | const std::string & | filename, |
| bool | merge = true |
||
| ) | [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 bool makVrv::DtModelDefinitionManager::loadModelDefinition | ( | const std::string & | filename | ) | [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 bool makVrv::DtModelDefinitionManager::exportToFile | ( | const std::vector< std::string > & | defs, |
| const std::string & | filename | ||
| ) | const [virtual] |
Exports the named definitions to the specified file.
The file can then be imported via the loadModelDefinitions() method
| virtual bool makVrv::DtModelDefinitionManager::schemaInUse | ( | const std::string & | ) | const [virtual] |
Returns true if the schema is in use by and model definition.
| virtual bool makVrv::DtModelDefinitionManager::schemaInUse | ( | const std::string & | , |
| std::vector< std::string > & | |||
| ) | const [virtual] |
true if schema is in use and the vector of model defs for those that do
| virtual void makVrv::DtModelDefinitionManager::backup | ( | ) | [virtual] |
Backs up model definitions to backup manager.
| const DtSettingsBackup* makVrv::DtModelDefinitionManager::settingsBackup | ( | ) | const [inline] |
| virtual DtModelDefinitionManager& makVrv::DtModelDefinitionManager::operator= | ( | const DtModelDefinitionManager & | ) | [virtual] |
Assignment operator.
| void makVrv::DtModelDefinitionManager::setAutoSave | ( | bool | b | ) | [inline] |
Sets whether or not to automatically save model definition mananger on any change. Default is true.
| bool makVrv::DtModelDefinitionManager::autoSave | ( | ) | const [inline] |
| virtual void makVrv::DtModelDefinitionManager::removeNonPersistentItems | ( | ) | [virtual] |
Removes items that are not persistent. These items should not be saved to disk or backed-up.
| void makVrv::DtModelDefinitionManager::serialize | ( | Archive & | ar, |
| unsigned int | version | ||
| ) | [inline, protected] |
friend class DtModelDefinitionManagerCreator [friend] |
friend class DtModelDefinitionManagerBackup [friend] |
friend class boost::serialization::access [friend] |
DtDe& makVrv::DtModelDefinitionManager::myDe [protected] |
std::string makVrv::DtModelDefinitionManager::myModelFileName [protected] |
bool makVrv::DtModelDefinitionManager::myAutoSave [protected] |