MultiAxisDevice.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_MULTIAXIS_MULTIAXISDEVICE_H
#define SURGSIM_DEVICES_MULTIAXIS_MULTIAXISDEVICE_H
#include <memory>
#include <string>
#include "SurgSim/Devices/DeviceFilters/FilteredDevice.h"
#include "SurgSim/Input/CommonDevice.h"
namespace SurgSim
{
namespace Devices
{
class RawMultiAxisDevice;
class PoseIntegrator;
SURGSIM_STATIC_REGISTRATION(MultiAxisDevice);
class MultiAxisDevice : public FilteredDevice
{
public:
explicit MultiAxisDevice(const std::string& uniqueName);
SURGSIM_CLASSNAME(SurgSim::Devices::MultiAxisDevice);
void setPositionScale(double scale);
double getPositionScale() const;
void setOrientationScale(double scale);
double getOrientationScale() const;
void setAxisDominance(bool onOff);
bool isUsingAxisDominance() const;
void setReset(const std::string& name);
private:
static double defaultPositionScale();
static double defaultOrientationScale();
std::shared_ptr<RawMultiAxisDevice> m_rawDevice;
std::shared_ptr<PoseIntegrator> m_filter;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_MULTIAXIS_MULTIAXISDEVICE_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::MultiAxisDevice::defaultOrientationScale
static double defaultOrientationScale()
Get the default rotation from device ticks to radians.
Definition: MultiAxisDevice.cpp:87
SurgSim::Devices::MultiAxisDevice
A class implementing the communication with a multi-axis controller input device, for example a 3DCon...
Definition: MultiAxisDevice.h:57
SurgSim::Devices::FilteredDevice
A DeviceInterface connected in series with one or more DeviceFilters. Useful for serialization.
Definition: FilteredDevice.h:39
SurgSim::Devices::MultiAxisDevice::setPositionScale
void setPositionScale(double scale)
Sets the position scale for this device.
Definition: MultiAxisDevice.cpp:52
SurgSim::Devices::MultiAxisDevice::MultiAxisDevice
MultiAxisDevice(const std::string &uniqueName)
Constructor.
Definition: MultiAxisDevice.cpp:31
SurgSim::Devices::MultiAxisDevice::setOrientationScale
void setOrientationScale(double scale)
Sets the orientation scale for this device.
Definition: MultiAxisDevice.cpp:62
SurgSim::Devices::MultiAxisDevice::m_rawDevice
std::shared_ptr< RawMultiAxisDevice > m_rawDevice
The raw underlying device.
Definition: MultiAxisDevice.h:111
SurgSim::Devices::MultiAxisDevice::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Devices::MultiAxisDevice)
SurgSim::Devices::MultiAxisDevice::m_filter
std::shared_ptr< PoseIntegrator > m_filter
The pose integration filter.
Definition: MultiAxisDevice.h:114
SurgSim::Devices::MultiAxisDevice::isUsingAxisDominance
bool isUsingAxisDominance() const
Gets the axis dominance setting for this device.
Definition: MultiAxisDevice.cpp:77
SurgSim::Devices::MultiAxisDevice::setAxisDominance
void setAxisDominance(bool onOff)
Turns on or off the axis dominance setting for this device.
Definition: MultiAxisDevice.cpp:72
CommonDevice.h
SurgSim::Devices::MultiAxisDevice::getOrientationScale
double getOrientationScale() const
Gets the orientation scale for this device.
Definition: MultiAxisDevice.cpp:67
FilteredDevice.h
SurgSim::Devices::MultiAxisDevice::setReset
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
SurgSim::Devices::MultiAxisDevice::getPositionScale
double getPositionScale() const
Gets the position scale for this device.
Definition: MultiAxisDevice.cpp:57
SurgSim::Devices::MultiAxisDevice::defaultPositionScale
static double defaultPositionScale()
Get the default position scale from device ticks to meters.
Definition: MultiAxisDevice.cpp:82