VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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>
15 
16 #include <vrfGuiCore/vrfGuiCore.h>
18 #include <vrvCore/DtUniqueID.h>
20 #include <vrvUtil/event_signal.h>
21 #include <vrvUtil/DtUnicode.h>
22 
23 #include <vrvCore/DtDe.h>
24 
25 namespace makVrv
26 {
27  class DtRecordSettingsBackupInterface;
28  class DtEventQueueInterface;
29  class DtSharedSettingsManager;
30 }
31 
32 namespace makVrf
33 {
37  {
38  public:
39 
45 
49  static std::string className();
50 
52  virtual ~DtSharedRangeRingsSettings();
53 
54  virtual void setFill2D(bool);
55  virtual bool fill2D() const;
56 
57  virtual void setShowRangeSphere(bool);
58  virtual bool showRangeSphere() const;
59 
60  virtual void setShowWeaponNameLabel( bool );
61  virtual bool showWeaponNameLabel() const;
62 
63  virtual void setShowEntityNameLabel( bool );
64  virtual bool showEntityNameLabel() const;
65 
66  virtual void setShowRangeValueLabel( bool );
67  virtual bool showRangeValueLabel() const;
68 
69  virtual void setShowByDefault( bool );
70  virtual bool showByDefault() const;
71 
72  virtual void setShowForSelected( bool );
73  virtual bool showForSelected() const;
74 
75  virtual void setShowPhysicalFootprint( bool );
76  virtual bool showPhysicalFootprint() const;
77 
78  virtual void setSphereOpacityModifier(double);
79  virtual double sphereOpacityModifier() const;
80 
83  virtual void setAttackAnimationForRingEnabled(const std::string&, bool);
84  virtual bool attackAnimationForRingEnabled(const std::string&) const;
85 
86  virtual const DtRangeRingsSettingsRecord::ColorOptions& colorOptions() const;
87  virtual DtRangeRingsSettingsRecord::ColorOption colorOption(const std::string&) const;
88 
89  virtual void setColorOptions(const DtRangeRingsSettingsRecord::ColorOptions&);
90  virtual bool getColor(const std::string& type, int force, float& r, float& g, float& b, float& a, makVrv::DtUnicode&) const;
91  virtual void setColor(const std::string& type, int color, const makVrv::DtUnicode&);
92  virtual void removeColorOption(const std::string& type);
93 
94  virtual void getRecord(DtRangeRingsSettingsRecord& rec) const;
95  virtual void setFromRecord(const DtRangeRingsSettingsRecord& rec);
96 
99  virtual void getSplitRecord(std::vector<DtRangeRingsSettingsRecord>& rec,
100  std::vector<std::string>& fileNames) {};
101 
104  virtual void addRecords(DtRangeRingsSettingsRecord& recs,
105  DtRangeRingsSettingsRecord& combinedRec) {};
106 
108  virtual void addColorOptionIfMissing(const std::string& option, int color, const makVrv::DtUnicode& label,
109  bool visible = true);
110 
113  virtual bool getColorByCategory(const std::string& type, int& color) const;
114 
115  virtual makVrv::DtUnicode labelForType(const std::string&) const;
116  virtual void setVisible(const std::string& type, bool);
117  virtual bool visible(const std::string& type) const;
118  virtual bool wasRequested(const std::string&) const;
119 
120  virtual void setSectorSizeProperty(const std::string&);
121  virtual const std::string& sectorSizeProperty() const;
122 
123  virtual bool hasNewOptions() const;
124  virtual void getAndClearOptions(std::set<std::string>& newOptions, std::set<std::string>& newOptionsRequested);
125 
126  protected:
127  virtual void colorFromForce(int force, float& r, float& g, float& b);
128 
129  protected:
130 
133 
134  protected:
135  bool myFill2D;
140 
144 
146 
148 
149  std::map<std::string, bool> myRequested;
150  std::map<std::string, bool> myAttackAnimationEnabled;
151  std::string mySectorSizeProperty;
152 
153  std::set<std::string> myNewColorOptions;
154  std::set<std::string> myNewOptionRequested;
155  };
156 
159  {
160  public:
162  virtual ~DtRangeRingsManager();
163 
165  static DtRangeRingsManager& instance(makVrv::DtDe& de);
166  static void registerInstance(makVrv::DtDe&, DtRangeRingsManager*);
167 
169  virtual void loadDefaults(bool fromFactory = false);
170 
172  virtual void saveAsDefaults();
173 
174  const makVrv::DtRecordSettingsBackupInterface* settingsBackup() const
175  {
176  return mySettingsBackup;
177  }
178 
180  {
181  return mySettingsBackup;
182  }
183 
185  void exportSettings(const std::string& fileName);
186 
188  void importSettings(const std::string& fileName);
189 
190  void setAutoSave(bool b);
191  bool autoSave() const;
192 
193  virtual void getRecord(DtRangeRingsSettingsRecord& rec) const;
194  virtual void setFromRecord(const DtRangeRingsSettingsRecord& rec);
195 
198  virtual void getSplitRecord(std::vector<DtRangeRingsSettingsRecord>& rec,
199  std::vector<std::string>& fileNames) {};
200 
203  virtual void addRecords(DtRangeRingsSettingsRecord& recs,
204  DtRangeRingsSettingsRecord& combinedRec) {};
205 
206  virtual void setFill2D(bool b);
207  virtual bool fill2D() const;
208 
209  virtual void setShowRangeSphere( bool onOff );
210  virtual bool showRangeSphere() const;
211 
212  virtual void setShowWeaponNameLabel( bool );
213  virtual bool showWeaponNameLabel() const;
214 
215  virtual void setShowEntityNameLabel( bool );
216  virtual bool showEntityNameLabel() const;
217 
218  virtual void setShowRangeValueLabel( bool );
219  virtual bool showRangeValueLabel() const;
220 
221  virtual void setShowByDefault( bool );
222  virtual bool showByDefault() const;
223 
224  virtual void setShowForSelected( bool );
225  virtual bool showForSelected() const;
226 
227  virtual void setShowPhysicalFootprint( bool );
228  virtual bool showPhysicalFootprint() const;
229 
230  virtual void setSphereOpacityModifier(double);
231  virtual double sphereOpacityModifier() const;
232 
233  virtual const DtRangeRingsSettingsRecord::ColorOptions& colorOptions() const;
234  virtual DtRangeRingsSettingsRecord::ColorOption colorOption(const std::string&) const;
235  virtual void setColorOptions(const DtRangeRingsSettingsRecord::ColorOptions&);
236  virtual bool getColor(const std::string& type, int force, float& r, float& g, float& b, float& a, makVrv::DtUnicode&) const;
237  virtual void setColor(const std::string& type, int color, const makVrv::DtUnicode&);
238  virtual void setVisible(const std::string& type, bool);
239  virtual bool visible(const std::string& type) const;
240 
243  virtual void setAttackAnimationForRingEnabled(const std::string&, bool);
244  virtual bool attackAnimationForRingEnabled(const std::string&) const;
245 
246  virtual void removeColorOption(const std::string& type);
247  virtual bool wasRequested(const std::string&) const;
248 
250  virtual void addColorOptionIfMissing(const std::string& option, int color, const makVrv::DtUnicode& label,
251  bool visible = true);
252 
253  virtual makVrv::DtUnicode labelForType(const std::string&) const;
254 
255  virtual std::string sectorSizeProperty() const;
256  virtual void setSectorSizeProperty(const std::string&);
257 
258  protected:
259  virtual void completeSetup();
260 
261  protected:
264  };
265 
269  {
270  public:
271 
276 
280 
284  static DtSharedRangeRingsSettingsSignaler* findInstance(
286 
289 
299 
305 
306  protected:
308 
309  private:
312  };
313 }

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)