DriveElementFromInputBehavior.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_DRIVEELEMENTFROMINPUTBEHAVIOR_H
17 #define SURGSIM_BLOCKS_DRIVEELEMENTFROMINPUTBEHAVIOR_H
18 
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 
39 {
40 public:
43  explicit DriveElementFromInputBehavior(const std::string& name);
44 
46 
49  void setSource(std::shared_ptr<SurgSim::Framework::Component> source);
50 
53  std::shared_ptr<SurgSim::Framework::Component> getSource();
54 
57  void setPoseName(const std::string& poseName);
58 
61  std::string getPoseName();
62 
65  virtual void update(double dt);
66 
67 protected:
69  virtual bool doInitialize();
70 
72  virtual bool doWakeUp();
73 
74 private:
76  std::shared_ptr<SurgSim::Input::InputComponent> m_source;
77 
79 };
80 
81 
82 }; // namespace Blocks
83 
84 }; // namespace SurgSim
85 
86 
87 #endif // SURGSIM_BLOCKS_DRIVEELEMENTFROMINPUTBEHAVIOR_H
Definition: DriveElementFromInputBehavior.cpp:27
std::string m_poseName
Definition: DriveElementFromInputBehavior.h:78
SURGSIM_STATIC_REGISTRATION(InputComponent)
InputComponent combines the Component interface and the InputConsumerInterface so that input devices ...
Definition: InputComponent.h:41
string(TOUPPER ${DEVICE}DEVICE_UPPER_CASE) option(BUILD_DEVICE_ $
Definition: CMakeLists.txt:35
#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_source
InputComponent to get the pose.
Definition: DriveElementFromInputBehavior.h:76
Behavior to copy a pose from an input component to a SceneElement By adding this behavior to a SceneE...
Definition: DriveElementFromInputBehavior.h:38
Behaviors perform actions.
Definition: Behavior.h:40