RawMultiAxisDevice.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_RAWMULTIAXISDEVICE_H
#define SURGSIM_DEVICES_MULTIAXIS_RAWMULTIAXISDEVICE_H
#include <memory>
#include <string>
#include "SurgSim/Input/CommonDevice.h"
#include "SurgSim/Devices/MultiAxis/MultiAxisDevice.h"
namespace SurgSim
{
namespace Devices
{
class RawMultiAxisScaffold;
SURGSIM_STATIC_REGISTRATION(RawMultiAxisDevice);
class RawMultiAxisDevice : public SurgSim::Input::CommonDevice
{
public:
explicit RawMultiAxisDevice(const std::string& uniqueName);
SURGSIM_CLASSNAME(SurgSim::Devices::RawMultiAxisDevice);
virtual ~RawMultiAxisDevice();
bool initialize() override;
bool isInitialized() const override;
void setPositionScale(double scale);
double getPositionScale() const;
void setOrientationScale(double scale);
double getOrientationScale() const;
void setAxisDominance(bool onOff);
bool isUsingAxisDominance() const;
private:
bool finalize() override;
// Returns the default position scale, in meters per tick.
static double defaultPositionScale()
{
// the position scale from Paul N's measurements of the SpaceNavigator; 1/16"/350 ticks
return 0.0000045;
}
// Returns the default rotation scale, in radians per tick.
static double defaultOrientationScale()
{
// the rotation scale from Paul N's measurements of the SpaceNavigator
return 0.0003;
}
friend SurgSim::Devices::MultiAxisDevice::MultiAxisDevice(const std::string& uniqueName);
friend class RawMultiAxisScaffold;
std::shared_ptr<RawMultiAxisScaffold> m_scaffold;
double m_positionScale;
double m_orientationScale;
bool m_useAxisDominance;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_MULTIAXIS_RAWMULTIAXISDEVICE_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::RawMultiAxisDevice::setAxisDominance
void setAxisDominance(bool onOff)
Turns on or off the axis dominance setting for this device.
Definition: RawMultiAxisDevice.cpp:119
SurgSim::Devices::RawMultiAxisDevice::~RawMultiAxisDevice
virtual ~RawMultiAxisDevice()
Destructor.
Definition: RawMultiAxisDevice.cpp:44
SurgSim::Devices::RawMultiAxisDevice::finalize
bool finalize() override
Finalize (de-initialize) the device.
Definition: RawMultiAxisDevice.cpp:72
MultiAxisDevice.h
SurgSim::Devices::RawMultiAxisDevice::defaultPositionScale
static double defaultPositionScale()
Definition: RawMultiAxisDevice.h:99
SurgSim::Devices::RawMultiAxisDevice::isInitialized
bool isInitialized() const override
Definition: RawMultiAxisDevice.cpp:81
SurgSim::Devices::RawMultiAxisDevice::initialize
bool initialize() override
Fully initialize the device.
Definition: RawMultiAxisDevice.cpp:53
SurgSim::Devices::RawMultiAxisScaffold
A class that implements the behavior of RawMultiAxisDevice objects.
Definition: RawMultiAxisScaffold.h:37
SurgSim::Devices::RawMultiAxisDevice::m_scaffold
std::shared_ptr< RawMultiAxisScaffold > m_scaffold
Definition: RawMultiAxisDevice.h:116
SurgSim::Devices::RawMultiAxisDevice
A class implementing the communication with a multi-axis controller input device, for example a 3DCon...
Definition: RawMultiAxisDevice.h:56
SurgSim::Devices::MultiAxisDevice::MultiAxisDevice
MultiAxisDevice(const std::string &uniqueName)
Constructor.
Definition: MultiAxisDevice.cpp:31
SurgSim::Devices::RawMultiAxisDevice::m_useAxisDominance
bool m_useAxisDominance
Controls whether dominance will be enabled; stored locally before the device is initialized.
Definition: RawMultiAxisDevice.h:123
SurgSim::Devices::RawMultiAxisDevice::getOrientationScale
double getOrientationScale() const
Gets the orientation scale for this device.
Definition: RawMultiAxisDevice.cpp:113
SurgSim::Devices::RawMultiAxisDevice::RawMultiAxisDevice
RawMultiAxisDevice(const std::string &uniqueName)
Constructor.
Definition: RawMultiAxisDevice.cpp:29
SurgSim::Input::CommonDevice
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:35
SurgSim::Devices::RawMultiAxisDevice::isUsingAxisDominance
bool isUsingAxisDominance() const
Gets the axis dominance setting for this device.
Definition: RawMultiAxisDevice.cpp:129
SurgSim::Devices::RawMultiAxisDevice::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Devices::RawMultiAxisDevice)
CommonDevice.h
SurgSim::Devices::RawMultiAxisDevice::setPositionScale
void setPositionScale(double scale)
Sets the position scale for this device.
Definition: RawMultiAxisDevice.cpp:87
SurgSim::Devices::RawMultiAxisDevice::defaultOrientationScale
static double defaultOrientationScale()
Definition: RawMultiAxisDevice.h:106
SurgSim::Devices::RawMultiAxisDevice::getPositionScale
double getPositionScale() const
Gets the position scale for this device.
Definition: RawMultiAxisDevice.cpp:97
SurgSim::Devices::RawMultiAxisDevice::m_orientationScale
double m_orientationScale
Scale factor for the orientation axes; stored locally before the device is initialized.
Definition: RawMultiAxisDevice.h:121
SurgSim::Devices::RawMultiAxisDevice::setOrientationScale
void setOrientationScale(double scale)
Sets the orientation scale for this device.
Definition: RawMultiAxisDevice.cpp:103
SurgSim::Devices::RawMultiAxisDevice::m_positionScale
double m_positionScale
Scale factor for the position axes; stored locally before the device is initialized.
Definition: RawMultiAxisDevice.h:119