VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Friends
makVrv::DtElementDefinitionManager Class Reference

Manager which owns element definitions.for one type of element Use the makVrv::DtElementDefinitionTypesManager to get each element definition manager. How DtElementDefinitions work - Element Definitions are used specify which visual elements(Visualizers) will be created for an object; and how those visual elements will be configured. Each visual element is specified and configured with a Visualizer Definition.The specifications for that visual element are provided as Visualizer Attributes.Visualizer Definitions in turn are grouped into Visualizer Definition Sets.

The system supports 6 different model sets, but only 3 are actively used - the 3D model set, the XR model set, and the icon(2D) model set.Each Element Definition has a Visualizer Definition Set for each model set(although the sets for unused model sets may be empty).

Element Definitions are organized hierarchically.Visualizer Definitions are inherited by descendant Element Definitions(within their corresponding Visualizer Definition Sets).Visualizer Attributes can be added or overridden by including a corresponding Visualizer Definition in a descendant Element Definition.

A request for the attributes of a Visualizer Definition in a particular Element Definition will start with the Visualizer Definition(either local or inherited) in that Element Definition and works it's way up the hierarchy adding any inherited attributes that haven't already been seen.

So there is a hierarchical relationship for the Element Definitions, but also a corresponding hierarchy for each Visualizer Definition within any given Element Definition hierarchy.

Within the API(once data is loaded) each Element Definition has a pointer to it's parent Element Definition (if any) and a children's list.Similarly, each Visualizer Definition will have a parent pointer to it's parent Visualizer Definition and a children's list.

In it's archive form (saved in SharedData), just parent info is maintained. Each element definition has a Name and a Parent Name (which specifies it's parent Element Definition's Name). Visualizer Definitions have a UUID string and a parent UUID string.

There is an important different here though.Each Element Definition Name is unique; but Visualizer Definition UUID strings are shared by all the visualizer definitions within a corresponding Element Definition hierarchy.

Inheritance diagram for makVrv::DtElementDefinitionManager:
Inheritance graph
[legend]

Public Types

enum  DefinitionFileType { DefinitionFileType::FileTypeHierarchy, DefinitionFileType::FileTypeLeaf, DefinitionFileType::FileTypeBoth }
 
typedef std::map< DtUnicode,
DtElementDefinition * > 
DefinitionMap
 
typedef std::map< std::string,
makArchives::DtElementsRecord
StringToElementsRecordMap
 
typedef std::vector< const
DtElementDefinition * > 
ElementDefinitions
 
typedef std::vector
< std::string >
::const_iterator 
ParentToElementIter
 

Public Member Functions

 DtElementDefinitionManager ()=delete
 
DtElementDefinitionManageroperator= (const DtElementDefinitionManager &)=delete
 
virtual ~DtElementDefinitionManager ()
 
virtual const std::string & name () const
 
virtual const DtUnicodescreenName () const
 
virtual const std::string & rootsFilesname () const
 
virtual unsigned int numberOfElementDefinitions () const
 
virtual const DefinitionMapelementDefinitions () const
 
virtual DtElementDefinitionfindElementDefinition (const DtUnicode &definitionName)
 
virtual const DtElementDefinitionfindElementDefinition (const DtUnicode &definitionName) const
 
virtual DtElementDefinitioncreateElementDefinition (const DtUnicode &definitionName)
 
virtual DtElementDefinitioncreateElementDefinition (const DtUnicode &definitionName, DtElementDefinition *parentDefinition)
 
virtual void destroyElementDefinition (DtElementDefinition *)
 
virtual void destroyElementDefinitionAndChildren (DtElementDefinition *)
 
virtual DtElementDefinitioncopyElementDefinition (DtElementDefinition &def, const DtUnicode &newName)
 
virtual DtBackupInterfacebackup ()
 
virtual bool renameElementDefinition (const DtUnicode &oldName, const DtUnicode &newName)
 
virtual void loadDefaults ()
 
virtual void loadDefaults (bool loadOnlyFactory)
 
virtual DefinitionMapmodifiedDefinitions ()
 
virtual std::vector< std::string > retrieveHierFilesToMerge (const std::string &type)
 
virtual std::vector< std::string > retrieveLeafFilesToMerge (const std::string &type)
 
virtual bool shouldSkipDefLoading ()
 
virtual 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 exportHierSettings (std::vector< std::string > &fileList)
 
virtual void exportLeafSettings (std::vector< std::string > &fileList)
 
virtual void exportSelectedLeafSetting (const std::string &name, const std::string &fileName)
 
virtual void exportSelectedHierSetting (const std::string &name, const std::string &fileName, bool allLevels=true)
 
virtual void createFolderFromPathAndSplit (const std::string &fileOrDirName, std::string &newPath, std::string &dirName)
 
virtual bool importAndReplaceSettings (const std::string &fileName)
 
virtual bool importAndReplaceHierRecords (StringToElementsRecordMap &recordMap, const std::string &importFileName)
 
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 DtDeSettingssettings ()
 
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, bool &forceSaveAfterLoad)
 
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) const
 
virtual void getRecord (makArchives::DtElementsRecord &rec, const std::string &fileName) const
 
virtual void getRecord (const std::vector< std::string > &elementDefinitions, makArchives::DtElementsRecord &rec) const
 
virtual void getRecordIncludingParent (const std::vector< std::string > &elementDefinitions, makArchives::DtElementsRecord &rec) const
 
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 DtElementDefinition &def)
 
virtual bool validateElementAttribute (const DtVisualizerDefinition::SortedAttributeMap::iterator &attr)
 
virtual DtUnicode getElementDefinitionError (const DtElementDefinition &def)
 
virtual bool canUseHierLeaf ()
 
virtual bool modifiedSinceStartup ()
 
virtual void resetModifiedSinceStartupFlag ()
 
virtual void addToModifiedDefinitionsMap (DtElementDefinition *modelDefinition)
 
virtual void addToAddedDefinitionsMap (DtElementDefinition *modelDefinition)
 
virtual DefinitionMap getDeletedDefinitionsMap ()
 
virtual void addToDeletedDefinitionsMap (DtElementDefinition *modelDefinition)
 
virtual void resetModifiedFlags ()
 
virtual DtUnicode findFirstDefWithAttribPair (const DtUnicode &attributeName, const DtUnicode &attributeValue)
 
virtual
DtVisualizerAttributeStringVector::StringVector 
findAllAttributeValues (const DtUnicode &elementDefName, const DtUnicode &attributeName)
 
virtual std::string getModelSetDisplayName (DtModelSetId modelSet) const
 
virtual void removeElementFromChangeMaps (const DtUnicode &definitionName)
 
virtual void removeElementsFromChangeMaps (DefinitionFileType fileType)
 
virtual void getChangedFiles (std::vector< std::string > &changedFiles, DefinitionFileType fileType)
 

Static Public Member Functions

static const
DtElementDefinitionManager
createConstCopy (const DtElementDefinitionManager &orig)
 
static
makArchives::DtElementDefinitionRecord 
buildElementDefinitionRecord (const DtElementDefinition &elementDef)
 
static void setupVisualizerDefs (makArchives::DtElementDefinitionRecord &elementRec, const DtElementDefinition &elementDef, DtModelSetId modelSet)
 
static bool isHierFileName (const std::string &fileName)
 

Public Attributes

boost::signalslib::signal< void()> signal_managerAboutTobeDeleted
 

Protected Types

typedef std::pair< std::string,
const
makArchives::DtElementDefinitionRecord * > 
ElementPair
 
typedef std::vector< ElementPairElementGroup
 
typedef std::map< DtUnicode,
ElementGroup
ParentToElementsMap
 
typedef std::map< std::string,
DtVisualizerDefinitionValidator * > 
VisualizerDefinitionValidatorMap
 
typedef DtRecordSettingsBackup
< DtElementDefinitionManager,
makArchives::DtElementsRecord
ElementDefinitionsBackup
 

Protected Member Functions

 DtElementDefinitionManager (const std::string &name, const DtUnicode &screenName, DtDe &de, bool procedural)
 
 DtElementDefinitionManager (const DtElementDefinitionManager &rhs)
 
virtual void registerDefinitionHierarchy (DtElementDefinition *root)
 
virtual void buildElementVisualizerDefinitions (DtElementDefinition &newDef, const makArchives::DtElementDefinitionRecord &defRecord)
 
virtual void buildElementVisualizerDefinitionsForModelSet (const makArchives::DtElementDefinitionRecord &defRecord, DtElementDefinition &newDef, DtModelSetId modelSet)
 
virtual void buildElementChildren (DtElementDefinition &ed, ParentToElementsMap &parentToElementsMap, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 
virtual void registerBackup ()
 
virtual bool recordMatchesDefinition (const makArchives::DtElementDefinitionRecord *childRec, const DtElementDefinition *existingChildDef) const
 
virtual bool recordMatchesDefinitionModelSet (const makArchives::DtElementDefinitionRecord *childRec, const DtElementDefinition *existingChildDef, DtModelSetId modelSet) const
 
virtual void generateParentToElement (ParentToElementsMap &parentToElements, StringToElementsRecordMap &rec)
 
virtual bool checkRecordsAreLeavesInHier (ParentToElementsMap &parentToElements, StringToElementsRecordMap &recordMap, std::vector< std::string > &leafFiles)
 
virtual bool replaceMergeLeaves (StringToElementsRecordMap &firstRecMap, StringToElementsRecordMap &secondRecMap, const std::vector< std::string > &leafFiles)
 
virtual bool loadDefaultsFromHierLeafDir (StringToElementsRecordMap &recordMap)
 
virtual bool isEntityDefinitions () const
 
virtual bool isTacticalGraphicsDefinitions () const
 
virtual bool isUnitDefinitions () const
 
virtual void checkDefinitionName (const DtUnicode &definitionName)
 
virtual void processVisualizerDefinitionAttributes (DtVisualizerDefinition *vd, const makArchives::DtVisualizerDefinitionRecord &vdRecord, const std::string &defName, DtModelSetId modelSet)
 
virtual void logWarning (const std::string &message)
 
virtual void getFilesFromDefinitionMap (const DefinitionMap &defMap, std::set< std::string > &changedFiles)
 
virtual void removeElementsFromDefnitionMap (DefinitionMap &defMap, DefinitionFileType fileType)
 

Protected Attributes

VisualizerDefinitionValidatorMap myValidators
 
std::string myName
 
std::string myRootsFilename
 
std::string myHierName
 
std::string myLeafName
 
DtUnicode myScreenName
 
DtDemyOptionalDe
 
DefinitionMap myDefinitions
 
boost::unordered_map
< std::string, std::string > 
myDefinitionNameCheck
 
bool myProceduralFlag
 
bool myAutoSave
 
ElementDefinitionsBackupmyBackup
 
DefinitionMap myModifiedDefinitions
 
DefinitionMap myAddedDefinitions
 
bool myConvertingHierarchy
 
DefinitionMap myDeletedDefinitions
 
bool myConvertWarningsToInfo = false
 

Friends

class DtElementDefinitionTypeManager
 
typedef std::multimap< const
std::string,
DtVisualizerDefinition * > 
ParentSchemaDataMap
 
typedef std::multimap< const
std::string,
DtVisualizerDefinition * >
::iterator 
ParentSchemaDataInterator
 
typedef std::multimap< const
std::string,
DtVisualizerDefinition * >
::const_iterator 
ConstParentSchemaDataInterator
 
virtual DtVisualizerDefinitionconvertLoadedVisualizerDefinition (const makArchives::DtVisualizerDefinitionRecord &vdRecord, DtVisualizerDefinitionSet &vdSet, int visualizerIndex, DtElementDefinition *ancestor)
 
virtual bool hierarchyNeedsConversion (const makArchives::DtElementDefinitionRecord *elemRec) const
 
virtual void clearDefinitionMap (DefinitionMap &map)
 
virtual bool validateVisualizerDefinitionSet (const DtElementDefinition &newDef, const DtVisualizerDefinitionSet &vdSet, const makArchives::DtVisualizerDefinitionSetRecords *vdRecordSet)
 
virtual void convertLeafToUuid (const std::vector< makArchives::DtVisualizerDefinitionRecord > &visualizerDefinitionRecords, const Utf8String &elementName, const Utf8String &parentName, DtVisualizerDefinitionSet &vdSet)
 
virtual DtVisualizerDefinitionfindAncestorVisualizerDefinition (const std::string &schemaName, ParentSchemaDataMap &schemaDataMap)
 

Member Typedef Documentation

Ordered map from element definition name to definition object.

Ordered map from a string (fileName) to a DtElementsRecord.

List of new element definitions.

typedef std::vector<std::string>::const_iterator makVrv::DtElementDefinitionManager::ParentToElementIter

Iterator for parent to element names.

a pair, holding the definition file name in the key and the element definition record in the value

A group of element definition records, used for the following map.

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 std::multimap<const std::string, DtVisualizerDefinition*> makVrv::DtElementDefinitionManager::ParentSchemaDataMap
protected

Remove all elements from a definition map.

typedef std::multimap<const std::string, DtVisualizerDefinition*>::iterator makVrv::DtElementDefinitionManager::ParentSchemaDataInterator
protected

Remove all elements from a definition map.

typedef std::multimap<const std::string, DtVisualizerDefinition*>::const_iterator makVrv::DtElementDefinitionManager::ConstParentSchemaDataInterator
protected

Remove all elements from a definition map.

Member Enumeration Documentation

Enumerator
FileTypeHierarchy 
FileTypeLeaf 
FileTypeBoth 

Constructor & Destructor Documentation

makVrv::DtElementDefinitionManager::DtElementDefinitionManager ( )
delete

Default constructor- Not implemented.

virtual makVrv::DtElementDefinitionManager::~DtElementDefinitionManager ( )
virtual

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.

Member Function Documentation

static const DtElementDefinitionManager* makVrv::DtElementDefinitionManager::createConstCopy ( const DtElementDefinitionManager orig)
static

Create a constant copy for use in separate threads.

static makArchives::DtElementDefinitionRecord makVrv::DtElementDefinitionManager::buildElementDefinitionRecord ( const DtElementDefinition elementDef)
static

Utility function to construct an element definition record from an element definition object.

static void makVrv::DtElementDefinitionManager::setupVisualizerDefs ( makArchives::DtElementDefinitionRecord elementRec,
const DtElementDefinition elementDef,
DtModelSetId  modelSet 
)
static

Utility function to construct the visualizer definitions for 2D, 3D, XR.

static bool makVrv::DtElementDefinitionManager::isHierFileName ( const std::string &  fileName)
static

Utility function to determine if fileName is a .hier file (! isHierFileName() means leaf file)

DtElementDefinitionManager& makVrv::DtElementDefinitionManager::operator= ( const DtElementDefinitionManager )
delete

Assignment Operator- Not implemented.

virtual const std::string& makVrv::DtElementDefinitionManager::name ( ) const
virtual

Get the name of the element definition manager. This name is used to uniquely specify file names.

virtual const DtUnicode& makVrv::DtElementDefinitionManager::screenName ( ) const
virtual

Get the screen name of the element definition manager. This name is display the name of the element type to the user.

virtual const std::string& makVrv::DtElementDefinitionManager::rootsFilesname ( ) const
virtual

This is the name of the .hier file that contains the root element definitions for this type of element If multiple such files are found, setFromRecords will warn and abort.

virtual unsigned int makVrv::DtElementDefinitionManager::numberOfElementDefinitions ( ) const
virtual

Get the number of element definitions.

virtual const DefinitionMap& makVrv::DtElementDefinitionManager::elementDefinitions ( ) const
virtual

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.

virtual DtElementDefinition* makVrv::DtElementDefinitionManager::findElementDefinition ( const DtUnicode definitionName)
virtual

Find an element definition by name.

Returns
0 if the definition is not found.
virtual const DtElementDefinition* makVrv::DtElementDefinitionManager::findElementDefinition ( const DtUnicode definitionName) const
virtual

Find an element definition by name.

Returns
0 if the definition is not found.
virtual DtElementDefinition* makVrv::DtElementDefinitionManager::createElementDefinition ( const DtUnicode definitionName)
virtual

Create an element definition with a given name.

Returns
0 If the element definition with the name already exists.
virtual DtElementDefinition* makVrv::DtElementDefinitionManager::createElementDefinition ( const DtUnicode definitionName,
DtElementDefinition parentDefinition 
)
virtual

Create an element definition with a given name, that inherits an existing definition.

Returns
0 If the element definition with the name already exists.
virtual void makVrv::DtElementDefinitionManager::destroyElementDefinition ( DtElementDefinition )
virtual

Destroy an element definition, any inherited definitions will now be Parented under destroyed element's parent.

virtual void makVrv::DtElementDefinitionManager::destroyElementDefinitionAndChildren ( DtElementDefinition )
virtual

Destroys an element definition and all of it's child definitions.

virtual DtElementDefinition* makVrv::DtElementDefinitionManager::copyElementDefinition ( DtElementDefinition def,
const DtUnicode newName 
)
virtual

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.

virtual DtBackupInterface* makVrv::DtElementDefinitionManager::backup ( )
virtual

Get the backup object.

virtual bool makVrv::DtElementDefinitionManager::renameElementDefinition ( const DtUnicode oldName,
const DtUnicode newName 
)
virtual

Rename an element definition.

Returns
true if the element was renamed.
false if an element with the old name was not found or an element with the new name already existed.
virtual void makVrv::DtElementDefinitionManager::loadDefaults ( )
virtual

Load the default definitions.

virtual void makVrv::DtElementDefinitionManager::loadDefaults ( bool  loadOnlyFactory)
virtual

Load the default definitions.

virtual DefinitionMap& makVrv::DtElementDefinitionManager::modifiedDefinitions ( )
virtual

Returns map of modified definitions.

virtual std::vector<std::string> makVrv::DtElementDefinitionManager::retrieveHierFilesToMerge ( const std::string &  type)
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 std::vector<std::string> makVrv::DtElementDefinitionManager::retrieveLeafFilesToMerge ( const std::string &  type)
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 bool makVrv::DtElementDefinitionManager::shouldSkipDefLoading ( )
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.

virtual void makVrv::DtElementDefinitionManager::revertSettings ( )
virtual

Revert to startup settings.

virtual void makVrv::DtElementDefinitionManager::saveAsDefaults ( )
virtual

Called to save the current definitions as the defaults.

virtual void makVrv::DtElementDefinitionManager::splitAndWriteToDir ( makArchives::DtElementsRecord elementsRec,
const std::string &  existingDirName 
)
virtual

Write records as .hier/.leaf to an existing directory.

virtual void makVrv::DtElementDefinitionManager::exportSettings ( const std::string &  fileOrDirName)
virtual

Export settings to the named file.

virtual void makVrv::DtElementDefinitionManager::exportSelectedSettings ( const std::vector< std::string > &  names,
const std::string &  fileName 
)
virtual

Export Selected settings to the name file.

virtual void makVrv::DtElementDefinitionManager::exportHierSettings ( const std::string &  fileName)
virtual

Export hierarchy to the named file.

virtual void makVrv::DtElementDefinitionManager::exportHierSettings ( std::vector< std::string > &  fileList)
virtual

Export hierarchy files on the supplied list.

virtual void makVrv::DtElementDefinitionManager::exportLeafSettings ( std::vector< std::string > &  fileList)
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 void makVrv::DtElementDefinitionManager::exportSelectedLeafSetting ( const std::string &  name,
const std::string &  fileName 
)
virtual

Export Selected leafs to the name file (elements with no children)

virtual void makVrv::DtElementDefinitionManager::exportSelectedHierSetting ( const std::string &  name,
const std::string &  fileName,
bool  allLevels = true 
)
virtual

Export Selected hierarchy node to the name file (elements with no children)

virtual void makVrv::DtElementDefinitionManager::createFolderFromPathAndSplit ( const std::string &  fileOrDirName,
std::string &  newPath,
std::string &  dirName 
)
virtual

For saving out element definitions, make a folder and write a file for the hierarchy, and one for the leaf element definitions.

virtual bool makVrv::DtElementDefinitionManager::importAndReplaceSettings ( const std::string &  fileName)
virtual

Import settings from the named file.

virtual bool makVrv::DtElementDefinitionManager::importAndReplaceHierRecords ( StringToElementsRecordMap recordMap,
const std::string &  importFileName 
)
virtual
virtual void makVrv::DtElementDefinitionManager::mergeHierSettings ( const std::string &  hierFileOrDirName)
virtual

Merge in a .hier file or directory that contains .hier files.

virtual void makVrv::DtElementDefinitionManager::mergeHierSettings ( const std::string &  hierFileOrDirName,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions 
)
virtual

Merge in a .hier file or directory that contains .hier files.

virtual void makVrv::DtElementDefinitionManager::mergeLeafSettings ( const std::string &  leafFileOrDirName)
virtual

Merge a .leaf file into the existing hierarchy Replace existing leaves and add new leaves.

virtual void makVrv::DtElementDefinitionManager::mergeLeafSettings ( const std::string &  fileOrDirName,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions 
)
virtual

Merge in a .hier file or directory that contains .hier files.

virtual void makVrv::DtElementDefinitionManager::mergeSettings ( const std::string &  fileName,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions 
)
virtual

Merge records from *.elem or *.leaf file.

virtual void makVrv::DtElementDefinitionManager::markRecordsAsHier ( makArchives::DtElementsRecord rec)
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 DtDeSettings* makVrv::DtElementDefinitionManager::settings ( )
virtual

Get the settings object that manages element definitions on disk.

virtual void makVrv::DtElementDefinitionManager::setFromRecord ( const makArchives::DtElementsRecord elemRecord)
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 void makVrv::DtElementDefinitionManager::setFromRecord ( const makArchives::DtElementsRecord elemRecord,
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 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 void makVrv::DtElementDefinitionManager::setFromRecords ( StringToElementsRecordMap elemRecords,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions,
bool forceSaveAfterLoad 
)
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 void makVrv::DtElementDefinitionManager::mergeRecords ( StringToElementsRecordMap recordMap,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions 
)
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 void makVrv::DtElementDefinitionManager::mergeHierRecord ( const makArchives::DtElementsRecord hierRecord,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions 
)
virtual

Merge in the element definitions from a record Returns a list of the new elements.

virtual void makVrv::DtElementDefinitionManager::mergeLeafRecords ( StringToElementsRecordMap recordMap,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions 
)
virtual

Merge in the element definitions from all leaf records Returns a list of the new elements.

virtual void makVrv::DtElementDefinitionManager::mergeLeafRecord ( const makArchives::DtElementsRecord leafRecord,
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) const
virtual

Fill in a record with the current definitions.

virtual void makVrv::DtElementDefinitionManager::getRecord ( makArchives::DtElementsRecord rec,
const std::string &  fileName 
) const
virtual

Get records for definitions from the specified fileName.

virtual void makVrv::DtElementDefinitionManager::getRecord ( const std::vector< std::string > &  elementDefinitions,
makArchives::DtElementsRecord rec 
) const
virtual

Fill in a record with the passed definitions.

virtual void makVrv::DtElementDefinitionManager::getRecordIncludingParent ( const std::vector< std::string > &  elementDefinitions,
makArchives::DtElementsRecord rec 
) const
virtual

Fill in a record with the passed definitions and their parents(if exist)

virtual void makVrv::DtElementDefinitionManager::getSplitRecord ( std::vector< makArchives::DtElementsRecord > &  rec,
std::vector< std::string > &  fileNames 
)
virtual

Divide the single DefinitionMap into multiple pieces (hierarchy, leaves for this case) fileNames are root files names (.backup is appended)

virtual void makVrv::DtElementDefinitionManager::addRecords ( makArchives::DtElementsRecord recs,
makArchives::DtElementsRecord combinedRec 
)
virtual

Take element definitions and append them to the existing element definitions.

virtual void makVrv::DtElementDefinitionManager::splitRecordElemMgr ( makArchives::DtElementsRecord rec,
makArchives::DtElementsRecord recHier,
makArchives::DtElementsRecord recLeaves 
)
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 void makVrv::DtElementDefinitionManager::setAutoSave ( bool  enabled)
virtual

Set whether the manager saves itself out as default when changed.

virtual bool makVrv::DtElementDefinitionManager::validateElementDefinition ( const DtElementDefinition def)
virtual

Validate an element definition against its registered schema validator, if any.

virtual bool makVrv::DtElementDefinitionManager::validateElementAttribute ( const DtVisualizerDefinition::SortedAttributeMap::iterator &  attr)
virtual

Validate an element attribute against its registered schema validator, if any.

virtual DtUnicode makVrv::DtElementDefinitionManager::getElementDefinitionError ( const DtElementDefinition def)
virtual

Gets the string indicates the errors in an element definition.

virtual bool makVrv::DtElementDefinitionManager::canUseHierLeaf ( )
virtual

Are these element definitions using the .hier/.leaf setup?

Reimplemented in makVrf::DtVrfElementDefinitionManager.

virtual bool makVrv::DtElementDefinitionManager::modifiedSinceStartup ( )
virtual

return whether the element definitions have modified since start up

virtual void makVrv::DtElementDefinitionManager::resetModifiedSinceStartupFlag ( )
virtual

Reset the flag about any changes to element definitions since start up.

virtual void makVrv::DtElementDefinitionManager::addToModifiedDefinitionsMap ( DtElementDefinition modelDefinition)
virtual

add a model definition to the modifiedDefinitions map

virtual void makVrv::DtElementDefinitionManager::addToAddedDefinitionsMap ( DtElementDefinition modelDefinition)
virtual

add a model definition to the addedDefinitions map

virtual DefinitionMap makVrv::DtElementDefinitionManager::getDeletedDefinitionsMap ( )
virtual

get the map of deleted definitions

virtual void makVrv::DtElementDefinitionManager::addToDeletedDefinitionsMap ( DtElementDefinition modelDefinition)
virtual

add a model definition to the deletedDefinitions map

virtual void makVrv::DtElementDefinitionManager::resetModifiedFlags ( )
virtual

reset the flags about the modification after you have save it.

virtual DtUnicode makVrv::DtElementDefinitionManager::findFirstDefWithAttribPair ( const DtUnicode attributeName,
const DtUnicode attributeValue 
)
virtual

search the list of definitions for one with the attribute value pair requested and return the name of the first one found

virtual DtVisualizerAttributeStringVector::StringVector makVrv::DtElementDefinitionManager::findAllAttributeValues ( const DtUnicode elementDefName,
const DtUnicode attributeName 
)
virtual

search the attributes of a definitions for one with the attribute name requested and return a list of all values for those attributes

virtual std::string makVrv::DtElementDefinitionManager::getModelSetDisplayName ( DtModelSetId  modelSet) const
virtual

Gets the display name for a modelSet. 0 for "Model Set 3D" etc.

Parameters
modelSetThe model set.
virtual void makVrv::DtElementDefinitionManager::removeElementFromChangeMaps ( const DtUnicode definitionName)
virtual

Removes the specified element definition from any change map it might be on.

virtual void makVrv::DtElementDefinitionManager::removeElementsFromChangeMaps ( DefinitionFileType  fileType)
virtual

Remove all definitions of the specified file type from any change map it might be on.

virtual void makVrv::DtElementDefinitionManager::getChangedFiles ( std::vector< std::string > &  changedFiles,
DefinitionFileType  fileType 
)
virtual

Get a list of files associated with element definitions on any change maps of the type specify.

virtual void makVrv::DtElementDefinitionManager::registerDefinitionHierarchy ( DtElementDefinition root)
protectedvirtual

Internal function to register a hierarchy.

virtual void makVrv::DtElementDefinitionManager::buildElementVisualizerDefinitions ( DtElementDefinition newDef,
const makArchives::DtElementDefinitionRecord defRecord 
)
protectedvirtual

Build the visualizer definition sets for an element from its record.

virtual void makVrv::DtElementDefinitionManager::buildElementVisualizerDefinitionsForModelSet ( const makArchives::DtElementDefinitionRecord defRecord,
DtElementDefinition newDef,
DtModelSetId  modelSet 
)
protectedvirtual

Build the 2D, 3D, XR visualizers for a particular model set.

virtual void makVrv::DtElementDefinitionManager::buildElementChildren ( DtElementDefinition ed,
ParentToElementsMap parentToElementsMap,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions 
)
protectedvirtual

Recursively create the child element definitions for an element using a map from parent names to child records.

virtual void makVrv::DtElementDefinitionManager::registerBackup ( )
protectedvirtual

register the settings backup after the de has initialized the shared settings object

virtual bool makVrv::DtElementDefinitionManager::recordMatchesDefinition ( const makArchives::DtElementDefinitionRecord childRec,
const DtElementDefinition existingChildDef 
) const
protectedvirtual

Do all visualizers for all model sets match.

virtual bool makVrv::DtElementDefinitionManager::recordMatchesDefinitionModelSet ( const makArchives::DtElementDefinitionRecord childRec,
const DtElementDefinition existingChildDef,
DtModelSetId  modelSet 
) const
protectedvirtual

Does (2D,3D,XR) match (2D,3D,XR) in another definition.

virtual void makVrv::DtElementDefinitionManager::generateParentToElement ( ParentToElementsMap parentToElements,
StringToElementsRecordMap rec 
)
protectedvirtual

Generate data structure mapping parent1 -> vec{child1, child2, child3}.

virtual bool makVrv::DtElementDefinitionManager::checkRecordsAreLeavesInHier ( ParentToElementsMap parentToElements,
StringToElementsRecordMap recordMap,
std::vector< std::string > &  leafFiles 
)
protectedvirtual

Check if .leaf files contain only leaf nodes.

virtual bool makVrv::DtElementDefinitionManager::replaceMergeLeaves ( StringToElementsRecordMap firstRecMap,
StringToElementsRecordMap secondRecMap,
const std::vector< std::string > &  leafFiles 
)
protectedvirtual

Load .leaf files and add/replace existing entries in the record.

virtual bool makVrv::DtElementDefinitionManager::loadDefaultsFromHierLeafDir ( StringToElementsRecordMap recordMap)
protectedvirtual

Load from appData/definitions/ElementDefinitions.

virtual bool makVrv::DtElementDefinitionManager::isEntityDefinitions ( ) const
protectedvirtual

Identify if a record set is entity definitions.

virtual bool makVrv::DtElementDefinitionManager::isTacticalGraphicsDefinitions ( ) const
protectedvirtual

Identify if a record set is tactcal graphics definitions.

virtual bool makVrv::DtElementDefinitionManager::isUnitDefinitions ( ) const
protectedvirtual

Identify if a record set is unit definitions.

virtual void makVrv::DtElementDefinitionManager::checkDefinitionName ( const DtUnicode definitionName)
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.

virtual void makVrv::DtElementDefinitionManager::processVisualizerDefinitionAttributes ( DtVisualizerDefinition vd,
const makArchives::DtVisualizerDefinitionRecord vdRecord,
const std::string &  defName,
DtModelSetId  modelSet 
)
protectedvirtual
virtual void makVrv::DtElementDefinitionManager::logWarning ( const std::string &  message)
protectedvirtual

wrapped logging of warning

virtual void makVrv::DtElementDefinitionManager::getFilesFromDefinitionMap ( const DefinitionMap defMap,
std::set< std::string > &  changedFiles 
)
protectedvirtual

Get the filenames of all the element definitions of the specified type on a definition map.

virtual void makVrv::DtElementDefinitionManager::removeElementsFromDefnitionMap ( DefinitionMap defMap,
DefinitionFileType  fileType 
)
protectedvirtual

Remove all the elements of the specified type from a definition map.

virtual DtVisualizerDefinition* makVrv::DtElementDefinitionManager::convertLoadedVisualizerDefinition ( const makArchives::DtVisualizerDefinitionRecord vdRecord,
DtVisualizerDefinitionSet vdSet,
int  visualizerIndex,
DtElementDefinition ancestor 
)
protectedvirtual

Remove all elements from a definition map.

virtual bool makVrv::DtElementDefinitionManager::hierarchyNeedsConversion ( const makArchives::DtElementDefinitionRecord elemRec) const
protectedvirtual

Remove all elements from a definition map.

virtual void makVrv::DtElementDefinitionManager::clearDefinitionMap ( DefinitionMap map)
protectedvirtual

Remove all elements from a definition map.

virtual bool makVrv::DtElementDefinitionManager::validateVisualizerDefinitionSet ( const DtElementDefinition newDef,
const DtVisualizerDefinitionSet vdSet,
const makArchives::DtVisualizerDefinitionSetRecords vdRecordSet 
)
protectedvirtual

Remove all elements from a definition map.

virtual void makVrv::DtElementDefinitionManager::convertLeafToUuid ( const std::vector< makArchives::DtVisualizerDefinitionRecord > &  visualizerDefinitionRecords,
const Utf8String elementName,
const Utf8String parentName,
DtVisualizerDefinitionSet vdSet 
)
protectedvirtual

This gets called if we are not in a conversion pass and a leaf node is found without Uuids.

virtual DtVisualizerDefinition* makVrv::DtElementDefinitionManager::findAncestorVisualizerDefinition ( const std::string &  schemaName,
ParentSchemaDataMap schemaDataMap 
)
protectedvirtual

Remove all elements from a definition map.

Friends And Related Function Documentation

friend class DtElementDefinitionTypeManager
friend

Member Data Documentation

boost::signalslib::signal<void()> makVrv::DtElementDefinitionManager::signal_managerAboutTobeDeleted

Signals Signal sent when this manager is about to be deleted.

VisualizerDefinitionValidatorMap makVrv::DtElementDefinitionManager::myValidators
protected
std::string makVrv::DtElementDefinitionManager::myName
protected
std::string makVrv::DtElementDefinitionManager::myRootsFilename
protected
std::string makVrv::DtElementDefinitionManager::myHierName
protected
std::string makVrv::DtElementDefinitionManager::myLeafName
protected
DtUnicode makVrv::DtElementDefinitionManager::myScreenName
protected
DtDe* makVrv::DtElementDefinitionManager::myOptionalDe
protected
DefinitionMap makVrv::DtElementDefinitionManager::myDefinitions
protected
boost::unordered_map<std::string, std::string> makVrv::DtElementDefinitionManager::myDefinitionNameCheck
protected
bool makVrv::DtElementDefinitionManager::myProceduralFlag
protected
bool makVrv::DtElementDefinitionManager::myAutoSave
protected
ElementDefinitionsBackup* makVrv::DtElementDefinitionManager::myBackup
protected
DefinitionMap makVrv::DtElementDefinitionManager::myModifiedDefinitions
protected
DefinitionMap makVrv::DtElementDefinitionManager::myAddedDefinitions
protected
bool makVrv::DtElementDefinitionManager::myConvertingHierarchy
protected
DefinitionMap makVrv::DtElementDefinitionManager::myDeletedDefinitions
protected
bool makVrv::DtElementDefinitionManager::myConvertWarningsToInfo = false
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)