VR-Forces 4.8 Class Documentation
 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 
171  const ObserverSettingsMap& observerSettingsMap() const;
172 
173 
174  protected:
175  friend class boost::serialization::access;
176 
177  template <typename Archive>
178  void serialize(Archive& ar, unsigned int version)
179  {
180  ar & BOOST_SERIALIZATION_NVP(myModeKey);
181  ar & BOOST_SERIALIZATION_NVP(myName);
182  ar & BOOST_SERIALIZATION_NVP(myIs2D);
183  ar & BOOST_SERIALIZATION_NVP(myModelSet);
184  ar & BOOST_SERIALIZATION_NVP(myKeyMap);
185  ar & BOOST_SERIALIZATION_NVP(myOrbitSpeedGain);
186  ar & BOOST_SERIALIZATION_NVP(myLinearScaledSpeedGain);
187  ar & BOOST_SERIALIZATION_NVP(myLinearUnscaledSpeedGain);
188  ar & BOOST_SERIALIZATION_NVP(myRotationSpeedGain);
189  ar & BOOST_SERIALIZATION_NVP(myGainPrecision);
190  if ( version >= 1 )
191  {
192  ar & BOOST_SERIALIZATION_NVP(myModelScaleFactor);
193  }
194  if ( version >= 2 )
195  {
196  if ( version < 6 )
197  {
198  ar & BOOST_SERIALIZATION_NVP(myModelScaleType);
199  }
200  ar & BOOST_SERIALIZATION_NVP(myMaxModelScaleFactor);
201  }
202  if ( version >= 3 )
203  {
204  ar & BOOST_SERIALIZATION_NVP(mySensor);
205  }
206  ar & BOOST_SERIALIZATION_NVP(myObserverSettingsMap);
207  if ( version >= 4 )
208  {
209  ar & BOOST_SERIALIZATION_NVP(mySpeedScalingMode);
210  ar & BOOST_SERIALIZATION_NVP(mySpeedScalingMslModeOffset);
211  }
212  if ( version >= 5 )
213  {
214  ar & BOOST_SERIALIZATION_NVP(myCameraShakeEnabled);
215  ar & BOOST_SERIALIZATION_NVP(myCameraShakeIntensity);
216  }
217  if ( version >= 6 )
218  {
219  ar & BOOST_SERIALIZATION_NVP(myMutableModelScaleTypeString);
220  }
221  if (version >= 7)
222  {
223  ar & BOOST_SERIALIZATION_NVP(myLodScaleCenterEnabled);
224  ar & BOOST_SERIALIZATION_NVP(myLodScaleCenterMagMinLimit);
225  }
226  }
227 
228  protected:
229  std::string myModeKey;
230  std::string myName;
231  std::string mySensor;
232  bool myIs2D;
233  std::string myKeyMap;
250  private:
251  // Mutable so that we can provide backward compatibility with settings files that contain
252  // the old enum instead of the new string
253  mutable std::string myMutableModelScaleTypeString;
254  };
255 }
256 
int myLinearUnscaledSpeedGain
Definition: DtObserverModeRecord.h:237
bool myLodScaleCenterEnabled
Definition: DtObserverModeRecord.h:248
void serialize(Archive &ar, unsigned int version)
Definition: DtObserverModeRecord.h:178
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:233
double myModelScaleFactor
Definition: DtObserverModeRecord.h:240
unsigned myModelScaleType
Definition: DtObserverModeRecord.h:242
double myCameraShakeIntensity
Definition: DtObserverModeRecord.h:247
bool myIs2D
Definition: DtObserverModeRecord.h:232
Contains DLL export macros.
int myGainPrecision
Definition: DtObserverModeRecord.h:239
BOOST_CLASS_VERSION(makArchives::DtDiGuySettingsRecord, 2)
ObserverSettingsMap myObserverSettingsMap
Definition: DtObserverModeRecord.h:241
std::string mySensor
Definition: DtObserverModeRecord.h:231
int myModelSet
Definition: DtObserverModeRecord.h:234
std::string myModeKey
Definition: DtObserverModeRecord.h:229
int myOrbitSpeedGain
Definition: DtObserverModeRecord.h:235
int myRotationSpeedGain
Definition: DtObserverModeRecord.h:238
double myMaxModelScaleFactor
Definition: DtObserverModeRecord.h:243
bool myCameraShakeEnabled
Definition: DtObserverModeRecord.h:246
std::string myName
Definition: DtObserverModeRecord.h:230
double mySpeedScalingMslModeOffset
Definition: DtObserverModeRecord.h:245
std::string myMutableModelScaleTypeString
Definition: DtObserverModeRecord.h:253
std::map< std::string, bool > ObserverSettingsMap
Definition: DtObserverModeRecord.h:27
const char int mode
Definition: ioapi.h:38
double myLodScaleCenterMagMinLimit
Definition: DtObserverModeRecord.h:249
voidpf uLong offset
Definition: ioapi.h:42
unsigned mySpeedScalingMode
Definition: DtObserverModeRecord.h:244
#define DT_DLL_MAKARCHIVES
Definition: makArchives.h:31
int myLinearScaledSpeedGain
Definition: DtObserverModeRecord.h:236

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)