Trackball manipulator that uses the mouse wheel to control zoom amount.
More...
#include <SurgSim/Graphics/OsgTrackballZoomManipulator.h>
|
virtual bool | handle (const osgGA::GUIEventAdapter &eventAdapter, osgGA::GUIActionAdapter &actionAdapter) |
| Handle keyboard CTRL-U events to make the view upright. More...
|
|
virtual bool | handleMouseWheel (const osgGA::GUIEventAdapter &eventAdapter, osgGA::GUIActionAdapter &actionAdapter) |
| Handle mouse wheel scrolling to zoom in or out. More...
|
|
Trackball manipulator that uses the mouse wheel to control zoom amount.
The output matrices are view matrices and do not include the zoom. To apply the zoom, get the value from getZoomFactor() and multiply it by some base FOV to calculate the FOV for the current zoom level.
SurgSim::Graphics::OsgTrackballZoomManipulator::OsgTrackballZoomManipulator |
( |
| ) |
|
Initializes the zoom parameters to default values.
double SurgSim::Graphics::OsgTrackballZoomManipulator::getMaxZoomAmount |
( |
| ) |
const |
Gets the maximum amount to change the zoom factor in one step.
- Returns
- Maximum zoom factor
double SurgSim::Graphics::OsgTrackballZoomManipulator::getMaxZoomFactor |
( |
| ) |
const |
Gets the maximum zoom factor.
- Returns
- Maximum zoom factor
double SurgSim::Graphics::OsgTrackballZoomManipulator::getMinZoomAmount |
( |
| ) |
const |
Gets the minimum amount to change the zoom factor in one step.
- Returns
- Minimum zoom factor
double SurgSim::Graphics::OsgTrackballZoomManipulator::getMinZoomFactor |
( |
| ) |
const |
Gets the minimum zoom factor.
- Returns
- Minimum zoom factor
double SurgSim::Graphics::OsgTrackballZoomManipulator::getZoomFactor |
( |
| ) |
const |
Gets the current zoom factor.
- Returns
- Zoom factor
double SurgSim::Graphics::OsgTrackballZoomManipulator::getZoomFactorScale |
( |
| ) |
const |
Gets the current zoom factor.
- Returns
- Scale applied to the zoom factor
bool SurgSim::Graphics::OsgTrackballZoomManipulator::handle |
( |
const osgGA::GUIEventAdapter & |
eventAdapter, |
|
|
osgGA::GUIActionAdapter & |
actionAdapter |
|
) |
| |
|
protectedvirtual |
Handle keyboard CTRL-U events to make the view upright.
- Parameters
-
eventAdapter | Event adapter |
actionAdapter | Action adapter |
- Returns
- true if the event was handled, false otherwise
bool SurgSim::Graphics::OsgTrackballZoomManipulator::handleMouseWheel |
( |
const osgGA::GUIEventAdapter & |
eventAdapter, |
|
|
osgGA::GUIActionAdapter & |
actionAdapter |
|
) |
| |
|
protectedvirtual |
Handle mouse wheel scrolling to zoom in or out.
- Parameters
-
eventAdapter | Event adapter |
actionAdapter | Action adapter |
- Returns
- true if the mouse wheel was handled, false otherwise
void SurgSim::Graphics::OsgTrackballZoomManipulator::makeUpright |
( |
| ) |
|
|
virtual |
Removes roll of the camera, so that the top of the view is towards the Y direction.
void SurgSim::Graphics::OsgTrackballZoomManipulator::setMaxZoomAmount |
( |
double |
amount | ) |
|
|
virtual |
Sets the maximum amount to change the zoom factor in one step.
- Parameters
-
amount | Maximum zoom amount |
void SurgSim::Graphics::OsgTrackballZoomManipulator::setMaxZoomFactor |
( |
double |
factor | ) |
|
|
virtual |
Sets the maximum zoom factor (zoomed out)
- Parameters
-
factor | Maximum zoom factor |
void SurgSim::Graphics::OsgTrackballZoomManipulator::setMinZoomAmount |
( |
double |
amount | ) |
|
|
virtual |
Sets the minimum amount to change the zoom factor in one step.
- Parameters
-
amount | Minimum zoom amount |
void SurgSim::Graphics::OsgTrackballZoomManipulator::setMinZoomFactor |
( |
double |
factor | ) |
|
|
virtual |
Sets the minimum zoom factor (zoomed out)
- Parameters
-
factor | Minimum zoom factor |
void SurgSim::Graphics::OsgTrackballZoomManipulator::setZoomFactor |
( |
double |
factor | ) |
|
|
virtual |
Sets the current zoom factor.
- Parameters
-
void SurgSim::Graphics::OsgTrackballZoomManipulator::setZoomFactorScale |
( |
double |
factor | ) |
|
|
virtual |
Sets the scale applied to the zoom factor before it is applied to the FOV.
- Parameters
-
factor | Scale applied to the zoom factor |
void SurgSim::Graphics::OsgTrackballZoomManipulator::zoom |
( |
double |
zoomPercent | ) |
|
|
virtual |
Zoom by a percent of the difference between the current zoom amount and minimum zoom factor.
- Parameters
-
zoomPercent | Percent to zoom by: positive values zoom out, negative values zoom in |
double SurgSim::Graphics::OsgTrackballZoomManipulator::m_maxZoomAmount |
|
protected |
Maximum amount to change the zoom factor in one step.
double SurgSim::Graphics::OsgTrackballZoomManipulator::m_maxZoomFactor |
|
protected |
Maximum zoom factor value (zoomed out)
double SurgSim::Graphics::OsgTrackballZoomManipulator::m_minZoomAmount |
|
protected |
Minimum amount to change the zoom factor in one step This minimum prevents zooming by infinitely smaller amounts.
double SurgSim::Graphics::OsgTrackballZoomManipulator::m_minZoomFactor |
|
protected |
Minimum zoom factor value (zoomed in)
double SurgSim::Graphics::OsgTrackballZoomManipulator::m_zoomFactor |
|
protected |
Current zoom factor Larger values are zoomed out, smaller values are zoomed in.
double SurgSim::Graphics::OsgTrackballZoomManipulator::m_zoomFactorScale |
|
protected |
Scaling factor applied to the zoom factor before it is applied to the FOV.
The documentation for this class was generated from the following files: