VR-Forces 4.1.1 Class Documentation
DtDeInitializer.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2012 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 setPathConfiguration( const DtDePathConfiguration& pathConfig );
312 
314  DtDePathConfiguration& pathConfiguration();
315 
317  const DtDePathConfiguration& pathConfiguration() const;
318 
321  void setInitLibXml( bool enabled );
322 
325  bool initLibXml() const;
326 
328  void setCheckForData( bool check );
329 
331  bool checkForData() const;
332 
333  protected:
334 
335  template<class Archive>
336  void _serialize(Archive & ar, const unsigned int version)
337  {
339  ar & DT_SERIALIZE_MEMBER(myDriverConfiguration);
340  ar & DT_SERIALIZE_MEMBER(myGuiConfiguration);
341  ar & DT_SERIALIZE_MEMBER(myInputDriverConfiguration);
342  ar & DT_SERIALIZE_MEMBER(myDisplayEngineName);
343 
344  ar & DT_SERIALIZE_MEMBER(myDeMode);
345  ar & DT_SERIALIZE_MEMBER(myDriverInstances);
346  ar & DT_SERIALIZE_MEMBER(myCoordinateSystem);
347  ar & DT_SERIALIZE_MEMBER(myCoordinateSystemParameters);
348 
349  ar & DT_SERIALIZE_MEMBER(myDeConfiguration);
350 
351  ar & DT_SERIALIZE_MEMBER(myAutoLoadDriversFlag);
352 
353  ar & DT_SERIALIZE_MEMBER(myAutoStartDrivers);
354  ar & DT_SERIALIZE_MEMBER(myMappingFilesToLoad);
355 
356  ar & DT_SERIALIZE_MEMBER(myDisplayConnections);
357  ar & DT_SERIALIZE_MEMBER(myAutoLoadFile);
358  ar & DT_SERIALIZE_MEMBER(myFullScreenFlag);
359  ar & DT_SERIALIZE_MEMBER(myConstrainToTerrainFlag);
360  ar & DT_SERIALIZE_MEMBER(mySpeedScalingFlag);
361 
362  ar & DT_SERIALIZE_MEMBER(myDoubleBufferFlag);
363  ar & DT_SERIALIZE_MEMBER(myVSyncFlag);
364 
365  ar & DT_SERIALIZE_MEMBER(myDefaultRecords);
366 
367  if (version >= 2)
368  {
369  ar & BOOST_SERIALIZATION_NVP(myInitLibXml);
370  }
371  if(version >= 3)
372  {
373  ar & BOOST_SERIALIZATION_NVP(myFeatures);
374  }
375  if(version >= 4)
376  {
377  ar & BOOST_SERIALIZATION_NVP(myVertexSelectsParentFlag);
378  }
379 
380  if(version >= 5)
381  {
382  ar & BOOST_SERIALIZATION_NVP(myCheckForData);
383  }
384  }
385 
386  protected:
387 
391  std::string myDisplayEngineName;
392 
395 
398  std::string myCoordinateSystem;
401  std::string myLogFileName;
402 
404 
407 
408  std::vector<std::string> myAutoStartDrivers;
410  std::vector<std::string> myMappingFilesToLoad;
411 
413  std::string myAutoLoadFile;
414 
419 
422  unsigned int myFrameRate;
425 
427 
429 
430  };
431 
432 }
433 

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)