VR-Forces 4.8 Class Documentation
 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 | Static Protected Member Functions | Protected Attributes | Private Member Functions | 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. More...

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

Public Types

typedef std::map< DtUnicode,
DtElementDefinitionNew * > 
DefinitionMap
 Ordered map from element definition name to definition object. More...
 
typedef std::vector< const
DtElementDefinitionNew * > 
ElementDefinitions
 List of new element definitions. More...
 
typedef std::vector
< std::string >
::const_iterator 
ParentToElementIter
 Iterator for parent to element names. More...
 

Public Member Functions

virtual ~DtElementDefinitionManager ()
 Destructor. More...
 
const std::string & name () const
 Get the name of the element definition manager. More...
 
const DtUnicodescreenName () const
 Get the screen name of the element definition manager. More...
 
unsigned int numberOfElementDefinitions () const
 Get the number of element definitions. More...
 
const DefinitionMapelementDefinitions () const
 Get the element definitions. More...
 
DtElementDefinitionNewfindElementDefinition (const DtUnicode &definitionName)
 Find an element definition by name. More...
 
const DtElementDefinitionNewfindElementDefinition (const DtUnicode &definitionName) const
 Find an element definition by name. More...
 
DtElementDefinitionNewcreateElementDefinition (const DtUnicode &definitionName)
 Create an element definition with a given name. More...
 
DtElementDefinitionNewcreateElementDefinition (const DtUnicode &definitionName, DtElementDefinitionNew *parentDefinition)
 Create an element definition with a given name, that inherits an existing definition. More...
 
void destroyElementDefinition (DtElementDefinitionNew *)
 Destroy an element definition, any inherited definitions will now be Parented under destroyed element's parent. More...
 
void destroyElementDefinitionAndChildren (DtElementDefinitionNew *)
 Destroys an element definition and all of it's child definitions. More...
 
DtElementDefinitionNewcopyElementDefinition (DtElementDefinitionNew &def, const DtUnicode &newName)
 Create a copy of an element definition, with a new name. More...
 
DtBackupInterfacebackup ()
 Get the backup object. More...
 
bool renameElementDefinition (const DtUnicode &oldName, const DtUnicode &newName)
 Rename an element definition. More...
 
void loadDefaults ()
 Load the default definitions. More...
 
void loadDefaults (bool loadOnlyFactory)
 Load the default definitions. More...
 
virtual std::vector< std::string > retrieveHierFilesToMerge (const std::string &type)
 For command line arguments, list of .hier files from command line for this type (entity, aggregate, tactical graphics, etc) More...
 
virtual std::vector< std::string > retrieveLeafFilesToMerge (const std::string &type)
 For command line arguments, list of .leaf files from command line for this type (entity, aggregate, tactical graphics, etc) More...
 
virtual bool shouldSkipDefLoading ()
 Given command line parameters, should we skip loading definitions from the usual place (currently entity, aggregate, tactical graphics can skip) More...
 
void revertSettings ()
 Revert to startup settings. More...
 
virtual void saveAsDefaults ()
 Called to save the current definitions as the defaults. More...
 
virtual void splitAndWriteToDir (makArchives::DtElementsRecord &elementsRec, const std::string &existingDirName)
 Write records as .hier/.leaf to an existing directory. More...
 
virtual void exportSettings (const std::string &fileOrDirName)
 Export settings to the named file. More...
 
virtual void exportSelectedSettings (const std::vector< std::string > &names, const std::string &fileName)
 Export Selected settings to the name file. More...
 
virtual void exportHierSettings (const std::string &fileName)
 Export hierarchy to the named file. More...
 
virtual void exportLeafSettings (const std::string &fileName, std::vector< std::string > &fileList)
 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. More...
 
virtual void exportSelectedLeafSettings (const std::vector< std::string > &names, const std::string &fileName)
 Export Selected leafs to the name file (elements with no children) More...
 
void 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. More...
 
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. More...
 
virtual void importSettings (const std::string &fileName)
 Import settings from the named file. More...
 
virtual void mergeHierSettings (const std::string &hierFileOrDirName)
 Merge in a .hier file or directory that contains .hier files. More...
 
virtual void mergeHierSettings (const std::string &hierFileOrDirName, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 Merge in a .hier file or directory that contains .hier files. More...
 
virtual void mergeLeafSettings (const std::string &leafFileOrDirName)
 Merge a .leaf file into the existing hierarchy Replace existing leaves and add new leaves. More...
 
virtual void mergeLeafSettings (const std::string &fileOrDirName, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 Merge in a .hier file or directory that contains .hier files. More...
 
virtual void mergeSettings (const std::string &fileName, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 Merge records from *.elem or *.leaf file. More...
 
virtual void markRecordsAsHier (makArchives::DtElementsRecord &rec)
 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) More...
 
virtual DtDeSettingssettings ()
 Get the settings object that manages element definitions on disk. More...
 
virtual void setFromRecord (const makArchives::DtElementsRecord &elemRecord)
 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. More...
 
virtual void setFromRecord (const makArchives::DtElementsRecord &elemRecord, 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 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. More...
 
virtual void setFromRecords (std::map< std::string, makArchives::DtElementsRecord > &elemRecords, 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 This takes in a map as opposed to a vector, like setFromRecord does. More...
 
virtual void mergeRecords (std::map< std::string, makArchives::DtElementsRecord > &recordMap, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 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. More...
 
virtual void mergeHierRecord (const makArchives::DtElementsRecord &hierRecord, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 Merge in the element definitions from a record Returns a list of the new elements. More...
 
virtual void mergeLeafRecords (std::map< std::string, makArchives::DtElementsRecord > &recordMap, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 Merge in the element definitions from all leaf records Returns a list of the new elements. More...
 
virtual void mergeLeafRecord (const makArchives::DtElementsRecord &leafRecord, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 Merge in the element definitions from a record Returns a list of the new elements. More...
 
virtual void getRecord (makArchives::DtElementsRecord &rec)
 Fill in a record with the current definitions. More...
 
virtual void getRecord (const std::vector< std::string > &elementDefinitions, makArchives::DtElementsRecord &rec)
 Fill in a record with the passed definitions. More...
 
virtual void getRecordIncludingParent (const std::vector< std::string > &elementDefinitions, makArchives::DtElementsRecord &rec)
 Fill in a record with the passed definitions and their parents(if exist) More...
 
virtual void getSplitRecord (std::vector< makArchives::DtElementsRecord > &rec, std::vector< std::string > &fileNames)
 Divide the single DefinitionMap into multiple pieces (hierarchy, leaves for this case) fileNames are root files names (.backup is appended) More...
 
virtual void addRecords (makArchives::DtElementsRecord &recs, makArchives::DtElementsRecord &combinedRec)
 Take element definitions and append them to the existing element definitions. More...
 
virtual void splitRecordElemMgr (makArchives::DtElementsRecord &rec, makArchives::DtElementsRecord &recHier, makArchives::DtElementsRecord &recLeaves)
 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) More...
 
virtual void setAutoSave (bool enabled)
 Set whether the manager saves itself out as default when changed. More...
 
virtual bool validateElementDefinition (const DtElementDefinitionNew &def)
 Validate an element definition against its registered schema validator, if any. More...
 
virtual bool validateElementAttribute (const DtVisualizerDefinition::SortedAttributeMap::iterator &attr)
 Validate an element attribute against its registered schema validator, if any. More...
 
virtual DtUnicode getElementDefinitionError (const DtElementDefinitionNew &def)
 Gets the string indicates the errors in an element definition. More...
 
virtual bool canUseHierLeaf ()
 Are these element definitions using the .hier/.leaf setup? More...
 
virtual bool modifiedSinceStartup ()
 return whether the element definitions have modified since start up More...
 
virtual void resetModifiedSinceStartupFlag ()
 Reset the flag about any changes to element definitions since start up. More...
 
virtual void addToModifiedDefinitionsMap (DtElementDefinitionNew *modelDefinition)
 add a model definition to the modifiedDefinitions map More...
 
virtual void addToAddedDefinitionsMap (DtElementDefinitionNew *modelDefinition)
 add a model definition to the addedDefinitions map More...
 
DefinitionMap getDeletedDefinitionsMap ()
 get the map of deleted definitions More...
 
virtual void addToDeletedDefinitionsMap (DtElementDefinitionNew *modelDefinition)
 add a model definition to the deletedDefinitions map More...
 
virtual void resetModifiedFlags ()
 reset the flags about the modification after you have save it. More...
 
DtUnicode 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 More...
 
DtVisualizerAttributeStringVector::StringVector 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 More...
 
virtual std::string getModelSetDisplayName (int modelSet) const
 Gets the display name for a modelSet. More...
 

Static Public Member Functions

static const
DtElementDefinitionManager
createConstCopy (const DtElementDefinitionManager &orig)
 Create a constant copy for use in separate threads. More...
 
static
makArchives::DtElementDefinitionRecord 
buildElementDefinitionRecord (DtElementDefinitionNew &elementDef)
 Utility function to construct an element definition record from an element definition object. More...
 

Public Attributes

boost::signal< void()> signal_managerAboutTobeDeleted
 Signals Signal sent when this manager is about to be deleted. More...
 

Protected Types

typedef std::pair< std::string,
const
makArchives::DtElementDefinitionRecord * > 
ElementPair
 a pair, holding the definition file name in the key and the element definition record in the value More...
 
typedef std::vector< ElementPairElementGroup
 A group of element definition records, used for the following map. More...
 
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. More...
 
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)
 Constructor. More...
 
 DtElementDefinitionManager (const DtElementDefinitionManager &rhs)
 Copy constructor.o. More...
 
void registerDefinitionHierarchy (DtElementDefinitionNew *root)
 Internal function to register a hierarchy. More...
 
virtual void buildElementVisualizers (DtElementDefinitionNew &newDef, const makArchives::DtElementDefinitionRecord &defRecord)
 Build the visualizer definition sets for an element from its record. More...
 
virtual void buildElementVisualizersForModelSet (const makArchives::DtElementDefinitionRecord &defRecord, DtElementDefinitionNew &newDef, int modelSet)
 Build the 2D, 3D, XR visualizers for a particular model set. More...
 
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. More...
 
virtual void registerBackup ()
 register the settings backup after the de has initialized the shared settings object More...
 
virtual bool recordMatchesDefinition (const makArchives::DtElementDefinitionRecord *childRec, const DtElementDefinitionNew *existingChildDef) const
 Do all visualizers for all model sets match. More...
 
virtual bool recordMatchesDefinitionModelSet (const makArchives::DtElementDefinitionRecord *childRec, const DtElementDefinitionNew *existingChildDef, int modelSet) const
 Does (2D,3D,XR) match (2D,3D,XR) in another definition. More...
 
virtual void generateParentToElement (ParentToElementsMap &parentToElements, std::map< std::string, makArchives::DtElementsRecord > &rec)
 Generate data structure mapping parent1 -> vec{child1, child2, child3}. More...
 
virtual bool checkRecordsAreLeavesInHier (ParentToElementsMap &parentToElements, std::map< std::string, makArchives::DtElementsRecord > &recordMap, std::vector< std::string > &leafFiles)
 Check if .leaf files contain only leaf nodes. More...
 
virtual bool replaceMergeLeaves (std::map< std::string, makArchives::DtElementsRecord > &firstRecMap, std::map< std::string, makArchives::DtElementsRecord > &secondRecMap, const std::vector< std::string > &leafFiles)
 Load .leaf files and add/replace existing entries in the record. More...
 
virtual bool loadDefaultsFromHierLeafDir (std::map< std::string, makArchives::DtElementsRecord > &recordMap)
 Load from appData/definitions/ElementDefinitions. More...
 
virtual bool isEntityDefinitions ()
 Since we are using folders for only entity element definitions this is a way to identify that case. More...
 
virtual void checkDefinitionName (const DtUnicode &definitionName)
 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. More...
 

Static Protected Member Functions

static void setupVisualizerDefs (makArchives::DtElementDefinitionRecord &elementRec, DtElementDefinitionNew &elementDef, unsigned int modelSet)
 Utility function to construct the visualizer definitions for 2D, 3D, XR. More...
 

Protected Attributes

VisualizerDefinitionValidatorMap myValidators
 
std::string myName
 
std::string myHierName
 
std::string myLeafName
 
DtUnicode myScreenName
 
DtDemyOptionalDe
 
DefinitionMap myDefinitions
 
boost::unordered_map
< std::string, std::string > 
myDefinitionNameCheck
 
bool myProceduralFlag
 
bool myAutoSave
 
ElementDefinitionsBackupmyBackup
 
int myStartupNumOfDefinition
 
DefinitionMap myModifiedDefinitions
 
DefinitionMap myAddedDefinitions
 
DefinitionMap myDeletedDefinitions
 

Private Member Functions

 DtElementDefinitionManager ()
 Default constructor. More...
 
DtElementDefinitionManageroperator= (const DtElementDefinitionManager &)
 Assignment Operator. More...
 

Friends

class DtElementDefinitionTypeManager
 

Detailed Description

Manager which owns element definitions.for one type of element Use the makVrv::DtElementDefinitionTypesManager to get each element definition manager.

Member Typedef Documentation

Ordered map from element definition name to definition object.

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.

Constructor & Destructor Documentation

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.

makVrv::DtElementDefinitionManager::DtElementDefinitionManager ( )
private

Default constructor.

Note
Not implemented

Member Function Documentation

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.

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

Find an element definition by name.

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

Create an element definition with a given name.

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

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

Returns
0 If the element definition with the name already exists.
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.

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.
void makVrv::DtElementDefinitionManager::loadDefaults ( )

Load the default definitions.

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

Load the default 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.

void makVrv::DtElementDefinitionManager::revertSettings ( )

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::exportLeafSettings ( const std::string &  fileName,
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::exportSelectedLeafSettings ( const std::vector< std::string > &  names,
const std::string &  fileName 
)
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 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::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 ( std::map< std::string, makArchives::DtElementsRecord > &  elemRecords,
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 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 ( std::map< std::string, makArchives::DtElementsRecord > &  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.

Reimplemented in makVrf::DtVrfElementDefinitionManager.

virtual void makVrv::DtElementDefinitionManager::mergeLeafRecords ( std::map< std::string, makArchives::DtElementsRecord > &  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.

Reimplemented in makVrf::DtVrfElementDefinitionManager.

virtual void makVrv::DtElementDefinitionManager::getRecord ( makArchives::DtElementsRecord rec)
virtual

Fill in a record with the current definitions.

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

Fill in a record with the passed definitions.

virtual void makVrv::DtElementDefinitionManager::getRecordIncludingParent ( const std::vector< std::string > &  elementDefinitions,
makArchives::DtElementsRecord rec 
)
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 DtElementDefinitionNew 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 DtElementDefinitionNew def)
virtual

Gets the string indicates the errors in an element definition.

static makArchives::DtElementDefinitionRecord makVrv::DtElementDefinitionManager::buildElementDefinitionRecord ( DtElementDefinitionNew elementDef)
static

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

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 ( DtElementDefinitionNew modelDefinition)
virtual

add a model definition to the modifiedDefinitions map

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

add a model definition to the addedDefinitions map

DefinitionMap makVrv::DtElementDefinitionManager::getDeletedDefinitionsMap ( )

get the map of deleted definitions

virtual void makVrv::DtElementDefinitionManager::addToDeletedDefinitionsMap ( DtElementDefinitionNew 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.

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 std::string makVrv::DtElementDefinitionManager::getModelSetDisplayName ( int  modelSet) const
virtual

Gets the display name for a modelSet.

0 for "Model Set 3D" etc.

Parameters
modelSetThe model set.
void makVrv::DtElementDefinitionManager::registerDefinitionHierarchy ( DtElementDefinitionNew root)
protected

Internal function to register a hierarchy.

virtual void makVrv::DtElementDefinitionManager::buildElementVisualizers ( DtElementDefinitionNew newDef,
const makArchives::DtElementDefinitionRecord defRecord 
)
protectedvirtual

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

virtual void makVrv::DtElementDefinitionManager::buildElementVisualizersForModelSet ( const makArchives::DtElementDefinitionRecord defRecord,
DtElementDefinitionNew newDef,
int  modelSet 
)
protectedvirtual

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

virtual void makVrv::DtElementDefinitionManager::buildElementChildren ( DtElementDefinitionNew 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.

static void makVrv::DtElementDefinitionManager::setupVisualizerDefs ( makArchives::DtElementDefinitionRecord elementRec,
DtElementDefinitionNew elementDef,
unsigned int  modelSet 
)
staticprotected

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

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 DtElementDefinitionNew existingChildDef 
) const
protectedvirtual

Do all visualizers for all model sets match.

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

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

virtual void makVrv::DtElementDefinitionManager::generateParentToElement ( ParentToElementsMap parentToElements,
std::map< std::string, makArchives::DtElementsRecord > &  rec 
)
protectedvirtual

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

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

Check if .leaf files contain only leaf nodes.

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

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

virtual bool makVrv::DtElementDefinitionManager::loadDefaultsFromHierLeafDir ( std::map< std::string, makArchives::DtElementsRecord > &  recordMap)
protectedvirtual

Load from appData/definitions/ElementDefinitions.

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

Since we are using folders for only entity element definitions this is a way to identify that case.

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.

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

Assignment Operator.

Note
Not implemented

Friends And Related Function Documentation

friend class DtElementDefinitionTypeManager
friend

Member Data Documentation

boost::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::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
int makVrv::DtElementDefinitionManager::myStartupNumOfDefinition
protected
DefinitionMap makVrv::DtElementDefinitionManager::myModifiedDefinitions
protected
DefinitionMap makVrv::DtElementDefinitionManager::myAddedDefinitions
protected
DefinitionMap makVrv::DtElementDefinitionManager::myDeletedDefinitions
protected

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)