VR-Forces 4.1 Class Documentation
DtDriverManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtDriverManager.h,v $ $Revision: 1.38 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtDriverManager_H_
14 #define DtDriverManager_H_
15 
16 #include <vrvCore/vrvCore.h>
17 
19 #include <boost/signals.hpp>
20 
21 #include <vector>
22 
23 namespace makVrv
24 {
25  class DtDe;
26  class DtInputDriver;
27  class DtMessage;
28  class DtSceneDriver;
29  class DtDriver;
30  class DtDriverManager;
31  class DtDriverManagerSignaler;
32 
36  {
37  public:
38 
40  typedef std::vector<DtDriver*> Drivers;
41 
43  DtDriverManager(DtDe& de);
44 
46  ~DtDriverManager();
47 
50  void tick();
51 
56  void addDriver(DtDriver* driver);
57 
59  void startDriver(DtDriver* driver);
60 
62  void stopDriver(DtDriver* driver);
63 
66  void destroyDriver(DtDriver* driver);
67 
69  void renameDriver( DtDriver* driver, const std::string& newName);
70 
72  DtDriver* findDriver(const std::string& name);
73 
75 
76  Drivers& drivers();
77  const Drivers& drivers() const;
79 
81  DtSceneDriver& sceneDriver();
82 
84  DtInputDriver& inputDriver();
85 
87  inline DtDe& de()
88  {
89  return myDe;
90  }
91 
92  //@name Signals
94  boost::signal<void (DtDriver&)> signal_driverAdded;
95  boost::signal<void (DtDriver&)> signal_driverToBeDestroyed;
96  boost::signal<void (DtDriver&)> signal_driverStarted;
97  boost::signal<void (DtDriver&)> signal_driverStopped;
98 
99  boost::signal<void (const std::string&)> signal_autoDriverChanged;
100 
102 
104  void saveDriverToFile(const DtDriver& driver) const;
105 
107  void deleteDriverFile(const DtDriver& driver) const;
108 
110  std::string createDriverFileName(const DtDriver& driver) const;
111 
113  void saveAutoDriver();
114 
116  void loadAutoDriversFromFile(bool errorIfNotFound);
117 
119  void autoStartDrivers();
120 
122  void setAutoDriver(const std::string& driver, bool saveToFile);
123 
124  const std::string& autoDriver() const;
125 
127  void startDrivers( const std::vector<std::string>& drivers);
128 
130  void autoLoadDrivers();
131 
133  void saveDrivers();
134 
136  void loadDriver(const std::string& filename);
137 
138  protected:
139 
141  void startWindowDependendDrivers();
142 
144  void stopWindowDependentDrivers();
145 
148  void onViewCreated();
149  void onViewToBeDestroyed();
150 
151  protected:
152 
160  std::string myAutoDriver;
163 
164  };
165 
169  {
170  public:
172  static DtDriverManagerSignaler& instance(DtDe& anIG);
173 
175  virtual ~DtDriverManagerSignaler();
176 
177  protected:
179 
180  };
181 
182 }
183 
184 #endif

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)