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 Device
27 {
28 class TrackIRScaffold;
29 
41 {
42 public:
45  explicit TrackIRDevice(const std::string& uniqueName);
46 
48  virtual ~TrackIRDevice();
49 
52  virtual bool initialize() override;
55  virtual bool finalize() override;
56 
59  bool isInitialized() const;
60 
64  void setPositionScale(double scale);
66  double getPositionScale() const;
67 
71  void setOrientationScale(double scale);
73  double getOrientationScale() const;
74 
75 private:
76  friend class TrackIRScaffold;
77 
78  // Returns the default position scale
79  static double defaultPositionScale();
80  // Returns the default rotation scale
81  static double defaultOrientationScale();
82 
87 
89  std::shared_ptr<TrackIRScaffold> m_scaffold;
90 };
91 
92 }; // namespace Device
93 }; // namespace SurgSim
94 
95 #endif // SURGSIM_DEVICES_TRACKIR_TRACKIRDEVICE_H
std::shared_ptr< TrackIRScaffold > m_scaffold
Communication with hardware is handled by scaffold.
Definition: TrackIRDevice.h:89
Definition: DriveElementFromInputBehavior.cpp:27
virtual ~TrackIRDevice()
Destructor.
Definition: TrackIRDevice.cpp:31
A class implementing the communication with Natural Point TrackIR camera.
Definition: TrackIRDevice.h:40
void setOrientationScale(double scale)
Sets the orientation scale for this device.
Definition: TrackIRDevice.cpp:86
double getPositionScale() const
Gets the position scale for this device.
Definition: TrackIRDevice.cpp:80
double m_positionScale
Scale factor for the position axes; stored locally before the device is initialized.
Definition: TrackIRDevice.h:84
string(TOUPPER ${DEVICE}DEVICE_UPPER_CASE) option(BUILD_DEVICE_ $
Definition: CMakeLists.txt:35
double m_orientationScale
Scale factor for the orientation axes; stored locally before the device is initialized.
Definition: TrackIRDevice.h:86
double getOrientationScale() const
Gets the orientation scale for this device.
Definition: TrackIRDevice.cpp:95
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:34
virtual bool initialize() override
Initialize this device, register it with the scaffold.
Definition: TrackIRDevice.cpp:40
bool isInitialized() const
Check whether this device is initialized.
Definition: TrackIRDevice.cpp:65
static double defaultOrientationScale()
Definition: TrackIRDevice.cpp:106
static double defaultPositionScale()
Definition: TrackIRDevice.cpp:101
void setPositionScale(double scale)
Sets the position scale for this device.
Definition: TrackIRDevice.cpp:71
virtual bool finalize() override
Finalize this device, unregister this device from the scaffold.
Definition: TrackIRDevice.cpp:56
A class that manages Natural Point TRACKIR devices.
Definition: TrackIRScaffold.h:38
TrackIRDevice(const std::string &uniqueName)
Constructor.
Definition: TrackIRDevice.cpp:26