VR-Forces 4.3 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) 2014 MAK Technologies, Inc.
3 * All rights reserved.
4 *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvUtil/vrvUtil.h>
14 #include <vrvUtil/DtDebugLog.h>
20 #include <vrvUtil/DtRecordHolder.h>
21 
24 
25 #include <vector>
26 
27 namespace makVrv
28 {
29 
30  class DtBaseRecordHolder;
31 
35  {
36  public:
37 
38  enum DeMode
39  {
40  NoMode = 0,
41  MasterMode = 1,
42  SlaveMode = 2,
43  DeMode_end
44 
45  };
46 
50  {
51  Features_None = 0,
52  Features_2D = 1,
53  Features_3D = 2,
54  Features_Stealth = Features_3D | Features_2D,
55  DeFeatures_end
56  };
57 
58 
62  typedef std::vector<std::pair<std::string,DtConfiguration> >
64 
68  typedef std::map<std::string, std::string> AuthorizationCodeMap;
69 
71  typedef std::vector<std::pair<std::string, makArchives::DtObserverStateRecord> >
73 
75  typedef std::map<std::string,DtBaseRecordHolder*> DefaultRecordMap;
76 
78  {
79  int port;
80  std::string address;
82 
83  template<class Archive>
84  void serialize(Archive & ar, const unsigned int version)
85  {
86  ar & BOOST_SERIALIZATION_NVP(port);
87  ar & BOOST_SERIALIZATION_NVP(address);
88  ar & BOOST_SERIALIZATION_NVP(configuration);
89  }
90  };
91 
92  typedef std::vector<DisplayConnection> DisplayConnections;
93 
94  public:
95 
98  DtDeInitializer( const std::string& name = "" );
99 
101  DtDeInitializer( const DtDeInitializer& initializer );
102 
104  DtDeInitializer& operator = ( const DtDeInitializer& initializer );
105 
107  virtual ~DtDeInitializer();
108 
110  void setFeatures( DeFeatures features );
111 
113  DeFeatures features() const;
114 
116  bool featureSupported( DeFeatures feature ) const;
117 
124 
127  const DtDriverConfiguration& driverConfiguration() const;
128  DtDriverConfiguration& driverConfiguration();
130 
132  void setDriverConfiguration(const DtDriverConfiguration&);
133 
136  const DtGuiConfiguration& guiConfiguration() const;
137  DtGuiConfiguration& guiConfiguration();
139 
141  void setGuiConfiguration( const DtGuiConfiguration& config );
142 
145  const DtInputDriverConfiguration& inputDriverConfiguration() const;
146  DtInputDriverConfiguration& inputDriverConfiguration();
148 
150  void setInputDriverConfiguration( const DtInputDriverConfiguration& config );
151 
153  const std::string& displayName() const;
154 
156  void setDisplayEngineName( const std::string& name );
157 
159  DtDeInitializer::DeMode deMode() const;
160 
162  void setDeMode( DtDeInitializer::DeMode mode );
163 
165  void setDefaultDrivers( const DriverInstanceList& drivers );
166 
168  const DriverInstanceList& defaultDrivers() const;
169 
171  void setDeConfiguration( const DtDeConfiguration& config );
172 
174  DtDeConfiguration& deConfiguration();
175 
177  const DtDeConfiguration& deConfiguration() const;
178 
180  void setCoordinateSystem( const std::string& coordinateSystem,
181  const std::string& parameters );
182 
184  const std::string& coordinateSystem() const;
185 
187  const std::string& coordinateSystemParameters() const;
188 
190  void setNotifyLevel( DtDebugLog::PrintLevel level );
191 
193  DtDebugLog::PrintLevel notifyLevel() const;
194 
196  void setLogFileName( const std::string& filename );
197 
199  const std::string& logFileName() const;
200 
203  void setAutoLoadDrivers( bool autoLoad );
204 
207  bool autoLoadDrivers() const;
208 
210  void setAutoStartDrivers( const std::vector<std::string>& names );
211 
213  const std::vector<std::string>& autoStartDrivers() const;
214 
216  void setAuthorizationCodeMap( const AuthorizationCodeMap& map );
217 
219  void addAuthorizationCodeMapping( const std::string& key,
220  const std::string& value );
221 
223  void removeAuthorizationCodeMapping( const std::string& key );
224 
227  const std::string* findAuthorizationCodeValue( const std::string& key ) const;
228 
230  void setObserverStateMap( const ObserverStateMap& osm );
231 
233  const ObserverStateMap& observerStateMap() const;
234 
236  const std::vector<std::string>& mappingFilesToLoad() const;
237 
239  void setMappingFilesToLoad( const std::vector<std::string>& );
240 
242  const DisplayConnections& displayConnections() const;
243  DisplayConnections& displayConnections();
244 
245  void setDisplayConnections( const DisplayConnections& displayConnections );
246 
248  void setAutoLoadFile( const std::string& file );
249 
251  const std::string& autoLoadFile() const;
252 
254  void setStartFullScreen( bool );
255 
257  bool startFullScreen() const;
258 
260  void addDefaultSettingsRecord( const std::string& recordName,
261  const DtBaseRecordHolder& record );
262 
264  void removeDefaultSettingsRecord( const std::string& record );
265 
267  template <typename RecordType>
268  bool findDefaultSettingsRecord( const std::string& name, RecordType& record ) const
269  {
270  DefaultRecordMap::const_iterator iter = myDefaultRecords.find( name );
271  if ( iter != myDefaultRecords.end() )
272  {
273  const DtRecordHolder<RecordType>* holder =
274  dynamic_cast<const DtRecordHolder<RecordType>*>( iter->second );
275  if ( holder )
276  {
277  record = holder->record();
278  return true;
279  }
280  }
281 
282  return false;
283  }
284 
286  void setConstrainToTerrain( bool constrain );
287  bool constrainToTerrain() const;
288 
290  void setSpeedScaling( bool scale );
291  bool speedScaling() const;
292 
294  void setVertexSelectsParent( bool selectsParent );
295  bool vertexSelectsParent() const;
296 
298  void setDoubleBuffering( bool buffer );
299  bool doubleBuffer() const;
300 
302  void setVSync( bool sync );
303  bool vsync() const;
304 
307  void setFixedFrameRate( unsigned int framesPerSecond );
308  unsigned int fixedFrameRate() const;
309 
311  void setNumDepthBits(unsigned short numBits);
312  unsigned short numDepthBits() const;
313 
315  void setNumStencilBits(unsigned short numBits);
316  unsigned short numStencilBits() const;
317 
319  void setBatchedRendering(bool val);
320 
322  bool batchedRendering() const;
323 
326  void setIgnoreZoomForSpeedtreeLod(bool val);
327 
330  bool ignoreZoomForSpeedtreeLod() const;
331 
338  void setSuppressHatIntersectOnAttach(bool val);
339 
342  bool suppressHatIntersectOnAttach() const;
343 
346  void setSynchronizedNtpTime(bool val);
347 
350  bool synchronizedNtpTime() const;
351 
353  void setAntiAliasingLevel(unsigned short level);
354  unsigned short antiAliasingLevel() const;
355 
357  void setPathConfiguration( const DtDePathConfiguration& pathConfig );
358 
360  DtDePathConfiguration& pathConfiguration();
361 
363  const DtDePathConfiguration& pathConfiguration() const;
364 
367  void setInitLibXml( bool enabled );
368 
371  bool initLibXml() const;
372 
374  void setCheckForData( bool check );
375 
377  bool checkForData() const;
378 
379  protected:
380 
381  template<class Archive>
382  void _serialize(Archive & ar, const unsigned int version)
383  {
385  ar & DT_SERIALIZE_MEMBER(myDriverConfiguration);
386  ar & DT_SERIALIZE_MEMBER(myGuiConfiguration);
387  ar & DT_SERIALIZE_MEMBER(myInputDriverConfiguration);
388  ar & DT_SERIALIZE_MEMBER(myDisplayEngineName);
389 
390  ar & DT_SERIALIZE_MEMBER(myDeMode);
391  ar & DT_SERIALIZE_MEMBER(myDriverInstances);
392  ar & DT_SERIALIZE_MEMBER(myCoordinateSystem);
393  ar & DT_SERIALIZE_MEMBER(myCoordinateSystemParameters);
394 
395  ar & DT_SERIALIZE_MEMBER(myDeConfiguration);
396 
397  ar & DT_SERIALIZE_MEMBER(myAutoLoadDriversFlag);
398 
399  ar & DT_SERIALIZE_MEMBER(myAutoStartDrivers);
400  ar & DT_SERIALIZE_MEMBER(myMappingFilesToLoad);
401 
402  ar & DT_SERIALIZE_MEMBER(myDisplayConnections);
403  ar & DT_SERIALIZE_MEMBER(myAutoLoadFile);
404  ar & DT_SERIALIZE_MEMBER(myFullScreenFlag);
405  ar & DT_SERIALIZE_MEMBER(myConstrainToTerrainFlag);
406  ar & DT_SERIALIZE_MEMBER(mySpeedScalingFlag);
407 
408  ar & DT_SERIALIZE_MEMBER(myDoubleBufferFlag);
409  ar & DT_SERIALIZE_MEMBER(myVSyncFlag);
410 
411  ar & DT_SERIALIZE_MEMBER(myDefaultRecords);
412 
413  if (version >= 2)
414  {
415  ar & BOOST_SERIALIZATION_NVP(myInitLibXml);
416  }
417  if(version >= 3)
418  {
419  ar & BOOST_SERIALIZATION_NVP(myFeatures);
420  }
421  if(version >= 4)
422  {
423  ar & BOOST_SERIALIZATION_NVP(myVertexSelectsParentFlag);
424  }
425 
426  if(version >= 5)
427  {
428  ar & BOOST_SERIALIZATION_NVP(myCheckForData);
429  }
430 
431  if(version >= 6)
432  {
433  ar & BOOST_SERIALIZATION_NVP(myBatchedRenderingFlag);
434  }
435 
436  if(version >= 7)
437  {
438  ar & BOOST_SERIALIZATION_NVP(mySynchronizedOceanFlag);
439  }
440  if(version >= 8)
441  {
442  ar & BOOST_SERIALIZATION_NVP(mySynchronizedNtpTimeFlag);
443  }
444  if(version >= 9)
445  {
446  ar & BOOST_SERIALIZATION_NVP(myIgnoreZoomForSpeedtreeLod);
447  }
448  if(version >= 10)
449  {
450  ar & BOOST_SERIALIZATION_NVP(mySuppressHatIntersectOnAttach);
451  }
452  }
453 
454  protected:
455 
459  std::string myDisplayEngineName;
460 
463 
466  std::string myCoordinateSystem;
469  std::string myLogFileName;
470 
472 
475 
476  std::vector<std::string> myAutoStartDrivers;
478  std::vector<std::string> myMappingFilesToLoad;
479 
481  std::string myAutoLoadFile;
482 
490 
493  unsigned int myFrameRate;
494  unsigned short myNumDepthBits;
495  unsigned short myNumStencilBits;
496  unsigned short myAntiAliasingLevel;
501 
503 
505 
506  };
507 
508 }
509 

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)