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 // CLASS QtBaseViewer
49 //
50 //=============================================================================
51
52 #ifndef ACG_QTBASEVIEWER_HH
53 #define ACG_QTBASEVIEWER_HH
54
55 //== INCLUDES =================================================================
56
57
58 #include "../Scenegraph/DrawModes.hh"
59 #include "../Config/ACGDefines.hh"
60 #include "../Math/VectorT.hh"
61 #include "../Math/GLMatrixT.hh"
62 #include "../Scenegraph/PickTarget.hh"
63 #include "../GL/gl.hh"
64
65 #include <QBoxLayout>
66 #include <QtNetwork/QUdpSocket>
67 #include <QWheelEvent>
68 #include <QKeyEvent>
69 #include <QDropEvent>
70 #include <QContextMenuEvent>
71 #include <QDragEnterEvent>
72 #include <QMouseEvent>
73 #include <QAction>
74 #include <QSize>
75 #include <QMap>
76 #include <QString>
77 #include <QMenu>
78 #include <QToolBar>
79 #include <QTime>
80
81 #include <vector>
82 #include <string>
83
84
85 //== FORWARDDECLARATIONS ======================================================
86
87
88 class QPushButton;
89 class QToolButton;
90 class QStatusBar;
91 class QSplitter;
92 class QTimer;
93 class QImage;
94 class QSocketNotifier;
95 class QGraphicsWidget;
96 class QGraphicsGridLayout;
97 class QGLFormat;
98 class QGLWidget;
99
100 //== NAMESPACES ===============================================================
101
102 namespace ACG {
103 class GLState;
104 namespace SceneGraph {
105 class BaseNode;
106 }
107 namespace QtWidgets {
108
109
110 //== FORWARDDECLARATIONS ======================================================
111
112
113 class QtWheel;
114 class QtGLGraphicsScene;
115 class QtGLGraphicsView;
116 class QtSceneGraphDialog;
117 class QtShiftPopupMenu;
118
119 //== CLASS DEFINITION =========================================================
120
121
129 class ACGDLLEXPORT QtBaseViewer : public QWidget
130 {
131 Q_OBJECT
132
133 //-------------------------------------------------------------- public methods
134 public:
135
139 enum Options {
141 Nothing=0,
142
149 ShowPrivateStatusBar=1,
150
160 ShowToolBar=2,
161
163 ShowPickButton=4,
165 ShowLassoButton=8,
167 ShowQuestionButton=0x10,
168
170 ShowWheelX=0x20,
172 ShowWheelY=0x40,
176 ShowWheelZ=0x80,
177
179 ShowWheels=0xe0,
180
182 DefaultOptions = 0xffff & (~ShowPrivateStatusBar)
183 };
184
185
186
187
188 //--------------------------------------------------- constructor / destructor
189
199 QtBaseViewer( QWidget* _parent=0,
200 const char* _name=0,
201 QStatusBar *_statusBar=0,
202 const QGLFormat* _format=0,
203 const QtBaseViewer* _share=0,
204 Options _options=DefaultOptions );
205
207 virtual ~QtBaseViewer();
208
209
210
211
212
213 //------------------------------------------------------------- public methods
214
215 virtual QSize sizeHint () const;
216
218 QStatusBar* statusBar() { return statusbar_; }
227 void setStatusBar(QStatusBar* _sb);
228
230 void applyOptions(int _options);
232 int options() const { return options_; }
233
234
236 virtual void makeCurrent();
238 virtual void swapBuffers();
239
240
242 GLState& glState() { return *glstate_; }
243
244
248 void backgroundColor(const Vec4f& _color);
250 Vec4f backgroundColor();
251
252
258 virtual void lockUpdate();
260 virtual void unlockUpdate();
265 virtual void unlockAndUpdate();
268 bool isUpdateLocked() const { return updateLocked_; }
269
270
272 void lockProjectionUpdate( void ) { projectionUpdateLocked_ = true; }
273
275 void unlockProjectionUpdate( void ) { projectionUpdateLocked_ = false; }
276
278 bool animation() const { return animation_; }
280 void animation(bool _b);
281
283 void trackMouse(bool _track);
284
286 void enablePopupMenu(bool _enable);
287
288
289
290
291
292
294 SceneGraph::BaseNode* sceneGraph() { return sceneGraphRoot_; }
296 const SceneGraph::BaseNode* sceneGraph() const { return sceneGraphRoot_; }
306 void sceneGraph(SceneGraph::BaseNode* _root);
307
309 enum NavigationMode {
310 NORMAL_NAVIGATION,
311 FIRSTPERSON_NAVIGATION
312 };
313
315 enum ProjectionMode {
316 ORTHOGRAPHIC_PROJECTION,
317 PERSPECTIVE_PROJECTION
318 };
319
321 void projectionMode(ProjectionMode _p);
323 ProjectionMode projectionMode() const { return projectionMode_; }
324
326 void navigationMode(NavigationMode _n);
328 NavigationMode navigationMode() const { return navigationMode_; }
329
334 void setScenePos( const ACG::Vec3d& _center, double _radius, const bool _setCenter = true );
335
339 void setSceneCenter( const ACG::Vec3d& _center );
340
344 const ACG::Vec3d& scene_center() const { return scene_center_; }
348 double scene_radius() const { return scene_radius_; }
349
350 void setSceneRadius(double radius) { scene_radius_ = radius; }
351
353 void viewingDirection( const ACG::Vec3d& _dir, const ACG::Vec3d& _up );
354
356 void setFovy( double _fovy );
357
359 enum ActionMode {
360 // examine geometry, get transformations from mouse events
361 ExamineMode,
365 PickingMode,
366 // same as picking, but emit signalMouseEventIdentify()
367 QuestionMode,
368 // Ligh rotation mode
369 LightMode
370 };
371
372
378 void actionMode(ActionMode);
379
381 ActionMode lastActionMode(){ return lastActionMode_; };
382
384 ActionMode actionMode() const { return actionMode_; }
385
386
388 enum FaceOrientation {
389 CCW_ORIENTATION,
390 CW_ORIENTATION
391 };
392
394 void faceOrientation(FaceOrientation);
396 FaceOrientation faceOrientation() const { return faceOrientation_; }
397
399 void backFaceCulling( bool _b );
401 bool backFaceCulling() const { return backFaceCulling_; }
402
404 void twoSidedLighting( bool _b );
406 bool twoSidedLighting() const { return twoSidedLighting_; }
407
409 enum NormalsMode {
411 DONT_TOUCH_NORMALS,
416 NORMALIZE_NORMALS
417 };
418
420 void normalsMode(NormalsMode _mode);
422 NormalsMode normalsMode() const { return normalsMode_; }
423
424
426 GLMatrixd& light_matrix() { return light_matrix_; }
428 void rotate_lights(Vec3d& _axis, double _angle);
430 void update_lights();
431
432
434 void copyToImage( QImage& _image, GLenum _buffer=GL_BACK) {
435 copyToImage(_image, 0, 0, glWidth(), glHeight(), _buffer);
436 }
437
439 void copyToImage( QImage& _image,
440 unsigned int _left, unsigned int _top,
441 unsigned int _width, unsigned int _height,
442 GLenum _buffer );
443
444
446 unsigned int glWidth() const;
448 unsigned int glHeight() const;
450 QSize glSize() const;
452 QPoint glMapFromGlobal( const QPoint& _pos ) const;
454 QPoint glMapToGlobal( const QPoint& _pos ) const;
455
456
458 void drawMode(ACG::SceneGraph::DrawModes::DrawMode _mode)
459 {
460 curDrawMode_=_mode;
461 updatePopupMenu();
462 }
463
465 ACG::SceneGraph::DrawModes::DrawMode drawMode() { return curDrawMode_; }
466
468 void encodeView(QString& _view);
473 bool decodeView(const QString& _view);
474
476 void initModelviewMatrix();
477
478 // get all Mouse & Key Events for GlWidget
479 void grabGLArea();
480
481 // undo grabbing GLArea
482 void releaseGLArea();
483
485 void drawBlendedObjects(bool _status) { blending_ = _status; }
486
488 void translate(const Vec3d& trans);
489
491 void rotate(const Vec3d& axis, double angle)
492 { rotate(axis, angle, trackball_center_); }
493
495 void rotate(const Vec3d& axis, double angle, const Vec3d& _center);
496
498 QMenu * getPickMenu() { return pickMenu_; };
499 QMenu * getFuncMenu() { return funcMenu_; };
500 QMenu * getDrawMenu() { return drawMenu_; };
501
503 QToolBar* getToolBar();
504
506 QToolBar* removeToolBar();
507
509 void moveForward();
510
512 void moveBack();
513
515 void strafeLeft();
516
518 void strafeRight();
519
520 //---------------------------------------------------------------- public slots
521 public slots:
522
528 virtual void drawNow();
530 virtual void updateGL();
531
533 virtual void setHome();
535 virtual void home();
537 virtual void viewAll();
539 virtual void flyTo(const QPoint& _pos, bool _move_back);
541 virtual void flyTo(const QPoint& _pos) { flyTo(_pos,false); }
543 virtual void flyFrom(const QPoint& _pos) { flyTo(_pos,true); }
544
550 virtual void flyTo(const Vec3d& _position,
551 const Vec3d& _center,
552 double _time = 1000.0);
553
555 virtual void examineMode() { actionMode(ExamineMode); }
557 virtual void lightMode() { actionMode(LightMode); }
559 virtual void questionMode() { actionMode(QuestionMode); }
560
562 virtual void perspectiveProjection();
564 virtual void orthographicProjection();
566 virtual void toggleProjectionMode();
568 virtual void toggleNavigationMode();
569
570 signals:
571
572 void projectionModeChanged( bool _ortho );
573 void navigationModeChanged( bool _normal );
574
575 public slots:
576
578 virtual void showSceneGraphDialog();
579
581 virtual void setView( const GLMatrixd& _modelview,
582 const GLMatrixd& _inverse_modelview );
583
584 void actionBackground();
585 void actionCopyView();
586 void actionPasteView();
587 void actionPasteDropSize();
588 void actionSynchronize();
589 void actionAnimation();
590 void actionBackfaceCulling();
591 void actionTwoSidedLighting();
592 void actionSynchronize(bool _enable);
593 void actionAnimation(bool _enable);
594 void actionBackfaceCulling(bool _enable);
595 void actionTwoSidedLighting(bool _enable);
596
597 void actionDrawMenu( QAction * _action );
598 void actionPickMenu( QAction * _action );
599
600
601
602
603 //-------------------------------------------------------------- public signals
604 signals:
605
607 void signalInitializeGL();
608
619 void signalMouseEvent(QMouseEvent*, const std::string&);
620
622 void signalMouseEvent(QMouseEvent*);
623
625 void signalWheelEvent(QWheelEvent*, const std::string&);
626
630 void signalMouseEventIdentify( QMouseEvent* );
631
632
634 void signalSetView( const GLMatrixd& _modelview,
635 const GLMatrixd& _inverse_modelview );
637 void signalSceneGraphChanged(ACG::SceneGraph::BaseNode* _root);
639 void signalNodeChanged(ACG::SceneGraph::BaseNode* _node);
641 void signalActionModeChanged(ACG::QtWidgets::QtBaseViewer::ActionMode _m);
643 void signalDrawScene(ACG::GLState* _state);
644
645
646 signals:
647
652 void signalCustomContextMenuRequested ( const QPoint & );
653
654
655 //----------------------------------------------------------- protected methods
656 protected:
657
658 friend class QtGLGraphicsScene;
659 friend class QtGLGraphicsView;
660
662 virtual void initializeGL();
664 virtual void paintGL();
666 virtual void resizeGL(int _w, int _h);
667
668
670 virtual void glMousePressEvent(QMouseEvent* _event);
672 virtual void glMouseDoubleClickEvent(QMouseEvent* _event);
674 virtual void glMouseMoveEvent(QMouseEvent* _event);
676 virtual void glMouseReleaseEvent(QMouseEvent* _event);
678 virtual void glMouseWheelEvent(QWheelEvent* _event);
680 virtual void glContextMenuEvent(QContextMenuEvent* _event);
681
682
684 virtual void viewMouseEvent( QMouseEvent* _event) = 0;
686 virtual void viewWheelEvent(QWheelEvent* _event) = 0;
687
689 virtual void lightMouseEvent( QMouseEvent* /* _event */ ) {}
690
691
692 protected:
693
694
696 void updateProjectionMatrix();
698 void updatePickMenu();
699
700
701
702 //------------------------------------------------------------- protected slots
703 protected slots:
704
706 virtual void sceneRectChanged(const QRectF & rect);
707
709 virtual void slotWheelX(double _dAngle);
711 virtual void slotWheelY(double _dAngle);
713 virtual void slotWheelZ(double _dist);
714
716 virtual void slotNodeChanged(ACG::SceneGraph::BaseNode* _node);
717
719 virtual void cleanupEventFilter()
720 { removeEventFilter( sender());}
721
722
723
724 //--------------------------------------------------------------- private slots
725 private slots:
726
727 void hidePopupMenus();
728
729 //----------------------------------------------------------- private functions
730 private:
731
732 // IDs for \c funcMenu_
733 enum FuncMenuID {
734 M_CopyView=0x100,
735 M_PasteView,
736 M_PasteDropSize,
737 M_Animation,
738 M_BackfaceCulling,
739 M_TwoSidedLighting,
740 M_Background,
741 M_Snapshot,
742 M_SnapshotName,
743 M_SnapshotSavesView,
744 M_Synchronize
745 };
746
748 QtBaseViewer(const QtBaseViewer&);
750 QtBaseViewer& operator=(const QtBaseViewer&);
751
752 // create widgets
753 void createWidgets(const QGLFormat* _format,QStatusBar* _sb,
754 const QtBaseViewer* _share);
755
756 /* Recursively draws each node in the scene graph.
757 Called by paintGL(). */
758 void drawScene();
759 // helper called by drawScene().
760 void drawScene_mono();
761 // helper called by drawScene() when stereo viewing is active.
762 void drawScene_stereo();
763
764 // helper to check openGL support
765 bool hasOpenGL();
766
767 // updates popup menu with the available draw modes
768 void updatePopupMenu();
769
770 //-------------------------------------------------------------- protected data
771 protected:
772
773
774 // scene center and radius
775 Vec3d scene_center_, trackball_center_;
776 double scene_radius_, trackball_radius_;
777
778
779 // projection stuff
780 GLdouble orthoWidth_;
781 GLdouble near_, far_, fovy_;
782
783
784 // scenegraph
785 GLState *glstate_;
786
787
788 // helper
789 bool isRotating_;
790
791
792 // current status bar, guaranteed to be !=0
793 QStatusBar* statusbar_;
794
795
796
797 //---------------------------------------------------------------- private data
798 private:
799
800
801 // data stored for home view
802 Vec3d home_center_;
803 double home_radius_;
804 GLMatrixd home_modelview_,
805 home_inverse_modelview_;
806 double homeOrthoWidth_;
807
808
809 // matrix for rotating light position
810 GLMatrixd light_matrix_;
811
812
813 // modi
814 NormalsMode normalsMode_;
815 FaceOrientation faceOrientation_;
816 ProjectionMode projectionMode_;
817 NavigationMode navigationMode_;
818
819 ActionMode actionMode_, lastActionMode_;
820 bool backFaceCulling_;
821 bool twoSidedLighting_;
822 bool animation_;
823
824 // helper
825 bool trackMouse_;
826 bool popupEnabled_;
827 bool glareaGrabbed_;
828 double frame_time_;
829
830
831 QMenu * pickMenu_;
832 QMenu * funcMenu_;
833 QMenu * drawMenu_;
834
835 // scenegraph stuff
836 SceneGraph::BaseNode* sceneGraphRoot_;
837
838 ACG::SceneGraph::DrawModes::DrawMode curDrawMode_,
839 availDrawModes_;
840
841 bool updateLocked_;
842 bool projectionUpdateLocked_;
843 bool blending_;
844
845
846 // widget showing the scenegraph
847 QtSceneGraphDialog* sceneGraphDialog_;
848
849
850
851 // options
852 Options options_;
853 // gl widget used as drawing area to paint the graphics scene
854 QGLWidget* glWidget_;
855 // graphics scene used to paint gl context and widgets
856 QtGLGraphicsScene* glScene_;
857 // graphics view that holds the gl scene
858 QtGLGraphicsView* glView_;
859
860 // Base graphics widget for wheels in the scene
861 QGraphicsWidget* glBase_;
862 // Base graphics widget layout
863 QGraphicsGridLayout* glBaseLayout_;
864
865 // private status bar, 0 if status bar is provided externally
866 QStatusBar* privateStatusBar_;
867
868 // Layout for the basic widget ( viewer + wheels )
869 QGridLayout* glLayout_;
870
871 // tool bar
872 QToolBar * buttonBar_;
873
874 // set pick mode
875 QToolButton* pickButton_;
876 // set move mode
877 QToolButton* moveButton_;
878 // set light mode
879 QToolButton* lightButton_;
880 // set question mode
881 QToolButton* questionButton_;
882 // change projection mode (perspective/orthographic)
883 QToolButton* projectionButton_;
884 // go to home() position
885 QToolButton* homeButton_;
886 // setHome()
887 QToolButton* setHomeButton_;
888 // viewAll()
889 QToolButton* viewAllButton_;
890 // show sceneGraphDialog_
891 QToolButton* sceneGraphButton_;
892 // enable/disable stereo viewing
893 QToolButton* stereoButton_;
894
895 // rotate around x-axis
896 QtWheel* wheelX_;
897 // rotate around y-axis
898 QtWheel* wheelY_;
899 // translate along z-axis
900 QtWheel* wheelZ_;
901
902 // all actions
903 QMap< QString, QAction * > action_;
904
905 // vector of current draw mode actions
906 std::vector< QAction * > drawMenuActions_;
907
908 // Used to calculate the time passed between redraws
909 QTime redrawTime_;
910
911 //===========================================================================
914 //===========================================================================
915 signals:
917 void viewUpdated();
918
920 void viewChanged();
921
924 //===========================================================================
927 //===========================================================================
928
929 public slots:
930
932 virtual void toggleStereoMode();
933
935 virtual void setStereoMode(bool _b);
936
937 public:
942 void setEyeDistance(double _distance);
943
945 double eyeDistance( );
946
951 void setFocalDistance(double _distance);
952
954 double focalDistance( );
955
956 private:
957 // stereo stuff
958 bool stereo_;
959 double eyeDist_, focalDist_;
960
961
965 //===========================================================================
968 //===========================================================================
969
970 signals:
977 void signalKeyPressEvent(QKeyEvent*);
978
979 public:
985 void disableKeyHandling(bool _state );
986
990 bool keyHandlingState();
991
992 protected:
993
998 virtual void glKeyPressEvent(QKeyEvent*);
999
1006 virtual void glKeyReleaseEvent(QKeyEvent* _event);
1007
1015 virtual bool viewKeyPressEvent(QKeyEvent* _event) = 0;
1016
1017 private:
1018 bool disableKeyHandling_;
1019
1022 //===========================================================================
1025 //===========================================================================
1026
1027 protected:
1028
1030 virtual void startDrag();
1032 virtual void glDragEnterEvent(QDragEnterEvent* _event);
1034 virtual void glDropEvent(QDropEvent* _event);
1035
1036 public:
1038 void setExternalDrag( bool _external ) { externalDrag_ = _external; };
1039
1040 signals:
1044 void startDragEvent( QMouseEvent* _event );
1045
1049 void dragEnterEvent(QDragEnterEvent* _event);
1050
1054 void dropEvent( QDropEvent* _event );
1055
1056 private:
1057
1061 bool externalDrag_;
1062
1066 //===========================================================================
1069 //===========================================================================
1070
1071 public:
1076 void sync_connect(const QtBaseViewer*);
1077
1079 void sync_disconnect(const QtBaseViewer*);
1080
1082 virtual void setSynchronization(bool _b);
1083
1085 bool add_sync_host(const QString& _name);
1087 void add_sync_host(QHostAddress& _adr);
1088
1089 bool synchronization();
1090
1091 private slots:
1092
1093 void sync_receive();
1094 void sync_send(const GLMatrixd& _modelview,
1095 const GLMatrixd& _inverse_modelview);
1096
1097 private:
1099 bool synchronized_;
1100
1102 bool skipNextSync_;
1103
1105 QUdpSocket * socket_;
1106
1108 std::vector<QHostAddress> sync_hosts_;
1109
1112 //===========================================================================
1115 //===========================================================================
1116
1117 public slots:
1129 virtual void snapshotBaseFileName(const QString& _fname);
1130
1135 virtual void snapshot();
1136
1139 void actionSnapshot();
1140
1143 void actionSnapshotName();
1144
1147 void actionSnapshotSavesView();
1148
1149 private:
1150
1151 QString snapshotName_;
1152 int snapshotCounter_;
1153 QImage* snapshot_;
1154
1157 //===========================================================================
1160 //===========================================================================
1161 public:
1175 bool pick( SceneGraph::PickTarget _pickTarget,
1176 const QPoint& _mousePos,
1177 unsigned int& _nodeIdx,
1178 unsigned int& _targetIdx,
1179 Vec3d* _hitPointPtr=0 );
1180
1186 bool fast_pick( const QPoint& _mousePos,
1187 Vec3d& _hitPoint );
1188
1197 void addPickMode(const std::string& _name,
1198 bool _mouse_tracking = false,
1199 int _pos = -1,
1200 bool _visible = true,
1201 QCursor _cursor = Qt::ArrowCursor );
1202
1205 void clearPickModes();
1206
1209 const std::string& pickMode() const;
1210
1214 void pickMode(const std::string& _name);
1215
1219 void pickMode( int _id );
1220
1225 void renderPicking(bool _renderPicking, ACG::SceneGraph::PickTarget _mode);
1226
1227 public slots:
1228
1232 virtual void pickingMode();
1233
1239 void setPickModeCursor(const std::string& _name, QCursor _cursor);
1240
1246 void setPickModeMouseTracking(const std::string& _name, bool _mouseTracking);
1247
1248 signals:
1251 void signalPickModeChanged(const std::string&);
1252
1253 private:
1254
1257 struct PickMode
1258 {
1260 PickMode(const std::string& _n, bool _t, bool _v, QCursor _c) :
1261 name(_n), tracking(_t), visible(_v), cursor(_c) {}
1262
1265 std::string name;
1266
1269 bool tracking;
1270
1273 bool visible;
1274
1277 QCursor cursor;
1278 };
1279
1282 std::vector<PickMode> pick_modes_;
1283
1286 std::string pick_mode_name_;
1287
1290 int pick_mode_idx_;
1291
1294 bool renderPicking_;
1295
1300 ACG::SceneGraph::PickTarget pickRendererMode_;
1301
1303 };
1304
1305
1306 //=============================================================================
1307 } // namespace QtWidgets
1308 } // namespace ACG
1309 //=============================================================================
1310 #endif // ACG_QTBASEVIEWER_HH defined
1311 //=============================================================================
ACG::QtWidgets::QtBaseViewer::Options
Options
Definition: QtBaseViewer.hh:139
ACG::QtWidgets::QtBaseViewer::PickMode::PickMode
PickMode(const std::string &_n, bool _t, bool _v, QCursor _c)
Constructor.
Definition: QtBaseViewer.hh:1260
ACG::QtWidgets::QtBaseViewer::ProjectionMode
ProjectionMode
projection mode
Definition: QtBaseViewer.hh:315
ACG::QtWidgets::QtBaseViewer::flyFrom
virtual void flyFrom(const QPoint &_pos)
Fly to, get more distant.
Definition: QtBaseViewer.hh:543
ACG::QtWidgets::QtBaseViewer::PickMode::tracking
bool tracking
Definition: QtBaseViewer.hh:1269
ACG::QtWidgets::QtBaseViewer::FaceOrientation
FaceOrientation
orientation of the faces
Definition: QtBaseViewer.hh:388
ACG
Namespace providing different geometric functions concerning angles.
Definition: BaseObjectData.hh:68
ACG::QtWidgets::QtBaseViewer::ORTHOGRAPHIC_PROJECTION
orthographic
Definition: QtBaseViewer.hh:316
QtGLGraphicsScene
Definition: QtGLGraphicsScene.hh:81
ACG::QtWidgets::QtBaseViewer::lightMouseEvent
virtual void lightMouseEvent(QMouseEvent *)
optional: hande mouse events to rotate light
Definition: QtBaseViewer.hh:689
ACG::QtWidgets::QtBaseViewer::glState
GLState & glState()
get OpenGL state
Definition: QtBaseViewer.hh:242
ACG::QtWidgets::QtBaseViewer::pick_modes_
std::vector< PickMode > pick_modes_
Definition: QtBaseViewer.hh:1282
ACG::QtWidgets::QtBaseViewer::snapshotName_
QString snapshotName_
Definition: QtBaseViewer.hh:1151
ACG::QtWidgets::QtBaseViewer::sync_hosts_
std::vector< QHostAddress > sync_hosts_
List of hosts which should receive sync information.
Definition: QtBaseViewer.hh:1108
ACG::QtWidgets::QtBaseViewer::synchronized_
bool synchronized_
synchronized with different viewer?
Definition: QtBaseViewer.hh:1099
ACG::QtWidgets::QtBaseViewer::isUpdateLocked
bool isUpdateLocked() const
Definition: QtBaseViewer.hh:268
ACG::QtWidgets::QtBaseViewer::cleanupEventFilter
virtual void cleanupEventFilter()
correct ??? (same function as in qt src)
Definition: QtBaseViewer.hh:719
ACG::QtWidgets::QtBaseViewer::NavigationMode
NavigationMode
Navigation mode.
Definition: QtBaseViewer.hh:309
ACG::QtWidgets::QtBaseViewer::externalDrag_
bool externalDrag_
Definition: QtBaseViewer.hh:1061
ACG::QtWidgets::QtBaseViewer::renderPicking_
bool renderPicking_
Definition: QtBaseViewer.hh:1294
ACG::QtWidgets::QtBaseViewer::statusBar
QStatusBar * statusBar()
get status bar, guaranteed to be not 0 (QStatusBar may be invisible)
Definition: QtBaseViewer.hh:218
ACG::QtWidgets::QtWheel
Definition: QtWheel.hh:101
ACG::QtWidgets::QtSceneGraphDialog
Definition: QtSceneGraphWidget.hh:266
ACG::QtWidgets::QtBaseViewer::rotate
void rotate(const Vec3d &axis, double angle)
rotate the scene (around its center) and update modelview matrix
Definition: QtBaseViewer.hh:491
ACG::QtWidgets::QtBaseViewer::NormalsMode
NormalsMode
Automatically normalize normals?
Definition: QtBaseViewer.hh:409
ACG::QtWidgets::QtBaseViewer::normalsMode
NormalsMode normalsMode() const
get treatment of normals
Definition: QtBaseViewer.hh:422
ACG::QtWidgets::QtBaseViewer::navigationMode
NavigationMode navigationMode() const
get current navigation mode
Definition: QtBaseViewer.hh:328
ACG::QtWidgets::QtBaseViewer::copyToImage
void copyToImage(QImage &_image, GLenum _buffer=GL_BACK)
copy current framebuffer to an QImage
Definition: QtBaseViewer.hh:434
ACG::QtWidgets::QtBaseViewer::setExternalDrag
void setExternalDrag(bool _external)
Enable or disable external dragging controls.
Definition: QtBaseViewer.hh:1038
ACG::QtWidgets::QtBaseViewer::lockProjectionUpdate
void lockProjectionUpdate(void)
Lock update of projection matrix.
Definition: QtBaseViewer.hh:272
ACG::QtWidgets::QtBaseViewer::stereo_
bool stereo_
Set eye distance for stereo.
Definition: QtBaseViewer.hh:958
ACG::GLState
Definition: GLState.hh:213
ACG::QtWidgets::QtBaseViewer::backFaceCulling
bool backFaceCulling() const
is backface culling enabled?
Definition: QtBaseViewer.hh:401
ACG::QtWidgets::QtBaseViewer::focalDist_
double focalDist_
Set eye distance for stereo.
Definition: QtBaseViewer.hh:959
ACG::QtWidgets::QtBaseViewer::questionMode
virtual void questionMode()
calls actionMode() with QuestionMode (cf. ActionMode)
Definition: QtBaseViewer.hh:559
ACG::QtWidgets::QtBaseViewer
Definition: QtBaseViewer.hh:129
ACG::QtWidgets::QtBaseViewer::getPickMenu
QMenu * getPickMenu()
Get the menu pointers (required to add them to the menubar as a temp workaround for a qt 4...
Definition: QtBaseViewer.hh:498
ACG::QtWidgets::QtBaseViewer::lightMode
virtual void lightMode()
calls actionMode() with LightMode (cf. ActionMode)
Definition: QtBaseViewer.hh:557
ACG::QtWidgets::QtBaseViewer::DONT_TOUCH_NORMALS
use provided normals as is
Definition: QtBaseViewer.hh:411
ACG::GLMatrixT< double >
ACG::QtWidgets::QtBaseViewer::PickMode::name
std::string name
Definition: QtBaseViewer.hh:1265
ACG::QtWidgets::QtBaseViewer::drawMode
void drawMode(ACG::SceneGraph::DrawModes::DrawMode _mode)
set draw mode (No test if this mode is available!)
Definition: QtBaseViewer.hh:458
ACG::QtWidgets::QtBaseViewer::scene_center
const ACG::Vec3d & scene_center() const
Definition: QtBaseViewer.hh:344
ACG::QtWidgets::QtBaseViewer::options
int options() const
get current ORed Options
Definition: QtBaseViewer.hh:232
ACG::QtWidgets::QtBaseViewer::examineMode
virtual void examineMode()
calls actionMode() with ExamineMode (cf. ActionMode)
Definition: QtBaseViewer.hh:555
ACG::SceneGraph::DrawModes::DrawMode
Specifies a DrawMode.
Definition: DrawModes.hh:288
ACG::QtWidgets::QtBaseViewer::ActionMode
ActionMode
How to react on mouse events?
Definition: QtBaseViewer.hh:359
ACG::QtWidgets::QtBaseViewer::faceOrientation
FaceOrientation faceOrientation() const
get face orientation
Definition: QtBaseViewer.hh:396
ACG::QtWidgets::QtGLGraphicsView
Definition: QtGLGraphicsView.hh:69
ACG::QtWidgets::QtBaseViewer::CCW_ORIENTATION
counter clockwise (default)
Definition: QtBaseViewer.hh:389
ACG::QtWidgets::QtBaseViewer::pick_mode_idx_
int pick_mode_idx_
Definition: QtBaseViewer.hh:1290
ACG::QtWidgets::QtBaseViewer::socket_
QUdpSocket * socket_
socket used for synchronization
Definition: QtBaseViewer.hh:1105
ACG::QtWidgets::QtBaseViewer::projectionMode
ProjectionMode projectionMode() const
get current projection mode
Definition: QtBaseViewer.hh:323
SceneGraph
Definition: QtPrincipalAxisDialog.hh:67
ACG::QtWidgets::QtBaseViewer::sceneGraph
const SceneGraph::BaseNode * sceneGraph() const
same but const
Definition: QtBaseViewer.hh:296
ACG::QtWidgets::QtBaseViewer::drawMode
ACG::SceneGraph::DrawModes::DrawMode drawMode()
get current draw mode
Definition: QtBaseViewer.hh:465
ACG::QtWidgets::QtBaseViewer::pick_mode_name_
std::string pick_mode_name_
Definition: QtBaseViewer.hh:1286
ACG::QtWidgets::QtBaseViewer::skipNextSync_
bool skipNextSync_
Skips the next synch event.
Definition: QtBaseViewer.hh:1102
ACG::SceneGraph::PickTarget
PickTarget
What target to use for picking.
Definition: PickTarget.hh:73
ACG::SceneGraph::BaseNode
Definition: BaseNode.hh:104
OpenMesh::VectorT
Definition: Vector11T.hh:83
ACG::QtWidgets::QtBaseViewer::animation
bool animation() const
Is animation enabled?
Definition: QtBaseViewer.hh:278
ACG::QtWidgets::QtBaseViewer::pickRendererMode_
ACG::SceneGraph::PickTarget pickRendererMode_
Definition: QtBaseViewer.hh:1300
ACG::QtWidgets::QtBaseViewer::snapshotCounter_
int snapshotCounter_
Definition: QtBaseViewer.hh:1152
ACG::QtWidgets::QtBaseViewer::unlockProjectionUpdate
void unlockProjectionUpdate(void)
Unlock update of projection matrix.
Definition: QtBaseViewer.hh:275
QtGLGraphicsView
Definition: QtGLGraphicsView.hh:67
ACG::QtWidgets::QtBaseViewer::actionMode
ActionMode actionMode() const
get action mode
Definition: QtBaseViewer.hh:384
ACG::QtWidgets::QtBaseViewer::drawBlendedObjects
void drawBlendedObjects(bool _status)
One or two pass Drawing.
Definition: QtBaseViewer.hh:485
ACG::QtWidgets::QtBaseViewer::lastActionMode
ActionMode lastActionMode()
Return the last action mode.
Definition: QtBaseViewer.hh:381
ACG::QtWidgets::QtBaseViewer::PickingMode
Definition: QtBaseViewer.hh:365
ACG::QtWidgets::QtBaseViewer::NORMAL_NAVIGATION
Normal mode.
Definition: QtBaseViewer.hh:310
ACG::QtWidgets::QtBaseViewer::scene_radius
double scene_radius() const
Definition: QtBaseViewer.hh:348
ACG::QtWidgets::QtBaseViewer::PickMode::cursor
QCursor cursor
Definition: QtBaseViewer.hh:1277
ACG::QtWidgets::QtBaseViewer::PickMode
Definition: QtBaseViewer.hh:1257
ACG::QtWidgets::QtBaseViewer::snapshot_
QImage * snapshot_
Definition: QtBaseViewer.hh:1153
ACG::QtWidgets::QtBaseViewer::PickMode::visible
bool visible
Definition: QtBaseViewer.hh:1273
ACG::QtWidgets::QtBaseViewer::disableKeyHandling_
bool disableKeyHandling_
Enable or disable internal Key handling.
Definition: QtBaseViewer.hh:1018
ACG::QtWidgets::QtBaseViewer::flyTo
virtual void flyTo(const QPoint &_pos)
Fly to, get closer.
Definition: QtBaseViewer.hh:541
ACG::QtWidgets::QtGLGraphicsScene
Definition: QtGLGraphicsScene.hh:74
ACG::QtWidgets::QtBaseViewer::light_matrix
GLMatrixd & light_matrix()
get light rotation matrix
Definition: QtBaseViewer.hh:426
ACG::QtWidgets::QtBaseViewer::sceneGraph
SceneGraph::BaseNode * sceneGraph()
Returns: root node of scene graph.
Definition: QtBaseViewer.hh:294
ACG::QtWidgets::QtBaseViewer::twoSidedLighting
bool twoSidedLighting() const
is 2-sided lighing enabled?
Definition: QtBaseViewer.hh:406