VR-Forces 4.3.1 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/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 
386  void setUsePseudoFullScreen( bool enable );
387 
389  bool usePseudoFullScreen() const;
390 
392  void setUseHighestPriority( bool enable );
393 
395  bool useHighestPriority() const;
396 
397  protected:
398 
399  template<class Archive>
400  void _serialize(Archive & ar, const unsigned int version)
401  {
403  ar & DT_SERIALIZE_MEMBER(myDriverConfiguration);
404  ar & DT_SERIALIZE_MEMBER(myGuiConfiguration);
405  ar & DT_SERIALIZE_MEMBER(myInputDriverConfiguration);
406  ar & DT_SERIALIZE_MEMBER(myDisplayEngineName);
407 
408  ar & DT_SERIALIZE_MEMBER(myDeMode);
409  ar & DT_SERIALIZE_MEMBER(myDriverInstances);
410  ar & DT_SERIALIZE_MEMBER(myCoordinateSystem);
411  ar & DT_SERIALIZE_MEMBER(myCoordinateSystemParameters);
412 
413  ar & DT_SERIALIZE_MEMBER(myDeConfiguration);
414 
415  ar & DT_SERIALIZE_MEMBER(myAutoLoadDriversFlag);
416 
417  ar & DT_SERIALIZE_MEMBER(myAutoStartDrivers);
418  ar & DT_SERIALIZE_MEMBER(myMappingFilesToLoad);
419 
420  ar & DT_SERIALIZE_MEMBER(myDisplayConnections);
421  ar & DT_SERIALIZE_MEMBER(myAutoLoadFile);
422  ar & DT_SERIALIZE_MEMBER(myFullScreenFlag);
423  ar & DT_SERIALIZE_MEMBER(myConstrainToTerrainFlag);
424  ar & DT_SERIALIZE_MEMBER(mySpeedScalingFlag);
425 
426  ar & DT_SERIALIZE_MEMBER(myDoubleBufferFlag);
427  ar & DT_SERIALIZE_MEMBER(myVSyncFlag);
428 
429  ar & DT_SERIALIZE_MEMBER(myDefaultRecords);
430 
431  if (version >= 2)
432  {
433  ar & BOOST_SERIALIZATION_NVP(myInitLibXml);
434  }
435  if(version >= 3)
436  {
437  ar & BOOST_SERIALIZATION_NVP(myFeatures);
438  }
439  if(version >= 4)
440  {
441  ar & BOOST_SERIALIZATION_NVP(myVertexSelectsParentFlag);
442  }
443 
444  if(version >= 5)
445  {
446  ar & BOOST_SERIALIZATION_NVP(myCheckForData);
447  }
448 
449  if(version >= 6)
450  {
451  ar & BOOST_SERIALIZATION_NVP(myBatchedRenderingFlag);
452  }
453 
454  if(version >= 7)
455  {
456  ar & BOOST_SERIALIZATION_NVP(mySynchronizedOceanFlag);
457  }
458  if(version >= 8)
459  {
460  ar & BOOST_SERIALIZATION_NVP(mySynchronizedNtpTimeFlag);
461  }
462  if(version >= 9)
463  {
464  ar & BOOST_SERIALIZATION_NVP(myIgnoreZoomForSpeedtreeLod);
465  }
466  if(version >= 10)
467  {
468  ar & BOOST_SERIALIZATION_NVP(mySuppressHatIntersectOnAttach);
469  }
470  if(version >= 11)
471  {
472  ar & BOOST_SERIALIZATION_NVP(myUsePseudoFullScreen);
473  }
474  if(version >= 12)
475  {
476  ar & BOOST_SERIALIZATION_NVP(myUseHighestPriorityFlag);
477  }
478  }
479 
480  protected:
481 
485  std::string myDisplayEngineName;
486 
489 
492  std::string myCoordinateSystem;
495  std::string myLogFileName;
496 
498 
501 
502  std::vector<std::string> myAutoStartDrivers;
504  std::vector<std::string> myMappingFilesToLoad;
505 
507  std::string myAutoLoadFile;
508 
517 
519 
522  unsigned int myFrameRate;
523  unsigned short myNumDepthBits;
524  unsigned short myNumStencilBits;
525  unsigned short myAntiAliasingLevel;
530 
532 
534 
535  };
536 
537 }
538 

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)