VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSharedSimulationSettingsManager.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2020 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
6 #pragma once
7 
11 
12 #include <vrvVrl/vrvVrl.h>
13 
15 
19 
20 namespace makArchives
21 {
22  class DtEntityTypeMappingRecord;
23 }
24 
25 namespace makVrv
26 {
27 
28  class DtSettingsBackup;
29  class DtEntityTypeMapper;
30  class DtDeSettings;
31 
47  : public DtVirtualBaseClass
48  {
49  public:
50 
52  static DtSharedSimulationSettingsManager& instance(DtDe& de);
53 
56 
57  private:
66 
67  public:
71  void connectInputSignals();
72  std::vector<std::string> getFileList(DtEntityTypeMapper& mapper);
73 
77  void loadDefaultMappings(DtEntityTypeMapper& mapper, bool useFactory);
78 
81  void saveDefaultMappings();
82 
85  void saveDefaultMappings(const DtEntityTypeMapper& mapper);
86 
89  void loadMapFile(const std::string& filePath, DtEntityTypeMapper& mapper);
90 
93  void mergeMapFile(const std::string& filePath, DtEntityTypeMapper& mapper);
94 
97  void saveMapFile(const std::string& filePath,
98  const DtEntityTypeMapper& mapper);
99 
100  //saves out all mappings to their saved files
101  void saveMapFiles(const std::vector<std::string>& filePath,
102  const DtEntityTypeMapper& mapper);
103 
106  void saveSelectedMapFile(const std::string& filePath, std::vector<std::string>& keys,
107  const DtEntityTypeMapper& mapper);
108 
111  bool shouldLoadDefaultMappings(const DtDeSettings* setting);
112 
116  bool shouldMergeMappings(const DtDeSettings* setting);
117 
118  // Get list of files to merge when using the command line
119  // --merge{Entity,Aggregate,TacticalGraphics}TypeMap
120  const std::vector<std::string> getFilesToMerge(const DtDeSettings* setting);
121 
122  // Check that type map should end with 'TypeMap'
123  // (helps with generating where to look for type maps in the definitions)
124  bool hasTypeMapSuffix(DtDeSettings* settings);
125 
127  void setAutoSave(bool b);
128 
130  bool autoSave() const;
131 
132  protected:
133 
135  virtual void mapperChanged(const DtEntityTypeMapper&);
136 
139  virtual void backupMapper(DtEntityTypeMapper&);
140 
142  virtual void entityTypeMappingsRestored(const DtSettingsBackup*);
143 
147  virtual bool mergeTypeMappingsFromPaths(
148  std::map<std::string, makArchives::DtEntityTypeMappingRecord> &record,
149  DtDeSettings* settings, const std::string& fileOrDir);
150 
155  virtual bool mergeTypeMappings(const std::string& dir);
156 
160  virtual bool mergeTypeMappingFile(const std::string& fileName);
161 
163  virtual bool mergeTypeMappingsFromPath(
165  DtDeSettings* settings, const std::string& fileOrDir);
166 
170  std::string generateDefaultDir(DtDeSettings* settings);
171 
173  void generateDefaultDirAndFiles(DtDeSettings* settings,
174  std::string& defaultDir, std::vector<std::string>& defaultDirFiles);
175 
179  std::string generateFactoryDir(DtDeSettings* settings);
180 
182  void generateFactoryDirAndFiles(DtDeSettings* settings,
183  std::string& factoryDir, std::vector<std::string>& factoryDirFiles);
184 
187 
188  private:
189 
191  void initializeMappings();
192 
196  void initDefaultMappings(bool useFactory);
197 
201  bool checkEntityTypeMapper(const std::string& name,
202  DtSettingsChangeObject::UseType t, std::string& inUse);
203 
204  private:
205 
207 
209 
210  std::string myTypeMapSuffix;
211 
213 
214  std::vector<std::string> myFactoryFiles;
215 
216  };
217 
218 }
Contains the DtSharedSimulationSettings class declaration.
#define DT_DLL_VRVVRL
Definition: vrvVrl.h:19
Virtual base class.
Definition: DtVirtualBaseClass.h:19
UseType
Definition: DtSettingsChangeManager.h:43
An EntityType to Definition mapper.
Definition: DtEntityTypeMapper.h:34
DtDe & myDe
Definition: DtSharedSimulationSettingsManager.h:212
DtSignalConnectionManager myConnections
Definition: DtSharedSimulationSettingsManager.h:206
std::vector< std::string > myFactoryFiles
Definition: DtSharedSimulationSettingsManager.h:214
Contains makVrv::DtVirtualBaseClass class.
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
bool myAutoSave
Definition: DtSharedSimulationSettingsManager.h:208
Provides a method of doign settings backup.
Definition: DtSettingsBackup.h:23
std::string myTypeMapSuffix
Definition: DtSharedSimulationSettingsManager.h:210
Record of a mappings from an entity type to some number.
Definition: DtEntityTypeMappingRecord.h:22
Base class to provide boost signal/slot management.
Settings class for reading and writing settings to/from files.
Definition: DtDeSettings.h:29
The shared settings manager handles low level access to the settings.
Definition: DtSharedSimulationSettingsManager.h:46
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Contains DLL export macros.

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)