![]() |
VR-Forces 4.0.4 Class Documentation
|
Manager which owns element definitions.for one type of element Use the makVrv::DtElementDefinitionTypesManager to get each element definition manager. More...
Public Types | |
| typedef boost::unordered_map < DtUnicode, DtElementDefinitionNew * > | DefinitionMap |
| Map from element definition name to definition object. | |
| typedef std::vector< const DtElementDefinitionNew * > | ElementDefinitions |
| List of new element definitions. | |
Public Member Functions | |
| ~DtElementDefinitionManager () | |
| Destructor. | |
| const std::string & | name () const |
| Get the name of the element definition manager. | |
| const DtUnicode & | screenName () const |
| Get the screen name of the element definition manager. | |
| unsigned int | numberOfElementDefinitions () const |
| Get the number of element definitions. | |
| const DefinitionMap & | elementDefinitions () const |
| Get the element definitions. | |
| DtElementDefinitionNew * | findElementDefinition (const DtUnicode &definitionName) |
| Find an element definition by name. | |
| const DtElementDefinitionNew * | findElementDefinition (const DtUnicode &definitionName) const |
| Find an element definition by name. | |
| DtElementDefinitionNew * | createElementDefinition (const DtUnicode &definitionName) |
| Create an element definition with a given name. | |
| DtElementDefinitionNew * | createElementDefinition (const DtUnicode &definitionName, DtElementDefinitionNew *parentDefinition) |
| Create an element definition with a given name, that inherits an existing definition. | |
| void | destroyElementDefinition (DtElementDefinitionNew *) |
| Destroy an element definition, any inherited definitions will now be Parented under destroyed element's parent. | |
| void | destroyElementDefinitionAndChildren (DtElementDefinitionNew *) |
| Destroys an element definition and all of it's child definitions. | |
| DtElementDefinitionNew * | copyElementDefinition (DtElementDefinitionNew &def, const DtUnicode &newName) |
| Create a copy of an element definition, with a new name. | |
| DtBackupInterface * | backup () |
| Get the backup object. | |
| bool | renameElementDefinition (const DtUnicode &oldName, const DtUnicode &newName) |
| Rename an element definition. | |
| void | loadDefaults () |
| Load the default definitions. | |
| void | loadDefaults (bool loadOnlyFactory) |
| Load the default definitions. | |
| void | revertSettings () |
| Revert to startup settings. | |
| virtual void | saveAsDefaults () |
| Called to save the current definitions as the defaults. | |
| virtual void | exportSettings (const std::string &fileName) |
| Export settings to the named file. | |
| virtual void | importSettings (const std::string &fileName, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| Import settings from the named file Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added and were different from any existing definition with the same name. | |
| virtual void | importSettings (const std::string &fileName) |
| Import settings from the named file. | |
| virtual void | mergeSettings (const std::string &fileName, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| Merge settings from the named file Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added and were different from any existing definition with the same name. | |
| virtual DtDeSettings * | settings () |
| Get the settings object that manages element definitions on disk. | |
| virtual void | setFromRecord (const makArchives::DtElementsRecord &rec) |
| Set the element definitions from a record. | |
| virtual void | setFromRecord (const makArchives::DtElementsRecord &rec, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| Set the element definitions from a record Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added and were different from any existing definition with the same name. | |
| virtual void | mergeRecord (const makArchives::DtElementsRecord &rec, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| Merge in the element definitions from a record Returns a list of the new elements. | |
| virtual void | getRecord (makArchives::DtElementsRecord &rec) |
| Fill in a record with the current definitions. | |
| virtual void | setAutoSave (bool enabled) |
| Set whether the manager saves itself out as default when changed. | |
Static Public Member Functions | |
| static const DtElementDefinitionManager * | createConstCopy (const DtElementDefinitionManager &orig) |
| Create a constant copy for use in separate threads. | |
Protected Types | |
| typedef std::vector< const makArchives::DtElementDefinitionRecord * > | ElementGroup |
| A group of element definition records, used for the following map. | |
| typedef std::map< DtUnicode, ElementGroup > | ParentToElementsMap |
| Map from parent element definition name to a group of elements Used to reconstruct the element hierarchy from a flat record in the following functions. | |
| typedef DtRecordSettingsBackup < DtElementDefinitionManager, makArchives::DtElementsRecord > | ElementDefinitionsBackup |
Protected Member Functions | |
| DtElementDefinitionManager (const std::string &name, const DtUnicode &screenName, DtDe &de, bool procedural) | |
| Constructor. | |
| DtElementDefinitionManager (const DtElementDefinitionManager &rhs) | |
| Copy constructor.o. | |
| void | registerDefinitionHierarchy (DtElementDefinitionNew *root) |
| Internal function to register a hierarchy. | |
| void | setFromOldRecord (const makArchives::oldRecords::DtElementDefinitionHierarchy &oldRe, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| Load an old element definition hierarchy record Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added. | |
| void | loadOldDefinitionNode (DtElementDefinitionNew *parent, const makArchives::oldRecords::DtElementDefinitionNode &oldDef, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| Load an old element definition node record (and its subtree) into the manager, under the specified parent definition. | |
| void | buildDefinitionSetsFromOldRecord (DtElementDefinitionNew &newElem, const makArchives::oldRecords::DtElementDefinition &oldElem) |
| build definition sets for a new element definition from an old definition record | |
| virtual void | buildElementVisualizers (DtElementDefinitionNew &ed, const makArchives::DtElementDefinitionRecord &rec) |
| Build the visualizer definition sets for an element from its record. | |
| virtual void | buildElementChildren (DtElementDefinitionNew &ed, ParentToElementsMap &parentToElementsMap, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| Recursively create the child element definitions for an element using a map from parent names to child records. | |
| virtual void | registerBackup () |
| register the settings backup after the de has initialized the shared settings object | |
| virtual bool | recordMatchesDefinition (const makArchives::DtElementDefinitionRecord *childRec, const DtElementDefinitionNew *existingChildDef) const |
Static Protected Member Functions | |
| static DtVisualizerAttribute * | attributeFromOldRecord (const makArchives::oldRecords::DtVisualAttributeInterface *attributeRecord) |
| Convert an old visualizer attribute record into a new attribute. | |
| static makArchives::DtElementDefinitionRecord | buildElementDefinitionRecord (DtElementDefinitionNew &elementDef) |
| Utility function to construct an element definition record from an element definition object. | |
Protected Attributes | |
| std::string | myName |
| DtUnicode | myScreenName |
| DtDe * | myOptionalDe |
| DefinitionMap | myDefinitions |
| bool | myProceduralFlag |
| bool | myAutoSave |
| ElementDefinitionsBackup * | myBackup |
Friends | |
| class | DtElementDefinitionTypeManager |
Manager which owns element definitions.for one type of element Use the makVrv::DtElementDefinitionTypesManager to get each element definition manager.
| typedef boost::unordered_map<DtUnicode,DtElementDefinitionNew*> makVrv::DtElementDefinitionManager::DefinitionMap |
Map from element definition name to definition object.
| typedef std::vector<const DtElementDefinitionNew*> makVrv::DtElementDefinitionManager::ElementDefinitions |
List of new element definitions.
typedef std::vector<const makArchives::DtElementDefinitionRecord*> makVrv::DtElementDefinitionManager::ElementGroup [protected] |
A group of element definition records, used for the following map.
typedef std::map<DtUnicode, ElementGroup> makVrv::DtElementDefinitionManager::ParentToElementsMap [protected] |
Map from parent element definition name to a group of elements Used to reconstruct the element hierarchy from a flat record in the following functions.
typedef DtRecordSettingsBackup<DtElementDefinitionManager, makArchives::DtElementsRecord> makVrv::DtElementDefinitionManager::ElementDefinitionsBackup [protected] |
Destructor.
| makVrv::DtElementDefinitionManager::DtElementDefinitionManager | ( | const std::string & | name, |
| const DtUnicode & | screenName, | ||
| DtDe & | de, | ||
| bool | procedural | ||
| ) | [protected] |
Constructor.
| makVrv::DtElementDefinitionManager::DtElementDefinitionManager | ( | const DtElementDefinitionManager & | rhs | ) | [protected] |
Copy constructor.o.
| static const DtElementDefinitionManager* makVrv::DtElementDefinitionManager::createConstCopy | ( | const DtElementDefinitionManager & | orig | ) | [static] |
Create a constant copy for use in separate threads.
| const std::string& makVrv::DtElementDefinitionManager::name | ( | ) | const |
Get the name of the element definition manager.
This name is used to uniquely specify file names.
| const DtUnicode& makVrv::DtElementDefinitionManager::screenName | ( | ) | const |
Get the screen name of the element definition manager.
This name is display the name of the element type to the user.
| unsigned int makVrv::DtElementDefinitionManager::numberOfElementDefinitions | ( | ) | const |
Get the number of element definitions.
| const DefinitionMap& makVrv::DtElementDefinitionManager::elementDefinitions | ( | ) | const |
Get the element definitions.
This map will change if there are any calls to create or destroy elements. Those calls may invalidate any iterators obtained from the map.
| DtElementDefinitionNew* makVrv::DtElementDefinitionManager::findElementDefinition | ( | const DtUnicode & | definitionName | ) |
Find an element definition by name.
| const DtElementDefinitionNew* makVrv::DtElementDefinitionManager::findElementDefinition | ( | const DtUnicode & | definitionName | ) | const |
Find an element definition by name.
| DtElementDefinitionNew* makVrv::DtElementDefinitionManager::createElementDefinition | ( | const DtUnicode & | definitionName | ) |
Create an element definition with a given name.
| DtElementDefinitionNew* makVrv::DtElementDefinitionManager::createElementDefinition | ( | const DtUnicode & | definitionName, |
| DtElementDefinitionNew * | parentDefinition | ||
| ) |
Create an element definition with a given name, that inherits an existing definition.
Destroy an element definition, any inherited definitions will now be Parented under destroyed element's parent.
| void makVrv::DtElementDefinitionManager::destroyElementDefinitionAndChildren | ( | DtElementDefinitionNew * | ) |
Destroys an element definition and all of it's child definitions.
| DtElementDefinitionNew* makVrv::DtElementDefinitionManager::copyElementDefinition | ( | DtElementDefinitionNew & | def, |
| const DtUnicode & | newName | ||
| ) |
Create a copy of an element definition, with a new name.
The element definition must not be inherited by any other definitions to be copyable. The new definition will share the same parent as the source definition.
Get the backup object.
| bool makVrv::DtElementDefinitionManager::renameElementDefinition | ( | const DtUnicode & | oldName, |
| const DtUnicode & | newName | ||
| ) |
Rename an element definition.
Load the default definitions.
| void makVrv::DtElementDefinitionManager::loadDefaults | ( | bool | loadOnlyFactory | ) |
Load the default definitions.
Revert to startup settings.
| virtual void makVrv::DtElementDefinitionManager::saveAsDefaults | ( | ) | [virtual] |
Called to save the current definitions as the defaults.
| virtual void makVrv::DtElementDefinitionManager::exportSettings | ( | const std::string & | fileName | ) | [virtual] |
Export settings to the named file.
| virtual void makVrv::DtElementDefinitionManager::importSettings | ( | const std::string & | fileName, |
| ElementDefinitions & | addedDefinitions, | ||
| ElementDefinitions & | skippedDefinitions | ||
| ) | [virtual] |
Import settings from the named file Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added and were different from any existing definition with the same name.
| virtual void makVrv::DtElementDefinitionManager::importSettings | ( | const std::string & | fileName | ) | [virtual] |
Import settings from the named file.
| virtual void makVrv::DtElementDefinitionManager::mergeSettings | ( | const std::string & | fileName, |
| ElementDefinitions & | addedDefinitions, | ||
| ElementDefinitions & | skippedDefinitions | ||
| ) | [virtual] |
Merge settings from the named file Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added and were different from any existing definition with the same name.
| virtual DtDeSettings* makVrv::DtElementDefinitionManager::settings | ( | ) | [virtual] |
Get the settings object that manages element definitions on disk.
| virtual void makVrv::DtElementDefinitionManager::setFromRecord | ( | const makArchives::DtElementsRecord & | rec | ) | [virtual] |
Set the element definitions from a record.
| virtual void makVrv::DtElementDefinitionManager::setFromRecord | ( | const makArchives::DtElementsRecord & | rec, |
| ElementDefinitions & | addedDefinitions, | ||
| ElementDefinitions & | skippedDefinitions | ||
| ) | [virtual] |
Set the element definitions from a record Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added and were different from any existing definition with the same name.
| virtual void makVrv::DtElementDefinitionManager::mergeRecord | ( | const makArchives::DtElementsRecord & | rec, |
| ElementDefinitions & | addedDefinitions, | ||
| ElementDefinitions & | skippedDefinitions | ||
| ) | [virtual] |
Merge in the element definitions from a record Returns a list of the new elements.
| virtual void makVrv::DtElementDefinitionManager::getRecord | ( | makArchives::DtElementsRecord & | rec | ) | [virtual] |
Fill in a record with the current definitions.
| virtual void makVrv::DtElementDefinitionManager::setAutoSave | ( | bool | enabled | ) | [virtual] |
Set whether the manager saves itself out as default when changed.
| void makVrv::DtElementDefinitionManager::registerDefinitionHierarchy | ( | DtElementDefinitionNew * | root | ) | [protected] |
Internal function to register a hierarchy.
| static DtVisualizerAttribute* makVrv::DtElementDefinitionManager::attributeFromOldRecord | ( | const makArchives::oldRecords::DtVisualAttributeInterface * | attributeRecord | ) | [static, protected] |
Convert an old visualizer attribute record into a new attribute.
| void makVrv::DtElementDefinitionManager::setFromOldRecord | ( | const makArchives::oldRecords::DtElementDefinitionHierarchy & | oldRe, |
| ElementDefinitions & | addedDefinitions, | ||
| ElementDefinitions & | skippedDefinitions | ||
| ) | [protected] |
Load an old element definition hierarchy record Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added.
| void makVrv::DtElementDefinitionManager::loadOldDefinitionNode | ( | DtElementDefinitionNew * | parent, |
| const makArchives::oldRecords::DtElementDefinitionNode & | oldDef, | ||
| ElementDefinitions & | addedDefinitions, | ||
| ElementDefinitions & | skippedDefinitions | ||
| ) | [protected] |
Load an old element definition node record (and its subtree) into the manager, under the specified parent definition.
Passing a null parent loads the subtree with no parent (as a root node) Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added
| void makVrv::DtElementDefinitionManager::buildDefinitionSetsFromOldRecord | ( | DtElementDefinitionNew & | newElem, |
| const makArchives::oldRecords::DtElementDefinition & | oldElem | ||
| ) | [protected] |
build definition sets for a new element definition from an old definition record
| virtual void makVrv::DtElementDefinitionManager::buildElementVisualizers | ( | DtElementDefinitionNew & | ed, |
| const makArchives::DtElementDefinitionRecord & | rec | ||
| ) | [protected, virtual] |
Build the visualizer definition sets for an element from its record.
| virtual void makVrv::DtElementDefinitionManager::buildElementChildren | ( | DtElementDefinitionNew & | ed, |
| ParentToElementsMap & | parentToElementsMap, | ||
| ElementDefinitions & | addedDefinitions, | ||
| ElementDefinitions & | skippedDefinitions | ||
| ) | [protected, virtual] |
Recursively create the child element definitions for an element using a map from parent names to child records.
| static makArchives::DtElementDefinitionRecord makVrv::DtElementDefinitionManager::buildElementDefinitionRecord | ( | DtElementDefinitionNew & | elementDef | ) | [static, protected] |
Utility function to construct an element definition record from an element definition object.
| virtual void makVrv::DtElementDefinitionManager::registerBackup | ( | ) | [protected, virtual] |
register the settings backup after the de has initialized the shared settings object
| virtual bool makVrv::DtElementDefinitionManager::recordMatchesDefinition | ( | const makArchives::DtElementDefinitionRecord * | childRec, |
| const DtElementDefinitionNew * | existingChildDef | ||
| ) | const [protected, virtual] |
friend class DtElementDefinitionTypeManager [friend] |
std::string makVrv::DtElementDefinitionManager::myName [protected] |
DtDe* makVrv::DtElementDefinitionManager::myOptionalDe [protected] |
bool makVrv::DtElementDefinitionManager::myAutoSave [protected] |