Developer Documentation
QtBaseViewer.hh
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41 
42 
43 
44 
45 
46 
47 //=============================================================================
48 //
49 // CLASS glViewer
50 //
51 //=============================================================================
52 
53 #ifndef BASEVIEWER_HH
54 #define BASEVIEWER_HH
55 
56 //== INCLUDES =================================================================
57 
60 
61 #include <OpenFlipper/common/OFGLWidget.hh>
62 
63 #include <ACG/GL/GLState.hh>
64 #include <ACG/GL/FBO.hh>
66 #include <ACG/QtWidgets/QtSceneGraphWidget.hh>
67 
68 #include <ACG/ShaderUtils/GLSLShader.hh>
69 #include <ACG/GL/globjects.hh>
70 
71 #include <vector>
72 #include <string>
73 #include <limits>
74 
75 #include <QGraphicsWidget>
76 #include <QTimer>
77 #include <QMouseEvent>
78 #include <QTime>
79 #include <QElapsedTimer>
80 
81 //== FORWARDDECLARATIONS ======================================================
82 
83 
84 class QPushButton;
85 class QToolButton;
86 class QSplitter;
87 class QImage;
88 class QSocketNotifier;
89 class QPropertyAnimation;
90 class QFramebufferObject;
91 struct PostProcessorInput;
92 
93 
94 //== NAMESPACES ===============================================================
95 
96 //== FORWARDDECLARATIONS ======================================================
97 
98 namespace ACG {
99  namespace QtWidgets {
100  class QtWheel;
101  }
102 }
103 class QGraphicsScene;
104 class QtGLViewerLayout;
105 class QtShiftPopupMenu;
106 class CursorPainter;
107 class PostProcessing;
108 
109 
110 class QOpenGLFramebufferObject;
111 class QOpenGLFramebufferObjectFormat;
112 
113 
114 class QOpenGLDebugLogger;
115 class QOpenGLDebugMessage;
116 
117 
118 //== CLASS DEFINITION =========================================================
119 
120 
127 class DLLEXPORT glViewer : public QGraphicsWidget
128 {
129 Q_OBJECT
130 
131 //-------------------------------------------------------------- public methods
132 public:
133 
134  //--------------------------------------------------- constructor / destructor
135 
144  glViewer( QGraphicsScene* _scene,
145  OFGLWidget* _glWidget,
146  Viewer::ViewerProperties& _properties,
147  QGraphicsWidget* _parent = 0 );
148 
150  virtual ~glViewer();
151 
152  //------------------------------------------------------------- public methods
153 
154 
156  virtual void makeCurrent();
158  virtual void swapBuffers();
159 
161  void lockProjectionUpdate( void ) { projectionUpdateLocked_ = true; }
162 
164  void unlockProjectionUpdate( void ) { projectionUpdateLocked_ = false; }
165 
166  signals :
167  void functionMenuUpdate();
168 
169  void statusMessage (const QString & message, int timeout = 0);
170 
171  public:
172 
174  void trackMouse(bool _track);
175 
190  void sceneGraph(ACG::SceneGraph::BaseNode* _root,
191  unsigned int _maxPasses,
192  ACG::Vec3d _bbmin,
193  ACG::Vec3d _bbmax,
194  const bool _resetTrackBall = false);
195 
199  PERSPECTIVE_PROJECTION
200  };
201 
205  FIRSTPERSON_NAVIGATION
206  };
207 
209  void projectionMode(ProjectionMode _p);
211  ProjectionMode projectionMode() const { return projectionMode_; }
212 
214  void navigationMode(NavigationMode _n);
216  NavigationMode navigationMode() const { return navigationMode_; }
217 
222  void setScenePos( const ACG::Vec3d& _center, double _radius, const bool _resetTrackBall = false );
223 
225  void viewingDirection( const ACG::Vec3d& _dir, const ACG::Vec3d& _up );
226 
228  void lookAt(const ACG::Vec3d& _eye, const ACG::Vec3d& _center, const ACG::Vec3d& _up);
229 
231  enum NormalsMode {
238  NORMALIZE_NORMALS
239  };
240 
242  void normalsMode(NormalsMode _mode);
244  NormalsMode normalsMode() const { return normalsMode_; }
245 
247  void copyToImage( QImage& _image, GLenum _buffer=GL_BACK) {
248  copyToImage(_image, 0, 0, glWidth(), glHeight(), _buffer);
249  }
250 
252  void copyToImage( QImage& _image,
253  unsigned int _left, unsigned int _top,
254  unsigned int _width, unsigned int _height,
255  GLenum _buffer );
256 
257 
259  unsigned int glWidth() const;
261  unsigned int glHeight() const;
263  QSize glSize() const;
265  QPoint glMapFromGlobal( const QPoint& _pos ) const;
267  QPoint glMapToGlobal( const QPoint& _pos ) const;
268 
269  double field_of_view_vertical() const;
270 
272  double aspect_ratio() const {
273  if (isVisible() && glWidth() && glHeight())
274  return (double) glWidth() / (double) glHeight();
275  else
276  return 1.0;
277  }
278 
280  double near_plane() const {
281  return properties_.nearPlane();
282  }
283 
285  double far_plane() const {
286  return properties_.farPlane();
287  }
288 
290  double ortho_width() const {
291  return properties_.orthoWidth();
292  }
293 
298  void encodeView(QString& _view, const QSize& _windowSize = QSize(-1,-1),
299  const int _toolBarWidth = -1, const bool _make_c_string = false);
300 
313  static bool decodeView(const QString& _view,
314  ACG::GLMatrixd &m, ACG::GLMatrixd &p, int &pMode, double &ortho_width,
315  QSize *_windowSize = NULL,
316  int* _splitterWidth = NULL, QSize *_viewportSize = NULL);
317 
327  bool decodeView(const QString& _view, QSize *_windowSize = NULL,
328  int* _toolBarWidth = NULL, QSize *_viewportSize = NULL);
329 
331  void initModelviewMatrix();
332 
334  void grabGLArea();
335 
337  void releaseGLArea();
338 
340  void translate(const ACG::Vec3d& trans);
341 
343  void rotate(const ACG::Vec3d& axis, double angle)
344  { rotate(axis, angle, properties_.trackballCenter()); }
345 
347  void rotate(const ACG::Vec3d& axis, double angle, const ACG::Vec3d& _center);
348 
350  void setCursorPainter (CursorPainter *_cursorPainter);
351 
353  void updateCursorPosition (QPointF _scenePos);
354 
356  void moveForward();
357 
359  void moveBack();
360 
362  void strafeLeft();
363 
365  void strafeRight();
366 
367 //---------------------------------------------------------------- public slots
368 public slots:
369 
371  virtual void updateGL();
372 
374  virtual void setHome();
376  virtual void home();
378  virtual void viewAll();
379 
381  virtual void perspectiveProjection();
383  virtual void orthographicProjection();
385  virtual void toggleProjectionMode();
387  virtual void toggleNavigationMode();
388 
390  virtual void setFOVY(double _fovy);
391 
392  signals:
393 
394  void projectionModeChanged( bool _ortho );
395  void navigationModeChanged( bool _normal );
396 
397  public slots:
398 
400  virtual void setView( const ACG::GLMatrixd& _modelview,
401  const ACG::GLMatrixd& _inverse_modelview );
402 
407  void actionPasteView(QSize * _windowSize = NULL, int *_splitterWidth = NULL);
411  void actionCopyView(const QSize &_windowSize = QSize(-1,-1), const int _splitterWidth = -1,
412  const bool _make_c_string = false);
413 
414  void actionSetView(QString view);
415 
416 //-------------------------------------------------------------- public signals
417 signals:
418 
429  void signalMouseEvent(QMouseEvent*, const std::string&);
430 
432  void signalMouseEvent(QMouseEvent*);
433 
435  void signalWheelEvent(QWheelEvent*, const std::string&);
436 
440  void signalMouseEventIdentify( QMouseEvent* );
441 
445  void signalMouseEventLight( QMouseEvent* );
446 
448  void signalSceneGraphChanged(ACG::SceneGraph::BaseNode* _root);
449 
452  void signalMouseEventClick ( QMouseEvent*, bool _double );
453 
454 
455  signals:
456 
461  void signalCustomContextMenuRequested ( const QPoint & );
462 
463  private slots:
464 
466  void slotClickTimeout ();
467 
468 
469 //----------------------------------------------------------- protected methods
470 protected:
471 
472  friend class QtGLGraphicsScene;
473  friend class SimpleGLGraphicsScene;
474  friend class QtGLGraphicsView;
475 
476 
478  //virtual QSizeF sizeHint (Qt::SizeHint which, const QSizeF & constraint) const;
479 
481  virtual void initializeGL();
483  virtual void paintGL(double _aspect = 0.0);
485  virtual void resizeEvent(QGraphicsSceneResizeEvent * _e);
487  virtual void moveEvent (QGraphicsSceneMoveEvent * _e);
488 
490  virtual void mousePressEvent(QGraphicsSceneMouseEvent* _event);
492  virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* _event);
494  virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* _event);
496  virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* _event);
498  virtual void wheelEvent(QGraphicsSceneWheelEvent* _event);
500  virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent* _e);
501 
502 
504  void viewMouseEvent( QMouseEvent* _event);
506  void viewWheelEvent(QWheelEvent* _event);
508  void viewKeyEvent( QKeyEvent* _event);
509 
510 
511  protected:
512 
513 
515  void updateProjectionMatrix(double _aspect = 0.0);
516 
517 
518 //------------------------------------------------------------- protected slots
519 protected slots:
520 
522  virtual void slotWheelX(double _dAngle);
524  virtual void slotWheelY(double _dAngle);
526  virtual void slotWheelZ(double _dist);
527 
529  virtual void cleanupEventFilter()
530  { removeEventFilter( sender());}
531 
533  void processGLDebugMessage(const QOpenGLDebugMessage& msg);
534 
535 
536 //----------------------------------------------------------- private functions
537 private:
538 
540  glViewer(const glViewer&);
542  glViewer& operator=(const glViewer&);
543 
544  // create widgets
545  void createWidgets();
546 
547  /* Recursively draws each node in the scene graph.
548  Called by paintGL(). */
549  void drawScene(double _aspect = 0.0);
550  // helper called by drawScene().
551  void drawScene_mono();
553  void setCoordSysProjection(glViewer::ProjectionMode _mode);
555  void drawCursor();
556 
557  // start QOpenGLDebugLogger
558  void startGLDebugLogger();
559  void deleteGLDebugLogger();
560 
561  // wrapper for glWidget make current
562  void makeWidgetCurrent();
563 
564  // wrapper to create QFramebufferObject returns true if QFBO is valid if samples is -1 the default samples are retrieved
565  bool createQFBO(QOpenGLFramebufferObject*& _ptr, GLuint* _handle, int _width, int _height, int* _samples);
566  bool bindQFBO(QOpenGLFramebufferObject* _ptr);
567  bool QFBOResized(QOpenGLFramebufferObject* _ptr);
568  void blitQFBO(QOpenGLFramebufferObject* _ptr1, const QRect& _size1, QOpenGLFramebufferObject* _ptr2, const QRect& _size2);
569  void deleteQFBO(QOpenGLFramebufferObject* _ptr);
570 
571 
572 //-------------------------------------------------------------- protected data
573 protected:
574 
575  // helper
576  bool isRotating_;
577  bool lookAround_;
578 
579 
580 //---------------------------------------------------------------- private data
581 private:
582 
583 
584  // data stored for home view
585  ACG::Vec3d home_center_;
586  double home_radius_;
587  ACG::GLMatrixd home_modelview_,
588  home_inverse_modelview_;
589  double homeOrthoWidth_;
590 
591 
592  // modi
593  NormalsMode normalsMode_;
594  ProjectionMode projectionMode_;
595  NavigationMode navigationMode_;
596 
597 
598  // helper
599  bool trackMouse_;
600  bool glareaGrabbed_;
601  double frame_time_;
602 
603 
604  // scenegraph stuff
605  ACG::SceneGraph::BaseNode* sceneGraphRoot_;
606 
607  bool projectionUpdateLocked_;
608 
609  // graphics scene used to paint gl context and widgets
610  QGraphicsScene* glScene_;
611 
612  // gl widget used as drawing area to paint the graphics scene
613  OFGLWidget* glWidget_;
614 
615  // Base graphics widget layout
616  QtGLViewerLayout* glBaseLayout_;
617 
618  // vector of current draw mode actions
619  std::vector< QAction * > drawMenuActions_;
620 
621  // Used to calculate the time passed between redraws
622  QElapsedTimer redrawTime_;
623 
624  // Default VAO needed in core profile mode
625  ACG::VertexArrayObject defaultVAO_;
626 
627  // Get additional debug info from OpenGL
628  QOpenGLDebugLogger* glDebugLogger_;
629 
630 
631  //===========================================================================
634  //===========================================================================
635 
636  public:
637  bool wheelsVisible();
638 
639  public slots:
640  void slotShowWheels();
641  void slotHideWheels();
642 
643  private:
644  // rotate around x-axis
645  ACG::QtWidgets::QtWheel* wheelX_;
646  // rotate around y-axis
647  ACG::QtWidgets::QtWheel* wheelY_;
648  // translate along z-axis
649  ACG::QtWidgets::QtWheel* wheelZ_;
650 
651 
654  //===========================================================================
657  //===========================================================================
658  signals:
660  void viewUpdated();
661 
663  void viewChanged();
664 
666  void signalMakeActive ();
667 
671  //===========================================================================
674  //===========================================================================
675 
676  public:
680  void setSceneCenter( const ACG::Vec3d& _center ) { properties_.sceneCenter(_center); };
681 
686  void setTrackBallCenter( const ACG::Vec3d& _center ) { properties_.trackballCenter(_center); }
687 
692  const ACG::Vec3d trackBallCenter( ) { return properties_.trackballCenter(); };
693 
697  const ACG::Vec3d scene_center() const { return properties_.sceneCenter(); }
700  double scene_radius() const { return properties_.sceneRadius(); }
701 
702  void setSceneRadius(double _radius) { properties_.sceneRadius(_radius); }
703 
707  //===========================================================================
710  //===========================================================================
711 
712  signals:
719  void signalKeyPressEvent(QKeyEvent*);
720 
721  protected:
722 
727  virtual void keyPressEvent(QKeyEvent* _event) { _event->ignore(); };
728 
735  virtual void keyReleaseEvent(QKeyEvent* _event) { _event->ignore(); };
736 
744  virtual bool viewKeyPressEvent(QKeyEvent* /* _event */ ) { return false; }
745 
748  //===========================================================================
751  //===========================================================================
752 
753  public:
754 
756  virtual void dragEnterEvent(QGraphicsSceneDragDropEvent* _e);
757 
759  virtual void dropEvent(QGraphicsSceneDragDropEvent* _e);
760 
761  signals:
765  void startDragEvent( QMouseEvent* _event );
766 
770  void dragEnterEvent(QDragEnterEvent* _event);
771 
775  void dropEvent( QDropEvent* _event );
776 
777 
780  //===========================================================================
783  //===========================================================================
784 
785  public slots:
786 
787 
792  virtual void snapshot(int _width = 0, int _height = 0, bool _alpha = false, bool _hideCoordsys = false, int samples = 1);
793 
795  virtual void snapshot(QImage& _image, int _width = 0, int _height = 0, bool _alpha = false, bool _hideCoordsys = false, int samples = 1);
796 
799  //===========================================================================
802  //===========================================================================
803  public:
817  bool pick( ACG::SceneGraph::PickTarget _pickTarget,
818  const QPoint& _mousePos,
819  size_t& _nodeIdx,
820  size_t& _targetIdx,
821  ACG::Vec3d* _hitPointPtr=0 );
822 
836  bool pick_region( ACG::SceneGraph::PickTarget _pickTarget,
837  const QRegion& _region,
838  QList<QPair<size_t,size_t> >& _list,
839  QVector<float>* _depths = 0,
840  QVector<ACG::Vec3d>* _points = 0);
841 
842 
848  bool fast_pick( const QPoint& _mousePos,
849  ACG::Vec3d& _hitPoint );
850 
852  return glstate_->unproject(pt);
853  }
854 
855  private:
856 
858  int pickColor( ACG::SceneGraph::PickTarget _pickTarget,
859  const QPoint& _mousePos,
860  size_t& _nodeIdx,
861  size_t& _targetIdx,
862  ACG::Vec3d* _hitPointPtr=0 );
863 
865  int pickFromCache( ACG::SceneGraph::PickTarget _pickTarget,
866  const QPoint& _mousePos,
867  size_t& _nodeIdx,
868  size_t& _targetIdx,
869  ACG::Vec3d* _hitPointPtr=0 );
870 
871  private:
872 
873 
874  typedef QOpenGLFramebufferObjectFormat QFramebufferObjectFormat;
875  typedef QOpenGLFramebufferObject QFramebufferObject;
876 
877 
879  QFramebufferObject* pickCache_;
880  QFramebufferObject* mouseCache_;
881 
884 
887 
890 
893  //===========================================================================
896  //===========================================================================
897 
898  public:
899 
901  void allowRotation( bool _mode ) { allowRotation_ = _mode; };
902  bool allowRotation() { return allowRotation_; };
903 
905  constrainedRotationAxis_ = axis;
906  }
908  return constrainedRotationAxis_[0] == constrainedRotationAxis_[0];
909  }
911  return constrainedRotationAxis_;
912  }
914  constrainedRotationAxis_[0] = std::numeric_limits<double>::quiet_NaN();
915  }
917  updatePickCache_ = true;
918  }
919 
920  private slots:
921 
922  void slotAnimation();
923 
924  protected:
925 
930  QPoint lastPoint2D_;
931 
936  float startDepth_;
937 
938  private:
939 
941  bool mapToSphere(const QPoint& _p, ACG::Vec3d& _result) const;
942 
944  void handleFirstPersonNavigation( QMouseEvent* _event);
945 
947  void handleNormalNavigation( QMouseEvent* _event);
948 
949 
950  // mouse interaction
954 
955  // animation stuff
959  QElapsedTimer lastMoveTime_;
960  QTimer* timer_;
962 
963  QTimer clickTimer_;
964  QElapsedTimer clickTime_;
965  QMouseEvent clickEvent_;
966 
967 
970  //===========================================================================
973  //===========================================================================
974 
975  public:
977  Viewer::ViewerProperties* properties() { return &properties_; };
978  const Viewer::ViewerProperties* properties() const { return &properties_; };
979 
980  private:
983 
986 
989 
990  private slots:
994  void slotPropertiesUpdated();
995 
996  private:
1000  void applyProperties();
1001 
1004  //===========================================================================
1007  //===========================================================================
1008  public slots:
1009 
1017  virtual void flyTo(const QPoint& _pos, bool _moveBack);
1018 
1024  virtual void flyTo(const QPoint& _pos) { flyTo(_pos,false); }
1025 
1026 
1032  virtual void flyFrom(const QPoint& _pos) { flyTo(_pos,true); }
1033 
1039  virtual void flyTo(const ACG::Vec3d& _position,
1040  const ACG::Vec3d& _center,
1041  int _time = 1000);
1042 
1043  private:
1044 
1046  QPropertyAnimation* flyAnimationPerspective_;
1047  QPropertyAnimation* flyAnimationOrthogonal_;
1048 
1051 
1054 
1056  double flyAngle_;
1057 
1060 
1061  Q_PROPERTY(double currentAnimationPosition READ currentAnimationPos WRITE currentAnimationPos NOTIFY currentAnimationPosChanged)
1062 
1063 
1064  double currentAnimationPos_;
1065 
1067  double currentAnimationPos() {return currentAnimationPos_;};
1068 
1070  void currentAnimationPos(double _currentAnimationPos) {currentAnimationPos_ = _currentAnimationPos; emit currentAnimationPosChanged(_currentAnimationPos); };
1071 
1074 
1077 
1080 
1083 
1084  signals:
1086  void currentAnimationPosChanged(double _currentAnimationPos);
1087 
1088  private slots:
1090  void flyAnimationPerspective(QVariant _pos);
1091 
1093  void flyAnimationOrthogonal(QVariant _pos);
1094 
1096  void flyAnimationPerspectiveFinished();
1097 
1099  void flyAnimationOrthogonalFinished();
1100 
1105  //===========================================================================
1108  //===========================================================================
1109 
1110 private:
1111 
1120  void computeProjStereo(int _width, int _height,
1121  Viewer::ViewerProperties& _properties,
1122  ACG::GLMatrixd* _outLeft, ACG::GLMatrixd* _outRight);
1123 
1127  //===========================================================================
1130  //===========================================================================
1131 
1132 private:
1133 
1134 
1137 
1138 
1141 };
1142 
1143 
1144 //=============================================================================
1145 //=============================================================================
1146 #endif // BASEVIEWER_HH defined
1147 //=============================================================================
double near_plane() const
Returns a chili cheese burger.
QPropertyAnimation * flyAnimationPerspective_
The animation object for flyTo.
void allowRotation(bool _mode)
Lock scene rotation.
NormalsMode normalsMode() const
get treatment of normals
ACG::Vec3d unproject(const ACG::Vec3d &pt)
Framebuffer object that holds the pick cache.
virtual bool viewKeyPressEvent(QKeyEvent *)
Handle key events in view mode.
void lockProjectionUpdate(void)
Lock update of projection matrix.
void setSceneCenter(const ACG::Vec3d &_center)
QMouseEvent clickEvent_
mouse interaction position
bool updatePickCache_
Should the pick cache be updated.
double far_plane() const
Returns a peanut butter sandwich.
void copyToImage(QImage &_image, GLenum _buffer=GL_BACK)
copy current framebuffer to an QImage
virtual void keyPressEvent(QKeyEvent *_event)
Get keyPress events from the glArea.
Namespace providing different geometric functions concerning angles.
#define DLLEXPORT
void rotate(const ACG::Vec3d &axis, double angle)
rotate the scene (around its center) and update modelview matrix
ACG::Vec3d constrainedRotationAxis_
mouse interaction position
QPropertyAnimation * flyAnimationOrthogonal_
The animation object for flyTo.
NavigationMode navigationMode() const
get current navigation mode
Viewer::ViewerProperties * properties()
Returns a pointer to the Viewer Status.
double lastAnimationPos_
The last position of the animation to compute the difference vector.
ACG::Vec3d flyTranslation_
Full translation between start and ed of animation.
ACG::Vec3d lastPoint3D_
mouse interaction position
ProjectionMode projectionMode() const
get current projection mode
ACG::Vec3d lastRotationAxis_
mouse interaction position
virtual void flyFrom(const QPoint &_pos)
Animated flight.
ACG::Vec3d flyCenter_
The new center after the flyTo animation.
void disallowConstrainedRotation()
mouse interaction position
ACG::SceneGraph::PickTarget pickCacheTarget_
Pick target stored in pick cache.
const ACG::Vec3d & getConstrainedRotationAxis()
mouse interaction position
NavigationMode
Navigation mode.
PickTarget
What target to use for picking.
Definition: PickTarget.hh:73
virtual void keyReleaseEvent(QKeyEvent *_event)
Get keyRelease events from the glArea.
double lastRotationAngle_
mouse interaction position
void allowConstrainedRotation(const ACG::Vec3d &axis)
mouse interaction position
bool initialized_
Have the viewer gl properties been initalized.
ProjectionMode
projection mode
NormalsMode
Automatically normalize normals?
bool allowConstrainedRotation()
mouse interaction position
double scene_radius() const
void invalidatePickCache()
mouse interaction position
QOpenGLFramebufferObjectFormat QFramebufferObjectFormat
Framebuffer object that holds the pick cache.
void unlockProjectionUpdate(void)
Unlock update of projection matrix.
double ortho_width() const
Get width of the gl scene in orthogonal projection mode.
const ACG::Vec3d scene_center() const
virtual void cleanupEventFilter()
correct ??? (same function as in qt src)
QElapsedTimer lastMoveTime_
mouse interaction position
ACG::Vec3d flyPosition_
The new position after the flyTo animation.
const ACG::Vec3d trackBallCenter()
Get Trackball Center point of scene.
bool pickCacheSupported_
Is pick caching supported.
double flyAngle_
The rotation angle (full angle) for fly to animation.
QPoint lastPoint2D_
mouse interaction position
QFramebufferObject * mouseCache_
Framebuffer object that holds the pick cache.
use provided normals as is
bool allowRotation()
mouse interaction position
bool lastPoint_hitSphere_
mouse interaction position
double fovyModifier_
mouse interaction position
void setTrackBallCenter(const ACG::Vec3d &_center)
Set Trackball Center point of scene.
float startDepth_
mouse interaction depth
double flyOrthoWidthOriginal_
Original orthogonal width during flyTo in orthogonal mode.
ACG::Vec3d flyAxis_
The rotation axis for fly to animation.
void setSceneRadius(double _radius)
QTimer * timer_
mouse interaction position
double aspect_ratio() const
Returns the viewer&#39;s aspect ratio.
QElapsedTimer clickTime_
mouse interaction position
bool flyMoveBack_
Flag for fly in orthogonal mode if we move back or forward.
QOpenGLFramebufferObject QFramebufferObject
Framebuffer object that holds the pick cache.
QFramebufferObject * pickCache_
Framebuffer object that holds the pick cache.
bool allowRotation_
mouse interaction position
Viewer::ViewerProperties & properties_
All properties for this viewer.
QTimer clickTimer_
mouse interaction position
virtual void flyTo(const QPoint &_pos)
Animated flight.
ACG::GLState * glstate_
Gl State.
PostProcessing * postproc_
Post-Processing executor.