VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rangeRingsManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
10 
11 #pragma once
12 
14 #include <vrvUtil/signalslib.h>
16 
17 #include <vrfGuiCore/vrfGuiCore.h>
19 #include <vrvCore/DtUniqueID.h>
22 #include <vrvUtil/event_signal.h>
23 #include <vrvUtil/DtUnicode.h>
24 
25 #include <vrvCore/DtDe.h>
26 
27 namespace makVrv
28 {
29  class DtRecordSettingsBackupInterface;
30  class DtEventQueueInterface;
31  class DtSharedSettingsManager;
32 }
33 
34 namespace makVrf
35 {
37 
41  {
42  public:
43 
49 
53  static std::string className();
54 
56  virtual ~DtSharedRangeRingsSettings();
57 
58  virtual void setFill2D(bool);
59  virtual bool fill2D() const;
60 
61  virtual void setShowRangeSphere(bool);
62  virtual bool showRangeSphere() const;
63 
64  virtual void setShowWeaponNameLabel( bool );
65  virtual bool showWeaponNameLabel() const;
66 
67  virtual void setShowEntityNameLabel( bool );
68  virtual bool showEntityNameLabel() const;
69 
70  virtual void setShowRangeValueLabel( bool );
71  virtual bool showRangeValueLabel() const;
72 
73  virtual void setShowByDefault( bool );
74  virtual bool showByDefault() const;
75 
76  virtual void setShowForSelected( bool );
77  virtual bool showForSelected() const;
78 
79  virtual void setShowPhysicalFootprint( bool );
80  virtual bool showPhysicalFootprint() const;
81 
82  virtual void setSphereOpacityModifier(double);
83  virtual double sphereOpacityModifier() const;
84 
87  virtual void setAttackAnimationForRingEnabled(const std::string&, bool);
88  virtual bool attackAnimationForRingEnabled(const std::string&) const;
89 
90  virtual const DtRangeRingsSettingsRecord::ColorOptions& colorOptions() const;
91  virtual DtRangeRingsSettingsRecord::ColorOption colorOption(const std::string&) const;
92 
93  virtual void setColorOptions(const DtRangeRingsSettingsRecord::ColorOptions&);
94  virtual bool getColor(const std::string& type, int force, float& r, float& g, float& b, float& a, makVrv::DtUnicode&) const;
95  virtual void setColor(const std::string& type, int color, const makVrv::DtUnicode&);
96  virtual void removeColorOption(const std::string& type);
97 
98  virtual void getRecord(DtRangeRingsSettingsRecord& rec) const;
99  virtual void setFromRecord(const DtRangeRingsSettingsRecord& rec);
100 
103  virtual void getSplitRecord(std::vector<DtRangeRingsSettingsRecord>& rec,
104  std::vector<std::string>& fileNames) {};
105 
108  virtual void addRecords(DtRangeRingsSettingsRecord& recs,
109  DtRangeRingsSettingsRecord& combinedRec) {};
110 
112  virtual void addColorOptionIfMissing(const std::string& option, int color, const makVrv::DtUnicode& label,
113  bool visible = true);
114 
117  virtual bool getColorByCategory(const std::string& type, int& color) const;
118 
119  virtual makVrv::DtUnicode labelForType(const std::string&) const;
120  virtual void setVisible(const std::string& type, bool);
121  virtual bool visible(const std::string& type) const;
122  virtual bool wasRequested(const std::string&) const;
123 
124  virtual void setSectorSizeProperty(const std::string&);
125  virtual const std::string& sectorSizeProperty() const;
126 
127  virtual bool hasNewOptions() const;
128  virtual void getAndClearOptions(std::set<std::string>& newOptions, std::set<std::string>& newOptionsRequested);
129 
130  protected:
131  virtual void colorFromForce(int force, float& r, float& g, float& b);
132 
133  protected:
134 
137 
138  protected:
139  bool myFill2D;
144 
148 
150 
152 
153  std::map<std::string, bool> myRequested;
154  std::map<std::string, bool> myAttackAnimationEnabled;
155  std::string mySectorSizeProperty;
156 
157  std::set<std::string> myNewColorOptions;
158  std::set<std::string> myNewOptionRequested;
159  };
160 
163  {
164  public:
166  virtual ~DtRangeRingsManager();
167 
169  static DtRangeRingsManager& instance(makVrv::DtDe& de);
170  static void registerInstance(makVrv::DtDe&, DtRangeRingsManager*);
171 
173  virtual void loadDefaults(bool fromFactory = false);
174 
176  virtual void saveAsDefaults();
177 
178  const makVrv::DtRecordSettingsBackupInterface* settingsBackup() const
179  {
180  return mySettingsBackup;
181  }
182 
184  {
185  return mySettingsBackup;
186  }
187 
189  void exportSettings(const std::string& fileName);
190 
192  void importSettings(const std::string& fileName);
193 
194  void setAutoSave(bool b);
195  bool autoSave() const;
196 
197  virtual void getRecord(DtRangeRingsSettingsRecord& rec) const;
198  virtual void setFromRecord(const DtRangeRingsSettingsRecord& rec);
199 
202  virtual void getSplitRecord(std::vector<DtRangeRingsSettingsRecord>& rec,
203  std::vector<std::string>& fileNames) {};
204 
207  virtual void addRecords(DtRangeRingsSettingsRecord& recs,
208  DtRangeRingsSettingsRecord& combinedRec) {};
209 
210  virtual void setFill2D(bool b);
211  virtual bool fill2D() const;
212 
213  virtual void setShowRangeSphere( bool onOff );
214  virtual bool showRangeSphere() const;
215 
216  virtual void setShowWeaponNameLabel( bool );
217  virtual bool showWeaponNameLabel() const;
218 
219  virtual void setShowEntityNameLabel( bool );
220  virtual bool showEntityNameLabel() const;
221 
222  virtual void setShowRangeValueLabel( bool );
223  virtual bool showRangeValueLabel() const;
224 
225  virtual void setShowByDefault( bool );
226  virtual bool showByDefault() const;
227 
228  virtual void setShowForSelected( bool );
229  virtual bool showForSelected() const;
230 
231  virtual void setShowPhysicalFootprint( bool );
232  virtual bool showPhysicalFootprint() const;
233 
234  virtual void setSphereOpacityModifier(double);
235  virtual double sphereOpacityModifier() const;
236 
237  virtual const DtRangeRingsSettingsRecord::ColorOptions& colorOptions() const;
238  virtual DtRangeRingsSettingsRecord::ColorOption colorOption(const std::string&) const;
239  virtual void setColorOptions(const DtRangeRingsSettingsRecord::ColorOptions&);
240  virtual bool getColor(const std::string& type, int force, float& r, float& g, float& b, float& a, makVrv::DtUnicode&) const;
241  virtual void setColor(const std::string& type, int color, const makVrv::DtUnicode&);
242  virtual void setVisible(const std::string& type, bool);
243  virtual bool visible(const std::string& type) const;
244 
247  virtual void setAttackAnimationForRingEnabled(const std::string&, bool);
248  virtual bool attackAnimationForRingEnabled(const std::string&) const;
249 
250  virtual void removeColorOption(const std::string& type);
251  virtual bool wasRequested(const std::string&) const;
252 
254  virtual void addColorOptionIfMissing(const std::string& option, int color, const makVrv::DtUnicode& label,
255  bool visible = true);
256 
257  virtual makVrv::DtUnicode labelForType(const std::string&) const;
258 
259  virtual std::string sectorSizeProperty() const;
260  virtual void setSectorSizeProperty(const std::string&);
261 
262  protected:
263  virtual void completeSetup();
264 
265  protected:
268  };
269 
273  {
274  public:
275 
280 
284 
288  static DtSharedRangeRingsSettingsSignaler* findInstance(
290 
293 
303 
309 
310  protected:
312 
313  private:
316  };
317 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)