Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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  * $Revision$ *
45  * $Author$ *
46  * $Date$ *
47  * *
48 \*===========================================================================*/
49 
50 
51 
52 //=============================================================================
53 //
54 // CLASS QtBaseViewer
55 //
56 //=============================================================================
57 
58 #ifndef ACG_QTBASEVIEWER_HH
59 #define ACG_QTBASEVIEWER_HH
60 
61 //== INCLUDES =================================================================
62 
63 
64 #include "../GL/GLState.hh"
65 #include "../Scenegraph/SceneGraph.hh"
66 #include "../Scenegraph/DrawModes.hh"
67 
68 #include <QGLFormat>
69 #include <QBoxLayout>
70 #include <QtNetwork/QUdpSocket>
71 #include <QWheelEvent>
72 #include <QKeyEvent>
73 #include <QDropEvent>
74 #include <QContextMenuEvent>
75 #include <QDragEnterEvent>
76 #include <QMouseEvent>
77 #include <QAction>
78 #include <QSize>
79 #include <QMap>
80 #include <QString>
81 #include <QMenu>
82 #include <QToolBar>
83 #include <QTime>
84 
85 #include <vector>
86 #include <string>
87 
88 
89 //== FORWARDDECLARATIONS ======================================================
90 
91 
92 class QPushButton;
93 class QToolButton;
94 class QStatusBar;
95 class QSplitter;
96 class QTimer;
97 class QImage;
98 class QSocketNotifier;
99 class QGraphicsWidget;
100 class QGraphicsGridLayout;
101 
102 
103 //== NAMESPACES ===============================================================
104 
105 
106 namespace ACG {
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 
120 //== CLASS DEFINITION =========================================================
121 
122 
130 class ACGDLLEXPORT QtBaseViewer : public QWidget
131 {
132 Q_OBJECT
133 
134 //-------------------------------------------------------------- public methods
135 public:
136 
140  enum Options {
142  Nothing=0,
143 
150  ShowPrivateStatusBar=1,
151 
161  ShowToolBar=2,
162 
164  ShowPickButton=4,
166  ShowLassoButton=8,
168  ShowQuestionButton=0x10,
169 
171  ShowWheelX=0x20,
173  ShowWheelY=0x40,
177  ShowWheelZ=0x80,
178 
180  ShowWheels=0xe0,
181 
183  DefaultOptions = 0xffff & (~ShowPrivateStatusBar)
184  };
185 
186 
187 
188 
189  //--------------------------------------------------- constructor / destructor
190 
200  QtBaseViewer( QWidget* _parent=0,
201  const char* _name=0,
202  QStatusBar *_statusBar=0,
203  const QGLFormat* _format=0,
204  const QtBaseViewer* _share=0,
205  Options _options=DefaultOptions );
206 
208  virtual ~QtBaseViewer();
209 
210 
211 
212 
213 
214  //------------------------------------------------------------- public methods
215 
216  virtual QSize sizeHint () const;
217 
219  QStatusBar* statusBar() { return statusbar_; }
228  void setStatusBar(QStatusBar* _sb);
229 
231  void applyOptions(int _options);
233  int options() const { return options_; }
234 
235 
237  virtual void makeCurrent();
239  virtual void swapBuffers();
240 
241 
243  GLState& glState() { return *glstate_; }
244 
245 
249  void backgroundColor(const Vec4f& _color) {
250  glstate_->set_clear_color(_color); updateGL();
251  }
253  Vec4f backgroundColor() { return glstate_->clear_color(); }
254 
255 
261  virtual void lockUpdate();
263  virtual void unlockUpdate();
268  virtual void unlockAndUpdate();
271  bool isUpdateLocked() const { return updateLocked_; }
272 
273 
275  void lockProjectionUpdate( void ) { projectionUpdateLocked_ = true; }
276 
278  void unlockProjectionUpdate( void ) { projectionUpdateLocked_ = false; }
279 
281  bool animation() const { return animation_; }
283  void animation(bool _b);
284 
286  void trackMouse(bool _track);
287 
289  void enablePopupMenu(bool _enable);
290 
291 
292 
293 
294 
295 
297  SceneGraph::BaseNode* sceneGraph() { return sceneGraphRoot_; }
299  const SceneGraph::BaseNode* sceneGraph() const { return sceneGraphRoot_; }
309  void sceneGraph(SceneGraph::BaseNode* _root);
310 
314  FIRSTPERSON_NAVIGATION
315  };
316 
320  PERSPECTIVE_PROJECTION
321  };
322 
324  void projectionMode(ProjectionMode _p);
326  ProjectionMode projectionMode() const { return projectionMode_; }
327 
329  void navigationMode(NavigationMode _n);
331  NavigationMode navigationMode() const { return navigationMode_; }
332 
337  void setScenePos( const ACG::Vec3d& _center, double _radius, const bool _setCenter = true );
338 
342  void setSceneCenter( const ACG::Vec3d& _center );
343 
347  const ACG::Vec3d& scene_center() const { return scene_center_; }
351  double scene_radius() const { return scene_radius_; }
352 
353  void setSceneRadius(double radius) { scene_radius_ = radius; }
354 
356  void viewingDirection( const ACG::Vec3d& _dir, const ACG::Vec3d& _up );
357 
359  void setFovy( double _fovy );
360 
362  enum ActionMode {
363  // examine geometry, get transformations from mouse events
364  ExamineMode,
369  // same as picking, but emit signalMouseEventIdentify()
370  QuestionMode,
371  // Ligh rotation mode
372  LightMode
373  };
374 
375 
381  void actionMode(ActionMode);
382 
384  ActionMode lastActionMode(){ return lastActionMode_; };
385 
387  ActionMode actionMode() const { return actionMode_; }
388 
389 
393  CW_ORIENTATION
394  };
395 
397  void faceOrientation(FaceOrientation);
399  FaceOrientation faceOrientation() const { return faceOrientation_; }
400 
402  void backFaceCulling( bool _b );
404  bool backFaceCulling() const { return backFaceCulling_; }
405 
407  void twoSidedLighting( bool _b );
409  bool twoSidedLighting() const { return twoSidedLighting_; }
410 
412  enum NormalsMode {
419  NORMALIZE_NORMALS
420  };
421 
423  void normalsMode(NormalsMode _mode);
425  NormalsMode normalsMode() const { return normalsMode_; }
426 
427 
429  GLMatrixd& light_matrix() { return light_matrix_; }
431  void rotate_lights(Vec3d& _axis, double _angle);
433  void update_lights();
434 
435 
437  void copyToImage( QImage& _image, GLenum _buffer=GL_BACK) {
438  copyToImage(_image, 0, 0, glWidth(), glHeight(), _buffer);
439  }
440 
442  void copyToImage( QImage& _image,
443  unsigned int _left, unsigned int _top,
444  unsigned int _width, unsigned int _height,
445  GLenum _buffer );
446 
447 
449  unsigned int glWidth() const;
451  unsigned int glHeight() const;
453  QSize glSize() const;
455  QPoint glMapFromGlobal( const QPoint& _pos ) const;
457  QPoint glMapToGlobal( const QPoint& _pos ) const;
458 
459 
462  {
463  curDrawMode_=_mode;
464  updatePopupMenu();
465  }
466 
469 
471  void encodeView(QString& _view);
476  bool decodeView(const QString& _view);
477 
479  void initModelviewMatrix();
480 
481  // get all Mouse & Key Events for GlWidget
482  void grabGLArea();
483 
484  // undo grabbing GLArea
485  void releaseGLArea();
486 
488  void drawBlendedObjects(bool _status) { blending_ = _status; }
489 
491  void translate(const Vec3d& trans);
492 
494  void rotate(const Vec3d& axis, double angle)
495  { rotate(axis, angle, trackball_center_); }
496 
498  void rotate(const Vec3d& axis, double angle, const Vec3d& _center);
499 
501  QMenu * getPickMenu() { return pickMenu_; };
502  QMenu * getFuncMenu() { return funcMenu_; };
503  QMenu * getDrawMenu() { return drawMenu_; };
504 
506  QToolBar* getToolBar();
507 
509  QToolBar* removeToolBar();
510 
512  void moveForward();
513 
515  void moveBack();
516 
518  void strafeLeft();
519 
521  void strafeRight();
522 
523 //---------------------------------------------------------------- public slots
524 public slots:
525 
531  virtual void drawNow();
533  virtual void updateGL();
534 
536  virtual void setHome();
538  virtual void home();
540  virtual void viewAll();
542  virtual void flyTo(const QPoint& _pos, bool _move_back);
544  virtual void flyTo(const QPoint& _pos) { flyTo(_pos,false); }
546  virtual void flyFrom(const QPoint& _pos) { flyTo(_pos,true); }
547 
553  virtual void flyTo(const Vec3d& _position,
554  const Vec3d& _center,
555  double _time = 1000.0);
556 
558  virtual void examineMode() { actionMode(ExamineMode); }
560  virtual void lightMode() { actionMode(LightMode); }
562  virtual void questionMode() { actionMode(QuestionMode); }
563 
565  virtual void perspectiveProjection();
567  virtual void orthographicProjection();
569  virtual void toggleProjectionMode();
571  virtual void toggleNavigationMode();
572 
573  signals:
574 
575  void projectionModeChanged( bool _ortho );
576  void navigationModeChanged( bool _normal );
577 
578  public slots:
579 
581  virtual void showSceneGraphDialog();
582 
584  virtual void setView( const GLMatrixd& _modelview,
585  const GLMatrixd& _inverse_modelview );
586 
587  void actionBackground();
588  void actionCopyView();
589  void actionPasteView();
590  void actionPasteDropSize();
591  void actionSynchronize();
592  void actionAnimation();
593  void actionBackfaceCulling();
594  void actionTwoSidedLighting();
595  void actionSynchronize(bool _enable);
596  void actionAnimation(bool _enable);
597  void actionBackfaceCulling(bool _enable);
598  void actionTwoSidedLighting(bool _enable);
599 
600  void actionDrawMenu( QAction * _action );
601  void actionPickMenu( QAction * _action );
602 
603 
604 
605 
606 //-------------------------------------------------------------- public signals
607 signals:
608 
610  void signalInitializeGL();
611 
622  void signalMouseEvent(QMouseEvent*, const std::string&);
623 
625  void signalMouseEvent(QMouseEvent*);
626 
628  void signalWheelEvent(QWheelEvent*, const std::string&);
629 
633  void signalMouseEventIdentify( QMouseEvent* );
634 
635 
637  void signalSetView( const GLMatrixd& _modelview,
638  const GLMatrixd& _inverse_modelview );
640  void signalSceneGraphChanged(ACG::SceneGraph::BaseNode* _root);
642  void signalNodeChanged(ACG::SceneGraph::BaseNode* _node);
644  void signalActionModeChanged(ACG::QtWidgets::QtBaseViewer::ActionMode _m);
646  void signalDrawScene(ACG::GLState* _state);
647 
648 
649  signals:
650 
655  void signalCustomContextMenuRequested ( const QPoint & );
656 
657 
658 //----------------------------------------------------------- protected methods
659 protected:
660 
661  friend class QtGLGraphicsScene;
662  friend class QtGLGraphicsView;
663 
665  virtual void initializeGL();
667  virtual void paintGL();
669  virtual void resizeGL(int _w, int _h);
670 
671 
673  virtual void glMousePressEvent(QMouseEvent* _event);
675  virtual void glMouseDoubleClickEvent(QMouseEvent* _event);
677  virtual void glMouseMoveEvent(QMouseEvent* _event);
679  virtual void glMouseReleaseEvent(QMouseEvent* _event);
681  virtual void glMouseWheelEvent(QWheelEvent* _event);
683  virtual void glContextMenuEvent(QContextMenuEvent* _event);
684 
685 
687  virtual void viewMouseEvent( QMouseEvent* _event) = 0;
689  virtual void viewWheelEvent(QWheelEvent* _event) = 0;
690 
692  virtual void lightMouseEvent( QMouseEvent* /* _event */ ) {}
693 
694 
695  protected:
696 
697 
699  void updateProjectionMatrix();
701  void updatePickMenu();
702 
703 
704 
705 //------------------------------------------------------------- protected slots
706 protected slots:
707 
709  virtual void sceneRectChanged(const QRectF & rect);
710 
712  virtual void slotWheelX(double _dAngle);
714  virtual void slotWheelY(double _dAngle);
716  virtual void slotWheelZ(double _dist);
717 
719  virtual void slotNodeChanged(ACG::SceneGraph::BaseNode* _node);
720 
722  virtual void cleanupEventFilter()
723  { removeEventFilter( sender());}
724 
725 
726 
727 //--------------------------------------------------------------- private slots
728 private slots:
729 
730  void hidePopupMenus();
731 
732 //----------------------------------------------------------- private functions
733 private:
734 
735  // IDs for \c funcMenu_
736  enum FuncMenuID {
737  M_CopyView=0x100,
738  M_PasteView,
739  M_PasteDropSize,
740  M_Animation,
741  M_BackfaceCulling,
742  M_TwoSidedLighting,
743  M_Background,
744  M_Snapshot,
745  M_SnapshotName,
746  M_SnapshotSavesView,
747  M_Synchronize
748  };
749 
751  QtBaseViewer(const QtBaseViewer&);
753  QtBaseViewer& operator=(const QtBaseViewer&);
754 
755  // create widgets
756  void createWidgets(const QGLFormat* _format,QStatusBar* _sb,
757  const QtBaseViewer* _share);
758 
759  /* Recursively draws each node in the scene graph.
760  Called by paintGL(). */
761  void drawScene();
762  // helper called by drawScene().
763  void drawScene_mono();
764  // helper called by drawScene() when stereo viewing is active.
765  void drawScene_stereo();
766 
767 
768  // updates popup menu with the available draw modes
769  void updatePopupMenu();
770 
771 //-------------------------------------------------------------- protected data
772 protected:
773 
774 
775  // scene center and radius
776  Vec3d scene_center_, trackball_center_;
777  double scene_radius_, trackball_radius_;
778 
779 
780  // projection stuff
781  GLdouble orthoWidth_;
782  GLdouble near_, far_, fovy_;
783 
784 
785  // scenegraph
786  GLState *glstate_;
787 
788 
789  // helper
790  bool isRotating_;
791 
792 
793  // current status bar, guaranteed to be !=0
794  QStatusBar* statusbar_;
795 
796 
797 
798 //---------------------------------------------------------------- private data
799 private:
800 
801 
802  // data stored for home view
803  Vec3d home_center_;
804  double home_radius_;
805  GLMatrixd home_modelview_,
806  home_inverse_modelview_;
807  double homeOrthoWidth_;
808 
809 
810  // matrix for rotating light position
811  GLMatrixd light_matrix_;
812 
813 
814  // modi
815  NormalsMode normalsMode_;
816  FaceOrientation faceOrientation_;
817  ProjectionMode projectionMode_;
818  NavigationMode navigationMode_;
819 
820  ActionMode actionMode_, lastActionMode_;
821  bool backFaceCulling_;
822  bool twoSidedLighting_;
823  bool animation_;
824 
825  // helper
826  bool trackMouse_;
827  bool popupEnabled_;
828  bool glareaGrabbed_;
829  double frame_time_;
830 
831 
832  QMenu * pickMenu_;
833  QMenu * funcMenu_;
834  QMenu * drawMenu_;
835 
836  // scenegraph stuff
837  SceneGraph::BaseNode* sceneGraphRoot_;
838 
840  availDrawModes_;
841 
842  bool updateLocked_;
843  bool projectionUpdateLocked_;
844  bool blending_;
845 
846 
847  // widget showing the scenegraph
848  QtSceneGraphDialog* sceneGraphDialog_;
849 
850 
851 
852  // options
853  Options options_;
854  // gl widget used as drawing area to paint the graphics scene
855  QGLWidget* glWidget_;
856  // graphics scene used to paint gl context and widgets
857  QtGLGraphicsScene* glScene_;
858  // graphics view that holds the gl scene
859  QtGLGraphicsView* glView_;
860 
861  // Base graphics widget for wheels in the scene
862  QGraphicsWidget* glBase_;
863  // Base graphics widget layout
864  QGraphicsGridLayout* glBaseLayout_;
865 
866  // private status bar, 0 if status bar is provided externally
867  QStatusBar* privateStatusBar_;
868 
869  // Layout for the basic widget ( viewer + wheels )
870  QGridLayout* glLayout_;
871 
872  // tool bar
873  QToolBar * buttonBar_;
874 
875  // set pick mode
876  QToolButton* pickButton_;
877  // set move mode
878  QToolButton* moveButton_;
879  // set light mode
880  QToolButton* lightButton_;
881  // set question mode
882  QToolButton* questionButton_;
883  // change projection mode (perspective/orthographic)
884  QToolButton* projectionButton_;
885  // go to home() position
886  QToolButton* homeButton_;
887  // setHome()
888  QToolButton* setHomeButton_;
889  // viewAll()
890  QToolButton* viewAllButton_;
891  // show sceneGraphDialog_
892  QToolButton* sceneGraphButton_;
893  // enable/disable stereo viewing
894  QToolButton* stereoButton_;
895 
896  // rotate around x-axis
897  QtWheel* wheelX_;
898  // rotate around y-axis
899  QtWheel* wheelY_;
900  // translate along z-axis
901  QtWheel* wheelZ_;
902 
903  // all actions
904  QMap< QString, QAction * > action_;
905 
906  // vector of current draw mode actions
907  std::vector< QAction * > drawMenuActions_;
908 
909  // Used to calculate the time passed between redraws
910  QTime redrawTime_;
911 
912  //===========================================================================
915  //===========================================================================
916  signals:
918  void viewUpdated();
919 
921  void viewChanged();
922 
925  //===========================================================================
928  //===========================================================================
929 
930  public slots:
931 
933  virtual void toggleStereoMode();
934 
936  virtual void setStereoMode(bool _b);
937 
938  public:
943  void setEyeDistance(double _distance);
944 
946  double eyeDistance( );
947 
952  void setFocalDistance(double _distance);
953 
955  double focalDistance( );
956 
957  private:
958  // stereo stuff
959  bool stereo_;
960  double eyeDist_, focalDist_;
961 
962 
966  //===========================================================================
969  //===========================================================================
970 
971  signals:
978  void signalKeyPressEvent(QKeyEvent*);
979 
980  public:
986  void disableKeyHandling(bool _state );
987 
991  bool keyHandlingState();
992 
993  protected:
994 
999  virtual void glKeyPressEvent(QKeyEvent*);
1000 
1007  virtual void glKeyReleaseEvent(QKeyEvent* _event);
1008 
1016  virtual bool viewKeyPressEvent(QKeyEvent* _event) = 0;
1017 
1018  private:
1020 
1023  //===========================================================================
1026  //===========================================================================
1027 
1028  protected:
1029 
1031  virtual void startDrag();
1033  virtual void glDragEnterEvent(QDragEnterEvent* _event);
1035  virtual void glDropEvent(QDropEvent* _event);
1036 
1037  public:
1039  void setExternalDrag( bool _external ) { externalDrag_ = _external; };
1040 
1041  signals:
1045  void startDragEvent( QMouseEvent* _event );
1046 
1050  void dragEnterEvent(QDragEnterEvent* _event);
1051 
1055  void dropEvent( QDropEvent* _event );
1056 
1057  private:
1058 
1063 
1067  //===========================================================================
1070  //===========================================================================
1071 
1072  public:
1077  void sync_connect(const QtBaseViewer*);
1078 
1080  void sync_disconnect(const QtBaseViewer*);
1081 
1083  virtual void setSynchronization(bool _b);
1084 
1086  bool add_sync_host(const QString& _name);
1088  void add_sync_host(QHostAddress& _adr);
1089 
1090  bool synchronization();
1091 
1092  private slots:
1093 
1094  void sync_receive();
1095  void sync_send(const GLMatrixd& _modelview,
1096  const GLMatrixd& _inverse_modelview);
1097 
1098  private:
1101 
1104 
1106  QUdpSocket * socket_;
1107 
1109  std::vector<QHostAddress> sync_hosts_;
1110 
1113  //===========================================================================
1116  //===========================================================================
1117 
1118  public slots:
1130  virtual void snapshotBaseFileName(const QString& _fname);
1131 
1136  virtual void snapshot();
1137 
1140  void actionSnapshot();
1141 
1144  void actionSnapshotName();
1145 
1148  void actionSnapshotSavesView();
1149 
1150  private:
1151 
1152  QString snapshotName_;
1154  QImage* snapshot_;
1155 
1158  //===========================================================================
1161  //===========================================================================
1162  public:
1176  bool pick( SceneGraph::PickTarget _pickTarget,
1177  const QPoint& _mousePos,
1178  unsigned int& _nodeIdx,
1179  unsigned int& _targetIdx,
1180  Vec3d* _hitPointPtr=0 );
1181 
1187  bool fast_pick( const QPoint& _mousePos,
1188  Vec3d& _hitPoint );
1189 
1198  void addPickMode(const std::string& _name,
1199  bool _mouse_tracking = false,
1200  int _pos = -1,
1201  bool _visible = true,
1202  QCursor _cursor = Qt::ArrowCursor );
1203 
1206  void clearPickModes();
1207 
1210  const std::string& pickMode() const;
1211 
1215  void pickMode(const std::string& _name);
1216 
1220  void pickMode( int _id );
1221 
1226  void renderPicking(bool _renderPicking, ACG::SceneGraph::PickTarget _mode);
1227 
1228  public slots:
1229 
1233  virtual void pickingMode();
1234 
1240  void setPickModeCursor(const std::string& _name, QCursor _cursor);
1241 
1247  void setPickModeMouseTracking(const std::string& _name, bool _mouseTracking);
1248 
1249  signals:
1252  void signalPickModeChanged(const std::string&);
1253 
1254  private:
1255 
1258  struct PickMode
1259  {
1261  PickMode(const std::string& _n, bool _t, bool _v, QCursor _c) :
1262  name(_n), tracking(_t), visible(_v), cursor(_c) {}
1263 
1266  std::string name;
1267 
1270  bool tracking;
1271 
1274  bool visible;
1275 
1278  QCursor cursor;
1279  };
1280 
1283  std::vector<PickMode> pick_modes_;
1284 
1287  std::string pick_mode_name_;
1288 
1292 
1296 
1302 
1304 };
1305 
1306 
1307 //=============================================================================
1308 } // namespace QtWidgets
1309 } // namespace ACG
1310 //=============================================================================
1311 #endif // ACG_QTBASEVIEWER_HH defined
1312 //=============================================================================
NormalsMode normalsMode() const
get treatment of normals
ActionMode
How to react on mouse events?
ProjectionMode projectionMode() const
get current projection mode
void backgroundColor(const Vec4f &_color)
virtual void cleanupEventFilter()
correct ??? (same function as in qt src)
ProjectionMode
projection mode
void rotate(const Vec3d &axis, double angle)
rotate the scene (around its center) and update modelview matrix
ActionMode actionMode() const
get action mode
void drawBlendedObjects(bool _status)
One or two pass Drawing.
virtual void flyTo(const QPoint &_pos)
Fly to, get closer.
Vec4f backgroundColor()
get background color
QUdpSocket * socket_
socket used for synchronization
Namespace providing different geometric functions concerning angles.
Definition: DBSCANT.cc:51
bool animation() const
Is animation enabled?
GLMatrixd & light_matrix()
get light rotation matrix
void drawMode(ACG::SceneGraph::DrawModes::DrawMode _mode)
set draw mode (No test if this mode is available!)
std::vector< PickMode > pick_modes_
virtual void flyFrom(const QPoint &_pos)
Fly to, get more distant.
GLState & glState()
get OpenGL state
PickMode(const std::string &_n, bool _t, bool _v, QCursor _c)
Constructor.
QMenu * getPickMenu()
Get the menu pointers (required to add them to the menubar as a temp workaround for a qt 4...
bool stereo_
Set eye distance for stereo.
NavigationMode navigationMode() const
get current navigation mode
int options() const
get current ORed Options
ACG::SceneGraph::DrawModes::DrawMode drawMode()
get current draw mode
const SceneGraph::BaseNode * sceneGraph() const
same but const
virtual void questionMode()
calls actionMode() with QuestionMode (cf. ActionMode)
bool synchronized_
synchronized with different viewer?
virtual void examineMode()
calls actionMode() with ExamineMode (cf. ActionMode)
void unlockProjectionUpdate(void)
Unlock update of projection matrix.
void copyToImage(QImage &_image, GLenum _buffer=GL_BACK)
copy current framebuffer to an QImage
bool disableKeyHandling_
Enable or disable internal Key handling.
void setExternalDrag(bool _external)
Enable or disable external dragging controls.
bool skipNextSync_
Skips the next synch event.
void lockProjectionUpdate(void)
Lock update of projection matrix.
SceneGraph::BaseNode * sceneGraph()
Returns: root node of scene graph.
const ACG::Vec3d & scene_center() const
PickTarget
What target to use for picking.
Definition: BaseNode.hh:99
NormalsMode
Automatically normalize normals?
QStatusBar * statusBar()
get status bar, guaranteed to be not 0 (QStatusBar may be invisible)
FaceOrientation faceOrientation() const
get face orientation
virtual void lightMode()
calls actionMode() with LightMode (cf. ActionMode)
ACG::SceneGraph::PickTarget pickRendererMode_
NavigationMode
Navigation mode.
bool twoSidedLighting() const
is 2-sided lighing enabled?
virtual void lightMouseEvent(QMouseEvent *)
optional: hande mouse events to rotate light
ActionMode lastActionMode()
Return the last action mode.
FaceOrientation
orientation of the faces
bool backFaceCulling() const
is backface culling enabled?
double focalDist_
Set eye distance for stereo.
std::vector< QHostAddress > sync_hosts_
List of hosts which should receive sync information.