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
58 #include <OpenFlipper/common/Types.hh>
59 #include <OpenFlipper/common/ViewerProperties.hh>
60
61 #include <OpenFlipper/common/OFGLWidget.hh>
62
63 #include <ACG/GL/GLState.hh>
64 #include <ACG/GL/FBO.hh>
65 #include <ACG/Scenegraph/SceneGraph.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
196 enum ProjectionMode {
197 ORTHOGRAPHIC_PROJECTION,
198 PERSPECTIVE_PROJECTION
199 };
200
202 enum NavigationMode {
203 NORMAL_NAVIGATION,
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 {
232 DONT_TOUCH_NORMALS,
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
850 ACG::Vec3d unproject(const ACG::Vec3d &pt) {
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
882 bool updatePickCache_;
883
885 ACG::SceneGraph::PickTarget pickCacheTarget_;
886
888 bool pickCacheSupported_;
889
892 //===========================================================================
895 //===========================================================================
896
897 public:
898
900 void allowRotation( bool _mode ) { allowRotation_ = _mode; };
901 bool allowRotation() { return allowRotation_; };
902
903 void allowConstrainedRotation(const ACG::Vec3d &axis) {
904 constrainedRotationAxis_ = axis;
905 }
906 bool allowConstrainedRotation() {
907 return constrainedRotationAxis_[0] == constrainedRotationAxis_[0];
908 }
909 const ACG::Vec3d &getConstrainedRotationAxis() {
910 return constrainedRotationAxis_;
911 }
912 void disallowConstrainedRotation() {
913 constrainedRotationAxis_[0] = std::numeric_limits<double>::quiet_NaN();
914 }
915 void invalidatePickCache() {
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
950 ACG::Vec3d lastPoint3D_;
951 bool lastPoint_hitSphere_;
952 bool allowRotation_;
953
954 // animation stuff
955 ACG::Vec3d lastRotationAxis_;
956 ACG::Vec3d constrainedRotationAxis_;
957 double lastRotationAngle_;
958 QTime lastMoveTime_;
959 QTimer* timer_;
960 double fovyModifier_;
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:
981 Viewer::ViewerProperties& properties_;
982
984 ACG::GLState *glstate_;
985
987 bool initialized_;
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
1049 ACG::Vec3d flyTranslation_;
1050
1052 ACG::Vec3d flyAxis_;
1053
1055 double flyAngle_;
1056
1058 double lastAnimationPos_;
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
1072 ACG::Vec3d flyCenter_;
1073
1075 ACG::Vec3d flyPosition_;
1076
1078 double flyOrthoWidthOriginal_;
1079
1081 bool flyMoveBack_;
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
1135 PostProcessing* postproc_;
1136
1137
1140 };
1141
1142
1143 //=============================================================================
1144 //=============================================================================
1145 #endif // BASEVIEWER_HH defined
1146 //=============================================================================
glViewer::near_plane
double near_plane() const
Returns a chili cheese burger.
Definition: QtBaseViewer.hh:279
glViewer::flyAnimationPerspective_
QPropertyAnimation * flyAnimationPerspective_
The animation object for flyTo.
Definition: QtBaseViewer.hh:1045
glViewer::allowRotation
void allowRotation(bool _mode)
Lock scene rotation.
Definition: QtBaseViewer.hh:900
Viewer::ViewerProperties
Definition: ViewerProperties.hh:107
glViewer::normalsMode
NormalsMode normalsMode() const
get treatment of normals
Definition: QtBaseViewer.hh:243
glViewer::unproject
ACG::Vec3d unproject(const ACG::Vec3d &pt)
Framebuffer object that holds the pick cache.
Definition: QtBaseViewer.hh:850
glViewer::viewKeyPressEvent
virtual bool viewKeyPressEvent(QKeyEvent *)
Handle key events in view mode.
Definition: QtBaseViewer.hh:743
glViewer::lockProjectionUpdate
void lockProjectionUpdate(void)
Lock update of projection matrix.
Definition: QtBaseViewer.hh:160
glViewer::setSceneCenter
void setSceneCenter(const ACG::Vec3d &_center)
Definition: QtBaseViewer.hh:679
ACG::GLState
Definition: GLState.hh:213
glViewer::clickEvent_
QMouseEvent clickEvent_
mouse interaction position
Definition: QtBaseViewer.hh:964
glViewer::updatePickCache_
bool updatePickCache_
Should the pick cache be updated.
Definition: QtBaseViewer.hh:882
glViewer::far_plane
double far_plane() const
Returns a peanut butter sandwich.
Definition: QtBaseViewer.hh:284
glViewer::NORMAL_NAVIGATION
Normal mode.
Definition: QtBaseViewer.hh:203
glViewer::ORTHOGRAPHIC_PROJECTION
orthographic
Definition: QtBaseViewer.hh:197
glViewer::copyToImage
void copyToImage(QImage &_image, GLenum _buffer=GL_BACK)
copy current framebuffer to an QImage
Definition: QtBaseViewer.hh:246
glViewer::keyPressEvent
virtual void keyPressEvent(QKeyEvent *_event)
Get keyPress events from the glArea.
Definition: QtBaseViewer.hh:726
ACG
Namespace providing different geometric functions concerning angles.
Definition: BaseObjectData.hh:68
DLLEXPORT
#define DLLEXPORT
Definition: GlobalDefines.hh:95
glViewer::rotate
void rotate(const ACG::Vec3d &axis, double angle)
rotate the scene (around its center) and update modelview matrix
Definition: QtBaseViewer.hh:342
CursorPainter
Definition: CursorPainter.hh:68
glViewer::constrainedRotationAxis_
ACG::Vec3d constrainedRotationAxis_
mouse interaction position
Definition: QtBaseViewer.hh:956
ACG::VertexArrayObject
Definition: globjects.hh:201
glViewer::flyAnimationOrthogonal_
QPropertyAnimation * flyAnimationOrthogonal_
The animation object for flyTo.
Definition: QtBaseViewer.hh:1046
ViewerProperties.hh
glViewer::navigationMode
NavigationMode navigationMode() const
get current navigation mode
Definition: QtBaseViewer.hh:215
glViewer::properties
Viewer::ViewerProperties * properties()
Returns a pointer to the Viewer Status.
Definition: QtBaseViewer.hh:976
SimpleGLGraphicsScene
Definition: simpleGLGraphicsScene.hh:77
glViewer::lastAnimationPos_
double lastAnimationPos_
The last position of the animation to compute the difference vector.
Definition: QtBaseViewer.hh:1058
OpenMesh::VectorT
Definition: Vector11T.hh:83
glViewer::flyTranslation_
ACG::Vec3d flyTranslation_
Full translation between start and ed of animation.
Definition: QtBaseViewer.hh:1049
PostProcessorInput
Definition: PostProcessorInterface.hh:54
glViewer::lastPoint3D_
ACG::Vec3d lastPoint3D_
mouse interaction position
Definition: QtBaseViewer.hh:950
glViewer::projectionMode
ProjectionMode projectionMode() const
get current projection mode
Definition: QtBaseViewer.hh:210
glViewer::lastRotationAxis_
ACG::Vec3d lastRotationAxis_
mouse interaction position
Definition: QtBaseViewer.hh:955
glViewer::flyFrom
virtual void flyFrom(const QPoint &_pos)
Animated flight.
Definition: QtBaseViewer.hh:1031
glViewer::flyCenter_
ACG::Vec3d flyCenter_
The new center after the flyTo animation.
Definition: QtBaseViewer.hh:1069
glViewer::disallowConstrainedRotation
void disallowConstrainedRotation()
mouse interaction position
Definition: QtBaseViewer.hh:912
glViewer::pickCacheTarget_
ACG::SceneGraph::PickTarget pickCacheTarget_
Pick target stored in pick cache.
Definition: QtBaseViewer.hh:885
glViewer::getConstrainedRotationAxis
const ACG::Vec3d & getConstrainedRotationAxis()
mouse interaction position
Definition: QtBaseViewer.hh:909
glViewer::NavigationMode
NavigationMode
Navigation mode.
Definition: QtBaseViewer.hh:202
ACG::SceneGraph::PickTarget
PickTarget
What target to use for picking.
Definition: PickTarget.hh:73
glViewer::keyReleaseEvent
virtual void keyReleaseEvent(QKeyEvent *_event)
Get keyRelease events from the glArea.
Definition: QtBaseViewer.hh:734
glViewer::lastRotationAngle_
double lastRotationAngle_
mouse interaction position
Definition: QtBaseViewer.hh:957
glViewer::allowConstrainedRotation
void allowConstrainedRotation(const ACG::Vec3d &axis)
mouse interaction position
Definition: QtBaseViewer.hh:903
PostProcessing
Definition: PostProcessing.hh:53
glViewer::lastMoveTime_
QTime lastMoveTime_
mouse interaction position
Definition: QtBaseViewer.hh:958
glViewer::initialized_
bool initialized_
Have the viewer gl properties been initalized.
Definition: QtBaseViewer.hh:987
glViewer::ProjectionMode
ProjectionMode
projection mode
Definition: QtBaseViewer.hh:196
glViewer::NormalsMode
NormalsMode
Automatically normalize normals?
Definition: QtBaseViewer.hh:230
glViewer::allowConstrainedRotation
bool allowConstrainedRotation()
mouse interaction position
Definition: QtBaseViewer.hh:906
glViewer::scene_radius
double scene_radius() const
Definition: QtBaseViewer.hh:699
glViewer::invalidatePickCache
void invalidatePickCache()
mouse interaction position
Definition: QtBaseViewer.hh:915
ACG::GLMatrixT< double >
glViewer::QFramebufferObjectFormat
QOpenGLFramebufferObjectFormat QFramebufferObjectFormat
Framebuffer object that holds the pick cache.
Definition: QtBaseViewer.hh:873
glViewer::unlockProjectionUpdate
void unlockProjectionUpdate(void)
Unlock update of projection matrix.
Definition: QtBaseViewer.hh:163
glViewer::ortho_width
double ortho_width() const
Get width of the gl scene in orthogonal projection mode.
Definition: QtBaseViewer.hh:289
glViewer::scene_center
const ACG::Vec3d scene_center() const
Definition: QtBaseViewer.hh:696
glViewer::cleanupEventFilter
virtual void cleanupEventFilter()
correct ??? (same function as in qt src)
Definition: QtBaseViewer.hh:528
QtGLViewerLayout
Definition: QtGLViewerLayout.hh:66
ACG::SceneGraph::BaseNode
Definition: BaseNode.hh:104
glViewer::flyPosition_
ACG::Vec3d flyPosition_
The new position after the flyTo animation.
Definition: QtBaseViewer.hh:1075
glViewer::trackBallCenter
const ACG::Vec3d trackBallCenter()
Get Trackball Center point of scene.
Definition: QtBaseViewer.hh:691
glViewer::pickCacheSupported_
bool pickCacheSupported_
Is pick caching supported.
Definition: QtBaseViewer.hh:888
glViewer::flyAngle_
double flyAngle_
The rotation angle (full angle) for fly to animation.
Definition: QtBaseViewer.hh:1055
glViewer::lastPoint2D_
QPoint lastPoint2D_
mouse interaction position
Definition: QtBaseViewer.hh:929
glViewer::mouseCache_
QFramebufferObject * mouseCache_
Framebuffer object that holds the pick cache.
Definition: QtBaseViewer.hh:879
glViewer::DONT_TOUCH_NORMALS
use provided normals as is
Definition: QtBaseViewer.hh:232
glViewer::allowRotation
bool allowRotation()
mouse interaction position
Definition: QtBaseViewer.hh:901
glViewer::lastPoint_hitSphere_
bool lastPoint_hitSphere_
mouse interaction position
Definition: QtBaseViewer.hh:951
QtGLGraphicsView
Definition: QtGLGraphicsView.hh:67
SceneGraph.hh
glViewer::fovyModifier_
double fovyModifier_
mouse interaction position
Definition: QtBaseViewer.hh:960
glViewer::setTrackBallCenter
void setTrackBallCenter(const ACG::Vec3d &_center)
Set Trackball Center point of scene.
Definition: QtBaseViewer.hh:685
glViewer::startDepth_
float startDepth_
mouse interaction depth
Definition: QtBaseViewer.hh:935
ACG::QtWidgets::QtWheel
Definition: QtWheel.hh:101
glViewer::flyOrthoWidthOriginal_
double flyOrthoWidthOriginal_
Original orthogonal width during flyTo in orthogonal mode.
Definition: QtBaseViewer.hh:1078
glViewer::flyAxis_
ACG::Vec3d flyAxis_
The rotation axis for fly to animation.
Definition: QtBaseViewer.hh:1052
glViewer::setSceneRadius
void setSceneRadius(double _radius)
Definition: QtBaseViewer.hh:701
glViewer::timer_
QTimer * timer_
mouse interaction position
Definition: QtBaseViewer.hh:959
QtGLGraphicsScene
Definition: QtGLGraphicsScene.hh:81
glViewer::aspect_ratio
double aspect_ratio() const
Returns the viewer&#39;s aspect ratio.
Definition: QtBaseViewer.hh:271
Types.hh
glViewer
Definition: QtBaseViewer.hh:126
glViewer::flyMoveBack_
bool flyMoveBack_
Flag for fly in orthogonal mode if we move back or forward.
Definition: QtBaseViewer.hh:1081
glViewer::QFramebufferObject
QOpenGLFramebufferObject QFramebufferObject
Framebuffer object that holds the pick cache.
Definition: QtBaseViewer.hh:874
glViewer::pickCache_
QFramebufferObject * pickCache_
Framebuffer object that holds the pick cache.
Definition: QtBaseViewer.hh:878
glViewer::allowRotation_
bool allowRotation_
mouse interaction position
Definition: QtBaseViewer.hh:952
glViewer::clickTime_
QTime clickTime_
mouse interaction position
Definition: QtBaseViewer.hh:963
glViewer::properties_
Viewer::ViewerProperties & properties_
All properties for this viewer.
Definition: QtBaseViewer.hh:977
glViewer::clickTimer_
QTimer clickTimer_
mouse interaction position
Definition: QtBaseViewer.hh:962
glViewer::flyTo
virtual void flyTo(const QPoint &_pos)
Animated flight.
Definition: QtBaseViewer.hh:1023
glViewer::glstate_
ACG::GLState * glstate_
Gl State.
Definition: QtBaseViewer.hh:984
glViewer::postproc_
PostProcessing * postproc_
Post-Processing executor.
Definition: QtBaseViewer.hh:1135