![]() |
A class implementing the communication with a mouse. More...
#include <SurgSim/Devices/Mouse/MouseDevice.h>
Public Member Functions | |
MouseDevice (const std::string &deviceName) | |
Constructor. More... | |
virtual | ~MouseDevice () |
Destructor. More... | |
virtual bool | initialize () override |
Initialize corresponding MouseScaffold. More... | |
virtual bool | finalize () override |
"De"-initialize corresponding MouseScaffold. More... | |
bool | isInitialized () const |
Check if the scaffold of this device is initialized. More... | |
OsgMouseHandler * | getMouseHandler () const |
Get mouse handler. More... | |
![]() | |
CommonDevice (const std::string &name) | |
Constructor. More... | |
CommonDevice (const std::string &name, const SurgSim::DataStructures::DataGroup &inputData) | |
Constructor. More... | |
CommonDevice (const std::string &name, SurgSim::DataStructures::DataGroup &&inputData) | |
Constructor. More... | |
virtual | ~CommonDevice () |
Destructor. More... | |
virtual std::string | getName () const override |
Return a (hopefully unique) device name. More... | |
void | setNameForCallback (const std::string &name) |
Set the name used for calling the input consumers and output producer. More... | |
std::string | getNameForCallback () const |
Get the name used for calling the input consumers and output producer. More... | |
virtual bool | addInputConsumer (std::shared_ptr< InputConsumerInterface > inputConsumer) override |
Connect this device to an InputConsumerInterface, which will receive the data that comes from this device. More... | |
virtual bool | removeInputConsumer (std::shared_ptr< InputConsumerInterface > inputConsumer) override |
Disconnect this device from an InputConsumerInterface, which will no longer receive data from this device. More... | |
virtual bool | setOutputProducer (std::shared_ptr< OutputProducerInterface > outputProducer) override |
Connect this device to an OutputProducerInterface, which will send data to this device. More... | |
virtual bool | removeOutputProducer (std::shared_ptr< OutputProducerInterface > outputProducer) override |
Disconnect this device from an OutputProducerInterface, which will no longer send data to this device. More... | |
virtual bool | hasOutputProducer () override |
Getter for whether or not this device is connected with an OutputProducerInterface. More... | |
![]() | |
virtual | ~DeviceInterface () |
Virtual destructor (empty). More... | |
Private Attributes | |
std::shared_ptr< MouseScaffold > | m_scaffold |
Communication with hardware is handled by scaffold. More... | |
Friends | |
class | MouseScaffold |
class | MouseDeviceTest |
Additional Inherited Members | |
![]() | |
virtual void | pushInput () |
Push application input to consumers. More... | |
virtual bool | pullOutput () |
Pull application output from a producer. More... | |
SurgSim::DataStructures::DataGroup & | getInputData () |
Getter for the input data DataGroup. More... | |
const SurgSim::DataStructures::DataGroup & | getOutputData () const |
Getter for the output data DataGroup. More... | |
A class implementing the communication with a mouse.
type | name | |
---|---|---|
bool | "button1" | State of mouse left button |
bool | "button2" | State of mouse middle button |
bool | "button3" | State of mouse right button |
scalar | "x" | X-coordinate of mouse |
scalar | "y" | Y-coordinate of mouse |
int | "scrollDeltaX" | Indicates vertical movement direction of mouse wheel |
int | "scrollDeltaY" | Indicates horizontal movement direction of mouse wheel |
|
explicit |
Constructor.
deviceName | Name for mouse device |
|
virtual |
Destructor.
|
overridevirtual |
"De"-initialize corresponding MouseScaffold.
Implements SurgSim::Input::DeviceInterface.
OsgMouseHandler * SurgSim::Device::MouseDevice::getMouseHandler | ( | ) | const |
Get mouse handler.
|
overridevirtual |
Initialize corresponding MouseScaffold.
Implements SurgSim::Input::DeviceInterface.
bool SurgSim::Device::MouseDevice::isInitialized | ( | ) | const |
Check if the scaffold of this device is initialized.
|
friend |
|
friend |
|
private |
Communication with hardware is handled by scaffold.