opensurgsim
DriveElementFromInputBehavior.h
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_DRIVEELEMENTFROMINPUTBEHAVIOR_H
17 #define SURGSIM_BLOCKS_DRIVEELEMENTFROMINPUTBEHAVIOR_H
18 
19 #include "SurgSim/Framework/Behavior.h"
20 #include "SurgSim/Framework/ObjectFactory.h"
21 
22 namespace SurgSim
23 {
24 
25 namespace Input
26 {
27 class InputComponent;
28 }
29 
30 namespace Blocks
31 {
32 
33 SURGSIM_STATIC_REGISTRATION(DriveElementFromInputBehavior);
34 
41 {
42 public:
45  explicit DriveElementFromInputBehavior(const std::string& name);
46 
48 
49  int getTargetManagerType() const override;
50 
53  void setSource(std::shared_ptr<SurgSim::Framework::Component> source);
54 
57  std::shared_ptr<SurgSim::Framework::Component> getSource();
58 
61  void setPoseName(const std::string& poseName);
62 
65  std::string getPoseName();
66 
69  virtual void update(double dt);
70 
71 protected:
73  virtual bool doInitialize();
74 
76  virtual bool doWakeUp();
77 
78 private:
80  std::shared_ptr<SurgSim::Input::InputComponent> m_source;
81 
82  std::string m_poseName;
83 };
84 
85 
86 }; // namespace Blocks
87 
88 }; // namespace SurgSim
89 
90 
91 #endif // SURGSIM_BLOCKS_DRIVEELEMENTFROMINPUTBEHAVIOR_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Behavior to copy a pose from an input component to a SceneElement By adding this behavior to a SceneE...
Definition: DriveElementFromInputBehavior.h:40
Behaviors perform actions.
Definition: Behavior.h:40