![]() |
VR-Forces 5.0.1 Developer's Guide
|
Manager which owns element definitions.for one type of element Use the makVrv::DtElementDefinitionTypesManager to get each element definition manager.

Public Types | |
| typedef std::map< DtUnicode, DtElementDefinitionNew * > | DefinitionMap |
| typedef std::map< std::string, makArchives::DtElementsRecord > | StringToElementsRecordMap |
| typedef std::vector< const DtElementDefinitionNew * > | ElementDefinitions |
| typedef std::vector < std::string > ::const_iterator | ParentToElementIter |
Public Member Functions | |
| virtual | ~DtElementDefinitionManager () |
| const std::string & | name () const |
| const DtUnicode & | screenName () const |
| unsigned int | numberOfElementDefinitions () const |
| const DefinitionMap & | elementDefinitions () const |
| DtElementDefinitionNew * | findElementDefinition (const DtUnicode &definitionName) |
| const DtElementDefinitionNew * | findElementDefinition (const DtUnicode &definitionName) const |
| DtElementDefinitionNew * | createElementDefinition (const DtUnicode &definitionName) |
| DtElementDefinitionNew * | createElementDefinition (const DtUnicode &definitionName, DtElementDefinitionNew *parentDefinition) |
| void | destroyElementDefinition (DtElementDefinitionNew *) |
| void | destroyElementDefinitionAndChildren (DtElementDefinitionNew *) |
| DtElementDefinitionNew * | copyElementDefinition (DtElementDefinitionNew &def, const DtUnicode &newName) |
| DtBackupInterface * | backup () |
| bool | renameElementDefinition (const DtUnicode &oldName, const DtUnicode &newName) |
| void | loadDefaults () |
| void | loadDefaults (bool loadOnlyFactory) |
| DefinitionMap & | modifiedDefinitions () |
| virtual std::vector< std::string > | retrieveHierFilesToMerge (const std::string &type) |
| virtual std::vector< std::string > | retrieveLeafFilesToMerge (const std::string &type) |
| virtual bool | shouldSkipDefLoading () |
| void | revertSettings () |
| virtual void | saveAsDefaults () |
| virtual void | splitAndWriteToDir (makArchives::DtElementsRecord &elementsRec, const std::string &existingDirName) |
| virtual void | exportSettings (const std::string &fileOrDirName) |
| virtual void | exportSelectedSettings (const std::vector< std::string > &names, const std::string &fileName) |
| virtual void | exportHierSettings (const std::string &fileName) |
| virtual void | exportLeafSettings (std::vector< std::string > &fileList) |
| virtual void | exportSelectedLeafSettings (const std::vector< std::string > &names, const std::string &fileName) |
| void | createFolderFromPathAndSplit (const std::string &fileOrDirName, std::string &newPath, std::string &dirName) |
| virtual void | importSettings (const std::string &fileName, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| virtual void | importSettings (const std::string &fileName) |
| virtual void | mergeHierSettings (const std::string &hierFileOrDirName) |
| virtual void | mergeHierSettings (const std::string &hierFileOrDirName, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| virtual void | mergeLeafSettings (const std::string &leafFileOrDirName) |
| virtual void | mergeLeafSettings (const std::string &fileOrDirName, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| virtual void | mergeSettings (const std::string &fileName, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| virtual void | markRecordsAsHier (makArchives::DtElementsRecord &rec) |
| virtual DtDeSettings * | settings () |
| virtual void | setFromRecord (const makArchives::DtElementsRecord &elemRecord) |
| virtual void | setFromRecord (const makArchives::DtElementsRecord &elemRecord, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| virtual void | setFromRecords (StringToElementsRecordMap &elemRecords, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| virtual void | mergeRecords (StringToElementsRecordMap &recordMap, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| virtual void | mergeHierRecord (const makArchives::DtElementsRecord &hierRecord, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| virtual void | mergeLeafRecords (StringToElementsRecordMap &recordMap, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| virtual void | mergeLeafRecord (const makArchives::DtElementsRecord &leafRecord, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions) |
| virtual void | getRecord (makArchives::DtElementsRecord &rec) |
| virtual void | getRecord (const std::vector< std::string > &elementDefinitions, makArchives::DtElementsRecord &rec) |
| virtual void | getRecordIncludingParent (const std::vector< std::string > &elementDefinitions, makArchives::DtElementsRecord &rec) |
| virtual void | getSplitRecord (std::vector< makArchives::DtElementsRecord > &rec, std::vector< std::string > &fileNames) |
| virtual void | addRecords (makArchives::DtElementsRecord &recs, makArchives::DtElementsRecord &combinedRec) |
| virtual void | splitRecordElemMgr (makArchives::DtElementsRecord &rec, makArchives::DtElementsRecord &recHier, makArchives::DtElementsRecord &recLeaves) |
| virtual void | setAutoSave (bool enabled) |
| virtual bool | validateElementDefinition (const DtElementDefinitionNew &def) |
| virtual bool | validateElementAttribute (const DtVisualizerDefinition::SortedAttributeMap::iterator &attr) |
| virtual DtUnicode | getElementDefinitionError (const DtElementDefinitionNew &def) |
| virtual bool | canUseHierLeaf () |
| virtual bool | modifiedSinceStartup () |
| virtual void | resetModifiedSinceStartupFlag () |
| virtual void | addToModifiedDefinitionsMap (DtElementDefinitionNew *modelDefinition) |
| virtual void | addToAddedDefinitionsMap (DtElementDefinitionNew *modelDefinition) |
| DefinitionMap | getDeletedDefinitionsMap () |
| virtual void | addToDeletedDefinitionsMap (DtElementDefinitionNew *modelDefinition) |
| virtual void | resetModifiedFlags () |
| DtUnicode | findFirstDefWithAttribPair (const DtUnicode &attributeName, const DtUnicode &attributeValue) |
| DtVisualizerAttributeStringVector::StringVector | findAllAttributeValues (const DtUnicode &elementDefName, const DtUnicode &attributeName) |
| virtual std::string | getModelSetDisplayName (int modelSet) const |
Static Public Member Functions | |
| static const DtElementDefinitionManager * | createConstCopy (const DtElementDefinitionManager &orig) |
| static makArchives::DtElementDefinitionRecord | buildElementDefinitionRecord (DtElementDefinitionNew &elementDef) |
Public Attributes | |
| boost::signalslib::signal< void()> | signal_managerAboutTobeDeleted |
Protected Types | |
| typedef std::pair< std::string, const makArchives::DtElementDefinitionRecord * > | ElementPair |
| typedef std::vector< ElementPair > | ElementGroup |
| typedef std::map< DtUnicode, ElementGroup > | ParentToElementsMap |
| typedef std::map< std::string, DtVisualizerDefinitionValidator * > | VisualizerDefinitionValidatorMap |
| typedef DtRecordSettingsBackup < DtElementDefinitionManager, makArchives::DtElementsRecord > | ElementDefinitionsBackup |
Static Protected Member Functions | |
| static void | setupVisualizerDefs (makArchives::DtElementDefinitionRecord &elementRec, DtElementDefinitionNew &elementDef, unsigned int modelSet) |
Protected Attributes | |
| VisualizerDefinitionValidatorMap | myValidators |
| std::string | myName |
| std::string | myHierName |
| std::string | myLeafName |
| DtUnicode | myScreenName |
| DtDe * | myOptionalDe |
| DefinitionMap | myDefinitions |
| boost::unordered_map < std::string, std::string > | myDefinitionNameCheck |
| bool | myProceduralFlag |
| bool | myAutoSave |
| ElementDefinitionsBackup * | myBackup |
| int | myStartupNumOfDefinition |
| DefinitionMap | myModifiedDefinitions |
| DefinitionMap | myAddedDefinitions |
| DefinitionMap | myDeletedDefinitions |
Private Member Functions | |
| DtElementDefinitionManager () | |
| DtElementDefinitionManager & | operator= (const DtElementDefinitionManager &) |
Friends | |
| class | DtElementDefinitionTypeManager |
| typedef std::map<DtUnicode, DtElementDefinitionNew*> makVrv::DtElementDefinitionManager::DefinitionMap |
Ordered map from element definition name to definition object.
| typedef std::map<std::string, makArchives::DtElementsRecord> makVrv::DtElementDefinitionManager::StringToElementsRecordMap |
Ordered map from a string (filename) to a DtElementsRecord.
| typedef std::vector<const DtElementDefinitionNew*> makVrv::DtElementDefinitionManager::ElementDefinitions |
List of new element definitions.
| typedef std::vector<std::string>::const_iterator makVrv::DtElementDefinitionManager::ParentToElementIter |
Iterator for parent to element names.
|
protected |
a pair, holding the definition file name in the key and the element definition record in the value
|
protected |
A group of element definition records, used for the following map.
|
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.
|
protected |
|
protected |
|
virtual |
Destructor.
|
protected |
Constructor.
|
protected |
Copy constructor.o.
|
private |
Default constructor.
|
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.
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.
| void makVrv::DtElementDefinitionManager::destroyElementDefinition | ( | DtElementDefinitionNew * | ) |
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.
| DtBackupInterface* makVrv::DtElementDefinitionManager::backup | ( | ) |
Get the backup object.
| bool makVrv::DtElementDefinitionManager::renameElementDefinition | ( | const DtUnicode & | oldName, |
| const DtUnicode & | newName | ||
| ) |
Rename an element definition.
| void makVrv::DtElementDefinitionManager::loadDefaults | ( | ) |
Load the default definitions.
| void makVrv::DtElementDefinitionManager::loadDefaults | ( | bool | loadOnlyFactory | ) |
Load the default definitions.
| DefinitionMap& makVrv::DtElementDefinitionManager::modifiedDefinitions | ( | ) |
Returns map of modified definitions.
|
virtual |
For command line arguments, list of .hier files from command line for this type (entity, aggregate, tactical graphics, etc)
Reimplemented in makVrf::DtVrfElementDefinitionManager.
|
virtual |
For command line arguments, list of .leaf files from command line for this type (entity, aggregate, tactical graphics, etc)
Reimplemented in makVrf::DtVrfElementDefinitionManager.
|
virtual |
Given command line parameters, should we skip loading definitions from the usual place (currently entity, aggregate, tactical graphics can skip)
Reimplemented in makVrf::DtVrfElementDefinitionManager.
| void makVrv::DtElementDefinitionManager::revertSettings | ( | ) |
Revert to startup settings.
|
virtual |
Called to save the current definitions as the defaults.
|
virtual |
Write records as .hier/.leaf to an existing directory.
|
virtual |
Export settings to the named file.
|
virtual |
Export Selected settings to the name file.
|
virtual |
Export hierarchy to the named file.
|
virtual |
Export leafs to the name file (elements with no children) fileList is the list of all leaf files in directory This function matches each definition to their matching file name in the fileList.
|
virtual |
Export Selected leafs to the name file (elements with no children)
| void makVrv::DtElementDefinitionManager::createFolderFromPathAndSplit | ( | const std::string & | fileOrDirName, |
| std::string & | newPath, | ||
| std::string & | dirName | ||
| ) |
For saving out element definitions, make a folder and write a file for the hierarchy, and one for the leaf element definitions.
|
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 |
Import settings from the named file.
|
virtual |
Merge in a .hier file or directory that contains .hier files.
|
virtual |
Merge in a .hier file or directory that contains .hier files.
|
virtual |
Merge a .leaf file into the existing hierarchy Replace existing leaves and add new leaves.
|
virtual |
Merge in a .hier file or directory that contains .hier files.
|
virtual |
Merge records from *.elem or *.leaf file.
|
virtual |
Mark all the element definitions in this record as belonging to the element hierarchy (used when records are split into hier/leaf files or when .elem is loaded)
|
virtual |
Get the settings object that manages element definitions on disk.
|
virtual |
Set the element definitions from a record will mark all hier DtelementsRecord as isHier() == true will not mark nodes it determines to be leaves as isHier()=false in case some of those nodes are desired to be in the hierarchy.
|
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 This function is still needed because it is called in some locations Certain lines of code are nearly identical to setFromRecords but setFromRecords lines contain certain lines specifically for map so they cannot be shared.
|
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 This takes in a map as opposed to a vector, like setFromRecord does. This is to accommodate the key to hold the definition's file location.
|
virtual |
Merge in the element definitions from records Returns a list of the new elements This takes in a map as opposed to a vector, like mergeRecord does. This is to accommodate the key to hold the definition's file location.
|
virtual |
Merge in the element definitions from a record Returns a list of the new elements.
|
virtual |
Merge in the element definitions from all leaf records Returns a list of the new elements.
|
virtual |
Merge in the element definitions from a record Returns a list of the new elements.
|
virtual |
Fill in a record with the current definitions.
|
virtual |
Fill in a record with the passed definitions.
|
virtual |
Fill in a record with the passed definitions and their parents(if exist)
|
virtual |
Divide the single DefinitionMap into multiple pieces (hierarchy, leaves for this case) fileNames are root files names (.backup is appended)
|
virtual |
Take element definitions and append them to the existing element definitions.
|
virtual |
Take myDefinitions and split it into two DtElementsRecords One for leaf elements (elements with no children) and one just for hierarchy elements (non-leaf nodes) will mark all hier as hier (isHier() == true)
|
virtual |
Set whether the manager saves itself out as default when changed.
|
virtual |
Validate an element definition against its registered schema validator, if any.
|
virtual |
Validate an element attribute against its registered schema validator, if any.
|
virtual |
Gets the string indicates the errors in an element definition.
|
static |
Utility function to construct an element definition record from an element definition object.
|
virtual |
Are these element definitions using the .hier/.leaf setup?
Reimplemented in makVrf::DtVrfElementDefinitionManager.
|
virtual |
return whether the element definitions have modified since start up
|
virtual |
Reset the flag about any changes to element definitions since start up.
|
virtual |
add a model definition to the modifiedDefinitions map
|
virtual |
add a model definition to the addedDefinitions map
| DefinitionMap makVrv::DtElementDefinitionManager::getDeletedDefinitionsMap | ( | ) |
get the map of deleted definitions
|
virtual |
add a model definition to the deletedDefinitions map
|
virtual |
reset the flags about the modification after you have save it.
| DtUnicode makVrv::DtElementDefinitionManager::findFirstDefWithAttribPair | ( | const DtUnicode & | attributeName, |
| const DtUnicode & | attributeValue | ||
| ) |
search the list of definitions for one with the attribute value pair requested and return the name of the first one found
| DtVisualizerAttributeStringVector::StringVector makVrv::DtElementDefinitionManager::findAllAttributeValues | ( | const DtUnicode & | elementDefName, |
| const DtUnicode & | attributeName | ||
| ) |
search the attributes of a definitions for one with the attribute name requested and return a list of all values for those attributes
|
virtual |
Gets the display name for a modelSet. 0 for "Model Set 3D" etc.
| modelSet | The model set. |
|
protected |
Internal function to register a hierarchy.
|
protectedvirtual |
Build the visualizer definition sets for an element from its record.
|
protectedvirtual |
Build the 2D, 3D, XR visualizers for a particular model set.
|
protectedvirtual |
Recursively create the child element definitions for an element using a map from parent names to child records.
|
staticprotected |
Utility function to construct the visualizer definitions for 2D, 3D, XR.
|
protectedvirtual |
register the settings backup after the de has initialized the shared settings object
|
protectedvirtual |
Do all visualizers for all model sets match.
|
protectedvirtual |
Does (2D,3D,XR) match (2D,3D,XR) in another definition.
|
protectedvirtual |
Generate data structure mapping parent1 -> vec{child1, child2, child3}.
|
protectedvirtual |
Check if .leaf files contain only leaf nodes.
|
protectedvirtual |
Load .leaf files and add/replace existing entries in the record.
|
protectedvirtual |
Load from appData/definitions/ElementDefinitions.
|
protectedvirtual |
Since we are using folders for only entity element definitions this is a way to identify that case.
|
protectedvirtual |
Check if an element has the same name but different capitalization or if it has 'Name', 'Name 1', 'Name 2' which happens sometimes with VRF.
|
private |
Assignment Operator.
|
friend |
| boost::signalslib::signal<void()> makVrv::DtElementDefinitionManager::signal_managerAboutTobeDeleted |
Signals Signal sent when this manager is about to be deleted.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |