A simple listener to display the simple scene composed of a square and tool for the example application.
More...
#include <SurgSim/Testing/VisualTestCommon/MovingSquareGlutWindow.h>
A simple listener to display the simple scene composed of a square and tool for the example application.
Includes support for the square being moved by a second tool.
- See also
- SurgSim::Input::InputConsumerInterface
MovingSquareGlutWindow::MovingSquareGlutWindow |
( |
const std::string & |
toolDeviceName, |
|
|
const std::string & |
squareDeviceName |
|
) |
| |
MovingSquareGlutWindow::~MovingSquareGlutWindow |
( |
| ) |
|
Notifies the consumer that the application input coming from the device has been updated.
Typical input data contents (but note that individual devices may do things differently):
type | name | |
pose | "pose" | Device pose (units are meters). |
bool | "button1" | State of the first device button. |
bool | "button2" | State of the second device button (and so on). |
Other possible contents includes:
type | name | |
bool | "isHomed" | Device homing status. |
bool | "isHomedX" | Individual homing status for the X axis (and so on). |
bool | "isHeld" | Safety sensor etc. status. |
string | "model" | Device model description. |
string | "serial" | Serial number string. |
(any) | "debug:*" | Various debugging information |
- Parameters
-
device | The name of the device that is producing the input. This should only be used to identify the device (e.g. if the consumer is listening to several devices at once). |
inputData | The application input state coming from the device. |
Implements SurgSim::Input::InputConsumerInterface.
Set the initial input data group.
- Parameters
-
device | The name of the device that is producing the input. This should only be used to identify the device (e.g. if the consumer is listening to several devices at once). |
inputData | The application input state coming from the device. |
Implements SurgSim::Input::InputConsumerInterface.
Updates the square based on the device input.
- Parameters
-
inputData | Input data from the device. |
Updates the tool based on the device input.
- Parameters
-
inputData | Input data from the device. |
std::shared_ptr<GlutCamera> MovingSquareGlutWindow::m_camera |
|
private |
Camera which controls the view of the scene.
boost::thread MovingSquareGlutWindow::m_renderThread |
|
private |
Render thread which runs the Glut main loop.
std::shared_ptr<GlutSquare> MovingSquareGlutWindow::m_square |
|
private |
Square that is moved with device input.
const std::string MovingSquareGlutWindow::m_squareDeviceName |
|
private |
Name of the square device.
std::shared_ptr<GlutGroup> MovingSquareGlutWindow::m_tool |
|
private |
Tool composed of a sphere and axes that are moved with device input.
const std::string MovingSquareGlutWindow::m_toolDeviceName |
|
private |
std::shared_ptr<GlutSphere> MovingSquareGlutWindow::m_toolSphere |
|
private |
Sphere of the tool.
Pointer is kept here so that the color can easily be changed based on the device's button state.
The documentation for this class was generated from the following files: