VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtObserverModeRecord.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
13 
14 #include <string>
15 #include <map>
16 
17 namespace makArchives
18 {
24  {
25  public:
26 
27  typedef std::map< std::string, bool> ObserverSettingsMap;
28 
31 
34 
37 
39  DtObserverModeRecord& operator=( const DtObserverModeRecord& orig );
40 
45  void setModeKey( const std::string& modeKey );
46 
48  const std::string& modeKey() const;
49 
51  void setName( const std::string& name );
52 
54  const std::string& name() const;
55 
58  void setIs2D( bool trueOrFalse );
59 
61  bool is2D() const;
62 
64  void setModelSet( int modelSet );
65 
67  int modelSet() const;
68 
70  void setKeyMap( const std::string& keyMap );
71 
73  const std::string& keyMap() const;
74 
76  const std::string& sensor() const;
78  void setSensor(const std::string& sensor);
80 
82  int gainPrecision() const;
84  void setGainPrecision( int amt );
86 
88  int orbitSpeedGain() const;
90  void setOrbitSpeedGain( int gain );
92 
94  int linearScaledSpeedGain() const;
96  void setLinearScaledSpeedGain( int gain );
98 
100  int linearUnscaledSpeedGain() const;
102  void setLinearUnscaledSpeedGain( int gain );
104 
106  int rotationSpeedGain() const;
108  void setRotationSpeedGain( int gain );
110 
112  double modelScaleFactor() const;
114  void setModelScaleFactor( double modelScaleFactor );
116 
118  const std::string& modelScaleType() const;
120  void setModelScaleType( const std::string& modelScaleType );
122 
124  double maxModelScaleFactor() const;
126  void setMaxModelScaleFactor( double maxModelScaleFactor );
128 
130  void setObserverSetting( const std::string& key, bool enabled );
132  bool observerSetting( const std::string& key ) const;
134 
136  void setSpeedScalingMode( unsigned int mode );
138  unsigned int speedScalingMode() const;
140 
142  void setSpeedScalingMslModeOffset( double offset );
144  double speedScalingMslModeOffset() const;
146 
148  void setCameraShakeEnabled( bool enabled );
150  bool cameraShakeEnabled() const;
152 
154  void setCameraShakeIntensity( double offset );
156  double cameraShakeIntensity() const;
158 
160  void setLodScaleCenterEnabled(bool enabled);
162  bool lodScaleCenterEnabled() const;
164 
166  void setLodScaleCenterMagMinLimit(double limit);
168  double lodScaleCenterMagMinLimit() const;
170 
172  unsigned int northType() const;
174  void setNorthType(unsigned int northType);
176 
177  const ObserverSettingsMap& observerSettingsMap() const;
178 
179 
180  protected:
181  friend class boost::serialization::access;
182 
183  template <typename Archive>
184  void serialize(Archive& ar, unsigned int version)
185  {
186  ar & BOOST_SERIALIZATION_NVP(myModeKey);
187  ar & BOOST_SERIALIZATION_NVP(myName);
188  ar & BOOST_SERIALIZATION_NVP(myIs2D);
189  ar & BOOST_SERIALIZATION_NVP(myModelSet);
190  ar & BOOST_SERIALIZATION_NVP(myKeyMap);
191  ar & BOOST_SERIALIZATION_NVP(myOrbitSpeedGain);
192  ar & BOOST_SERIALIZATION_NVP(myLinearScaledSpeedGain);
193  ar & BOOST_SERIALIZATION_NVP(myLinearUnscaledSpeedGain);
194  ar & BOOST_SERIALIZATION_NVP(myRotationSpeedGain);
195  ar & BOOST_SERIALIZATION_NVP(myGainPrecision);
196  if ( version >= 1 )
197  {
198  ar & BOOST_SERIALIZATION_NVP(myModelScaleFactor);
199  }
200  if ( version >= 2 )
201  {
202  if ( version < 6 )
203  {
204  ar & BOOST_SERIALIZATION_NVP(myModelScaleType);
205  }
206  ar & BOOST_SERIALIZATION_NVP(myMaxModelScaleFactor);
207  }
208  if ( version >= 3 )
209  {
210  ar & BOOST_SERIALIZATION_NVP(mySensor);
211  }
212  ar & BOOST_SERIALIZATION_NVP(myObserverSettingsMap);
213  if ( version >= 4 )
214  {
215  ar & BOOST_SERIALIZATION_NVP(mySpeedScalingMode);
216  ar & BOOST_SERIALIZATION_NVP(mySpeedScalingMslModeOffset);
217  }
218  if ( version >= 5 )
219  {
220  ar & BOOST_SERIALIZATION_NVP(myCameraShakeEnabled);
221  ar & BOOST_SERIALIZATION_NVP(myCameraShakeIntensity);
222  }
223  if ( version >= 6 )
224  {
225  ar & BOOST_SERIALIZATION_NVP(myMutableModelScaleTypeString);
226  }
227  if (version >= 7)
228  {
229  ar & BOOST_SERIALIZATION_NVP(myLodScaleCenterEnabled);
230  ar & BOOST_SERIALIZATION_NVP(myLodScaleCenterMagMinLimit);
231  }
232  if (version >= 8)
233  {
234  ar & BOOST_SERIALIZATION_NVP(myNorthType);
235  }
236  }
237 
238  protected:
239  std::string myModeKey;
240  std::string myName;
241  std::string mySensor;
242  bool myIs2D;
243  std::string myKeyMap;
260  unsigned int myNorthType;
261  private:
262  // Mutable so that we can provide backward compatibility with settings files that contain
263  // the old enum instead of the new string
264  mutable std::string myMutableModelScaleTypeString;
265  };
266 }
267 
int myLinearUnscaledSpeedGain
Definition: DtObserverModeRecord.h:247
bool myLodScaleCenterEnabled
Definition: DtObserverModeRecord.h:258
void serialize(Archive &ar, unsigned int version)
Definition: DtObserverModeRecord.h:184
BOOST_CLASS_VERSION(makArchives::DtDiGuySettingsRecord, 3)
DtObserverModeRecord is the serializable record used to read and write a Visual Mode&#39;s Configuration ...
Definition: DtObserverModeRecord.h:23
std::string myKeyMap
Definition: DtObserverModeRecord.h:243
double myModelScaleFactor
Definition: DtObserverModeRecord.h:250
unsigned myModelScaleType
Definition: DtObserverModeRecord.h:252
double myCameraShakeIntensity
Definition: DtObserverModeRecord.h:257
unsigned int myNorthType
Definition: DtObserverModeRecord.h:260
bool myIs2D
Definition: DtObserverModeRecord.h:242
Contains DLL export macros.
int myGainPrecision
Definition: DtObserverModeRecord.h:249
ObserverSettingsMap myObserverSettingsMap
Definition: DtObserverModeRecord.h:251
std::string mySensor
Definition: DtObserverModeRecord.h:241
int myModelSet
Definition: DtObserverModeRecord.h:244
std::string myModeKey
Definition: DtObserverModeRecord.h:239
int myOrbitSpeedGain
Definition: DtObserverModeRecord.h:245
int myRotationSpeedGain
Definition: DtObserverModeRecord.h:248
double myMaxModelScaleFactor
Definition: DtObserverModeRecord.h:253
bool myCameraShakeEnabled
Definition: DtObserverModeRecord.h:256
std::string myName
Definition: DtObserverModeRecord.h:240
double mySpeedScalingMslModeOffset
Definition: DtObserverModeRecord.h:255
std::string myMutableModelScaleTypeString
Definition: DtObserverModeRecord.h:264
std::map< std::string, bool > ObserverSettingsMap
Definition: DtObserverModeRecord.h:27
const char int mode
Definition: ioapi.h:38
double myLodScaleCenterMagMinLimit
Definition: DtObserverModeRecord.h:259
voidpf uLong offset
Definition: ioapi.h:42
unsigned mySpeedScalingMode
Definition: DtObserverModeRecord.h:254
#define DT_DLL_MAKARCHIVES
Definition: makArchives.h:31
int myLinearScaledSpeedGain
Definition: DtObserverModeRecord.h:246

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)