TrackIRDevice.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_DEVICES_TRACKIR_TRACKIRDEVICE_H
17 #define SURGSIM_DEVICES_TRACKIR_TRACKIRDEVICE_H
18 
19 #include <memory>
20 #include <string>
21 
23 
24 namespace SurgSim
25 {
26 namespace Devices
27 {
28 class TrackIRScaffold;
29 
30 SURGSIM_STATIC_REGISTRATION(TrackIRDevice);
31 
45 {
46 public:
49  explicit TrackIRDevice(const std::string& uniqueName);
50 
52 
54  virtual ~TrackIRDevice();
55 
56  bool initialize() override;
57 
58  bool isInitialized() const override;
59 
63  void setPositionScale(double scale);
65  double getPositionScale() const;
66 
70  void setOrientationScale(double scale);
72  double getOrientationScale() const;
73 
74 private:
75  friend class TrackIRScaffold;
76 
77  bool finalize() override;
78 
79  // Returns the default position scale
80  static double defaultPositionScale();
81  // Returns the default rotation scale
82  static double defaultOrientationScale();
83 
88 
90  std::shared_ptr<TrackIRScaffold> m_scaffold;
91 };
92 
93 }; // namespace Devices
94 }; // namespace SurgSim
95 
96 #endif // SURGSIM_DEVICES_TRACKIR_TRACKIRDEVICE_H
SurgSim::Devices::TrackIRDevice::initialize
bool initialize() override
Fully initialize the device.
Definition: TrackIRDevice.cpp:43
SurgSim::Devices::TrackIRDevice::m_scaffold
std::shared_ptr< TrackIRScaffold > m_scaffold
Communication with hardware is handled by scaffold.
Definition: TrackIRDevice.h:90
SurgSim::Devices::TrackIRDevice::setOrientationScale
void setOrientationScale(double scale)
Sets the orientation scale for this device.
Definition: TrackIRDevice.cpp:87
SurgSim::Devices::TrackIRDevice::defaultOrientationScale
static double defaultOrientationScale()
Definition: TrackIRDevice.cpp:107
SurgSim::Devices::TrackIRDevice::getOrientationScale
double getOrientationScale() const
Gets the orientation scale for this device.
Definition: TrackIRDevice.cpp:96
SurgSim::Devices::TrackIRDevice::m_orientationScale
double m_orientationScale
Scale factor for the orientation axes; stored locally before the device is initialized.
Definition: TrackIRDevice.h:87
SurgSim::Devices::TrackIRDevice::~TrackIRDevice
virtual ~TrackIRDevice()
Destructor.
Definition: TrackIRDevice.cpp:35
SurgSim::Devices::TrackIRDevice::defaultPositionScale
static double defaultPositionScale()
Definition: TrackIRDevice.cpp:102
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Input::CommonDevice
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
SurgSim::Devices::TrackIRDevice::isInitialized
bool isInitialized() const override
Definition: TrackIRDevice.cpp:66
SurgSim::Devices::TrackIRDevice
A class implementing the communication with Natural Point TrackIR camera.
Definition: TrackIRDevice.h:44
CommonDevice.h
SurgSim::Devices::TrackIRDevice::getPositionScale
double getPositionScale() const
Gets the position scale for this device.
Definition: TrackIRDevice.cpp:81
SurgSim::Devices::TrackIRDevice::TrackIRDevice
TrackIRDevice(const std::string &uniqueName)
Constructor.
Definition: TrackIRDevice.cpp:28
SurgSim::Devices::TrackIRDevice::m_positionScale
double m_positionScale
Scale factor for the position axes; stored locally before the device is initialized.
Definition: TrackIRDevice.h:85
SurgSim::Devices::TrackIRScaffold
A class that manages Natural Point TRACKIR devices.
Definition: TrackIRScaffold.h:38
SurgSim::Devices::TrackIRDevice::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Devices::TrackIRDevice)
SurgSim::Devices::TrackIRDevice::finalize
bool finalize() override
Finalize (de-initialize) the device.
Definition: TrackIRDevice.cpp:58
string
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
SurgSim::Devices::TrackIRDevice::setPositionScale
void setPositionScale(double scale)
Sets the position scale for this device.
Definition: TrackIRDevice.cpp:72