14#ifndef __SphericalManipulator_h__
15#define __SphericalManipulator_h__
29 virtual const char*
className()
const {
return "Spherical Manipulator"; }
BoundingSphered BoundingSphere
Definition BoundingSphere:308
The 'GA' in osgGA stands for 'GUI Abstraction'; the osgGA namespace provides facilities to help devel...
Definition Callback:21
Definition ApplicationUsage:26
static Matrixd inverse(const Matrixd &matrix)
Definition Matrixd:536
Base class for all internal nodes in the scene graph.
Definition Node:72
Smart pointer for observed objects, that automatically set pointers to them to null when they are del...
Definition observer_ptr:39
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
General purpose double triple for use as vertices, vectors and normals.
Definition Vec3d:30
Definition GUIActionAdapter:62
Event class for storing Keyboard, mouse and window events.
Definition GUIEventAdapter:82
double getDistance() const
Definition SphericalManipulator:83
double getElevtion() const
Definition SphericalManipulator:91
void setAllowThrow(bool allowThrow)
Set the 'allow throw' flag.
Definition SphericalManipulator:127
virtual void init(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
Start/restart the manipulator.
virtual void home(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
Move the camera to the default position.
double _homeDistance
Definition SphericalManipulator:174
bool calcMovement()
For the give mouse movement calculate the movement of the camera.
osg::ref_ptr< const osgGA::GUIEventAdapter > _ga_t1
Definition SphericalManipulator:147
virtual osgUtil::SceneView::FusionDistanceMode getFusionDistanceMode() const
Get the FusionDistanceMode.
Definition SphericalManipulator:44
void computeViewPosition(const osg::BoundingSphere &bound, double &scale, double &distance, osg::Vec3d ¢er)
virtual void home(double)
Move the camera to the default position.
void zoomOn(const osg::BoundingSphere &bound)
double _modelScale
Definition SphericalManipulator:152
double _elevation
Definition SphericalManipulator:173
double _minimumZoomScale
Definition SphericalManipulator:153
virtual void setNode(osg::Node *)
Attach a node to the manipulator.
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
handle events, return true if handled, false otherwise.
void setElevation(double elevation)
Definition SphericalManipulator:90
void flushMouseEventStack()
Reset the internal GUIEvent stack.
virtual void setByInverseMatrix(const osg::Matrixd &matrix)
set the position of the matrix manipulator using a 4x4 Matrix.
Definition SphericalManipulator:35
double _last_frame_time
The time the last frame started.
Definition SphericalManipulator:167
double _distance
Definition SphericalManipulator:171
virtual osg::Matrixd getInverseMatrix() const
get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model...
RotationMode getRotationMode() const
Definition SphericalManipulator:121
double _delta_frame_time
The approximate amount of time it is currently taking to draw a frame.
Definition SphericalManipulator:162
void setMinimumZoomScale(double minimumZoomScale)
set the minimum distance (as ratio) the eye point can be zoomed in towards the center before the cent...
Definition SphericalManipulator:99
const osg::Vec3d & getCenter() const
Definition SphericalManipulator:80
virtual const char * className() const
return the name of the object's class type.
Definition SphericalManipulator:29
void setCenter(const osg::Vec3d ¢er)
Definition SphericalManipulator:79
void setHeading(double azimuth)
Definition SphericalManipulator:87
void setRotationMode(RotationMode mode)
double getMinimumZoomScale() const
get the minimum distance (as ratio) the eye point can be zoomed in
Definition SphericalManipulator:95
virtual void setByMatrix(const osg::Matrixd &matrix)
set the position of the matrix manipulator using a 4x4 Matrix.
void setScroolWheelZoomDelta(double zoomDelta)
set the mouse scroll wheel zoom delta.
Definition SphericalManipulator:104
bool getAllowThrow() const
Returns true if the camera can be thrown, false otherwise.
Definition SphericalManipulator:125
osg::Vec3d _center
Definition SphericalManipulator:170
virtual const osg::Node * getNode() const
Return node if attached.
osg::ref_ptr< const osgGA::GUIEventAdapter > _ga_t0
Definition SphericalManipulator:148
RotationMode
Definition SphericalManipulator:114
@ ELEVATION_HEADING
Definition SphericalManipulator:115
@ HEADING
Definition SphericalManipulator:116
@ ELEVATION
Definition SphericalManipulator:117
@ MAP
Definition SphericalManipulator:118
RotationMode _rotationMode
Definition SphericalManipulator:169
bool _thrown
Definition SphericalManipulator:155
double getScroolWheelZoomDelta() const
get the mouse scroll wheel zoom delta.
Definition SphericalManipulator:107
double _heading
Definition SphericalManipulator:172
virtual osg::Matrixd getMatrix() const
get the position of the manipulator as 4x4 Matrix.
virtual void getUsage(osg::ApplicationUsage &usage) const
Get the keyboard and mouse usage of this manipulator.
virtual float getFusionDistanceValue() const
Get the FusionDistanceValue.
Definition SphericalManipulator:47
double getHeading() const
Definition SphericalManipulator:88
virtual osg::Node * getNode()
Return node if attached.
void addMouseEvent(const osgGA::GUIEventAdapter &ea)
Add the current mouse GUIEvent to internal stack.
bool isMouseMoving()
Check the speed at which the mouse is moving.
virtual void computeHomePosition()
Compute the home position.
bool setDistance(double distance)
virtual ~SphericalManipulator()
osg::observer_ptr< osg::Node > _node
Definition SphericalManipulator:150
double _zoomDelta
Definition SphericalManipulator:175
double getHomeDistance() const
Definition SphericalManipulator:85
bool _allowThrow
Definition SphericalManipulator:156
FusionDistanceMode
FusionDistanceMode is used only when working in stereo.
Definition SceneView:339
@ USE_FUSION_DISTANCE_VALUE
Use fusion distance from the value set on the SceneView.
Definition SceneView:341
#define OSGGA_EXPORT
Definition Export:40