opensurgsim
MultiAxisDevice.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_DEVICES_MULTIAXIS_MULTIAXISDEVICE_H
17 #define SURGSIM_DEVICES_MULTIAXIS_MULTIAXISDEVICE_H
18 
19 #include <memory>
20 #include <string>
21 
22 #include "SurgSim/Devices/DeviceFilters/FilteredDevice.h"
23 #include "SurgSim/Input/CommonDevice.h"
24 
25 namespace SurgSim
26 {
27 namespace Devices
28 {
29 
30 class RawMultiAxisDevice;
31 class PoseIntegrator;
32 
33 SURGSIM_STATIC_REGISTRATION(MultiAxisDevice);
34 
59 {
60 public:
63  explicit MultiAxisDevice(const std::string& uniqueName);
64 
65  SURGSIM_CLASSNAME(SurgSim::Devices::MultiAxisDevice);
66 
70  void setPositionScale(double scale);
71 
74  double getPositionScale() const;
75 
80  void setOrientationScale(double scale);
81 
84  double getOrientationScale() const;
85 
91  void setAxisDominance(bool onOff);
92 
95  bool isUsingAxisDominance() const;
96 
100  void setReset(const std::string& name);
101 
102 private:
105  static double defaultPositionScale();
106 
109  static double defaultOrientationScale();
110 
112  std::shared_ptr<RawMultiAxisDevice> m_rawDevice;
113 
115  std::shared_ptr<PoseIntegrator> m_filter;
116 };
117 
118 }; // namespace Devices
119 }; // namespace SurgSim
120 
121 #endif // SURGSIM_DEVICES_MULTIAXIS_MULTIAXISDEVICE_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
A class implementing the communication with a multi-axis controller input device, for example a 3DCon...
Definition: MultiAxisDevice.h:58
A DeviceInterface connected in series with one or more DeviceFilters. Useful for serialization.
Definition: FilteredDevice.h:39
void setPositionScale(double scale)
Sets the position scale for this device.
Definition: MultiAxisDevice.cpp:52
MultiAxisDevice(const std::string &uniqueName)
Constructor.
Definition: MultiAxisDevice.cpp:31
void setOrientationScale(double scale)
Sets the orientation scale for this device.
Definition: MultiAxisDevice.cpp:62
bool isUsingAxisDominance() const
Gets the axis dominance setting for this device.
Definition: MultiAxisDevice.cpp:77
void setAxisDominance(bool onOff)
Turns on or off the axis dominance setting for this device.
Definition: MultiAxisDevice.cpp:72
double getOrientationScale() const
Gets the orientation scale for this device.
Definition: MultiAxisDevice.cpp:67
void setReset(const std::string &name)
Sets the string name of the boolean entry that will reset the pose to its initial value...
Definition: MultiAxisDevice.cpp:92
double getPositionScale() const
Gets the position scale for this device.
Definition: MultiAxisDevice.cpp:57