VR-Forces 4.5 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) 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 setExtraArgs( const std::string& argString );
571 
573  const std::string& extraArgs() const;
574 
576  void setDisableDynamicTerrain(bool val);
577 
579  bool disableDynamicTerrain() const;
580 
581  protected:
582 
583  template<class Archive>
584  void _serialize(Archive & ar, const unsigned int version)
585  {
587  ar & DT_SERIALIZE_MEMBER(myDriverConfiguration);
588  ar & DT_SERIALIZE_MEMBER(myGuiConfiguration);
589  ar & DT_SERIALIZE_MEMBER(myInputDriverConfiguration);
590  ar & DT_SERIALIZE_MEMBER(myDisplayEngineName);
591 
592  ar & DT_SERIALIZE_MEMBER(myDeMode);
593  ar & DT_SERIALIZE_MEMBER(myDriverInstances);
594  ar & DT_SERIALIZE_MEMBER(myCoordinateSystem);
595  ar & DT_SERIALIZE_MEMBER(myCoordinateSystemParameters);
596 
597  ar & DT_SERIALIZE_MEMBER(myDeConfiguration);
598 
599  ar & DT_SERIALIZE_MEMBER(myAutoLoadDriversFlag);
600 
601  ar & DT_SERIALIZE_MEMBER(myAutoStartDrivers);
602  ar & DT_SERIALIZE_MEMBER(myMappingFilesToLoad);
603 
604  ar & DT_SERIALIZE_MEMBER(myDisplayConnections);
605  ar & DT_SERIALIZE_MEMBER(myAutoLoadFile);
606  ar & DT_SERIALIZE_MEMBER(myFullScreenFlag);
607  ar & DT_SERIALIZE_MEMBER(myConstrainToTerrainFlag);
608  ar & DT_SERIALIZE_MEMBER(mySpeedScalingFlag);
609 
610  ar & DT_SERIALIZE_MEMBER(myDoubleBufferFlag);
611  ar & DT_SERIALIZE_MEMBER(myVSyncFlag);
612 
613  ar & DT_SERIALIZE_MEMBER(myDefaultRecords);
614 
615  if (version >= 2)
616  {
617  ar & BOOST_SERIALIZATION_NVP(myInitLibXml);
618  }
619  if(version >= 3)
620  {
621  ar & BOOST_SERIALIZATION_NVP(myFeatures);
622  }
623  if(version >= 4)
624  {
625  ar & BOOST_SERIALIZATION_NVP(myVertexSelectsParentFlag);
626  }
627 
628  if(version >= 5)
629  {
630  ar & BOOST_SERIALIZATION_NVP(myCheckForData);
631  }
632 
633  if(version >= 6)
634  {
635  ar & BOOST_SERIALIZATION_NVP(myBatchedRenderingFlag);
636  }
637 
638  if(version >= 7)
639  {
640  ar & BOOST_SERIALIZATION_NVP(mySynchronizedOceanFlag);
641  }
642  if(version >= 8)
643  {
644  ar & BOOST_SERIALIZATION_NVP(mySynchronizedNtpTimeFlag);
645  }
646  if(version >= 9)
647  {
648  ar & BOOST_SERIALIZATION_NVP(myIgnoreZoomForSpeedtreeLod);
649  }
650  if(version >= 10)
651  {
652  ar & BOOST_SERIALIZATION_NVP(mySuppressHatIntersectOnAttach);
653  }
654  if(version >= 11)
655  {
656  ar & BOOST_SERIALIZATION_NVP(myUsePseudoFullScreen);
657  }
658  if(version >= 12)
659  {
660  ar & BOOST_SERIALIZATION_NVP(myUseHighestPriorityFlag);
661  }
662  if (version >= 13)
663  {
664  ar & BOOST_SERIALIZATION_NVP(myDisableKdTrees);
665  }
666  if (version >= 14)
667  {
668  ar & BOOST_SERIALIZATION_NVP(myForceTextShaping);
669  }
670  if (version >= 15)
671  {
672  ar & BOOST_SERIALIZATION_NVP(myUseNonBlockingSendForSlaves);
673  }
674  if (version >= 16)
675  {
676  ar & BOOST_SERIALIZATION_NVP(myNoEntityDefinitionLoadingFlag);
677  ar & BOOST_SERIALIZATION_NVP(myNoAggregateDefinitionLoadingFlag);
678  ar & BOOST_SERIALIZATION_NVP(myNoTacticalGraphicsDefinitionLoadingFlag);
679  ar & BOOST_SERIALIZATION_NVP(myNoModelDefinitionLoadingFlag);
680  ar & BOOST_SERIALIZATION_NVP(myNoEntityTypeMapLoadingFlag);
681  ar & BOOST_SERIALIZATION_NVP(myNoAggregateTypeMapLoadingFlag);
682  ar & BOOST_SERIALIZATION_NVP(myNoTacticalGraphicsTypeMapLoadingFlag);
683  ar & BOOST_SERIALIZATION_NVP(myEntityElementDefinitionHiersToMerge);
684  ar & BOOST_SERIALIZATION_NVP(myEntityElementDefinitionLeafsToMerge);
685  ar & BOOST_SERIALIZATION_NVP(myAggregateDefinitionHiersToMerge);
686  ar & BOOST_SERIALIZATION_NVP(myAggregateDefinitionLeafsToMerge);
687  ar & BOOST_SERIALIZATION_NVP(myTacticalGraphicsDefinitionHiersToMerge);
688  ar & BOOST_SERIALIZATION_NVP(myTacticalGraphicsDefinitionLeafsToMerge);
689  ar & BOOST_SERIALIZATION_NVP(myModelDefinitionsToMerge);
690  }
691  if (version >= 17)
692  {
693  ar & BOOST_SERIALIZATION_NVP(myUseReverseZBuffer);
694  ar & BOOST_SERIALIZATION_NVP(myExtraArgs);
695  }
696 
697  if (version >= 18)
698  {
699  ar & BOOST_SERIALIZATION_NVP(myDisableDynamicTerrain);
700  }
701  }
702 
703  protected:
704 
708  std::string myDisplayEngineName;
709 
712 
715  std::string myCoordinateSystem;
718  std::string myLogFileName;
721 
723 
726 
727  std::vector<std::string> myAutoStartDrivers;
729  std::vector<std::string> myMappingFilesToLoad;
730  std::vector<std::string> myEntityElementDefinitionHiersToMerge;
731  std::vector<std::string> myEntityElementDefinitionLeafsToMerge;
732  std::vector<std::string> myAggregateDefinitionHiersToMerge;
733  std::vector<std::string> myAggregateDefinitionLeafsToMerge;
736  std::vector<std::string> myModelDefinitionsToMerge;
737  std::vector<std::string> myEntityTypeMapsToMerge;
738  std::vector<std::string> myAggregateTypeMapsToMerge;
739  std::vector<std::string> myTacticalGraphicsTypeMapsToMerge;
740 
742  std::string myAutoLoadFile;
743 
764 
767  unsigned int myFrameRate;
768  unsigned short myNumDepthBits;
769  unsigned short myNumStencilBits;
770  unsigned short myNumAlphaBits;
771  unsigned short myAntiAliasingLevel;
777 
779 
782  std::string myExtraArgs;
783 
785 
786  };
787 
788 }
789 

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)