Developer Documentation
CoreWidget.hh
Go to the documentation of this file.
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 // CLASS CoreWidget
46 //
47 //=============================================================================
48 
54 #ifndef COREWIDGET_HH
55 #define COREWIDGET_HH
56 
57 
58 //== INCLUDES =================================================================
59 
60 #include <set>
61 
67 #include <OpenFlipper/BasePlugin/ViewInterface.hh>
69 
70 #include <OpenFlipper/widgets/coreWidget/SideArea.hh>
71 #include <OpenFlipper/widgets/coreWidget/ColorStatusBar.hh>
72 
73 #include <OpenFlipper/widgets/glWidget/QtBaseViewer.hh>
74 #include <OpenFlipper/widgets/glWidget/QtGLGraphicsScene.hh>
75 #include <OpenFlipper/widgets/glWidget/QtGLGraphicsView.hh>
76 #include <OpenFlipper/widgets/glWidget/QtMultiViewLayout.hh>
77 #include <OpenFlipper/widgets/glWidget/QtSlideWindow.hh>
78 
79 // QT INCLUDES
80 #include <QMainWindow>
81 #include <QStackedWidget>
82 #include <QTextEdit>
83 #include <QToolBar>
84 #include <QStatusBar>
85 
86 #include <QFuture>
87 #include <QFutureWatcher>
88 
89 #include <QDockWidget>
90 
91 #include <OpenFlipper/common/OFGLWidget.hh>
92 
93 #include <OpenFlipper/widgets/pythonWidget/pythonWidget.hh>
94 #include <OpenFlipper/widgets/aboutWidget/aboutWidget.hh>
95 #include <OpenFlipper/widgets/loggerWidget/loggerWidget.hh>
96 #include <OpenFlipper/widgets/optionsWidget/optionsWidget.hh>
97 #include <OpenFlipper/widgets/helpWidget/helpWidget.hh>
98 #include <OpenFlipper/widgets/stereoSettingsWidget/stereoSettingsWidget.hh>
99 #include <OpenFlipper/widgets/postProcessorWidget/postProcessorWidget.hh>
100 #include <OpenFlipper/widgets/rendererWidget/rendererWidget.hh>
101 #include <OpenFlipper/widgets/rendererWidget/rendererObjectWidget.hh>
102 
103 #include <OpenFlipper/Core/PluginInfo.hh>
104 
105 #include <ACG/QtWidgets/QtSceneGraphWidget.hh>
106 
107 #include <ACG/Scenegraph/DrawModes.hh>
108 #include <ACG/Scenegraph/CoordsysNode.hh>
109 
110 #include <OpenFlipper/INIFile/INIFile.hh>
112 
113 #include "../viewModeWidget/viewModeChangeWidget.hh"
114 
124 struct ViewMode{
125 
127  QString name;
128 
131  QString icon;
132 
134  bool custom;
135 
137  QStringList visibleToolboxes;
138 
140  QStringList visibleToolbars;
141 
143  QStringList visibleContextMenus;
144 };
145 
147  public:
148  StackWidgetInfo(bool _editable,QString _name,QWidget* _widget);
149 
150  bool editable;
151  QString name;
152  QWidget* widget;
153 };
154 
157 class MenuInfo {
158  public:
159  MenuInfo():
160  action(0),
162  {}
163 
165  QAction* action;
166 
169 
172 };
173 
179 class PickMode
180 {
181  public:
183  PickMode(const std::string& _n, const bool _t, const bool _v, QCursor _c, QToolBar *_tb = 0 );
184 
186  ~PickMode() {};
187 
188 
193  void visible(const bool _visible);
194 
199  bool visible() const;
200 
205  std::string name() const;
206 
214  void tracking(const bool _tracking);
215 
221  bool tracking() const;
222 
228  QCursor cursor() const;
229 
237  void cursor(const QCursor _cursor);
238 
246  void toolbar(QToolBar* _toolbar);
247 
253  QToolBar* toolbar() const;
254 
255  private:
256 
258  std::string name_;
259 
262  bool tracking_;
263 
266  bool visible_;
267 
270  QCursor cursor_;
271 
274  QToolBar * toolbar_;
275 };
276 
279 class CoreWidget : public QMainWindow
280 {
281  Q_OBJECT
282 
283 public:
284 
285  friend class Core;
286 
288  CoreWidget( QVector<ViewMode*>& _viewModes, QList< SlotInfo >& _coreSlots );
289 
291  ~CoreWidget();
292 
293  signals:
294  void clearAll();
295  void loadMenu();
296  void addEmptyObjectMenu();
297  void saveMenu();
298  void saveToMenu();
299  void loadIniMenu();
300  void saveIniMenu();
301  void recentOpen(QAction*);
302  void exit();
303 
304  void loadPlugin();
305  void showPlugins();
306 
307  private slots:
308 
310  void closeEvent ( QCloseEvent * event );
311 
312  //===========================================================================
315  //===========================================================================
316 
317  signals :
318  void log(Logtype _type, QString _message);
319  void log(QString _message);
320 
323  //===========================================================================
326  //===========================================================================
327 
328  protected :
329 
331  virtual void keyPressEvent (QKeyEvent* _e);
332  virtual void keyReleaseEvent(QKeyEvent* _e);
333 
334  // Filter alt key events under windows
335  //bool eventFilter(QObject *obj, QEvent *ev);
336 
337  private:
338  //event handling
339  bool event( QEvent *event );
340 
341  bool eventFilter(QObject *_obj, QEvent *_event);
342 
343  signals :
344 
348  void PluginKeyEvent(QKeyEvent* );
349 
353  void PluginKeyReleaseEvent(QKeyEvent* );
354 
356  void registerKey(int _key, Qt::KeyboardModifiers _modifiers, QString _description,
357  bool _multiUse = false);
358 
360  void call( QString _expression , bool& _success );
361 
362  private:
364  typedef std::multimap< std::pair< int, Qt::KeyboardModifiers > , std::pair< QObject*, int > > KeyMap;
365 
366  typedef std::pair< KeyMap::iterator, KeyMap::iterator > KeyRange;
367 
370  void registerCoreKeys();
371 
376  void coreKeyPressEvent();
377 
379  void coreKeyPressEvent (QKeyEvent* _e);
380  void coreKeyReleaseEvent(QKeyEvent* _e);
381 
382  KeyBinding getKeyBinding(QObject* _plugin, int _keyIndex );
383  QString getRPCName(QObject* _plugin );
384 
386  std::vector<KeyBinding> coreKeys_;
387 
389  KeyMap keys_;
390 
392  InverseKeyMap invKeys_;
393 
395  QList< SlotInfo >& coreSlots_;
396 
397  private slots:
403  void slotRegisterKey(int _key, Qt::KeyboardModifiers _modifiers, QString _description,
404  bool _multiUse = false);
405 
406  public slots:
411  void slotAddKeyMapping(int _key, Qt::KeyboardModifiers _modifiers, QObject* _plugin, int _keyBindingID);
412 
418  void slotRegisterSlotKeyBindings();
419 
420  public:
422  void loadKeyBindings(INIFile& _ini);
423 
425  void saveKeyBindings(INIFile& _ini);
426 
427  void showReducedMenuBar(bool reduced);
428 
429  private:
432 
435  //===========================================================================
438  //===========================================================================
439 
440  public:
441 
443  void setupMenuBar();
444 
448  //===========================================================================
451  //===========================================================================
452 
453  private:
454 
456  std::vector<PluginInfo>& plugins();
457 
460  //===========================================================================
463  //===========================================================================
464 
465  signals:
466  void startVideoCapture(QString _baseName, int _fps, bool _captureViewers);
467  void stopVideoCapture();
468 
469  void resizeViewers(int _width, int _height);
470  void resizeApplication(int _width, int _height);
471 
472  private slots:
473  void startVideoCaptureDialog();
474 
477  //===========================================================================
480  //===========================================================================
481 
482  public:
483 
485  void addRecent(QString _filename, DataType _type);
486 
488  void updateRecent();
489 
492  //===========================================================================
495  //===========================================================================
496 
497  public :
498 
500  void showLoggerInSplitView(bool _show);
501 
503  void updateInSceneLoggerGeometry();
504 
506  void setForceNativeCursor ( bool _state );
507 
508  QSize defaultIconSize();
509 
510  QScrollArea* getToolboxScrollArea() { return toolBoxScroll_; }
511  QWidget* getToolboxArea() { return toolBoxArea_; }
512  SideArea* getToolbox() { return toolBox_; }
513 
514  public slots:
515 
517  void toggleFullscreen();
518 
520  void setFullscreen(bool _state );
521 
523  void toggleLogger();
524 
526  void showLogger(OpenFlipper::Options::LoggerState _state);
527 
529  void toggleToolbox();
530 
532  void showToolbox( bool _state );
533 
535  void toggleStatusBar();
536 
538  void showStatusBar( bool _state );
539 
541  void showMenuBar( bool _state );
542 
544  void toggleMenuBar();
545 
547  void toggleToolBar();
548 
550  void showToolBar( bool _state );
551  signals:
553  void toolBarVisChanged( bool _state );
554 
556  void toolBoxVisChanged( bool _state );
557 
559  void statusBarVisChanged( bool _state );
560 
562  void menuBarVisChanged( bool _state );
563 
565  void fullScreenChanged( bool _state );
566 
567  private:
569 
571 
574  //===========================================================================
577  //===========================================================================
578 
579  private:
581  QVector<QWidget*> toolWidgets_;
582 
583  public:
585  QVector<ViewMode*>& viewModes_;
586 
587  private:
588 
589  QAction* viewModeButton_;
590 
593 
594  public slots:
595 
597  void initViewModes( );
598 
600  void slotAddViewModeToolboxes(QString _mode, QStringList _usedWidgets);
601 
603  void slotAddViewModeToolboxes(QString _mode, bool _custom, QStringList _usedWidgets);
604 
606  void slotAddViewModeToolbars(QString _mode, QStringList _usedToolbars);
607 
609  void slotAddViewModeToolbars(QString _mode, bool _custom, QStringList _usedToolbars);
610 
612  void slotAddViewModeContextMenus(QString _mode, QStringList _usedToolbars);
613 
615  void slotAddViewModeContextMenus(QString _mode, bool _custom, QStringList _usedToolbars);
616 
618  void slotAddViewModeComplete(QString _mode , bool _custom, QStringList _toolboxes, QStringList _toolbars, QStringList _contextmenus);
619 
621  void slotSetViewModeIcon(QString _mode, QString _iconName);
622 
624  void slotSetViewModeIcon(QString _mode, bool _custom, QString _iconName);
625 
627  void slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus, bool _expandAll = false);
628 
630  void setToolBoxOrientationOnTheRight(bool _toolBoxRight);
631 
633  void showViewModeControls(bool _show);
634 
636  void slotHideContextMenu();
637 
638  private slots:
640  void slotRemoveViewMode(QString _name);
641 
643  void slotSetViewMode( QAction* action);
644 
646  void slotViewModeDialog();
647 
649  void closeChangeViewModePopup();
650 
652  void slotUpdateExaminer(unsigned _id);
653 
654  public slots :
655 
657  void setViewMode( QString _mode, bool _expandAll = false );
658 
660  void moveToolBoxToTop(QString _name);
661 
663  void moveToolBoxToBottom(QString _name);
664 
669  //===========================================================================
672  //===========================================================================
673 
674  private:
675 
677  std::vector< glViewer* > examiner_widgets_;
678 
680  QSplitter* splitter_;
681 
684 
687 
690 
693 
696 
698  QMenu* helpMenu_;
699 
701  QMenu* windowMenu_;
702 
705 
707  OFGLWidget* glWidget_;
708 
711 
714 
716  QGraphicsWidget* centerWidget_;
717 
720 
723 
725  QWidget* toolBoxArea_;
726 
728  QToolButton *viewModePopupBtn_;
729 
731  QSplitter* toolSplitter_;
732 
735 
737  QScrollArea* toolBoxScroll_;
738 
740  typedef std::map<QToolBar*,QGraphicsProxyWidget*> PickToolBarMap;
741  PickToolBarMap curPickingToolbarItems_;
742 
745 
747  std::set<QToolBar*> registeredToolbars_;
748 
751 
752 
753  // widget showing the scenegraph
755 
757 
759 
762  private slots:
763 
766  void slotShowSceneGraphDialog();
767 
768 
771  void slotActivateExaminer ();
772 
773 
778  void slotLog(Logtype _type, QString _message);
779 
782  void sceneRectChanged(const QRectF &rect);
783 
784  //===========================================================================
787  //===========================================================================
788  private slots :
789 
790  void slotAddMenubarAction( QAction* _action , QString _name );
791  void slotAddMenubarActions( std::vector<QAction*> _actions , QString _name );
792  void slotGetMenubarMenu (QString _name, QMenu *& _menu, bool _create);
793 
794  private:
795 
797  QMenu *fileMenu_;
798 
800  QMenu *viewMenu_;
801 
803  QMenu* pythonMenu_;
804 
806  QMenu *toolsMenu_;
807 
809  QAction* fileMenuEnd_;
810 
812  QMap<QString, QMenu *> menus_;
813 
816  //===========================================================================
819  //===========================================================================
820  private:
821  QToolBar* viewerToolbar_;
822 
824 
825  QToolButton* stereoButton_;
826  QToolButton* moveButton_;
827  QToolButton* pickButton_;
828  QToolButton* questionButton_;
829 
830  QComboBox* viewerLayoutBox_;
831 
834  //===========================================================================
837  //===========================================================================
838 
839  public slots:
841  void slotUpdateGlobalDrawMenu();
842 
844  void slotUpdateRendererMenu();
845 
847  void setViewerLayout(int _idx);
848 
849  private slots:
851  void nextViewerLayout();
852 
854  void slotGlobalDrawMenu(QAction * _action);
855 
857  void slotViewMenuAboutToShow();
858 
860  void slotGlobalRendererMenu(QAction * _action);
861 
863  void slotGlobalPostProcessorMenu(QAction * _action);
864 
865  private:
868 
871 
872  QActionGroup * drawGroup_;
873 
875  QActionGroup * rendererGroup_;
876 
878  QActionGroup* viewGroup_;
879 
882 
885 
888 
891 
894 
897 
899 
901 
904  //===========================================================================
907  //===========================================================================
908 
909  signals :
911  void updateContextMenu(int);
912 
914  void updateContextMenuNode(int);
915 
917  void updateContextMenuBackground();
918 
919 
920  private slots:
922  void slotCustomContextMenu( const QPoint& _point );
923 
925  void slotAddContextItem(QAction* _entry, ContextMenuType _type);
926 
928  void slotAddContextItem( QAction* _entry , DataType _dataType ,ContextMenuType type_);
929 
931  void slotAddContextItemToViewMode( QAction* _entry );
932 
934  void slotPasteView( );
935 
937  void slotPasteViewAndWindow( );
938 
940  void slotSetView( QString view );
941 
943  void slotSetViewAndWindowGeometry( QString view );
944 
946  void slotCopyView( );
947 
949  void slotViewerDrawMenu( QAction * _action );
950 
952  void slotPostProcessorMenu( QAction * _action);
953 
955  void slotRenderMenu( QAction * _action);
956 
958  void slotUpdateViewerDrawMenu();
959 
961  void slotExaminerSnapshot();
962 
964  void slotSwitchWheels(bool _state);
965 
967  void slotSwitchNavigation(bool _egomode);
968 
970  void slotSnapshotName();
971 
973  void slotCoordSysVisibility(bool _visible);
974 
975  private :
980  void updatePopupMenu(const QPoint& _point);
981 
982  void updatePopupMenuCoordsysNode(QMenu* _menu , const int _part);
983  void updatePopupMenuObject(QMenu* _menu , BaseObjectData* _object );
984  void updatePopupMenuBackground(QMenu* _menu , const QPoint& _point);
985  void updatePopupMenuNode(QMenu* _menu , ACG::SceneGraph::BaseNode* _node);
986 
987  bool addContextMenus( QMenu* _menu , ContextMenuType _type, int _id = -1);
988 
989  private :
991  QMenu* contextMenu_;
992 
995 
997  std::vector< MenuInfo > contextMenus_;
998 
1000  QActionGroup* drawGroupViewer_;
1001 
1004 
1007 
1011 
1014  //===========================================================================
1017  //===========================================================================
1018 
1019  private:
1020 
1021  QString snapshotName_;
1023 
1024  public slots:
1025 
1027  void viewerSnapshotDialog();
1028 
1030  void viewerSnapshot();
1031 
1033  void applicationSnapshotDialog();
1034 
1036  void applicationSnapshot();
1037 
1039  void applicationSnapshotName(QString _name);
1040 
1042  void viewerSnapshot(QString file_name, bool store_comments,
1043  bool comments_visible_only, bool comments_targeted_only,
1044  bool store_material_info, int snapshot_width, int snapshot_height,
1045  bool snapshot_transparent, bool hide_coord_sys,
1046  int snapshot_multisampling, bool store_view);
1047 
1050  //===========================================================================
1053  //===========================================================================
1054 
1055  public:
1056 
1057  void writeImageAsynchronously(QImage* _image, const QString _name);
1058 
1059  private:
1060 
1061  // Store pointers to QFuture and QFutureWatcher
1062  std::map<QFutureWatcher<void>*,QFuture<void>*> watcher_garbage_;
1063 
1064  // Mutex for operations on map
1065  QMutex map_mutex_;
1066 
1067  private slots:
1068 
1069  void delete_garbage();
1070 
1073  //===========================================================================
1076  //===========================================================================
1077 
1078  private slots:
1079  void slotGetStackWidget( QString _name, QWidget*& _widget );
1080  void slotAddStackWidget( QString _name, QWidget* _widget );
1081  void slotUpdateStackWidget( QString _name, QWidget* _widget );
1082 
1083  void slotViewMenuAction( QAction * _action);
1084 
1085  void slotUpdateStackMenu();
1086 
1087 
1088  private :
1090  QMenu* stackMenu_;
1091 
1092  std::vector< StackWidgetInfo > stackWidgetList_;
1093 
1094  public :
1096  QStackedWidget* stackedWidget_;
1097 
1100  //===========================================================================
1103  //===========================================================================
1104 
1105  private:
1106  static const QString homePage_;
1107 
1108  public slots:
1110  void showHelpBrowser(const QString &page = homePage_);
1111 
1112  signals:
1113  void changeHelpSite(QUrl);
1114 
1115  private:
1118 
1121  //===========================================================================
1124  //===========================================================================
1125 
1126 
1127  public slots:
1128 
1129  void slotShowPostProcessorManager();
1130 
1131  private:
1132  PostProcessorDialog* postProcessorDialog_;
1133 
1136  //===========================================================================
1139  //===========================================================================
1140 
1141 
1142  public slots:
1143 
1145  void slotShowRenderManager();
1146 
1148  void slotShowRenderObjectWidget();
1149 
1150  private:
1153 
1156  //===========================================================================
1159  //===========================================================================
1160 
1161  public slots:
1163  void stereoButtonContextMenu(const QPoint& _pos);
1164 
1168  void slotApplyStereoSettings(int _tmpParam = 0);
1169 
1170 
1171  private:
1174 
1177  //===========================================================================
1180  //===========================================================================
1181 
1182  public slots:
1184  void showAboutWidget();
1185 
1191  void addAboutInfo(QString _text, QString _tabName );
1192 
1193  private:
1198  void addCoreLicenseInfo();
1199 
1200  private:
1203 
1205  QMap<QString,QString> additionalAboutTabs_;
1206 
1209  //===========================================================================
1212  //===========================================================================
1213 
1214  public slots:
1216  void showOptionsWidget();
1217 
1218  signals:
1219  void applyOptions();
1220  void saveOptions();
1221 
1222  private:
1223 
1226 
1227 
1230  //===========================================================================
1233  //===========================================================================
1234 
1235  public slots:
1236 
1237  void showPythonScriptInterpreter();
1238 
1239  private:
1242 
1245  //===========================================================================
1248  //===========================================================================
1249  private slots:
1251  void slotAddToolbar(QToolBar* _toolbar);
1252 
1254  void slotRemoveToolbar(QToolBar* _toolbar);
1255 
1257  void getToolBar( QString _name, QToolBar*& _toolbar);
1258 
1259  private :
1260  QToolBar* mainToolbar_;
1261 
1262  std::vector< QToolBar* > toolbars_;
1263 
1266  //===========================================================================
1269  //===========================================================================
1270  public slots:
1271  void statusMessage(QString _message, int _timeout = 0);
1272 
1273  void clearStatusMessage();
1274 
1275  void setStatus( ApplicationStatus::applicationStatus _status);
1276 
1277  void addWidgetToStatusbar(QWidget* _widget);
1278 
1279  private:
1280  void setupStatusBar();
1281 
1282  private :
1283  ColorStatusBar* statusBar_;
1284 
1285  QLabel* statusIcon_;
1286 
1289  //===========================================================================
1292  //===========================================================================
1293 
1294  signals:
1295  void dragOpenFile(QString _filename);
1296 
1297  private slots:
1298  void startDrag( QMouseEvent* _event );
1299 
1300  void dragEnterEvent(QDragEnterEvent* _event);
1301 
1302  void dropEvent( QDropEvent* _event );
1303 
1306  //===========================================================================
1309  //===========================================================================
1310 
1311  private slots:
1312 
1314  void slotToggleStereoMode();
1315 
1317  void slotSetGlobalBackgroundColor();
1318 
1320  void slotSetContextBackgroundColor();
1321 
1322 
1323 
1325  void slotContextHomeView();
1326 
1328  void slotGlobalHomeView();
1329 
1330 
1331 
1333  void slotContextSetHomeView();
1334 
1336  void slotGlobalSetHomeView();
1337 
1338 
1339 
1341  void slotContextViewAll();
1342 
1344  void slotGlobalViewAll();
1345 
1346 
1348  void slotContextSwitchProjection();
1349 
1351  ACG::SceneGraph::CoordsysNode::ProjectionMode getCoordsysProjection();
1352 
1354  void slotContextSwitchCoordsysProjection();
1355 
1357  void slotGlobalPerspectiveProjection();
1358 
1360  void slotGlobalOrthographicProjection();
1361 
1362 
1364  void slotSetViewingDirection(QAction* _action);
1365 
1367  void slotLockRotation(bool _lock);
1368 
1369 
1370 
1372  void slotGlobalToggleAnimation();
1373 
1375  void slotGlobalChangeAnimation(bool _animation);
1376 
1378  void slotLocalChangeAnimation(bool _animation);
1379 
1380 
1381 
1383  void slotGlobalToggleBackFaceCulling();
1384 
1386  void slotGlobalChangeBackFaceCulling(bool _backFaceCulling);
1387 
1389  void slotLocalChangeBackFaceCulling(bool _backFaceCulling);
1390 
1391 
1392 
1394  void slotGlobalToggleTwoSidedLighting();
1395 
1397  void slotGlobalChangeTwoSidedLighting(bool _lighting);
1398 
1400  void slotLocalChangeTwoSidedLighting(bool _lighting);
1401 
1402 
1403 
1405  void slotGlobalToggleMultisampling();
1406 
1408  void slotGlobalChangeMultisampling(bool _multisampling);
1409 
1411  void slotLocalChangeMultisampling(bool _multisampling);
1412 
1413 
1415  void slotGlobalToggleMipmapping();
1416 
1418  void slotGlobalChangeMipmapping(bool _multisampling);
1419 
1421  void slotLocalChangeMipmapping(bool _mipmapping);
1422 
1423 
1425  void moveBack();
1426 
1428  void moveForward();
1429 
1431  void strafeLeft();
1432 
1434  void strafeRight();
1435 
1436  signals :
1440  void drawModeChanged(int _viewerId);
1441 
1442  private :
1444 
1447  //===========================================================================
1450  //===========================================================================
1451 
1452  public slots:
1453 
1454  bool examineMode() { return(actionMode_ == Viewer::ExamineMode ); };
1455  bool pickingMode() { return(actionMode_ == Viewer::PickingMode ); };
1456  bool lightMode() { return(actionMode_ == Viewer::LightMode ); };
1457  bool questionMode(){ return(actionMode_ == Viewer::QuestionMode ); };
1458 
1462  void setExamineMode() { setActionMode(Viewer::ExamineMode ); };
1463  void setPickingMode() { setActionMode(Viewer::PickingMode ); };
1464  void setQuestionMode(){ setActionMode(Viewer::QuestionMode ); };
1465 
1466  void setActionMode(const Viewer::ActionMode _am);
1467  void getActionMode(Viewer::ActionMode& _am);
1468 
1469  public:
1470  Viewer::ActionMode actionMode() { return actionMode_; };
1471  Viewer::ActionMode lastActionMode() { return lastActionMode_; };
1472 
1473  private :
1474  Viewer::ActionMode actionMode_, lastActionMode_;
1475 
1478  //===========================================================================
1481  //===========================================================================
1482 
1483  public:
1484 
1493  void addPickMode(const std::string& _name,
1494  bool _mouse_tracking = false,
1495  int _pos = -1,
1496  bool _visible = true,
1497  QCursor _cursor = Qt::ArrowCursor );
1498 
1501  void clearPickModes();
1502 
1505  const std::string& pickMode() const;
1506 
1510  void pickMode( int _id );
1511 
1512  void expandToolBoxWidget(QWidget *widget, bool expand);
1513 
1514  public slots:
1515 
1519  void setPickMode(const std::string& _name);
1520 
1521 
1522  void getPickMode(std::string& _name);
1523 
1525  void setActivePickToolBar(QToolBar* _tool);
1526 
1528  void hidePickToolBar();
1529 
1530  public slots:
1531 
1537  void setPickModeCursor(const std::string& _name, QCursor _cursor);
1538 
1544  void setPickModeMouseTracking(const std::string& _name, bool _mouseTracking);
1545 
1553  void setPickModeToolbar( const std::string& _mode , QToolBar * _toolbar );
1554 
1561  void removePickModeToolbar( const std::string& _mode );
1562 
1563  void actionPickMenu( QAction * _action );
1564 
1565  signals:
1568  void signalPickModeChanged(const std::string&);
1569 
1570  private:
1571 
1572  QMenu* pickMenu_;
1573 
1576  std::vector<PickMode> pick_modes_;
1577 
1580  std::string pick_mode_name_;
1581 
1585 
1589  std::vector<QAction*> extended_actions;
1590 
1591 
1593  void updatePickMenu();
1594 
1595  private slots:
1596 
1597  void hidePopupMenus();
1599 };
1600 
1601 
1602 //=============================================================================
1603 #endif // COREWIDGET_HH defined
1604 //=============================================================================
1605 
QWidget * viewModeControlBox_
Group box containing Task Switcher Controls.
Definition: CoreWidget.hh:683
StereoSettingsWidget * stereoSettingsWidget_
Widget to change stereo settings.
Definition: CoreWidget.hh:1173
QSplitter * splitter_
Spliter between toplevel objects and the textedit at the bottom.
Definition: CoreWidget.hh:680
QMenu * viewModeMenu_
Submenu holding all ViewMode actions.
Definition: CoreWidget.hh:592
PythonWidget * pythonWidget_
Pointer to the about widget.
Definition: CoreWidget.hh:1241
QtGLGraphicsView * glView_
graphics view that holds the gl scene
Definition: CoreWidget.hh:713
QMenu * helpMenu_
Help Menu.
Definition: CoreWidget.hh:698
QMenu * pickMenu_
Definition: CoreWidget.hh:1572
QActionGroup * viewGroup_
Group for all menu items.
Definition: CoreWidget.hh:878
void startVideoCapture(QString _baseName, int _fps, bool _captureViewers)
Start video capturing.
Definition: Video.cc:63
QMap< QString, QString > additionalAboutTabs_
Additional tab information, that could be provided by plugins.
Definition: CoreWidget.hh:1205
QMenu * coordSysMenu_
Definition: CoreWidget.hh:1010
void clearAll()
Clear all data objects.
Definition: Core.cc:1043
QSize defaultIconSize_
Show logger in splitter or not.
Definition: CoreWidget.hh:570
QAction * orthogonalProjectionAction_
This variable holds the global draw menu.
Definition: CoreWidget.hh:881
void loadPlugin(const QString &_filename, const bool _silent, QString &_licenseErrors, QObject *_plugin=0)
Function for loading Plugins.
QToolButton * stereoButton_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:825
void showStatusBar(bool _state)
Show or hide Status Bar.
Definition: Core.cc:1124
QAction * AC_ShowViewModeControls_
Action for View Mode Widget Conrol in Menu.
Definition: CoreWidget.hh:704
QStringList visibleContextMenus
List of context Menus in this view mode.
Definition: CoreWidget.hh:143
SideArea * getToolbox()
Show logger in splitter or not.
Definition: CoreWidget.hh:512
ViewMode struct This struct contains a ViewMode and its status information such as used widgets...
Definition: CoreWidget.hh:124
bool examineMode()
Definition: CoreWidget.hh:1454
void showToolbox(bool _state)
Show or hide toolbox.
Definition: Core.cc:1117
QAction * viewModeButton_
a List of all widgets in the toolbar
Definition: CoreWidget.hh:589
QToolButton * moveButton_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:826
void saveOptions()
Save the current options to the standard ini file.
ProjectionMode
projection mode
Definition: CoordsysNode.hh:88
HelpWidget * helpWidget_
Pointer to the help Browser.
Definition: CoreWidget.hh:1117
QAction * globalMipmappingAction_
Action to globally set mipmapping.
Definition: CoreWidget.hh:896
ActionMode
Enum listing action modes of the viewers.
bool questionMode()
Definition: CoreWidget.hh:1457
QToolBar * mainToolbar_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:1260
QString snapshotName_
Create a snapshot of the whole app with fileDialog.
Definition: CoreWidget.hh:1021
QAction * fileMenuEnd_
First entry after all relevant parts of the File Menu.
Definition: CoreWidget.hh:809
QWidgetAction * viewModeChangePopupAction_
Handle to picking toolbar.
Definition: CoreWidget.hh:756
QMenu * contextMenu_
context Menu for the gl area
Definition: CoreWidget.hh:991
viewModeChangeWidget * modeChangeWidget
Handle to picking toolbar.
Definition: CoreWidget.hh:758
QtMultiViewLayout * baseLayout_
Base layout that holds gl views.
Definition: CoreWidget.hh:719
QScrollArea * getToolboxScrollArea()
Show logger in splitter or not.
Definition: CoreWidget.hh:510
void setPickingMode()
Definition: CoreWidget.hh:1463
AboutWidget * aboutWidget_
Pointer to the about widget.
Definition: CoreWidget.hh:1202
Definition: Core.hh:132
LoggerWidget * logWidget_
Textedit at the bottom for log messages.
Definition: CoreWidget.hh:686
Logtype
Log types for Message Window.
std::vector< KeyBinding > coreKeys_
vector of keys registered to the core
Definition: CoreWidget.hh:386
bool visible_
Definition: CoreWidget.hh:266
QAction * globalMultisamplingAction_
Action to globally set multisampling.
Definition: CoreWidget.hh:893
QMap< QString, QMenu * > menus_
All available menus.
Definition: CoreWidget.hh:812
ContextMenuType type
Type of the context Menu ( Context for what type .. Background,Object,Node)
Definition: CoreWidget.hh:171
QMenu * pythonMenu_
Python Menu.
Definition: CoreWidget.hh:803
Predefined datatypes.
Definition: DataTypes.hh:83
RendererObjectWidget * rendererObjectWidget_
shows the widget for the rendermanager
Definition: CoreWidget.hh:1152
void setQuestionMode()
Definition: CoreWidget.hh:1464
applicationStatus
Enum for the statusBar Status Icon.
QAction * perspectiveProjectionAction_
This variable holds the global draw menu.
Definition: CoreWidget.hh:880
SideArea * toolBox_
Toolbox.
Definition: CoreWidget.hh:734
void showViewModeControls(bool _show)
Show or Hide the viewmode control widget.
Definition: Core.cc:1075
void log(Logtype _type, QString _message)
Logg with OUT,WARN or ERR as type.
QActionGroup * drawGroupViewer_
DrawGroup for per Viewer Draw Modes.
Definition: CoreWidget.hh:1000
std::set< QToolBar * > registeredToolbars_
Store all toolbars that once have been registered.
Definition: CoreWidget.hh:747
QWidget * viewerDrawMenuWidget_
owns all the checkboxes of viewerDrawMenu_
Definition: CoreWidget.hh:1006
QActionGroup * drawGroup_
This variable holds the global draw menu.
Definition: CoreWidget.hh:872
ACG::QtWidgets::QtSceneGraphDialog * sceneGraphDialog_
Handle to picking toolbar.
Definition: CoreWidget.hh:754
void applyOptions()
after ini-files have been loaded and core is up or if options have been changed -> apply Options ...
bool shiftPressed_
Store the state of the shift key.
Definition: CoreWidget.hh:431
int snapshotCounter_
Create a snapshot of the whole app with fileDialog.
Definition: CoreWidget.hh:1022
QWidget * getToolboxArea()
Show logger in splitter or not.
Definition: CoreWidget.hh:511
LoggerState
State of the logging widget.
std::multimap< std::pair< int, Qt::KeyboardModifiers >, std::pair< QObject *, int > > KeyMap
typedefs
Definition: CoreWidget.hh:364
QActionGroup * rendererGroup_
Group for all renderers.
Definition: CoreWidget.hh:875
QMenu * rendererMenu_
This variable holds the global renderer menu.
Definition: CoreWidget.hh:870
QMenu * fileMenu_
File Menu.
Definition: CoreWidget.hh:797
QtGLGraphicsScene * glScene_
graphics scene used to paint gl context and widgets
Definition: CoreWidget.hh:710
QGraphicsWidget * centerWidget_
center widged
Definition: CoreWidget.hh:716
QWidget * toolBoxArea_
Widget for toolBox.
Definition: CoreWidget.hh:725
void resizeViewers(int _width, int _height)
resize the examinerViewer
Definition: Core.cc:1540
void setExamineMode()
Definition: CoreWidget.hh:1462
std::pair< KeyMap::iterator, KeyMap::iterator > KeyRange
typedefs
Definition: CoreWidget.hh:366
Viewer::ActionMode lastActionMode_
Definition: CoreWidget.hh:1471
QMenu * toolsMenu_
Tools Menu.
Definition: CoreWidget.hh:806
int originalLoggerSize_
Size of the logging window ( defaults to 240 )
Definition: CoreWidget.hh:689
int toolbarCount_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:823
RendererDialog * rendererDialog_
shows the widget for the rendermanager
Definition: CoreWidget.hh:1151
QToolBar * pickToolBarExternal_
Extra toolbar not in scene for picking.
Definition: CoreWidget.hh:744
QMenu * contextSelectionMenu_
Context Menu containing all selection elements.
Definition: CoreWidget.hh:994
int pick_mode_idx_
Definition: CoreWidget.hh:1584
QToolButton * viewModePopupBtn_
view mode gear icon at the upper left of the tool box
Definition: CoreWidget.hh:728
ACG::SceneGraph::DrawModes::DrawMode availableGlobalDrawModes_
This variable holds the global draw menu.
Definition: CoreWidget.hh:900
void resizeApplication(int _width, int _height)
resize the whole Application
Definition: Core.cc:1551
std::vector< PickMode > pick_modes_
Definition: CoreWidget.hh:1576
OFGLWidget * glWidget_
gl widget used as drawing area to paint the graphics scene
Definition: CoreWidget.hh:707
void slotLog(Logtype _type, QString _message)
Console logger.
Definition: Logging.cc:91
static const QString homePage_
Pointer to the help Browser.
Definition: CoreWidget.hh:1106
QList< SlotInfo > & coreSlots_
list of scripting slots from core
Definition: CoreWidget.hh:395
std::vector< StackWidgetInfo > stackWidgetList_
QMenu containing the recently opened files.
Definition: CoreWidget.hh:1092
OptionsWidget * optionsWidget_
Pointer to the OptionsWidget.
Definition: CoreWidget.hh:1225
QString icon
Definition: CoreWidget.hh:131
bool stereoActive_
The viewer with id _viewerId changed its draw Mode.
Definition: CoreWidget.hh:1443
Struct containing information about pickModes.
Definition: CoreWidget.hh:179
PickToolBarMap curPickingToolbarItems_
Handle to picking toolbar.
Definition: CoreWidget.hh:741
std::vector< QToolBar *> toolbars_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:1262
QMenu * viewerDrawMenu_
Draw Menu for per Viewer Draw Modes.
Definition: CoreWidget.hh:1003
std::string name_
Name of the pickMode.
Definition: CoreWidget.hh:258
QMenu * algorithmMenu_
Algorithms Menu.
Definition: CoreWidget.hh:695
QString name
Name of the View Mode.
Definition: CoreWidget.hh:127
std::vector< glViewer *> examiner_widgets_
Examiner Widget.
Definition: CoreWidget.hh:677
QMenu * windowMenu_
Window Menu.
Definition: CoreWidget.hh:701
Implementation of the logger Widget.
Definition: loggerWidget.hh:61
bool tracking_
Definition: CoreWidget.hh:262
Viewer::ActionMode actionMode()
Definition: CoreWidget.hh:1470
QMenu * globalDrawMenu_
This variable holds the global draw menu.
Definition: CoreWidget.hh:867
DataType contextType
Type of objects for which the context Menu should be visible.
Definition: CoreWidget.hh:168
QVector< ViewMode * > & viewModes_
List of currently available viewModes.
Definition: CoreWidget.hh:585
bool pickingMode()
Definition: CoreWidget.hh:1455
QtSlideWindow * slidingLogger_
Class that holds the animated log widget.
Definition: CoreWidget.hh:722
QStackedWidget * stackedWidget_
Container widget for holding multiple views.
Definition: CoreWidget.hh:1096
QStringList visibleToolboxes
List of Visible Toolboxes in this view mode.
Definition: CoreWidget.hh:137
QAction * globalBackfaceCullingAction_
Action to globally set backface culling.
Definition: CoreWidget.hh:887
OpenFlipper::Options::LoggerState loggerState_
Show logger in splitter or not.
Definition: CoreWidget.hh:568
Class for the handling of simple configuration files.
Definition: INIFile.hh:99
QStringList visibleToolbars
List of Toolbars in this view mode.
Definition: CoreWidget.hh:140
bool lightMode()
Definition: CoreWidget.hh:1456
std::vector< QAction * > extended_actions
Definition: CoreWidget.hh:1589
QAction * globalTwosidedLightingAction_
Action to globally set two-sided lighting.
Definition: CoreWidget.hh:890
void applicationSnapshotName(QString _name)
Set the baseName for the application snapshot.
Definition: Core.cc:1513
CursorPainter * cursorPainter_
Cursor handling.
Definition: CoreWidget.hh:750
void showReducedMenuBar(bool reduced)
Core scripting engine.
Definition: Core.cc:2055
QVector< QWidget * > toolWidgets_
a List of all widgets in the toolbar
Definition: CoreWidget.hh:581
QMenu * recentFilesMenu_
QMenu containing the recently opened files.
Definition: CoreWidget.hh:692
void setViewMode(QString _viewMode)
Set the active ViewMode.
Definition: scripting.cc:137
QComboBox * viewerLayoutBox_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:830
QToolBar * viewerToolbar_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:821
bool custom
Is this a user defined custom view mode or a plugin generated one.
Definition: CoreWidget.hh:134
std::vector< PluginInfo > & plugins()
Index of Plugins toolbox widget.
Definition: Core.cc:765
QToolButton * pickButton_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:827
QToolButton * questionButton_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:828
void moveToolBoxToTop(QString _name)
Move selected toolbox to top of side area.
Definition: scripting.cc:171
The Menu will be shown when the background was picked.
QMenu * viewMenu_
View Menu.
Definition: CoreWidget.hh:800
std::string pick_mode_name_
Definition: CoreWidget.hh:1580
QToolBar * toolbar_
Definition: CoreWidget.hh:274
InverseKeyMap invKeys_
mapping of all registered keys and the corresponding plugins to currently assigned keys ...
Definition: CoreWidget.hh:392
KeyMap keys_
mapping of all keys to registered keys and the corresponding plugins
Definition: CoreWidget.hh:389
QScrollArea * toolBoxScroll_
Toolbox scroll area.
Definition: CoreWidget.hh:737
std::map< QToolBar *, QGraphicsProxyWidget * > PickToolBarMap
Handle to picking toolbar.
Definition: CoreWidget.hh:740
ACG::SceneGraph::DrawModes::DrawMode activeDrawModes_
This variable holds the global draw menu.
Definition: CoreWidget.hh:898
QAction * action
The context item.
Definition: CoreWidget.hh:165
void viewerSnapshot()
Take a snapshot from all viewers.
Definition: Core.cc:1519
QSplitter * toolSplitter_
Spliter between toplevel objects and toolbox.
Definition: CoreWidget.hh:731
QCursor cursor_
Definition: CoreWidget.hh:270
QAction * globalAnimationAction_
Action to globally set animation.
Definition: CoreWidget.hh:884
void moveToolBoxToBottom(QString _name)
Move selected toolbox to bottom of side area.
Definition: scripting.cc:180
void applicationSnapshot()
Take a snapshot from the whole app.
Definition: Core.cc:1507
~PickMode()
Destructor.
Definition: CoreWidget.hh:186
std::vector< MenuInfo > contextMenus_
All real context menu entries.
Definition: CoreWidget.hh:997
void stopVideoCapture()
Stop video capturing.
Definition: Video.cc:109
QMenu * stackMenu_
QMenu containing the recently opened files.
Definition: CoreWidget.hh:1090