VR-Forces Developer's Guide
 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) 2023 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 
149  virtual bool mergeTypeMappingsFromPaths(
150  std::map<std::string, makArchives::DtEntityTypeMappingRecord> &record,
151  DtDeSettings* settings, const std::string& fileOrDir, bool overwrite=false);
152 
156  std::string generateDefaultDir(DtDeSettings* settings);
157 
159  void generateDefaultDirAndFiles(DtDeSettings* settings,
160  std::string& defaultDir, std::vector<std::string>& defaultDirFiles);
161 
165  std::string generateFactoryDir(DtDeSettings* settings);
166 
168  void generateFactoryDirAndFiles(DtDeSettings* settings,
169  std::string& factoryDir, std::vector<std::string>& factoryDirFiles);
170 
173 
174  private:
175 
177  void initializeMappings();
178 
182  void initDefaultMappings(bool useFactory);
183 
187  bool checkEntityTypeMapper(const std::string& name,
188  DtSettingsChangeObject::UseType t, std::string& inUse);
189 
190  private:
191 
193 
195 
196  std::string myTypeMapSuffix;
197 
199 
200  std::vector<std::string> myFactoryFiles;
201 
202  };
203 
204 }
Contains the DtSharedSimulationSettings class declaration.
#define DT_DLL_VRVVRL
Definition: vrvVrl.h:19
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
UseType
Definition: DtSettingsChangeManager.h:43
An EntityType to Definition mapper.
Definition: DtEntityTypeMapper.h:34
DtDe & myDe
Definition: DtSharedSimulationSettingsManager.h:198
DtSignalConnectionManager myConnections
Definition: DtSharedSimulationSettingsManager.h:192
std::vector< std::string > myFactoryFiles
Definition: DtSharedSimulationSettingsManager.h:200
Contains makVrv::DtVirtualBaseClass class.
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
bool myAutoSave
Definition: DtSharedSimulationSettingsManager.h:194
Provides a method of doign settings backup.
Definition: DtSettingsBackup.h:23
std::string myTypeMapSuffix
Definition: DtSharedSimulationSettingsManager.h:196
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. This object is not thread safe...
Definition: DtSharedSimulationSettingsManager.h:46
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:72
Contains DLL export macros.

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)