62 #include "QtBaseViewer.hh"
63 #include <QPropertyAnimation>
75 size_t 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;
int viewport_width() const
get viewport width
void flyAnimationPerspective(QVariant _pos)
Slot called during flyTo Animation in perspective mode.
ACG::Vec3d flyCenter_
The new center after the flyTo animation.
Vec3d project(const Vec3d &_point) const
project point in world coordinates to window coordinates
Vec3d eye() const
get eye point
bool pick(ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, size_t &_nodeIdx, size_t &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
void translate(const ACG::Vec3d &trans)
translate the scene and update modelview matrix
void rotate(const ACG::Vec3d &axis, double angle)
rotate the scene (around its center) and update modelview matrix
virtual void makeCurrent()
Makes this widget the current widget for OpenGL operations.
void viewChanged()
This signal is emitted whenever the view is changed by the user.
double flyAngle_
The rotation angle (full angle) for fly to animation.
ACG::Vec3d trackballCenter()
Get virtual trackball center (rotation center when using mouse)
ACG::Vec3d flyAxis_
The rotation axis for fly to animation.
double sceneRadius()
Get radius of the current scene.
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.
void updateProjectionMatrix(double _aspect=0.0)
updates projection matrix
void get_viewport(int &_left, int &_bottom, int &_width, int &_height) const
get viewport
ACG::Vec3d flyTranslation_
Full translation between start and ed of animation.
double orthoWidth()
Get width of the gl scene in orthogonal projection mode (defaults to 2.0)
QPropertyAnimation * flyAnimationOrthogonal_
The animation object for flyTo.
virtual void updateGL()
Redraw scene. Triggers paint event for updating the view (cf. drawNow()).
ACG::Vec3d flyPosition_
The new position after the flyTo animation.
double trackballRadius()
Get trackball radius (rotation sphere when using mouse)
VectorT< T, 3 > transform_vector(const VectorT< T, 3 > &_v) const
transform vector (x',y',z',0) = A * (x,y,z,0)
QPropertyAnimation * flyAnimationPerspective_
The animation object for flyTo.
void flyAnimationPerspectiveFinished()
Slot called when flyTo perspective Animation finished.
int viewport_height() const
get viewport height
virtual void flyTo(const QPoint &_pos, bool _moveBack)
Animated flight to or away from a given point.
const GLMatrixd & modelview() const
get modelview matrix
void flyAnimationOrthogonal(QVariant _pos)
Slot called during flyTo Animation in orthogonal mode.
double flyOrthoWidthOriginal_
Original orthogonal width during flyTo in orthogonal mode.
VectorT< double, 3 > Vec3d
bool updatePickCache_
Should the pick cache be updated.
bool flyMoveBack_
Flag for fly in orthogonal mode if we move back or forward.
void flyAnimationOrthogonalFinished()
Slot called when flyTo orthogonal Animation finished.
VectorT< T, 3 > transform_point(const VectorT< T, 3 > &_v) const
transform point (x',y',z',1) = M * (x,y,z,1)
ACG::GLState * glstate_
Gl State.
bool allowRotation_
mouse interaction position
Vec3d unproject(const Vec3d &_winPoint) const
unproject point in window coordinates _winPoint to world coordinates
Viewer::ViewerProperties & properties_
All properties for this viewer.