DebugDumpBehavior.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_BLOCKS_DEBUGDUMPBEHAVIOR_H
17 #define SURGSIM_BLOCKS_DEBUGDUMPBEHAVIOR_H
18 
19 #include <memory>
21 
22 namespace SurgSim
23 {
24 namespace Input
25 {
26 
27 class InputComponent;
28 }
29 namespace Graphics
30 {
31 class OsgManager;
32 }
33 
34 namespace Blocks
35 {
36 
37 SURGSIM_STATIC_REGISTRATION(DebugDumpBehavior)
38 
39 class DebugDumpBehavior : public Framework::Behavior
45 {
46 
47 public:
48 
51  explicit DebugDumpBehavior(const std::string& name);
52 
53  virtual ~DebugDumpBehavior();
54 
56 
59  void setInputComponent(std::shared_ptr<SurgSim::Framework::Component> inputComponent);
60 
62  std::shared_ptr<SurgSim::Input::InputComponent> getInputComponent() const;
63 
64 private:
65 
66  void update(double dt) override;
67 
68  bool doInitialize() override;
69 
70  bool doWakeUp() override;
71 
72  std::weak_ptr<SurgSim::Graphics::OsgManager> m_manager;
73  std::shared_ptr<SurgSim::Input::InputComponent> m_inputComponent;
75 };
76 
77 }
78 }
79 
80 #endif
Definition: CompoundShapeToGraphics.cpp:29
bool m_keyPressedLastUpdate
prevent a repeated keystroke
Definition: DebugDumpBehavior.h:74
Provides keyboard access to debugging functionality F1 - call the graphics manager dumpDebugInfo...
Definition: DebugDumpBehavior.h:44
InputComponents connect devices to SceneElements, facilitating data transfer from a device to SceneEl...
Definition: InputComponent.h:38
#define SURGSIM_CLASSNAME(ClassName)
Declare the class name of a class with the appropriate function header, do not use quotes...
Definition: Macros.h:21
std::shared_ptr< SurgSim::Input::InputComponent > m_inputComponent
The input component for reading.
Definition: DebugDumpBehavior.h:73
std::weak_ptr< SurgSim::Graphics::OsgManager > m_manager
Reference to the graphics manager.
Definition: DebugDumpBehavior.h:72
Behaviors perform actions.
Definition: Behavior.h:40