![]() |
Interface used to communicate with user-interface hardware devices. More...
#include <SurgSim/Input/DeviceInterface.h>
Public Member Functions | |
virtual | ~DeviceInterface () |
Virtual destructor (empty). More... | |
virtual std::string | getName () const =0 |
Return a (hopefully unique) device name. More... | |
virtual bool | initialize ()=0 |
Fully initialize the device. More... | |
virtual bool | addInputConsumer (std::shared_ptr< InputConsumerInterface > inputConsumer)=0 |
Adds an input consumer that will be notified when the application input state is updated. More... | |
virtual bool | removeInputConsumer (std::shared_ptr< InputConsumerInterface > inputConsumer)=0 |
Removes an input consumer previously added via addInputConsumer. More... | |
virtual bool | setOutputProducer (std::shared_ptr< OutputProducerInterface > outputProducer)=0 |
Sets an output producer that will be asked for application output state when the device needs it. More... | |
virtual bool | removeOutputProducer (std::shared_ptr< OutputProducerInterface > outputProducer)=0 |
Removes an output producer previously added via setOutputProducer. More... | |
virtual bool | hasOutputProducer ()=0 |
Query if this object has output producer. More... | |
Protected Member Functions | |
virtual bool | finalize ()=0 |
Finalize (de-initialize) the device. More... | |
Interface used to communicate with user-interface hardware devices.
Classes that implement communication with a hardware device implement this interface. This includes input/output devices (haptic devices are the most obvious example, but many other devices can, for example, display visual indicators such as LEDs, etc.), as well as input-only and output-only devices.
Derived classes will likely want to hide their constructor and only allow creation through a manager object for that type of device.
|
inlinevirtual |
Virtual destructor (empty).
|
pure virtual |
Adds an input consumer that will be notified when the application input state is updated.
inputConsumer | The input consumer to be added. |
Implemented in SurgSim::Device::MultiAxisDevice, SurgSim::Input::CommonDevice, and SurgSim::Device::IdentityPoseDevice.
|
protectedpure virtual |
Finalize (de-initialize) the device.
Implemented in SurgSim::Device::LabJackDevice, SurgSim::Device::PoseTransform, SurgSim::Device::ForceScale, LabJackToPoseFilter, SurgSim::Device::PhantomDevice, SurgSim::Device::MultiAxisDevice, SurgSim::Device::MouseDevice, SurgSim::Device::RawMultiAxisDevice, SurgSim::Device::SixenseDevice, SurgSim::Device::PoseIntegrator, SurgSim::Device::KeyboardDevice, SurgSim::Device::NovintCommonDevice, SurgSim::Device::TrackIRDevice, and SurgSim::Device::IdentityPoseDevice.
|
pure virtual |
Return a (hopefully unique) device name.
Implemented in SurgSim::Device::MultiAxisDevice, and SurgSim::Input::CommonDevice.
|
pure virtual |
Query if this object has output producer.
Implemented in SurgSim::Device::MultiAxisDevice, and SurgSim::Input::CommonDevice.
|
pure virtual |
Fully initialize the device.
When the manager object creates the device, the internal state of the device usually isn't fully initialized yet. This method performs any needed initialization.
Implemented in SurgSim::Device::LabJackDevice, LabJackToPoseFilter, SurgSim::Device::PhantomDevice, SurgSim::Device::MultiAxisDevice, SurgSim::Device::PoseTransform, SurgSim::Device::RawMultiAxisDevice, SurgSim::Device::MouseDevice, SurgSim::Device::SixenseDevice, SurgSim::Device::PoseIntegrator, SurgSim::Device::KeyboardDevice, SurgSim::Device::NovintCommonDevice, SurgSim::Device::ForceScale, SurgSim::Device::TrackIRDevice, and SurgSim::Device::IdentityPoseDevice.
|
pure virtual |
Removes an input consumer previously added via addInputConsumer.
inputConsumer | The input consumer to be removed. |
Implemented in SurgSim::Device::MultiAxisDevice, and SurgSim::Input::CommonDevice.
|
pure virtual |
Removes an output producer previously added via setOutputProducer.
outputProducer | The output producer to be removed. |
Implemented in SurgSim::Device::MultiAxisDevice, and SurgSim::Input::CommonDevice.
|
pure virtual |
Sets an output producer that will be asked for application output state when the device needs it.
Any previously set output producer will be removed.
outputProducer | The output producer to be added. |
Implemented in SurgSim::Device::MultiAxisDevice, and SurgSim::Input::CommonDevice.