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