TrackIRDevice.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_DEVICES_TRACKIR_TRACKIRDEVICE_H
#define SURGSIM_DEVICES_TRACKIR_TRACKIRDEVICE_H
#include <memory>
#include <string>
#include "SurgSim/Input/CommonDevice.h"
namespace SurgSim
{
namespace Devices
{
class TrackIRScaffold;
SURGSIM_STATIC_REGISTRATION(TrackIRDevice);
class TrackIRDevice : public SurgSim::Input::CommonDevice
{
public:
explicit TrackIRDevice(const std::string& uniqueName);
SURGSIM_CLASSNAME(SurgSim::Devices::TrackIRDevice);
virtual ~TrackIRDevice();
bool initialize() override;
bool isInitialized() const override;
void setPositionScale(double scale);
double getPositionScale() const;
void setOrientationScale(double scale);
double getOrientationScale() const;
private:
friend class TrackIRScaffold;
bool finalize() override;
// Returns the default position scale
static double defaultPositionScale();
// Returns the default rotation scale
static double defaultOrientationScale();
double m_positionScale;
double m_orientationScale;
std::shared_ptr<TrackIRScaffold> m_scaffold;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_TRACKIR_TRACKIRDEVICE_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
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::TrackIRScaffold
A class that manages Natural Point TRACKIR devices.
Definition: TrackIRScaffold.h:38
SurgSim::Devices::TrackIRDevice::isInitialized
bool isInitialized() const override
Definition: TrackIRDevice.cpp:66
SurgSim::Devices::TrackIRDevice::initialize
bool initialize() override
Fully initialize the device.
Definition: TrackIRDevice.cpp:43
SurgSim::Devices::TrackIRDevice
A class implementing the communication with Natural Point TrackIR camera.
Definition: TrackIRDevice.h:44
SurgSim::Devices::TrackIRDevice::getPositionScale
double getPositionScale() const
Gets the position scale for this device.
Definition: TrackIRDevice.cpp:81
SurgSim::Devices::TrackIRDevice::defaultOrientationScale
static double defaultOrientationScale()
Definition: TrackIRDevice.cpp:107
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::TrackIRDevice::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Devices::TrackIRDevice)
SurgSim::Devices::TrackIRDevice::~TrackIRDevice
virtual ~TrackIRDevice()
Destructor.
Definition: TrackIRDevice.cpp:35
SurgSim::Devices::TrackIRDevice::finalize
bool finalize() override
Finalize (de-initialize) the device.
Definition: TrackIRDevice.cpp:58
SurgSim::Devices::TrackIRDevice::defaultPositionScale
static double defaultPositionScale()
Definition: TrackIRDevice.cpp:102
SurgSim::Input::CommonDevice
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
SurgSim::Devices::TrackIRDevice::setPositionScale
void setPositionScale(double scale)
Sets the position scale for this device.
Definition: TrackIRDevice.cpp:72
CommonDevice.h
SurgSim::Devices::TrackIRDevice::TrackIRDevice
TrackIRDevice(const std::string &uniqueName)
Constructor.
Definition: TrackIRDevice.cpp:28
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::getOrientationScale
double getOrientationScale() const
Gets the orientation scale for this device.
Definition: TrackIRDevice.cpp:96