VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtDeInitializer.h
Go to the documentation of this file.
1 /*****************************************************************************
2 * Copyright (c) 2015 MAK Technologies, Inc.
3 * All rights reserved.
4 *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvUtil/DtDebugLog.h>
20 #include <vrvUtil/DtRecordHolder.h>
21 #include <vrvUtil/vrvUtil.h>
22 
24 
25 namespace makVrv
26 {
27 
28  class DtBaseRecordHolder;
29 
33  {
34  public:
35 
36  enum DeMode
37  {
38  NoMode = 0,
39  MasterMode = 1,
40  SlaveMode = 2,
41  DeMode_end
42 
43  };
44 
48  {
49  Features_None = 0,
50  Features_2D = 1,
51  Features_3D = 2,
52  Features_Stealth = Features_3D | Features_2D,
53  DeFeatures_end
54  };
55 
56 
60  typedef std::vector<std::pair<std::string,DtConfiguration> >
62 
66  typedef std::map<std::string, std::string> AuthorizationCodeMap;
67 
69  typedef std::vector<std::pair<std::string, makArchives::DtObserverStateRecord> >
71 
73  typedef std::map<std::string,DtBaseRecordHolder*> DefaultRecordMap;
74 
76  {
77  int port;
78  std::string address;
80 
81  template<class Archive>
82  void serialize(Archive & ar, const unsigned int version)
83  {
84  ar & BOOST_SERIALIZATION_NVP(port);
85  ar & BOOST_SERIALIZATION_NVP(address);
86  ar & BOOST_SERIALIZATION_NVP(configuration);
87  }
88  };
89 
90  typedef std::vector<DisplayConnection> DisplayConnections;
91 
92  public:
93 
96  DtDeInitializer( const std::string& name = "" );
97 
99  DtDeInitializer( const DtDeInitializer& initializer );
100 
102  DtDeInitializer& operator = ( const DtDeInitializer& initializer );
103 
105  virtual ~DtDeInitializer();
106 
108  void setFeatures( DeFeatures features );
109 
111  DeFeatures features() const;
112 
114  bool featureSupported( DeFeatures feature ) const;
115 
122 
125  const DtDriverConfiguration& driverConfiguration() const;
126  DtDriverConfiguration& driverConfiguration();
128 
130  void setDriverConfiguration(const DtDriverConfiguration&);
131 
134  const DtGuiConfiguration& guiConfiguration() const;
135  DtGuiConfiguration& guiConfiguration();
137 
139  void setGuiConfiguration( const DtGuiConfiguration& config );
140 
143  const DtInputDriverConfiguration& inputDriverConfiguration() const;
144  DtInputDriverConfiguration& inputDriverConfiguration();
146 
148  void setInputDriverConfiguration( const DtInputDriverConfiguration& config );
149 
151  const std::string& displayName() const;
152 
154  void setDisplayEngineName( const std::string& name );
155 
157  DtDeInitializer::DeMode deMode() const;
158 
160  void setDeMode( DtDeInitializer::DeMode mode );
161 
163  void setDefaultDrivers( const DriverInstanceList& drivers );
164 
166  const DriverInstanceList& defaultDrivers() const;
167 
169  void setDeConfiguration( const DtDeConfiguration& config );
170 
172  DtDeConfiguration& deConfiguration();
173 
175  const DtDeConfiguration& deConfiguration() const;
176 
178  void setCoordinateSystem( const std::string& coordinateSystem,
179  const std::string& parameters );
180 
182  const std::string& coordinateSystem() const;
183 
185  const std::string& coordinateSystemParameters() const;
186 
188  void setNotifyLevel( DtDebugLog::PrintLevel level );
189 
191  DtDebugLog::PrintLevel notifyLevel() const;
192 
194  void setLogFileName( const std::string& filename );
195 
197  const std::string& logFileName() const;
198 
201  void setAutoLoadDrivers( bool autoLoad );
202 
205  bool autoLoadDrivers() const;
206 
208  void setAutoStartDrivers( const std::vector<std::string>& names );
209 
211  const std::vector<std::string>& autoStartDrivers() const;
212 
214  void setAuthorizationCodeMap( const AuthorizationCodeMap& map );
215 
217  void addAuthorizationCodeMapping( const std::string& key,
218  const std::string& value );
219 
221  void removeAuthorizationCodeMapping( const std::string& key );
222 
225  const std::string* findAuthorizationCodeValue( const std::string& key ) const;
226 
228  void setObserverStateMap( const ObserverStateMap& osm );
229 
231  const ObserverStateMap& observerStateMap() const;
232 
234  const std::vector<std::string>& mappingFilesToLoad() const;
235 
237  void setMappingFilesToLoad( const std::vector<std::string>& );
238 
240  const DisplayConnections& displayConnections() const;
241  DisplayConnections& displayConnections();
242 
243  void setDisplayConnections( const DisplayConnections& displayConnections );
244 
246  void setAutoLoadFile( const std::string& file );
247 
249  const std::string& autoLoadFile() const;
250 
252  void setStartFullScreen( bool );
253 
255  bool startFullScreen() const;
256 
258  void addDefaultSettingsRecord( const std::string& recordName,
259  const DtBaseRecordHolder& record );
260 
262  void removeDefaultSettingsRecord( const std::string& record );
263 
265  template <typename RecordType>
266  bool findDefaultSettingsRecord( const std::string& name, RecordType& record ) const
267  {
268  DefaultRecordMap::const_iterator iter = myDefaultRecords.find( name );
269  if ( iter != myDefaultRecords.end() )
270  {
271  const DtRecordHolder<RecordType>* holder =
272  dynamic_cast<const DtRecordHolder<RecordType>*>( iter->second );
273  if ( holder )
274  {
275  record = holder->record();
276  return true;
277  }
278  }
279 
280  return false;
281  }
282 
284  void setConstrainToTerrain( bool constrain );
285  bool constrainToTerrain() const;
286 
288  void setSpeedScaling( bool scale );
289  bool speedScaling() const;
290 
292  void setVertexSelectsParent( bool selectsParent );
293  bool vertexSelectsParent() const;
294 
296  void setDoubleBuffering( bool buffer );
297  bool doubleBuffer() const;
298 
300  void setVSync( bool sync );
301  bool vsync() const;
302 
305  void setFixedFrameRate( unsigned int framesPerSecond );
306  unsigned int fixedFrameRate() const;
307 
309  void setNumDepthBits(unsigned short numBits);
310  unsigned short numDepthBits() const;
311 
313  void setNumStencilBits(unsigned short numBits);
314  unsigned short numStencilBits() const;
315 
317  void setNumAlphaBits(unsigned short numBits);
318  unsigned short numAlphaBits() const;
319 
321  void setBatchedRendering(bool val);
322 
324  bool batchedRendering() const;
325 
328  void setIgnoreZoomForSpeedtreeLod(bool val);
329 
332  bool ignoreZoomForSpeedtreeLod() const;
333 
340  void setSuppressHatIntersectOnAttach(bool val);
341 
344  bool suppressHatIntersectOnAttach() const;
345 
348  void setSynchronizedNtpTime(bool val);
349 
352  bool synchronizedNtpTime() const;
353 
355 
356  virtual void setKdTreesDisabled( bool disabled );
357  virtual bool kdTreesDisabled() const;
359 
361  virtual void setForceTextShaping( bool force );
362  virtual bool forceTextShaping() const;
364 
366  void setAntiAliasingLevel(unsigned short level);
367  unsigned short antiAliasingLevel() const;
368 
370  void setPathConfiguration( const DtDePathConfiguration& pathConfig );
371 
373  DtDePathConfiguration& pathConfiguration();
374 
376  const DtDePathConfiguration& pathConfiguration() const;
377 
380  void setInitLibXml( bool enabled );
381 
384  bool initLibXml() const;
385 
387  void setCheckForData( bool check );
388 
390  bool checkForData() const;
391 
399  void setUsePseudoFullScreen( bool enable );
400 
402  bool usePseudoFullScreen() const;
403 
405  void setUseHighestPriority( bool enable );
406 
408  bool useHighestPriority() const;
409 
412  void setTcpSendTimeout(double timeout);
413  double tcpSendTimeout() const;
414 
415  protected:
416 
417  template<class Archive>
418  void _serialize(Archive & ar, const unsigned int version)
419  {
421  ar & DT_SERIALIZE_MEMBER(myDriverConfiguration);
422  ar & DT_SERIALIZE_MEMBER(myGuiConfiguration);
423  ar & DT_SERIALIZE_MEMBER(myInputDriverConfiguration);
424  ar & DT_SERIALIZE_MEMBER(myDisplayEngineName);
425 
426  ar & DT_SERIALIZE_MEMBER(myDeMode);
427  ar & DT_SERIALIZE_MEMBER(myDriverInstances);
428  ar & DT_SERIALIZE_MEMBER(myCoordinateSystem);
429  ar & DT_SERIALIZE_MEMBER(myCoordinateSystemParameters);
430 
431  ar & DT_SERIALIZE_MEMBER(myDeConfiguration);
432 
433  ar & DT_SERIALIZE_MEMBER(myAutoLoadDriversFlag);
434 
435  ar & DT_SERIALIZE_MEMBER(myAutoStartDrivers);
436  ar & DT_SERIALIZE_MEMBER(myMappingFilesToLoad);
437 
438  ar & DT_SERIALIZE_MEMBER(myDisplayConnections);
439  ar & DT_SERIALIZE_MEMBER(myAutoLoadFile);
440  ar & DT_SERIALIZE_MEMBER(myFullScreenFlag);
441  ar & DT_SERIALIZE_MEMBER(myConstrainToTerrainFlag);
442  ar & DT_SERIALIZE_MEMBER(mySpeedScalingFlag);
443 
444  ar & DT_SERIALIZE_MEMBER(myDoubleBufferFlag);
445  ar & DT_SERIALIZE_MEMBER(myVSyncFlag);
446 
447  ar & DT_SERIALIZE_MEMBER(myDefaultRecords);
448 
449  if (version >= 2)
450  {
451  ar & BOOST_SERIALIZATION_NVP(myInitLibXml);
452  }
453  if(version >= 3)
454  {
455  ar & BOOST_SERIALIZATION_NVP(myFeatures);
456  }
457  if(version >= 4)
458  {
459  ar & BOOST_SERIALIZATION_NVP(myVertexSelectsParentFlag);
460  }
461 
462  if(version >= 5)
463  {
464  ar & BOOST_SERIALIZATION_NVP(myCheckForData);
465  }
466 
467  if(version >= 6)
468  {
469  ar & BOOST_SERIALIZATION_NVP(myBatchedRenderingFlag);
470  }
471 
472  if(version >= 7)
473  {
474  ar & BOOST_SERIALIZATION_NVP(mySynchronizedOceanFlag);
475  }
476  if(version >= 8)
477  {
478  ar & BOOST_SERIALIZATION_NVP(mySynchronizedNtpTimeFlag);
479  }
480  if(version >= 9)
481  {
482  ar & BOOST_SERIALIZATION_NVP(myIgnoreZoomForSpeedtreeLod);
483  }
484  if(version >= 10)
485  {
486  ar & BOOST_SERIALIZATION_NVP(mySuppressHatIntersectOnAttach);
487  }
488  if(version >= 11)
489  {
490  ar & BOOST_SERIALIZATION_NVP(myUsePseudoFullScreen);
491  }
492  if(version >= 12)
493  {
494  ar & BOOST_SERIALIZATION_NVP(myUseHighestPriorityFlag);
495  }
496  if (version >= 13)
497  {
498  ar & BOOST_SERIALIZATION_NVP(myDisableKdTrees);
499  }
500  if (version >= 14)
501  {
502  ar & BOOST_SERIALIZATION_NVP(myForceTextShaping);
503  }
504  }
505 
506  protected:
507 
511  std::string myDisplayEngineName;
512 
515 
518  std::string myCoordinateSystem;
521  std::string myLogFileName;
522 
524 
527 
528  std::vector<std::string> myAutoStartDrivers;
530  std::vector<std::string> myMappingFilesToLoad;
531 
533  std::string myAutoLoadFile;
534 
547 
550  unsigned int myFrameRate;
551  unsigned short myNumDepthBits;
552  unsigned short myNumStencilBits;
553  unsigned short myNumAlphaBits;
554  unsigned short myAntiAliasingLevel;
559 
561 
563  };
564 
565 }
566 

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)