VR-Forces 4.7 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) 2012 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
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 
60  void connectInputSignals();
61 
65  void loadDefaultMappings( DtEntityTypeMapper& mapper, bool useFactory );
66 
69  void saveDefaultMappings();
70 
73  void saveDefaultMappings( const DtEntityTypeMapper& mapper );
74 
77  void loadMapFile( const std::string& filePath, DtEntityTypeMapper& mapper );
78 
81  void mergeMapFile(const std::string& filePath, DtEntityTypeMapper& mapper);
82 
85  void saveMapFile( const std::string& filePath,
86  const DtEntityTypeMapper& mapper );
87 
90  void saveSelectedMapFile(const std::string& filePath,std::vector<std::string>& keys,
91  const DtEntityTypeMapper& mapper);
92 
95  bool shouldLoadDefaultMappings(const DtDeSettings* setting);
96 
100  bool shouldMergeMappings(const DtDeSettings* setting);
101 
102  // Get list of files to merge when using the command line
103  // --merge{Entity,Aggregate,TacticalGraphics}TypeMap
104  const std::vector<std::string> getFilesToMerge(const DtDeSettings* setting);
105 
106  // Check that type map should end with 'TypeMap'
107  // (helps with generating where to look for type maps in the definitions)
108  bool hasTypeMapSuffix(DtDeSettings* settings);
109 
111  void setAutoSave( bool b );
112 
114  bool autoSave() const;
115 
116  protected:
117 
119  virtual void mapperChanged( const DtEntityTypeMapper& );
120 
123  virtual void backupMapper( DtEntityTypeMapper& );
124 
126  virtual void entityTypeMappingsRestored( const DtSettingsBackup* );
127 
132  virtual bool mergeTypeMappings(const std::string& dir);
133 
137  virtual bool mergeTypeMappingFile(const std::string& fileName);
138 
140  virtual bool mergeTypeMappingsFromPath(
142  DtDeSettings* settings, const std::string& fileOrDir);
143 
147  std::string generateDefaultDir(DtDeSettings* settings);
148 
150  void generateDefaultDirAndFiles(DtDeSettings* settings,
151  std::string& defaultDir, std::vector<std::string>& defaultDirFiles);
152 
156  std::string generateFactoryDir(DtDeSettings* settings);
157 
159  void generateFactoryDirAndFiles(DtDeSettings* settings,
160  std::string& factoryDir, std::vector<std::string>& factoryDirFiles);
161 
164 
165  private:
166 
168  void initializeMappings();
169 
173  void initDefaultMappings( bool useFactory );
174 
175  private:
176 
178 
180 
181  std::string myTypeMapSuffix;
182 
184 
185  };
186 
187 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)