18 #ifndef AGXOSG_SCCAMERA_MANIPULATOR
19 #define AGXOSG_SCCAMERA_MANIPULATOR
24 #include <osgGA/StandardManipulator>
28 # pragma warning(push)
29 # pragma warning( disable : 4251 ) // warning C4251: non dll-interface class
41 typedef osgGA::StandardManipulator inherited;
47 const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY );
51 virtual void setByMatrix(
const osg::Matrixd& matrix );
52 virtual void setByInverseMatrix(
const osg::Matrixd& matrix );
53 virtual osg::Matrixd getMatrix()
const;
54 virtual osg::Matrixd getInverseMatrix()
const;
61 virtual void setCenter(
const osg::Vec3d& center );
63 virtual void setRotation(
const osg::Quat& rotation );
65 virtual void setDistance(
double distance );
66 double getDistance()
const;
68 virtual void setTrackballSize(
const double& size );
69 inline double getTrackballSize()
const;
70 virtual void setWheelZoomFactor(
double wheelZoomFactor );
71 inline double getWheelZoomFactor()
const;
73 virtual void setMinimumDistance(
const double& minimumDistance,
bool relativeToModelSize =
false );
74 double getMinimumDistance(
bool *relativeToModelSize =
nullptr )
const;
76 virtual osgUtil::SceneView::FusionDistanceMode getFusionDistanceMode()
const;
77 virtual float getFusionDistanceValue()
const;
81 virtual bool handleMousePush(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
83 virtual bool handleMouseWheel(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
85 virtual bool performMovementLeftMouseButton(
const double eventTimeDelta,
const double dx,
const double dy );
86 virtual bool performMovementMiddleMouseButton(
const double eventTimeDelta,
const double dx,
const double dy );
87 virtual bool performMovementRightMouseButton(
const double eventTimeDelta,
const double dx,
const double dy );
88 virtual bool performMouseDeltaMovement(
const float dx,
const float dy );
89 virtual void applyAnimationStep(
const double currentProgress,
const double prevProgress );
91 bool handleKeyDown(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
92 bool handleKeyUp(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
93 bool setCenterByMousePointerIntersection(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
96 virtual void rotateTrackball(
const float px0,
const float py0,
97 const float px1,
const float py1,
const float scale );
99 bool rotate(
const double eventTimeDelta,
const double dx,
const double dy);
100 virtual void rotateWithFixedVertical(
const float dx,
const float dy );
101 virtual void rotateWithFixedVertical(
const float dx,
const float dy,
const osg::Vec3f& up );
102 virtual void panModel(
const float dx,
const float dy,
const float dz = 0.f );
103 virtual void zoomModel(
const float dy,
bool pushForwardIfNeeded =
true );
104 void trackball(
osg::Vec3d& axis,
float& angle,
float p1x,
float p1y,
float p2x,
float p2y );
105 float tb_project_to_sphere(
float r,
float x,
float y );
106 virtual bool startAnimationByMousePointerIntersection(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
124 void start(
const osg::Vec3d& movement,
const double startTime );
142 # pragma warning(pop)