VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtChannelKeywordCompass.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtChannelKeywordCompass.h,v $ $Revision: 1.11 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #pragma once
14 
15 #include <vrvCore/vrvCore.h>
17 
19 
20 #include <string>
21 
22 namespace makVrv
23 {
24  class DtDe;
25  class DtChannelConfiguration;
26  class DtWindowConfiguration;
27  class DtChannelCompassAgent;
28  class DtObserver;
29  class DtInputDriver;
30 
34  {
35  public:
36 
40 
42  virtual ~DtChannelKeywordCompass();
43 
47  virtual void channelNameChanged( const std::string& displayName,
48  const std::string& windowName, const std::string& channelName );
49 
52  virtual void channelConfigurationChanged(
53  const DtChannelConfiguration& config );
54 
57  virtual void windowConfigurationChanged(
58  const DtWindowConfiguration& config ) {}
59 
61  DtChannelCompassAgent* compassAgent();
62 
63  protected:
64 
65  // Slots for responding to observer-related signals
66 
67  // Called when an observer is created, so that we can connect to an observer that
68  // didn't exist when the compass itself was created
69  virtual void slot_observerCreated( DtInputDriver*, DtObserver* observer );
70 
71  // Called when an observer is about to be destroyed, so we can disconnect from the
72  // observer mode changed signal and set myObserver to Null
73  virtual void slot_observerToBeDestroyed( DtInputDriver*, DtObserver* observer );
74 
75  // Called when an observer's observer mode changes, so we can determine if we need
76  // to create or destroy a compass
77  virtual void slot_observerModeChanged( DtObserver* observer, int newMode );
78 
79  // Called when an observer mode's setting changes; if its the mode our observer is
80  // using and the setting is DisplayCompass, we may need to create or destroy
81  // a compass
82  virtual void slot_observerModeSettingChanged( int mode, int setting );
83 
84  // Helper methods
85 
86  // Set myObserver to the specified observer and connect to the observerModeChanged
87  // signal
88  virtual void connectToObserver( DtObserver* observer );
89 
90  // Look up the observer by name, cache the observer name, and call connectToObserver
91  // with the found observer
92  virtual void connectToObserver( const std::string& observerName );
93 
94  // Disconnect from the current observer's observerModeChanged signal, delete the
95  // the compass agent if it exists, and set myObserver and myCompassAgent
96  // to Null
97  virtual void disconnectFromObserver();
98 
99  // This function looks up the display compass observer setting value and creates
100  // or destroys a compass as needed
101  virtual void updateCompassState();
102 
103  protected:
104 
106  DtChannelKeywordCompass( DtDe& de, const std::string& keyword,
107  const std::string& displayName, const std::string& windowName,
108  const DtChannelConfiguration& channelConfig );
109 
110  protected:
111 
112  DtChannelCompassAgent* myCompassAgent;
113  std::string myObserverName;
115  std::string myKeyword;
116  std::string myDisplayName;
117  std::string myWindowName;
118  std::string myChannelName;
120  };
121 
125  {
126  public:
129 
132 
134  virtual DtChannelKeywordObject* createChannelKeywordObject(DtDe& de,
135  const std::string& displayName, const std::string& windowName,
136  const DtChannelConfiguration& channelConfig );
137 
138  public:
139  static std::string keyword();
140 
141  protected:
142  std::string myKeyword;
143  };
144 
145 
149  {
150  public:
153 
156 
158  virtual DtChannelKeywordObject* createChannelKeywordObject(DtDe& de,
159  const std::string& displayName, const std::string& windowName,
160  const DtChannelConfiguration& channelConfig );
161 
162  public:
163  static std::string keyword();
164 
165  protected:
166  std::string myKeyword;
167  };
168 }
169 
170 

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)