62 #include "QtBaseViewer.hh"
63 #include <QPropertyAnimation>
75 unsigned int nodeIdx, targetIdx;
84 ACG::Vec3d e = eye + t * (_moveBack ? -0.5f : 0.5f);
85 flyTo(e, hitPoint, 300);
93 ACG::Vec3d centerPointProjected = hitPointProjected;
96 int w = 0, h = 0,left = 0, bottom = 0;
110 ACG::Vec3d t = hitPoint - centerPointUnProjected;
154 const double pos = _pos.toDouble();
171 lastAnimationPos_ = pos;
182 const double pos = _pos.toDouble();
192 if (fabs(a) > FLT_MIN)
241 flyAngle_ = acos(std::max(-1.0, std::min(1.0, (z | view)))) / M_PI * 180.0;
ACG::Vec3d flyPosition_
The new position after the flyTo animation.
bool flyMoveBack_
Flag for fly in orthogonal mode if we move back or forward.
double sceneRadius()
Get radius of the current scene.
virtual void flyTo(const QPoint &_pos, bool _moveBack)
Animated flight to or away from a given point.
pick any of the prior targets (should be implemented for all nodes)
double lastAnimationPos_
The last position of the animation to compute the difference vector.
Vec3d unproject(const Vec3d &_winPoint) const
unproject point in window coordinates _winPoint to world coordinates
double trackballRadius()
Get trackball radius (rotation sphere when using mouse)
QPropertyAnimation * flyAnimationPerspective_
The animation object for flyTo.
void translate(const ACG::Vec3d &trans)
translate the scene and update modelview matrix
virtual void updateGL()
Redraw scene. Triggers paint event for updating the view (cf. drawNow()).
void updateProjectionMatrix()
updates projection matrix
VectorT< double, 3 > Vec3d
const GLMatrixd & modelview() const
get modelview matrix
VectorT< T, 3 > transform_vector(const VectorT< T, 3 > &_v) const
transform vector (x',y',z',0) = A * (x,y,z,0)
void flyAnimationOrthogonal(QVariant _pos)
Slot called during flyTo Animation in orthogonal mode.
double flyAngle_
The rotation angle (full angle) for fly to animation.
ACG::Vec3d flyTranslation_
Full translation between start and ed of animation.
int viewport_width() const
get viewport width
bool pick(ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
ACG::Vec3d flyAxis_
The rotation axis for fly to animation.
virtual void makeCurrent()
Makes this widget the current widget for OpenGL operations.
void flyAnimationOrthogonalFinished()
Slot called when flyTo orthogonal Animation finished.
double orthoWidth()
Get width of the gl scene in orthogonal projection mode (defaults to 2.0)
ACG::GLState * glstate_
Gl State.
void get_viewport(int &_left, int &_bottom, int &_width, int &_height) const
get viewport
VectorT< T, 3 > transform_point(const VectorT< T, 3 > &_v) const
transform point (x',y',z',1) = M * (x,y,z,1)
bool updatePickCache_
Should the pick cache be updated.
void rotate(const ACG::Vec3d &axis, double angle)
rotate the scene (around its center) and update modelview matrix
bool allowRotation_
mouse interaction position
void flyAnimationPerspectiveFinished()
Slot called when flyTo perspective Animation finished.
QPropertyAnimation * flyAnimationOrthogonal_
The animation object for flyTo.
Viewer::ViewerProperties & properties_
All properties for this viewer.
void flyAnimationPerspective(QVariant _pos)
Slot called during flyTo Animation in perspective mode.
Vec3d eye() const
get eye point
Vec3d project(const Vec3d &_point) const
project point in world coordinates to window coordinates
int viewport_height() const
get viewport height
ACG::Vec3d trackballCenter()
Get virtual trackball center (rotation center when using mouse)
ACG::Vec3d flyCenter_
The new center after the flyTo animation.
void viewChanged()
This signal is emitted whenever the view is changed by the user.
double flyOrthoWidthOriginal_
Original orthogonal width during flyTo in orthogonal mode.