VR-Forces 4.3.1 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 
102  virtual void addColorOptionIfMissing(const std::string& option, int color, const makVrv::DtUnicode& label,
103  bool visible = true);
104 
107  virtual bool getColorByCategory(const std::string& type, int& color) const;
108 
109  virtual makVrv::DtUnicode labelForType(const std::string&) const;
110  virtual void setVisible(const std::string& type, bool);
111  virtual bool visible(const std::string& type) const;
112  virtual bool wasRequested(const std::string&) const;
113 
114  virtual void setSectorSizeProperty(const std::string&);
115  virtual const std::string& sectorSizeProperty() const;
116 
117  virtual bool hasNewOptions() const;
118  virtual void getAndClearOptions(std::set<std::string>& newOptions, std::set<std::string>& newOptionsRequested);
119 
120  protected:
121  virtual void colorFromForce(int force, float& r, float& g, float& b);
122 
123  protected:
124 
127 
128  protected:
129  bool myFill2D;
134 
138 
140 
142 
143  std::map<std::string, bool> myRequested;
144  std::map<std::string, bool> myAttackAnimationEnabled;
145  std::string mySectorSizeProperty;
146 
147  std::set<std::string> myNewColorOptions;
148  std::set<std::string> myNewOptionRequested;
149  };
150 
153  {
154  public:
156  virtual ~DtRangeRingsManager();
157 
159  static DtRangeRingsManager& instance(makVrv::DtDe& de);
160  static void registerInstance(makVrv::DtDe&, DtRangeRingsManager*);
161 
163  virtual void loadDefaults(bool fromFactory = false);
164 
166  virtual void saveAsDefaults();
167 
168  const makVrv::DtRecordSettingsBackupInterface* settingsBackup() const
169  {
170  return mySettingsBackup;
171  }
172 
174  {
175  return mySettingsBackup;
176  }
177 
179  void exportSettings(const std::string& fileName);
180 
182  void importSettings(const std::string& fileName);
183 
184  void setAutoSave(bool b);
185  bool autoSave() const;
186 
187  virtual void getRecord(DtRangeRingsSettingsRecord& rec) const;
188  virtual void setFromRecord(const DtRangeRingsSettingsRecord& rec);
189 
190  virtual void setFill2D(bool b);
191  virtual bool fill2D() const;
192 
193  virtual void setShowRangeSphere( bool onOff );
194  virtual bool showRangeSphere() const;
195 
196  virtual void setShowWeaponNameLabel( bool );
197  virtual bool showWeaponNameLabel() const;
198 
199  virtual void setShowEntityNameLabel( bool );
200  virtual bool showEntityNameLabel() const;
201 
202  virtual void setShowRangeValueLabel( bool );
203  virtual bool showRangeValueLabel() const;
204 
205  virtual void setShowByDefault( bool );
206  virtual bool showByDefault() const;
207 
208  virtual void setShowForSelected( bool );
209  virtual bool showForSelected() const;
210 
211  virtual void setShowPhysicalFootprint( bool );
212  virtual bool showPhysicalFootprint() const;
213 
214  virtual void setSphereOpacityModifier(double);
215  virtual double sphereOpacityModifier() const;
216 
217  virtual const DtRangeRingsSettingsRecord::ColorOptions& colorOptions() const;
218  virtual DtRangeRingsSettingsRecord::ColorOption colorOption(const std::string&) const;
219  virtual void setColorOptions(const DtRangeRingsSettingsRecord::ColorOptions&);
220  virtual bool getColor(const std::string& type, int force, float& r, float& g, float& b, float& a, makVrv::DtUnicode&) const;
221  virtual void setColor(const std::string& type, int color, const makVrv::DtUnicode&);
222  virtual void setVisible(const std::string& type, bool);
223  virtual bool visible(const std::string& type) const;
224 
227  virtual void setAttackAnimationForRingEnabled(const std::string&, bool);
228  virtual bool attackAnimationForRingEnabled(const std::string&) const;
229 
230  virtual void removeColorOption(const std::string& type);
231  virtual bool wasRequested(const std::string&) const;
232 
234  virtual void addColorOptionIfMissing(const std::string& option, int color, const makVrv::DtUnicode& label,
235  bool visible = true);
236 
237  virtual makVrv::DtUnicode labelForType(const std::string&) const;
238 
239  virtual std::string sectorSizeProperty() const;
240  virtual void setSectorSizeProperty(const std::string&);
241 
242  protected:
243  virtual void completeSetup();
244 
245  protected:
248  };
249 
253  {
254  public:
255 
260 
264 
268  static DtSharedRangeRingsSettingsSignaler* findInstance(
270 
273 
283 
289 
290  protected:
292 
293  private:
296  };
297 }

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)