VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtEntitySettingsRecord.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2021 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
14 
15 #include <limits>
16 #include <string>
17 #include <map>
18 
19 namespace makArchives
20 {
22  {
23  friend class boost::serialization::access;
24 
25  public:
26  DtDynamicScaleConfiguration(double altitude, float scale)
27  : myAltitude(altitude)
28  , myScale(scale)
29  { }
30 
32  : myAltitude(std::numeric_limits<double>::min())
33  , myScale(1.0)
34  { }
35 
36  ~DtDynamicScaleConfiguration() = default;
38  const DtDynamicScaleConfiguration &other) = default;
39  DtDynamicScaleConfiguration &operator=(
40  const DtDynamicScaleConfiguration &other) = default;
41 
42  template <typename Archive>
43  void serialize(Archive& ar, unsigned int version)
44  {
45  ar & BOOST_SERIALIZATION_NVP(myAltitude);
46  ar & BOOST_SERIALIZATION_NVP(myScale);
47  }
48 
49  public:
50  double myAltitude;
51  float myScale;
52  };
53 
54  typedef std::vector<DtDynamicScaleConfiguration> DtDynamicScaleConfigurationCollection;
55 
56  // Mapping between a display unit's name and its configuration
57  typedef std::map<std::string, DtDynamicScaleConfigurationCollection> DtDynamicScaleConfigurationCollectionMap;
58 
62  {
63  public:
64  enum BuoyancyCullType { BuoyancyCullNone, BuoyancyCullFrontFacing, BuoyancyCullFrustum };
65 
68 
71 
73  DtEntitySettingsRecord& operator = ( const DtEntitySettingsRecord& obj );
74 
77 
80 
81  bool groundClampingEnabled() const;
82  void setGroundClampingEnabled( bool enabled );
83 
84  float groundClampingRadiusScale() const;
85  void setGroundClampingRadiusScale( float scale );
86 
87  bool groundClampingCullingEnabled() const;
88  void setGroundClampingCullingEnabled( bool enabled );
89 
90  bool orientationClampingEnabled() const;
91  void setOrientationClampingEnabled( bool enabled );
92 
93  bool lifeformsUprightEnabled() const;
94  void setLifeformsUprightEnabled( bool enabled );
95 
96  bool smoothingEnabled() const;
97  void setSmoothingEnabled( bool enabled );
98 
99  float smoothingPeriod() const;
100  void setSmoothingPeriod( float period );
101 
104  bool artPartSmoothingEnabled() const;
105  void setArtPartSmoothingEnabled(bool setting);
106 
107  float artPartSmoothingPeriod() const;
108  void setArtPartSmoothingPeriod(float period);
110 
111  bool showEntityLabels() const;
112  void setShowEntityLabels( bool show );
113 
114  bool rotateEntitySymbols() const;
115  void setRotateEntitySymbols( bool show );
116 
117  bool showStealthsEnabled() const;
118  void setShowStealthsEnabled( bool enabled );
119 
120  bool infoPopupsOnSelectEnabled() const;
121  void setInfoPopupsOnSelectEnabled( bool enabled );
122 
123  bool fireDetonateLinesEnabled() const;
124  void setFireDetonateLinesEnabled( bool enabled );
125 
126  bool entityEmitterVolumesEnabled() const;
127  void setEntityEmitterVolumesEnabled( bool enabled );
128 
129  bool entityHeightAboveTerrainLinesEnabled() const;
130  void setEntityHeightAboveTerrainLinesEnabled( bool enabled );
131 
132  unsigned entityHeightAboveTerrainMode() const;
133  void setEntityHeightAboveTerrainMode( unsigned mode );
134 
135  bool entitySimDataEnabled() const;
136  void setEntitySimDataEnabled( bool enabled );
137 
138  unsigned colorizedModelColorType() const;
139  void setColorizedModelColorType( unsigned type );
140 
141  float entityIconScale() const;
142  void setEntityIconScale( float scale );
143 
144  bool fixedEntityIconScalingEnabled() const;
145  void setFixedEntityIconScalingEnabled(bool enabled);
146 
147  void setDynamicScaleCollectionMap(const DtDynamicScaleConfigurationCollectionMap&);
148  const DtDynamicScaleConfigurationCollectionMap& dynamicScaleCollectionMap() const;
149  DtDynamicScaleConfigurationCollectionMap& dynamicScaleCollectionMap();
150 
151  void setHideEmbarked2DObjects( bool b );
152  bool hideEmbarked2DObjects() const;
153 
154  bool entityOceanWakesEnabled() const;
155  void setEntityOceanWakesEnabled( bool enabled );
156 
157  bool entityHullSprayEffectsEnabled() const;
158  void setEntityHullSprayEffectsEnabled( bool enabled );
159 
160  bool entityBuoyancyModelsEnabled() const;
161  void setEntityBuoyancyModelsEnabled( bool enabled );
162 
163  float buoyancyDefaultLODDistance() const;
164  void setBuoyancyDefaultLODDistance( float distance );
165 
166  float wakeDefaultLODDistance() const;
167  void setWakeDefaultLODDistance( float distance );
168 
169  bool buoyAndBeaconIconsEnabled() const;
170  void setBuoyAndBeaconIconsEnabled( bool enabled );
171 
172  unsigned int heightAboveTerrainPeriod() const;
173  void setHeightAboveTerrainPeriod( unsigned int period );
174 
178  float buoyancyMinimumCullDistance() const;
179 
181  void setBuoyancyMinimumCullDistance( float distance );
182 
183  void setBuoyancyCullType( BuoyancyCullType cullType );
184  BuoyancyCullType buoyancyCullType() const;
185 
186  bool rotorWashEnabled() const;
187  void setRotorWashEnabled(bool enabled);
188 
191  bool occupantsVisible() const;
192  void setOccupantsVisible(bool enabled);
193 
195  bool wheelRotationEnabled() const;
196  void setWheelRotationEnabled(bool setting);
198 
200  bool adaptiveTickRateEnabled() const;
201  void setAdaptiveTickRateEnabled(bool setting);
203 
205 
206  protected:
207 
208  friend class boost::serialization::access;
209 
213  template<class Archive>
214  void serialize(Archive & ar, const unsigned int version)
215  {
216  if ( version <= 6 )
217  {
218  //Deprecated
219  bool myTrailingEffectsEnabled;
220  bool myTrackHistoryEnabled;
221  bool myDecalEffectsEnabled;
222  ar & BOOST_SERIALIZATION_NVP(myTrailingEffectsEnabled);
223  ar & BOOST_SERIALIZATION_NVP(myTrackHistoryEnabled);
224  ar & BOOST_SERIALIZATION_NVP(myDecalEffectsEnabled);
225  }
226  ar & BOOST_SERIALIZATION_NVP(myGroundClampingEnabled);
227  ar & BOOST_SERIALIZATION_NVP(myGroundClampingRadiusScale);
228  ar & BOOST_SERIALIZATION_NVP(mySmoothingEnabled);
229  ar & BOOST_SERIALIZATION_NVP(mySmoothingPeriod);
230  if (version >= 24)
231  {
232  ar & BOOST_SERIALIZATION_NVP(myArtPartSmoothingEnabled);
233  ar & BOOST_SERIALIZATION_NVP(myArtPartSmoothingPeriod);
234  }
235  ar & BOOST_SERIALIZATION_NVP(myOrientationClampingEnabled);
236  ar & BOOST_SERIALIZATION_NVP(myLifeformsUprightEnabled);
237 
238  if(version >= 1 && version != 7 )
239  {
240  ar & BOOST_SERIALIZATION_NVP(myShowEntityLabels);
241  }
242 
243  if (version >= 2)
244  {
245  ar & BOOST_SERIALIZATION_NVP(myShowStealthsEnabled);
246  }
247 
248  if (version >= 3)
249  {
250  ar & BOOST_SERIALIZATION_NVP(myInfoPopupsOnSelectEnabled);
251  }
252 
253  if (version >= 4 && version != 7 )
254  {
255  ar & BOOST_SERIALIZATION_NVP(myFireDetonateLinesEnabled);
256  }
257 
258  if (version >= 5)
259  {
260  if ( version != 7 )
261  {
262  ar & BOOST_SERIALIZATION_NVP(myEntityHeightAboveTerrainLinesEnabled);
263  }
264  ar & BOOST_SERIALIZATION_NVP(myEntityHeightAboveTerrainMode);
265  }
266 
267  if (version >=6)
268  {
269  ar& BOOST_SERIALIZATION_NVP(myEntitySimDataEnabled);
270  }
271 
272  if (version >= 9 )
273  {
274  ar & BOOST_SERIALIZATION_NVP(myColorizedModelColorType);
275  }
276 
277  if (version == 10 )
278  {
279  int myEntityIconScale = 1;
280  ar & BOOST_SERIALIZATION_NVP(myEntityIconScale);
281  myEntityIconScaleFactor =
282  pow(1.25, ((float)myEntityIconScale / 10.0) - 5);
283  }
284 
285  if (version >= 11 )
286  {
287  ar & BOOST_SERIALIZATION_NVP(myHideEmbarked2DObjects);
288  }
289 
290  if (version >= 27)
291  {
292  ar & BOOST_SERIALIZATION_NVP(myFixedEntityIconScalingEnabled);
293  }
294  if (version >= 26)
295  {
296  ar & BOOST_SERIALIZATION_NVP(myDynamicScaleFactorCollectionMap);
297  }
298  if (version >= 12)
299  {
300  ar & BOOST_SERIALIZATION_NVP(myEntityIconScaleFactor);
301  }
302  if ( version >= 13 )
303  {
304  ar & BOOST_SERIALIZATION_NVP(myEntitySensorVolumesEnabled);
305  }
306  if ( version >= 14 )
307  {
308  ar & BOOST_SERIALIZATION_NVP(myGroundClampingCullingEnabled);
309  }
310  else
311  {
312  myGroundClampingCullingEnabled = ( myGroundClampingRadiusScale < 100 );
313  }
314  if ( version >= 15 )
315  {
316  ar & BOOST_SERIALIZATION_NVP(myRotateEntitySymbols);
317  }
318  if ( version >= 16 )
319  {
320  ar & BOOST_SERIALIZATION_NVP(myOceanWakesEnabled);
321  ar & BOOST_SERIALIZATION_NVP(myHullSprayEffectsEnabled);
322  ar & BOOST_SERIALIZATION_NVP(myBuoyancyModelsEnabled);
323  }
324  if ( version >= 17 )
325  {
326  ar & BOOST_SERIALIZATION_NVP( myBuoyAndBeaconIconsEnabled );
327  }
328  if ( version >= 18 )
329  {
330  ar & BOOST_SERIALIZATION_NVP( myHeightAboveTerrainPeriod );
331  }
332  if ( version >= 19 )
333  {
334  ar & BOOST_SERIALIZATION_NVP( myBuoyancyDefaultLODDistance );
335  }
336  if ( version >= 20 )
337  {
338  ar & BOOST_SERIALIZATION_NVP( myBuoyancyMinimumCullDistance );
339  ar & BOOST_SERIALIZATION_NVP( myBuoyancyCullType );
340  }
341  if (version >= 21)
342  {
343  ar & BOOST_SERIALIZATION_NVP(myWakeDefaultLODDistance);
344  }
345  if (version >= 22)
346  {
347  ar & BOOST_SERIALIZATION_NVP(myRotorWashEnabled);
348  }
349  if (version >= 23)
350  {
351  ar & BOOST_SERIALIZATION_NVP(myOccupantsVisible);
352  }
353  if (version >= 24)
354  {
355  ar & BOOST_SERIALIZATION_NVP(myWheelRotationEnabled);
356  }
357  if (version >= 25)
358  {
359  ar& BOOST_SERIALIZATION_NVP(myAdaptiveTickRateEnabled);
360  }
361  }
362 
363  protected:
364 
372 
376 
385  bool myEntitySensorVolumesEnabled; // also referred to as 'EmitterVolumes'.
403  };
404 
405 }
406 
float myScale
Definition: DtEntitySettingsRecord.h:51
float myWakeDefaultLODDistance
Definition: DtEntitySettingsRecord.h:396
bool myBuoyancyModelsEnabled
Definition: DtEntitySettingsRecord.h:392
BOOST_CLASS_VERSION(makArchives::DtDiGuySettingsRecord, 3)
BuoyancyCullType myBuoyancyCullType
Definition: DtEntitySettingsRecord.h:398
bool myArtPartSmoothingEnabled
Definition: DtEntitySettingsRecord.h:370
bool myEntitySensorVolumesEnabled
Definition: DtEntitySettingsRecord.h:385
bool myOceanWakesEnabled
Definition: DtEntitySettingsRecord.h:390
bool myRotorWashEnabled
Definition: DtEntitySettingsRecord.h:399
bool myHullSprayEffectsEnabled
Definition: DtEntitySettingsRecord.h:391
float mySmoothingPeriod
Definition: DtEntitySettingsRecord.h:369
unsigned myColorizedModelColorType
Definition: DtEntitySettingsRecord.h:365
std::map< std::string, DtDynamicScaleConfigurationCollection > DtDynamicScaleConfigurationCollectionMap
Definition: DtEntitySettingsRecord.h:57
Contains DLL export macros.
bool myFireDetonateLinesEnabled
Definition: DtEntitySettingsRecord.h:384
float myBuoyancyMinimumCullDistance
Definition: DtEntitySettingsRecord.h:397
double myAltitude
Definition: DtEntitySettingsRecord.h:50
unsigned myEntityHeightAboveTerrainMode
Definition: DtEntitySettingsRecord.h:366
bool myShowStealthsEnabled
Definition: DtEntitySettingsRecord.h:382
Definition: DtEntitySettingsRecord.h:21
bool myOrientationClampingEnabled
Definition: DtEntitySettingsRecord.h:379
bool myShowEntityLabels
Definition: DtEntitySettingsRecord.h:381
bool myRotateEntitySymbols
Definition: DtEntitySettingsRecord.h:389
DtDynamicScaleConfiguration()
Definition: DtEntitySettingsRecord.h:31
bool myGroundClampingCullingEnabled
Definition: DtEntitySettingsRecord.h:378
unsigned int myHeightAboveTerrainPeriod
Definition: DtEntitySettingsRecord.h:394
BuoyancyCullType
Definition: DtEntitySettingsRecord.h:64
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
std::vector< DtDynamicScaleConfiguration > DtDynamicScaleConfigurationCollection
Definition: DtEntitySettingsRecord.h:54
bool myInfoPopupsOnSelectEnabled
Definition: DtEntitySettingsRecord.h:383
DtDynamicScaleConfigurationCollectionMap myDynamicScaleFactorCollectionMap
Definition: DtEntitySettingsRecord.h:374
bool myLifeformsUprightEnabled
Definition: DtEntitySettingsRecord.h:380
bool myOccupantsVisible
Definition: DtEntitySettingsRecord.h:400
void serialize(Archive &ar, unsigned int version)
Definition: DtEntitySettingsRecord.h:43
float myArtPartSmoothingPeriod
Definition: DtEntitySettingsRecord.h:371
bool myBuoyAndBeaconIconsEnabled
Definition: DtEntitySettingsRecord.h:393
float myGroundClampingRadiusScale
Definition: DtEntitySettingsRecord.h:367
const char int mode
Definition: ioapi.h:38
bool myFixedEntityIconScalingEnabled
Definition: DtEntitySettingsRecord.h:373
bool mySmoothingEnabled
Definition: DtEntitySettingsRecord.h:368
bool myHideEmbarked2DObjects
Definition: DtEntitySettingsRecord.h:388
bool myEntityHeightAboveTerrainLinesEnabled
Definition: DtEntitySettingsRecord.h:386
float myEntityIconScaleFactor
Definition: DtEntitySettingsRecord.h:375
#define DT_DLL_MAKARCHIVES
Definition: makArchives.h:31
bool myEntitySimDataEnabled
Definition: DtEntitySettingsRecord.h:387
Contains the entity display settings.
Definition: DtEntitySettingsRecord.h:61
void serialize(Archive &ar, const unsigned int version)
When the class Archive corresponds to an output archive, the &amp; operator is defined similar to &lt;&lt;...
Definition: DtEntitySettingsRecord.h:214
DtDynamicScaleConfiguration(double altitude, float scale)
Definition: DtEntitySettingsRecord.h:26
bool myAdaptiveTickRateEnabled
Definition: DtEntitySettingsRecord.h:402
bool myWheelRotationEnabled
Definition: DtEntitySettingsRecord.h:401
float myBuoyancyDefaultLODDistance
Definition: DtEntitySettingsRecord.h:395
bool myGroundClampingEnabled
Definition: DtEntitySettingsRecord.h:377

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)