VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtDeInitializer.h
Go to the documentation of this file.
1 /*****************************************************************************
2 * Copyright (c) 2017 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 
200  void setModelPreloadFilename(const std::string& filename);
201 
203  const std::string& modelPreloadFilename() const;
204 
206  void setDiscoveredModelPreloadFilename(const std::string& filename);
207 
209  const std::string& discoveredModelPreloadFilename() const;
210 
213  void setAutoLoadDrivers( bool autoLoad );
214 
217  bool autoLoadDrivers() const;
218 
220  void setAutoStartDrivers( const std::vector<std::string>& names );
221 
223  const std::vector<std::string>& autoStartDrivers() const;
224 
226  void setAuthorizationCodeMap( const AuthorizationCodeMap& map );
227 
229  void addAuthorizationCodeMapping( const std::string& key,
230  const std::string& value );
231 
233  void removeAuthorizationCodeMapping( const std::string& key );
234 
237  const std::string* findAuthorizationCodeValue( const std::string& key ) const;
238 
240  void setObserverStateMap( const ObserverStateMap& osm );
241 
243  const ObserverStateMap& observerStateMap() const;
244 
246  const std::vector<std::string>& mappingFilesToLoad() const;
247 
249  void setMappingFilesToLoad( const std::vector<std::string>& );
250 
253  const std::vector<std::string>& entityElementDefinitionHiersToMerge() const;
254 
257  void setEntityElementDefinitionHiersToMerge(const std::vector<std::string>& filesOrDirs);
258 
261  const std::vector<std::string>& entityElementDefinitionLeafsToMerge() const;
262 
265  void setEntityElementDefinitionLeafsToMerge(const std::vector<std::string>& filesOrDirs);
266 
269  const std::vector<std::string>& aggregateElementDefinitionHiersToMerge() const;
270 
273  void setAggregateElementDefinitionHiersToMerge(const std::vector<std::string>& filesOrDirs);
274 
277  const std::vector<std::string>& aggregateElementDefinitionLeafsToMerge() const;
278 
281  void setAggregateElementDefinitionLeafsToMerge(const std::vector<std::string>& filesOrDirs);
282 
285  const std::vector<std::string>& tacticalGraphicsElementDefinitionHiersToMerge() const;
286 
289  void setTacticalGraphicsElementDefinitionHiersToMerge(const std::vector<std::string>& filesOrDirs);
290 
293  const std::vector<std::string>& tacticalGraphicsElementDefinitionLeafsToMerge() const;
294 
297  void setTacticalGraphicsElementDefinitionLeafsToMerge(const std::vector<std::string>& filesOrDirs);
298 
300  const std::vector<std::string>& modelDefinitionFilesOrDirsToMerge() const;
301 
303  void setModelDefinitionFilesOrDirsToMerge(const std::vector<std::string>& filesOrDirs);
304 
306  const std::vector<std::string>& entityTypeMapFilesOrDirsToMerge() const;
307 
309  void setEntityTypeMapFilesOrDirsToMerge(const std::vector<std::string>& filesOrDirs);
310 
312  const std::vector<std::string>& aggregateTypeMapFilesOrDirsToMerge() const;
313 
315  void setAggregateTypeMapFilesOrDirsToMerge(const std::vector<std::string>& filesOrDirs);
316 
318  const std::vector<std::string>& tacticalGraphicsTypeMapFilesOrDirsToMerge() const;
319 
321  void setTacticalGraphicsTypeMapFilesOrDirsToMerge(const std::vector<std::string>& filesOrDirs);
322 
324  const DisplayConnections& displayConnections() const;
325  DisplayConnections& displayConnections();
326 
327  void setDisplayConnections( const DisplayConnections& displayConnections );
328 
330  void setAutoLoadFile( const std::string& file );
331 
333  const std::string& autoLoadFile() const;
334 
336  void setStartFullScreen( bool );
337 
339  bool startFullScreen() const;
340 
342  void addDefaultSettingsRecord( const std::string& recordName,
343  const DtBaseRecordHolder& record );
344 
346  void removeDefaultSettingsRecord( const std::string& record );
347 
349  template <typename RecordType>
350  bool findDefaultSettingsRecord( const std::string& name, RecordType& record ) const
351  {
352  DefaultRecordMap::const_iterator iter = myDefaultRecords.find( name );
353  if ( iter != myDefaultRecords.end() )
354  {
355  const DtRecordHolder<RecordType>* holder =
356  dynamic_cast<const DtRecordHolder<RecordType>*>( iter->second );
357  if ( holder )
358  {
359  record = holder->record();
360  return true;
361  }
362  }
363 
364  return false;
365  }
366 
368  void setConstrainToTerrain( bool constrain );
369  bool constrainToTerrain() const;
370 
372  void setSpeedScaling( bool scale );
373  bool speedScaling() const;
374 
376  void setVertexSelectsParent( bool selectsParent );
377  bool vertexSelectsParent() const;
378 
380  void setDoubleBuffering( bool buffer );
381  bool doubleBuffer() const;
382 
384  void setVSync( bool sync );
385  bool vsync() const;
386 
389  void setFixedFrameRate( unsigned int framesPerSecond );
390  unsigned int fixedFrameRate() const;
391 
393  void setNumDepthBits(unsigned short numBits);
394  unsigned short numDepthBits() const;
395 
397  void setNumStencilBits(unsigned short numBits);
398  unsigned short numStencilBits() const;
399 
401  void setNumAlphaBits(unsigned short numBits);
402  unsigned short numAlphaBits() const;
403 
405  void setBatchedRendering(bool val);
406 
408  bool batchedRendering() const;
409 
411  void setNoEntityDefinitionLoading(bool val);
412 
414  bool noEntityDefinitionLoading() const;
415 
417  void setNoAggregateDefinitionLoading(bool val);
418 
420  bool noAggregateDefinitionLoading() const;
421 
423  void setNoTacticalGraphicsDefinitionLoading(bool val);
424 
426  bool noTacticalGraphicsDefinitionLoading() const;
427 
429  void setNoModelDefinitionLoading(bool val);
430 
432  bool noModelDefinitionLoading() const;
433 
435  void setNoEntityTypeMapLoading(bool val);
436 
438  bool noEntityTypeMapLoading() const;
439 
441  void setNoAggregateTypeMapLoading(bool val);
442 
444  bool noAggregateTypeMapLoading() const;
445 
447  void setNoTacticalGraphicsTypeMapLoading(bool val);
448 
450  bool noTacticalGraphicsTypeMapLoading() const;
451 
454  void setIgnoreZoomForSpeedtreeLod(bool val);
455 
458  bool ignoreZoomForSpeedtreeLod() const;
459 
466  void setSuppressHatIntersectOnAttach(bool val);
467 
470  bool suppressHatIntersectOnAttach() const;
471 
474  void setSynchronizedNtpTime(bool val);
475 
478  bool synchronizedNtpTime() const;
479 
481 
482  virtual void setKdTreesDisabled( bool disabled );
483  virtual bool kdTreesDisabled() const;
485 
487  virtual void setForceTextShaping( bool force );
488  virtual bool forceTextShaping() const;
490 
494  void setUseNonBlockingSendForSlaves( bool nonBlocking );
495 
499  bool useNonBlockingSendForSlaves() const;
500 
502  void setAntiAliasingLevel(unsigned short level);
503  unsigned short antiAliasingLevel() const;
504 
506  void setPathConfiguration( const DtDePathConfiguration& pathConfig );
507 
509  DtDePathConfiguration& pathConfiguration();
510 
512  const DtDePathConfiguration& pathConfiguration() const;
513 
516  void setInitLibXml( bool enabled );
517 
520  bool initLibXml() const;
521 
523  void setCheckForData( bool check );
524 
526  bool checkForData() const;
527 
535  void setUsePseudoFullScreen( bool enable );
536 
538  bool usePseudoFullScreen() const;
539 
541  void setUseHighestPriority( bool enable );
542 
544  bool useHighestPriority() const;
545 
548  void setTcpSendTimeout(double timeout);
549  double tcpSendTimeout() const;
550 
554  void setAutoReconnectPeriod( double period );
555 
559  double autoReconnectPeriod() const;
560 
562  bool autoReconnectEnabled() const;
564  void setUseReverseZBuffer(bool val);
565 
567  bool useReverseZBuffer() const;
568 
570  void setForceVBOs(bool val);
571 
573  bool useForceVBOs() const;
574 
576  void setExtraArgs( const std::string& argString );
577 
579  const std::string& extraArgs() const;
580 
582  void setDisableDynamicTerrain(bool val);
583 
585  bool disableDynamicTerrain() const;
586 
588  bool preloadClouds() const;
589 
591  void setPreloadClouds(bool val);
592 
593 
594  protected:
595 
596  template<class Archive>
597  void _serialize(Archive & ar, const unsigned int version)
598  {
600  ar & DT_SERIALIZE_MEMBER(myDriverConfiguration);
601  ar & DT_SERIALIZE_MEMBER(myGuiConfiguration);
602  ar & DT_SERIALIZE_MEMBER(myInputDriverConfiguration);
603  ar & DT_SERIALIZE_MEMBER(myDisplayEngineName);
604 
605  ar & DT_SERIALIZE_MEMBER(myDeMode);
606  ar & DT_SERIALIZE_MEMBER(myDriverInstances);
607  ar & DT_SERIALIZE_MEMBER(myCoordinateSystem);
608  ar & DT_SERIALIZE_MEMBER(myCoordinateSystemParameters);
609 
610  ar & DT_SERIALIZE_MEMBER(myDeConfiguration);
611 
612  ar & DT_SERIALIZE_MEMBER(myAutoLoadDriversFlag);
613 
614  ar & DT_SERIALIZE_MEMBER(myAutoStartDrivers);
615  ar & DT_SERIALIZE_MEMBER(myMappingFilesToLoad);
616 
617  ar & DT_SERIALIZE_MEMBER(myDisplayConnections);
618  ar & DT_SERIALIZE_MEMBER(myAutoLoadFile);
619  ar & DT_SERIALIZE_MEMBER(myFullScreenFlag);
620  ar & DT_SERIALIZE_MEMBER(myConstrainToTerrainFlag);
621  ar & DT_SERIALIZE_MEMBER(mySpeedScalingFlag);
622 
623  ar & DT_SERIALIZE_MEMBER(myDoubleBufferFlag);
624  ar & DT_SERIALIZE_MEMBER(myVSyncFlag);
625 
626  ar & DT_SERIALIZE_MEMBER(myDefaultRecords);
627 
628  if (version >= 2)
629  {
630  ar & BOOST_SERIALIZATION_NVP(myInitLibXml);
631  }
632  if(version >= 3)
633  {
634  ar & BOOST_SERIALIZATION_NVP(myFeatures);
635  }
636  if(version >= 4)
637  {
638  ar & BOOST_SERIALIZATION_NVP(myVertexSelectsParentFlag);
639  }
640 
641  if(version >= 5)
642  {
643  ar & BOOST_SERIALIZATION_NVP(myCheckForData);
644  }
645 
646  if(version >= 6)
647  {
648  ar & BOOST_SERIALIZATION_NVP(myBatchedRenderingFlag);
649  }
650 
651  if(version >= 7)
652  {
653  ar & BOOST_SERIALIZATION_NVP(mySynchronizedOceanFlag);
654  }
655  if(version >= 8)
656  {
657  ar & BOOST_SERIALIZATION_NVP(mySynchronizedNtpTimeFlag);
658  }
659  if(version >= 9)
660  {
661  ar & BOOST_SERIALIZATION_NVP(myIgnoreZoomForSpeedtreeLod);
662  }
663  if(version >= 10)
664  {
665  ar & BOOST_SERIALIZATION_NVP(mySuppressHatIntersectOnAttach);
666  }
667  if(version >= 11)
668  {
669  ar & BOOST_SERIALIZATION_NVP(myUsePseudoFullScreen);
670  }
671  if(version >= 12)
672  {
673  ar & BOOST_SERIALIZATION_NVP(myUseHighestPriorityFlag);
674  }
675  if (version >= 13)
676  {
677  ar & BOOST_SERIALIZATION_NVP(myDisableKdTrees);
678  }
679  if (version >= 14)
680  {
681  ar & BOOST_SERIALIZATION_NVP(myForceTextShaping);
682  }
683  if (version >= 15)
684  {
685  ar & BOOST_SERIALIZATION_NVP(myUseNonBlockingSendForSlaves);
686  }
687  if (version >= 16)
688  {
689  ar & BOOST_SERIALIZATION_NVP(myNoEntityDefinitionLoadingFlag);
690  ar & BOOST_SERIALIZATION_NVP(myNoAggregateDefinitionLoadingFlag);
691  ar & BOOST_SERIALIZATION_NVP(myNoTacticalGraphicsDefinitionLoadingFlag);
692  ar & BOOST_SERIALIZATION_NVP(myNoModelDefinitionLoadingFlag);
693  ar & BOOST_SERIALIZATION_NVP(myNoEntityTypeMapLoadingFlag);
694  ar & BOOST_SERIALIZATION_NVP(myNoAggregateTypeMapLoadingFlag);
695  ar & BOOST_SERIALIZATION_NVP(myNoTacticalGraphicsTypeMapLoadingFlag);
696  ar & BOOST_SERIALIZATION_NVP(myEntityElementDefinitionHiersToMerge);
697  ar & BOOST_SERIALIZATION_NVP(myEntityElementDefinitionLeafsToMerge);
698  ar & BOOST_SERIALIZATION_NVP(myAggregateDefinitionHiersToMerge);
699  ar & BOOST_SERIALIZATION_NVP(myAggregateDefinitionLeafsToMerge);
700  ar & BOOST_SERIALIZATION_NVP(myTacticalGraphicsDefinitionHiersToMerge);
701  ar & BOOST_SERIALIZATION_NVP(myTacticalGraphicsDefinitionLeafsToMerge);
702  ar & BOOST_SERIALIZATION_NVP(myModelDefinitionsToMerge);
703  }
704  if (version >= 17)
705  {
706  ar & BOOST_SERIALIZATION_NVP(myUseReverseZBuffer);
707  ar & BOOST_SERIALIZATION_NVP(myExtraArgs);
708  }
709 
710  if (version >= 18)
711  {
712  ar & BOOST_SERIALIZATION_NVP(myDisableDynamicTerrain);
713  }
714 
715  if (version >= 19)
716  {
717  ar & BOOST_SERIALIZATION_NVP(myPreloadClouds);
718  ar & BOOST_SERIALIZATION_NVP(myEnableMetaflightInstancing); // NOT USED
719  ar & BOOST_SERIALIZATION_NVP(myMetaflightMinInstances); // NOT USED
720  }
721  }
722 
723  protected:
724 
728  std::string myDisplayEngineName;
729 
732 
735  std::string myCoordinateSystem;
738  std::string myLogFileName;
741 
743 
746 
747  std::vector<std::string> myAutoStartDrivers;
749  std::vector<std::string> myMappingFilesToLoad;
750  std::vector<std::string> myEntityElementDefinitionHiersToMerge;
751  std::vector<std::string> myEntityElementDefinitionLeafsToMerge;
752  std::vector<std::string> myAggregateDefinitionHiersToMerge;
753  std::vector<std::string> myAggregateDefinitionLeafsToMerge;
756  std::vector<std::string> myModelDefinitionsToMerge;
757  std::vector<std::string> myEntityTypeMapsToMerge;
758  std::vector<std::string> myAggregateTypeMapsToMerge;
759  std::vector<std::string> myTacticalGraphicsTypeMapsToMerge;
760 
762  std::string myAutoLoadFile;
763 
784 
787  unsigned int myFrameRate;
788  unsigned short myNumDepthBits;
789  unsigned short myNumStencilBits;
790  unsigned short myNumAlphaBits;
791  unsigned short myAntiAliasingLevel;
797 
799 
802  bool myForceVBOs; // not serialized
803  std::string myExtraArgs;
804 
807 
809  unsigned int myMetaflightMinInstances; // NOT USED
810  };
811 
812 }
813 

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)