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 
80 //== FORWARDDECLARATIONS ======================================================
81 
82 
83 class QPushButton;
84 class QToolButton;
85 class QSplitter;
86 class QImage;
87 class QSocketNotifier;
88 class QPropertyAnimation;
89 class QFramebufferObject;
90 struct PostProcessorInput;
91 
92 
93 //== NAMESPACES ===============================================================
94 
95 //== FORWARDDECLARATIONS ======================================================
96 
97 namespace ACG {
98  namespace QtWidgets {
99  class QtWheel;
100  }
101 }
102 class QGraphicsScene;
103 class QtGLViewerLayout;
104 class QtShiftPopupMenu;
105 class CursorPainter;
106 class PostProcessing;
107 
108 
109 class QOpenGLFramebufferObject;
110 class QOpenGLFramebufferObjectFormat;
111 
112 
113 class QOpenGLDebugLogger;
114 class QOpenGLDebugMessage;
115 
116 
117 //== CLASS DEFINITION =========================================================
118 
119 
126 class DLLEXPORT glViewer : public QGraphicsWidget
127 {
128 Q_OBJECT
129 
130 //-------------------------------------------------------------- public methods
131 public:
132 
133  //--------------------------------------------------- constructor / destructor
134 
143  glViewer( QGraphicsScene* _scene,
144  OFGLWidget* _glWidget,
145  Viewer::ViewerProperties& _properties,
146  QGraphicsWidget* _parent = 0 );
147 
149  virtual ~glViewer();
150 
151  //------------------------------------------------------------- public methods
152 
153 
155  virtual void makeCurrent();
157  virtual void swapBuffers();
158 
160  void lockProjectionUpdate( void ) { projectionUpdateLocked_ = true; }
161 
163  void unlockProjectionUpdate( void ) { projectionUpdateLocked_ = false; }
164 
165  signals :
166  void functionMenuUpdate();
167 
168  void statusMessage (const QString & message, int timeout = 0);
169 
170  public:
171 
173  void trackMouse(bool _track);
174 
189  void sceneGraph(ACG::SceneGraph::BaseNode* _root,
190  unsigned int _maxPasses,
191  ACG::Vec3d _bbmin,
192  ACG::Vec3d _bbmax,
193  const bool _resetTrackBall = false);
194 
198  PERSPECTIVE_PROJECTION
199  };
200 
204  FIRSTPERSON_NAVIGATION
205  };
206 
208  void projectionMode(ProjectionMode _p);
210  ProjectionMode projectionMode() const { return projectionMode_; }
211 
213  void navigationMode(NavigationMode _n);
215  NavigationMode navigationMode() const { return navigationMode_; }
216 
221  void setScenePos( const ACG::Vec3d& _center, double _radius, const bool _resetTrackBall = false );
222 
224  void viewingDirection( const ACG::Vec3d& _dir, const ACG::Vec3d& _up );
225 
227  void lookAt(const ACG::Vec3d& _eye, const ACG::Vec3d& _center, const ACG::Vec3d& _up);
228 
230  enum NormalsMode {
237  NORMALIZE_NORMALS
238  };
239 
241  void normalsMode(NormalsMode _mode);
243  NormalsMode normalsMode() const { return normalsMode_; }
244 
246  void copyToImage( QImage& _image, GLenum _buffer=GL_BACK) {
247  copyToImage(_image, 0, 0, glWidth(), glHeight(), _buffer);
248  }
249 
251  void copyToImage( QImage& _image,
252  unsigned int _left, unsigned int _top,
253  unsigned int _width, unsigned int _height,
254  GLenum _buffer );
255 
256 
258  unsigned int glWidth() const;
260  unsigned int glHeight() const;
262  QSize glSize() const;
264  QPoint glMapFromGlobal( const QPoint& _pos ) const;
266  QPoint glMapToGlobal( const QPoint& _pos ) const;
267 
268  double field_of_view_vertical() const;
269 
271  double aspect_ratio() const {
272  if (isVisible() && glWidth() && glHeight())
273  return (double) glWidth() / (double) glHeight();
274  else
275  return 1.0;
276  }
277 
279  double near_plane() const {
280  return properties_.nearPlane();
281  }
282 
284  double far_plane() const {
285  return properties_.farPlane();
286  }
287 
289  double ortho_width() const {
290  return properties_.orthoWidth();
291  }
292 
297  void encodeView(QString& _view, const QSize& _windowSize = QSize(-1,-1),
298  const int _toolBarWidth = -1, const bool _make_c_string = false);
299 
312  static bool decodeView(const QString& _view,
313  ACG::GLMatrixd &m, ACG::GLMatrixd &p, int &pMode, double &ortho_width,
314  QSize *_windowSize = NULL,
315  int* _splitterWidth = NULL, QSize *_viewportSize = NULL);
316 
326  bool decodeView(const QString& _view, QSize *_windowSize = NULL,
327  int* _toolBarWidth = NULL, QSize *_viewportSize = NULL);
328 
330  void initModelviewMatrix();
331 
333  void grabGLArea();
334 
336  void releaseGLArea();
337 
339  void translate(const ACG::Vec3d& trans);
340 
342  void rotate(const ACG::Vec3d& axis, double angle)
343  { rotate(axis, angle, properties_.trackballCenter()); }
344 
346  void rotate(const ACG::Vec3d& axis, double angle, const ACG::Vec3d& _center);
347 
349  void setCursorPainter (CursorPainter *_cursorPainter);
350 
352  void updateCursorPosition (QPointF _scenePos);
353 
355  void moveForward();
356 
358  void moveBack();
359 
361  void strafeLeft();
362 
364  void strafeRight();
365 
366 //---------------------------------------------------------------- public slots
367 public slots:
368 
370  virtual void updateGL();
371 
373  virtual void setHome();
375  virtual void home();
377  virtual void viewAll();
378 
380  virtual void perspectiveProjection();
382  virtual void orthographicProjection();
384  virtual void toggleProjectionMode();
386  virtual void toggleNavigationMode();
387 
389  virtual void setFOVY(double _fovy);
390 
391  signals:
392 
393  void projectionModeChanged( bool _ortho );
394  void navigationModeChanged( bool _normal );
395 
396  public slots:
397 
399  virtual void setView( const ACG::GLMatrixd& _modelview,
400  const ACG::GLMatrixd& _inverse_modelview );
401 
406  void actionPasteView(QSize * _windowSize = NULL, int *_splitterWidth = NULL);
410  void actionCopyView(const QSize &_windowSize = QSize(-1,-1), const int _splitterWidth = -1,
411  const bool _make_c_string = false);
412 
413  void actionSetView(QString view);
414 
415 //-------------------------------------------------------------- public signals
416 signals:
417 
428  void signalMouseEvent(QMouseEvent*, const std::string&);
429 
431  void signalMouseEvent(QMouseEvent*);
432 
434  void signalWheelEvent(QWheelEvent*, const std::string&);
435 
439  void signalMouseEventIdentify( QMouseEvent* );
440 
444  void signalMouseEventLight( QMouseEvent* );
445 
447  void signalSceneGraphChanged(ACG::SceneGraph::BaseNode* _root);
448 
451  void signalMouseEventClick ( QMouseEvent*, bool _double );
452 
453 
454  signals:
455 
460  void signalCustomContextMenuRequested ( const QPoint & );
461 
462  private slots:
463 
465  void slotClickTimeout ();
466 
467 
468 //----------------------------------------------------------- protected methods
469 protected:
470 
471  friend class QtGLGraphicsScene;
472  friend class SimpleGLGraphicsScene;
473  friend class QtGLGraphicsView;
474 
475 
477  //virtual QSizeF sizeHint (Qt::SizeHint which, const QSizeF & constraint) const;
478 
480  virtual void initializeGL();
482  virtual void paintGL(double _aspect = 0.0);
484  virtual void resizeEvent(QGraphicsSceneResizeEvent * _e);
486  virtual void moveEvent (QGraphicsSceneMoveEvent * _e);
487 
489  virtual void mousePressEvent(QGraphicsSceneMouseEvent* _event);
491  virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* _event);
493  virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* _event);
495  virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* _event);
497  virtual void wheelEvent(QGraphicsSceneWheelEvent* _event);
499  virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent* _e);
500 
501 
503  void viewMouseEvent( QMouseEvent* _event);
505  void viewWheelEvent(QWheelEvent* _event);
507  void viewKeyEvent( QKeyEvent* _event);
508 
509 
510  protected:
511 
512 
514  void updateProjectionMatrix(double _aspect = 0.0);
515 
516 
517 //------------------------------------------------------------- protected slots
518 protected slots:
519 
521  virtual void slotWheelX(double _dAngle);
523  virtual void slotWheelY(double _dAngle);
525  virtual void slotWheelZ(double _dist);
526 
528  virtual void cleanupEventFilter()
529  { removeEventFilter( sender());}
530 
532  void processGLDebugMessage(const QOpenGLDebugMessage& msg);
533 
534 
535 //----------------------------------------------------------- private functions
536 private:
537 
539  glViewer(const glViewer&);
541  glViewer& operator=(const glViewer&);
542 
543  // create widgets
544  void createWidgets();
545 
546  /* Recursively draws each node in the scene graph.
547  Called by paintGL(). */
548  void drawScene(double _aspect = 0.0);
549  // helper called by drawScene().
550  void drawScene_mono();
552  void setCoordSysProjection(glViewer::ProjectionMode _mode);
554  void drawCursor();
555 
556  // start QOpenGLDebugLogger
557  void startGLDebugLogger();
558  void deleteGLDebugLogger();
559 
560  // wrapper for glWidget make current
561  void makeWidgetCurrent();
562 
563  // wrapper to create QFramebufferObject returns true if QFBO is valid if samples is -1 the default samples are retrieved
564  bool createQFBO(QOpenGLFramebufferObject*& _ptr, GLuint* _handle, int _width, int _height, int* _samples);
565  bool bindQFBO(QOpenGLFramebufferObject* _ptr);
566  bool QFBOResized(QOpenGLFramebufferObject* _ptr);
567  void blitQFBO(QOpenGLFramebufferObject* _ptr1, const QRect& _size1, QOpenGLFramebufferObject* _ptr2, const QRect& _size2);
568  void deleteQFBO(QOpenGLFramebufferObject* _ptr);
569 
570 
571 //-------------------------------------------------------------- protected data
572 protected:
573 
574  // helper
575  bool isRotating_;
576  bool lookAround_;
577 
578 
579 //---------------------------------------------------------------- private data
580 private:
581 
582 
583  // data stored for home view
584  ACG::Vec3d home_center_;
585  double home_radius_;
586  ACG::GLMatrixd home_modelview_,
587  home_inverse_modelview_;
588  double homeOrthoWidth_;
589 
590 
591  // modi
592  NormalsMode normalsMode_;
593  ProjectionMode projectionMode_;
594  NavigationMode navigationMode_;
595 
596 
597  // helper
598  bool trackMouse_;
599  bool glareaGrabbed_;
600  double frame_time_;
601 
602 
603  // scenegraph stuff
604  ACG::SceneGraph::BaseNode* sceneGraphRoot_;
605 
606  bool projectionUpdateLocked_;
607 
608  // graphics scene used to paint gl context and widgets
609  QGraphicsScene* glScene_;
610 
611  // gl widget used as drawing area to paint the graphics scene
612  OFGLWidget* glWidget_;
613 
614  // Base graphics widget layout
615  QtGLViewerLayout* glBaseLayout_;
616 
617  // vector of current draw mode actions
618  std::vector< QAction * > drawMenuActions_;
619 
620  // Used to calculate the time passed between redraws
621  QTime redrawTime_;
622 
623  // Default VAO needed in core profile mode
624  ACG::VertexArrayObject defaultVAO_;
625 
626  // Get additional debug info from OpenGL
627  QOpenGLDebugLogger* glDebugLogger_;
628 
629 
630  //===========================================================================
633  //===========================================================================
634 
635  public:
636  bool wheelsVisible();
637 
638  public slots:
639  void slotShowWheels();
640  void slotHideWheels();
641 
642  private:
643  // rotate around x-axis
644  ACG::QtWidgets::QtWheel* wheelX_;
645  // rotate around y-axis
646  ACG::QtWidgets::QtWheel* wheelY_;
647  // translate along z-axis
648  ACG::QtWidgets::QtWheel* wheelZ_;
649 
650 
653  //===========================================================================
656  //===========================================================================
657  signals:
659  void viewUpdated();
660 
662  void viewChanged();
663 
665  void signalMakeActive ();
666 
670  //===========================================================================
673  //===========================================================================
674 
675  public:
679  void setSceneCenter( const ACG::Vec3d& _center ) { properties_.sceneCenter(_center); };
680 
685  void setTrackBallCenter( const ACG::Vec3d& _center ) { properties_.trackballCenter(_center); }
686 
691  const ACG::Vec3d trackBallCenter( ) { return properties_.trackballCenter(); };
692 
696  const ACG::Vec3d scene_center() const { return properties_.sceneCenter(); }
699  double scene_radius() const { return properties_.sceneRadius(); }
700 
701  void setSceneRadius(double _radius) { properties_.sceneRadius(_radius); }
702 
706  //===========================================================================
709  //===========================================================================
710 
711  signals:
718  void signalKeyPressEvent(QKeyEvent*);
719 
720  protected:
721 
726  virtual void keyPressEvent(QKeyEvent* _event) { _event->ignore(); };
727 
734  virtual void keyReleaseEvent(QKeyEvent* _event) { _event->ignore(); };
735 
743  virtual bool viewKeyPressEvent(QKeyEvent* /* _event */ ) { return false; }
744 
747  //===========================================================================
750  //===========================================================================
751 
752  public:
753 
755  virtual void dragEnterEvent(QGraphicsSceneDragDropEvent* _e);
756 
758  virtual void dropEvent(QGraphicsSceneDragDropEvent* _e);
759 
760  signals:
764  void startDragEvent( QMouseEvent* _event );
765 
769  void dragEnterEvent(QDragEnterEvent* _event);
770 
774  void dropEvent( QDropEvent* _event );
775 
776 
779  //===========================================================================
782  //===========================================================================
783 
784  public slots:
785 
786 
791  virtual void snapshot(int _width = 0, int _height = 0, bool _alpha = false, bool _hideCoordsys = false, int samples = 1);
792 
794  virtual void snapshot(QImage& _image, int _width = 0, int _height = 0, bool _alpha = false, bool _hideCoordsys = false, int samples = 1);
795 
798  //===========================================================================
801  //===========================================================================
802  public:
816  bool pick( ACG::SceneGraph::PickTarget _pickTarget,
817  const QPoint& _mousePos,
818  size_t& _nodeIdx,
819  size_t& _targetIdx,
820  ACG::Vec3d* _hitPointPtr=0 );
821 
835  bool pick_region( ACG::SceneGraph::PickTarget _pickTarget,
836  const QRegion& _region,
837  QList<QPair<size_t,size_t> >& _list,
838  QVector<float>* _depths = 0,
839  QVector<ACG::Vec3d>* _points = 0);
840 
841 
847  bool fast_pick( const QPoint& _mousePos,
848  ACG::Vec3d& _hitPoint );
849 
851  return glstate_->unproject(pt);
852  }
853 
854  private:
855 
857  int pickColor( ACG::SceneGraph::PickTarget _pickTarget,
858  const QPoint& _mousePos,
859  size_t& _nodeIdx,
860  size_t& _targetIdx,
861  ACG::Vec3d* _hitPointPtr=0 );
862 
864  int pickFromCache( ACG::SceneGraph::PickTarget _pickTarget,
865  const QPoint& _mousePos,
866  size_t& _nodeIdx,
867  size_t& _targetIdx,
868  ACG::Vec3d* _hitPointPtr=0 );
869 
870  private:
871 
872 
873  typedef QOpenGLFramebufferObjectFormat QFramebufferObjectFormat;
874  typedef QOpenGLFramebufferObject QFramebufferObject;
875 
876 
878  QFramebufferObject* pickCache_;
879  QFramebufferObject* mouseCache_;
880 
883 
886 
889 
892  //===========================================================================
895  //===========================================================================
896 
897  public:
898 
900  void allowRotation( bool _mode ) { allowRotation_ = _mode; };
901  bool allowRotation() { return allowRotation_; };
902 
904  constrainedRotationAxis_ = axis;
905  }
907  return constrainedRotationAxis_[0] == constrainedRotationAxis_[0];
908  }
910  return constrainedRotationAxis_;
911  }
913  constrainedRotationAxis_[0] = std::numeric_limits<double>::quiet_NaN();
914  }
916  updatePickCache_ = true;
917  }
918 
919  private slots:
920 
921  void slotAnimation();
922 
923  protected:
924 
929  QPoint lastPoint2D_;
930 
935  float startDepth_;
936 
937  private:
938 
940  bool mapToSphere(const QPoint& _p, ACG::Vec3d& _result) const;
941 
943  void handleFirstPersonNavigation( QMouseEvent* _event);
944 
946  void handleNormalNavigation( QMouseEvent* _event);
947 
948 
949  // mouse interaction
953 
954  // animation stuff
959  QTimer* timer_;
961 
962  QTimer clickTimer_;
963  QTime clickTime_;
964  QMouseEvent clickEvent_;
965 
966 
969  //===========================================================================
972  //===========================================================================
973 
974  public:
976  Viewer::ViewerProperties* properties() { return &properties_; };
977  const Viewer::ViewerProperties* properties() const { return &properties_; };
978 
979  private:
982 
985 
988 
989  private slots:
993  void slotPropertiesUpdated();
994 
995  private:
999  void applyProperties();
1000 
1003  //===========================================================================
1006  //===========================================================================
1007  public slots:
1008 
1016  virtual void flyTo(const QPoint& _pos, bool _moveBack);
1017 
1023  virtual void flyTo(const QPoint& _pos) { flyTo(_pos,false); }
1024 
1025 
1031  virtual void flyFrom(const QPoint& _pos) { flyTo(_pos,true); }
1032 
1038  virtual void flyTo(const ACG::Vec3d& _position,
1039  const ACG::Vec3d& _center,
1040  int _time = 1000);
1041 
1042  private:
1043 
1045  QPropertyAnimation* flyAnimationPerspective_;
1046  QPropertyAnimation* flyAnimationOrthogonal_;
1047 
1050 
1053 
1055  double flyAngle_;
1056 
1059 
1060  Q_PROPERTY(double currentAnimationPosition READ currentAnimationPos WRITE currentAnimationPos NOTIFY currentAnimationPosChanged)
1061 
1062 
1063  double currentAnimationPos_;
1064 
1066  double currentAnimationPos() {return currentAnimationPos_;};
1067 
1069  void currentAnimationPos(double _currentAnimationPos) {currentAnimationPos_ = _currentAnimationPos; emit currentAnimationPosChanged(_currentAnimationPos); };
1070 
1073 
1076 
1079 
1082 
1083  signals:
1085  void currentAnimationPosChanged(double _currentAnimationPos);
1086 
1087  private slots:
1089  void flyAnimationPerspective(QVariant _pos);
1090 
1092  void flyAnimationOrthogonal(QVariant _pos);
1093 
1095  void flyAnimationPerspectiveFinished();
1096 
1098  void flyAnimationOrthogonalFinished();
1099 
1104  //===========================================================================
1107  //===========================================================================
1108 
1109 private:
1110 
1119  void computeProjStereo(int _width, int _height,
1120  Viewer::ViewerProperties& _properties,
1121  ACG::GLMatrixd* _outLeft, ACG::GLMatrixd* _outRight);
1122 
1126  //===========================================================================
1129  //===========================================================================
1130 
1131 private:
1132 
1133 
1136 
1137 
1140 };
1141 
1142 
1143 //=============================================================================
1144 //=============================================================================
1145 #endif // BASEVIEWER_HH defined
1146 //=============================================================================
ACG::Vec3d flyTranslation_
Full translation between start and ed of animation.
void invalidatePickCache()
mouse interaction position
Namespace providing different geometric functions concerning angles.
ACG::Vec3d flyCenter_
The new center after the flyTo animation.
QMouseEvent clickEvent_
mouse interaction position
const ACG::Vec3d scene_center() const
QOpenGLFramebufferObjectFormat QFramebufferObjectFormat
Framebuffer object that holds the pick cache.
void copyToImage(QImage &_image, GLenum _buffer=GL_BACK)
copy current framebuffer to an QImage
float startDepth_
mouse interaction depth
double lastRotationAngle_
mouse interaction position
double flyOrthoWidthOriginal_
Original orthogonal width during flyTo in orthogonal mode.
virtual void keyReleaseEvent(QKeyEvent *_event)
Get keyRelease events from the glArea.
QFramebufferObject * mouseCache_
Framebuffer object that holds the pick cache.
virtual void flyFrom(const QPoint &_pos)
Animated flight.
void setSceneCenter(const ACG::Vec3d &_center)
virtual bool viewKeyPressEvent(QKeyEvent *)
Handle key events in view mode.
bool allowRotation()
mouse interaction position
double ortho_width() const
Get width of the gl scene in orthogonal projection mode.
NavigationMode navigationMode() const
get current navigation mode
ACG::Vec3d constrainedRotationAxis_
mouse interaction position
ProjectionMode
projection mode
QOpenGLFramebufferObject QFramebufferObject
Framebuffer object that holds the pick cache.
bool allowConstrainedRotation()
mouse interaction position
virtual void flyTo(const QPoint &_pos)
Animated flight.
ACG::SceneGraph::PickTarget pickCacheTarget_
Pick target stored in pick cache.
void rotate(const ACG::Vec3d &axis, double angle)
rotate the scene (around its center) and update modelview matrix
bool allowRotation_
mouse interaction position
bool updatePickCache_
Should the pick cache be updated.
void unlockProjectionUpdate(void)
Unlock update of projection matrix.
QTimer * timer_
mouse interaction position
double aspect_ratio() const
Returns the viewer&#39;s aspect ratio.
ACG::GLState * glstate_
Gl State.
QPropertyAnimation * flyAnimationPerspective_
The animation object for flyTo.
bool flyMoveBack_
Flag for fly in orthogonal mode if we move back or forward.
QTime clickTime_
mouse interaction position
QPoint lastPoint2D_
mouse interaction position
ACG::Vec3d lastRotationAxis_
mouse interaction position
Viewer::ViewerProperties * properties()
Returns a pointer to the Viewer Status.
double fovyModifier_
mouse interaction position
QPropertyAnimation * flyAnimationOrthogonal_
The animation object for flyTo.
Viewer::ViewerProperties & properties_
All properties for this viewer.
const ACG::Vec3d & getConstrainedRotationAxis()
mouse interaction position
bool pickCacheSupported_
Is pick caching supported.
void lockProjectionUpdate(void)
Lock update of projection matrix.
ProjectionMode projectionMode() const
get current projection mode
virtual void keyPressEvent(QKeyEvent *_event)
Get keyPress events from the glArea.
double lastAnimationPos_
The last position of the animation to compute the difference vector.
const ACG::Vec3d trackBallCenter()
Get Trackball Center point of scene.
use provided normals as is
bool initialized_
Have the viewer gl properties been initalized.
QTime lastMoveTime_
mouse interaction position
void allowConstrainedRotation(const ACG::Vec3d &axis)
mouse interaction position
void disallowConstrainedRotation()
mouse interaction position
double flyAngle_
The rotation angle (full angle) for fly to animation.
void setSceneRadius(double _radius)
QTimer clickTimer_
mouse interaction position
double scene_radius() const
NavigationMode
Navigation mode.
QFramebufferObject * pickCache_
Framebuffer object that holds the pick cache.
PickTarget
What target to use for picking.
Definition: PickTarget.hh:73
ACG::Vec3d flyPosition_
The new position after the flyTo animation.
ACG::Vec3d unproject(const ACG::Vec3d &pt)
Framebuffer object that holds the pick cache.
double near_plane() const
Returns a chili cheese burger.
NormalsMode
Automatically normalize normals?
bool lastPoint_hitSphere_
mouse interaction position
void setTrackBallCenter(const ACG::Vec3d &_center)
Set Trackball Center point of scene.
void allowRotation(bool _mode)
Lock scene rotation.
double far_plane() const
Returns a peanut butter sandwich.
#define DLLEXPORT
PostProcessing * postproc_
Post-Processing executor.
ACG::Vec3d lastPoint3D_
mouse interaction position
virtual void cleanupEventFilter()
correct ??? (same function as in qt src)
ACG::Vec3d flyAxis_
The rotation axis for fly to animation.
NormalsMode normalsMode() const
get treatment of normals