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 * $Revision$ *
45 * $LastChangedBy$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49 
50 
51 //=============================================================================
52 //
53 // CLASS CoreWidget
54 //
55 //=============================================================================
56 
62 #ifndef COREWIDGET_HH
63 #define COREWIDGET_HH
64 
65 
66 //== INCLUDES =================================================================
67 
68 #include <set>
69 
75 #include <OpenFlipper/BasePlugin/ViewInterface.hh>
77 
78 #include <OpenFlipper/widgets/coreWidget/SideArea.hh>
79 #include <OpenFlipper/widgets/coreWidget/ColorStatusBar.hh>
80 
81 #include <OpenFlipper/widgets/glWidget/QtBaseViewer.hh>
82 #include <OpenFlipper/widgets/glWidget/QtGLGraphicsScene.hh>
83 #include <OpenFlipper/widgets/glWidget/QtGLGraphicsView.hh>
84 #include <OpenFlipper/widgets/glWidget/QtMultiViewLayout.hh>
85 #include <OpenFlipper/widgets/glWidget/QtSlideWindow.hh>
86 
87 // QT INCLUDES
88 #include <QMainWindow>
89 #include <QStackedWidget>
90 #include <QTextEdit>
91 #include <QToolBar>
92 #include <QStatusBar>
93 
94 #include <QFuture>
95 #include <QFutureWatcher>
96 
97 #include <QDockWidget>
98 
99 #include <OpenFlipper/widgets/aboutWidget/aboutWidget.hh>
100 #include <OpenFlipper/widgets/loggerWidget/loggerWidget.hh>
101 #include <OpenFlipper/widgets/optionsWidget/optionsWidget.hh>
102 #include <OpenFlipper/widgets/helpWidget/helpWidget.hh>
103 #include <OpenFlipper/widgets/stereoSettingsWidget/stereoSettingsWidget.hh>
104 #include <OpenFlipper/widgets/postProcessorWidget/postProcessorWidget.hh>
105 #include <OpenFlipper/widgets/rendererWidget/rendererWidget.hh>
106 #include <OpenFlipper/widgets/rendererWidget/rendererObjectWidget.hh>
107 
108 #include <OpenFlipper/Core/PluginInfo.hh>
109 
110 #include <ACG/QtWidgets/QtSceneGraphWidget.hh>
111 
112 #include <ACG/Scenegraph/DrawModes.hh>
113 #include <ACG/Scenegraph/CoordsysNode.hh>
114 
115 #include <OpenFlipper/INIFile/INIFile.hh>
117 
118 #include "../viewModeWidget/viewModeChangeWidget.hh"
119 
129 struct ViewMode{
130 
132  QString name;
133 
136  QString icon;
137 
139  bool custom;
140 
142  QStringList visibleToolboxes;
143 
145  QStringList visibleToolbars;
146 
148  QStringList visibleContextMenus;
149 };
150 
152  public:
153  StackWidgetInfo(bool _editable,QString _name,QWidget* _widget);
154 
155  bool editable;
156  QString name;
157  QWidget* widget;
158 };
159 
162 class MenuInfo {
163  public:
164  MenuInfo():
165  action(0),
167  {}
168 
170  QAction* action;
171 
174 
177 };
178 
184 class PickMode
185 {
186  public:
188  PickMode(const std::string& _n, const bool _t, const bool _v, QCursor _c, QToolBar *_tb = 0 );
189 
191  ~PickMode() {};
192 
193 
198  void visible(const bool _visible);
199 
204  bool visible() const;
205 
210  std::string name() const;
211 
219  void tracking(const bool _tracking);
220 
226  bool tracking() const;
227 
233  QCursor cursor() const;
234 
242  void cursor(const QCursor _cursor);
243 
251  void toolbar(QToolBar* _toolbar);
252 
258  QToolBar* toolbar() const;
259 
260  private:
261 
263  std::string name_;
264 
267  bool tracking_;
268 
271  bool visible_;
272 
275  QCursor cursor_;
276 
279  QToolBar * toolbar_;
280 };
281 
284 class CoreWidget : public QMainWindow
285 {
286  Q_OBJECT
287 
288 public:
289 
290  friend class Core;
291 
293  CoreWidget( QVector<ViewMode*>& _viewModes, std::vector<PluginInfo>& _plugins, QList< SlotInfo >& _coreSlots );
294 
296  ~CoreWidget();
297 
298  signals:
299  void clearAll();
300  void loadMenu();
301  void addEmptyObjectMenu();
302  void saveMenu();
303  void saveToMenu();
304  void loadIniMenu();
305  void saveIniMenu();
306  void recentOpen(QAction*);
307  void exit();
308 
309  void loadPlugin();
310  void showPlugins();
311 
312  private slots:
313 
315  void closeEvent ( QCloseEvent * event );
316 
317  //===========================================================================
320  //===========================================================================
321 
322  signals :
323  void log(Logtype _type, QString _message);
324  void log(QString _message);
325 
328  //===========================================================================
331  //===========================================================================
332 
333  protected :
334 
336  virtual void keyPressEvent (QKeyEvent* _e);
337  virtual void keyReleaseEvent(QKeyEvent* _e);
338 
339  // Filter alt key events under windows
340  //bool eventFilter(QObject *obj, QEvent *ev);
341 
342  private:
343  //event handling
344  bool event( QEvent *event );
345 
346  bool eventFilter(QObject *_obj, QEvent *_event);
347 
348  signals :
349 
353  void PluginKeyEvent(QKeyEvent* );
354 
358  void PluginKeyReleaseEvent(QKeyEvent* );
359 
361  void registerKey(int _key, Qt::KeyboardModifiers _modifiers, QString _description,
362  bool _multiUse = false);
363 
365  void call( QString _expression , bool& _success );
366 
367  private:
369  typedef std::multimap< std::pair< int, Qt::KeyboardModifiers > , std::pair< QObject*, int > > KeyMap;
370 
371  typedef std::pair< KeyMap::iterator, KeyMap::iterator > KeyRange;
372 
375  void registerCoreKeys();
376 
381  void coreKeyPressEvent();
382 
384  void coreKeyPressEvent (QKeyEvent* _e);
385  void coreKeyReleaseEvent(QKeyEvent* _e);
386 
387  KeyBinding getKeyBinding(QObject* _plugin, int _keyIndex );
388  QString getRPCName(QObject* _plugin );
389 
391  std::vector<KeyBinding> coreKeys_;
392 
394  KeyMap keys_;
395 
397  InverseKeyMap invKeys_;
398 
400  QList< SlotInfo >& coreSlots_;
401 
402  private slots:
408  void slotRegisterKey(int _key, Qt::KeyboardModifiers _modifiers, QString _description,
409  bool _multiUse = false);
410 
411  public slots:
416  void slotAddKeyMapping(int _key, Qt::KeyboardModifiers _modifiers, QObject* _plugin, int _keyBindingID);
417 
423  void slotRegisterSlotKeyBindings();
424 
425  public:
427  void loadKeyBindings(INIFile& _ini);
428 
430  void saveKeyBindings(INIFile& _ini);
431 
432  void showReducedMenuBar(bool reduced);
433 
434  private:
437 
440  //===========================================================================
443  //===========================================================================
444 
445  public:
446 
448  void setupMenuBar();
449 
452  //===========================================================================
455  //===========================================================================
456 
457  signals:
458  void startVideoCapture(QString _baseName, int _fps, bool _captureViewers);
459  void stopVideoCapture();
460 
461  void resizeViewers(int _width, int _height);
462  void resizeApplication(int _width, int _height);
463 
464  private slots:
465  void startVideoCaptureDialog();
466 
469  //===========================================================================
472  //===========================================================================
473 
474  public:
475 
477  void addRecent(QString _filename, DataType _type);
478 
480  void updateRecent();
481 
484  //===========================================================================
487  //===========================================================================
488 
489  public :
490 
492  void showLoggerInSplitView(bool _show);
493 
495  void updateInSceneLoggerGeometry();
496 
498  void setForceNativeCursor ( bool _state );
499 
500  QSize defaultIconSize();
501 
502  QScrollArea* getToolboxScrollArea() { return toolBoxScroll_; }
503  QWidget* getToolboxArea() { return toolBoxArea_; }
504  SideArea* getToolbox() { return toolBox_; }
505 
506  public slots:
507 
509  void toggleFullscreen();
510 
512  void setFullscreen(bool _state );
513 
515  void toggleLogger();
516 
518  void showLogger(OpenFlipper::Options::LoggerState _state);
519 
521  void toggleToolbox();
522 
524  void showToolbox( bool _state );
525 
527  void toggleStatusBar();
528 
530  void showStatusBar( bool _state );
531 
533  void showMenuBar( bool _state );
534 
536  void toggleMenuBar();
537 
539  void toggleToolBar();
540 
542  void showToolBar( bool _state );
543  signals:
545  void toolBarVisChanged( bool _state );
546 
548  void toolBoxVisChanged( bool _state );
549 
551  void statusBarVisChanged( bool _state );
552 
554  void menuBarVisChanged( bool _state );
555 
557  void fullScreenChanged( bool _state );
558 
559  private:
561 
563 
566  //===========================================================================
569  //===========================================================================
570 
571  private:
573  QVector<QWidget*> toolWidgets_;
574 
575  public:
577  QVector<ViewMode*>& viewModes_;
578 
579  private:
580 
581  QAction* viewModeButton_;
582 
585 
586  public slots:
587 
589  void initViewModes( );
590 
592  void slotAddViewModeToolboxes(QString _mode, QStringList _usedWidgets);
593 
595  void slotAddViewModeToolboxes(QString _mode, bool _custom, QStringList _usedWidgets);
596 
598  void slotAddViewModeToolbars(QString _mode, QStringList _usedToolbars);
599 
601  void slotAddViewModeToolbars(QString _mode, bool _custom, QStringList _usedToolbars);
602 
604  void slotAddViewModeContextMenus(QString _mode, QStringList _usedToolbars);
605 
607  void slotAddViewModeContextMenus(QString _mode, bool _custom, QStringList _usedToolbars);
608 
610  void slotAddViewModeComplete(QString _mode , bool _custom, QStringList _toolboxes, QStringList _toolbars, QStringList _contextmenus);
611 
613  void slotSetViewModeIcon(QString _mode, QString _iconName);
614 
616  void slotSetViewModeIcon(QString _mode, bool _custom, QString _iconName);
617 
619  void slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus, bool _expandAll = false);
620 
622  void setToolBoxOrientationOnTheRight(bool _toolBoxRight);
623 
625  void showViewModeControls(bool _show);
626 
628  void slotHideContextMenu();
629 
630  private slots:
632  void slotRemoveViewMode(QString _name);
633 
635  void slotSetViewMode( QAction* action);
636 
638  void slotViewModeDialog();
639 
641  void closeChangeViewModePopup();
642 
644  void slotUpdateExaminer(unsigned _id);
645 
646  public slots :
647 
649  void setViewMode( QString _mode, bool _expandAll = false );
650 
652  void moveToolBoxToTop(QString _name);
653 
655  void moveToolBoxToBottom(QString _name);
656 
661  //===========================================================================
664  //===========================================================================
665 
666  private:
667 
669  std::vector< glViewer* > examiner_widgets_;
670 
672  QSplitter* splitter_;
673 
676 
679 
682 
685 
688 
690  QMenu* helpMenu_;
691 
693  QMenu* windowMenu_;
694 
697 
699  QGLWidget* glWidget_;
700 
703 
706 
708  QGraphicsWidget* centerWidget_;
709 
712 
715 
717  QWidget* toolBoxArea_;
718 
720  QToolButton *viewModePopupBtn_;
721 
723  QSplitter* toolSplitter_;
724 
727 
729  QScrollArea* toolBoxScroll_;
730 
732  typedef std::map<QToolBar*,QGraphicsProxyWidget*> PickToolBarMap;
733  PickToolBarMap curPickingToolbarItems_;
734 
737 
739  std::set<QToolBar*> registeredToolbars_;
740 
743 
744 
745  // widget showing the scenegraph
747 
749 
751 
754  private slots:
755 
758  void slotShowSceneGraphDialog();
759 
760 
763  void slotActivateExaminer ();
764 
765 
770  void slotLog(Logtype _type, QString _message);
771 
774  void sceneRectChanged(const QRectF &rect);
775 
776  //===========================================================================
779  //===========================================================================
780  private slots :
781 
782  void slotAddMenubarAction( QAction* _action , QString _name );
783  void slotAddMenubarActions( std::vector<QAction*> _actions , QString _name );
784  void slotGetMenubarMenu (QString _name, QMenu *& _menu, bool _create);
785 
786  private:
787 
789  QMenu *fileMenu_;
790 
792  QMenu *viewMenu_;
793 
795  QMenu *toolsMenu_;
796 
798  QAction* fileMenuEnd_;
799 
801  QMap<QString, QMenu *> menus_;
802 
805  //===========================================================================
808  //===========================================================================
809  private:
810  QToolBar* viewerToolbar_;
811 
813 
814  QToolButton* stereoButton_;
815  QToolButton* moveButton_;
816  QToolButton* pickButton_;
817  QToolButton* questionButton_;
818 
819  QComboBox* viewerLayoutBox_;
820 
823  //===========================================================================
826  //===========================================================================
827 
828  public slots:
830  void slotUpdateGlobalDrawMenu();
831 
833  void slotUpdateRendererMenu();
834 
836  void setViewerLayout(int _idx);
837 
838  private slots:
840  void nextViewerLayout();
841 
843  void slotGlobalDrawMenu(QAction * _action);
844 
846  void slotViewMenuAboutToShow();
847 
849  void slotGlobalRendererMenu(QAction * _action);
850 
852  void slotGlobalPostProcessorMenu(QAction * _action);
853 
854  private:
857 
860 
861  QActionGroup * drawGroup_;
862 
864  QActionGroup * rendererGroup_;
865 
867  QActionGroup* viewGroup_;
868 
871 
874 
877 
880 
883 
886 
888 
890 
893  //===========================================================================
896  //===========================================================================
897 
898  signals :
900  void updateContextMenu(int);
901 
903  void updateContextMenuNode(int);
904 
906  void updateContextMenuBackground();
907 
908 
909  private slots:
911  void slotCustomContextMenu( const QPoint& _point );
912 
914  void slotAddContextItem(QAction* _entry, ContextMenuType _type);
915 
917  void slotAddContextItem( QAction* _entry , DataType _dataType ,ContextMenuType type_);
918 
920  void slotAddContextItemToViewMode( QAction* _entry );
921 
923  void slotPasteView( );
924 
926  void slotPasteViewAndWindow( );
927 
929  void slotSetView( QString view );
930 
932  void slotSetViewAndWindowGeometry( QString view );
933 
935  void slotCopyView( );
936 
938  void slotViewerDrawMenu( QAction * _action );
939 
941  void slotPostProcessorMenu( QAction * _action);
942 
944  void slotRenderMenu( QAction * _action);
945 
947  void slotUpdateViewerDrawMenu();
948 
950  void slotExaminerSnapshot();
951 
953  void slotSwitchWheels(bool _state);
954 
956  void slotSwitchNavigation(bool _egomode);
957 
959  void slotSnapshotName();
960 
962  void slotCoordSysVisibility(bool _visible);
963 
964  private :
969  void updatePopupMenu(const QPoint& _point);
970 
971  void updatePopupMenuCoordsysNode(QMenu* _menu , const int _part);
972  void updatePopupMenuObject(QMenu* _menu , BaseObjectData* _object );
973  void updatePopupMenuBackground(QMenu* _menu , const QPoint& _point);
974  void updatePopupMenuNode(QMenu* _menu , ACG::SceneGraph::BaseNode* _node);
975 
976  bool addContextMenus( QMenu* _menu , ContextMenuType _type, int _id = -1);
977 
978  private :
980  QMenu* contextMenu_;
981 
984 
986  std::vector< MenuInfo > contextMenus_;
987 
989  QActionGroup* drawGroupViewer_;
990 
993 
996 
1000 
1003  //===========================================================================
1006  //===========================================================================
1007 
1008  private:
1009 
1010  QString snapshotName_;
1012 
1013  public slots:
1014 
1016  void viewerSnapshotDialog();
1017 
1019  void viewerSnapshot();
1020 
1022  void applicationSnapshotDialog();
1023 
1025  void applicationSnapshot();
1026 
1028  void applicationSnapshotName(QString _name);
1029 
1031  void viewerSnapshot(QString file_name, bool store_comments,
1032  bool comments_visible_only, bool comments_targeted_only,
1033  bool store_material_info, int snapshot_width, int snapshot_height,
1034  bool snapshot_transparent, bool hide_coord_sys,
1035  int snapshot_multisampling, bool store_view);
1036 
1039  //===========================================================================
1042  //===========================================================================
1043 
1044  public:
1045 
1046  void writeImageAsynchronously(QImage* _image, const QString _name);
1047 
1048  private:
1049 
1050  // Store pointers to QFuture and QFutureWatcher
1051  std::map<QFutureWatcher<void>*,QFuture<void>*> watcher_garbage_;
1052 
1053  // Mutex for operations on map
1054  QMutex map_mutex_;
1055 
1056  private slots:
1057 
1058  void delete_garbage();
1059 
1062  //===========================================================================
1065  //===========================================================================
1066 
1067  private slots:
1068  void slotGetStackWidget( QString _name, QWidget*& _widget );
1069  void slotAddStackWidget( QString _name, QWidget* _widget );
1070  void slotUpdateStackWidget( QString _name, QWidget* _widget );
1071 
1072  void slotViewMenuAction( QAction * _action);
1073 
1074  void slotUpdateStackMenu();
1075 
1076 
1077  private :
1079  QMenu* stackMenu_;
1080 
1081  std::vector< StackWidgetInfo > stackWidgetList_;
1082 
1083  public :
1085  QStackedWidget* stackedWidget_;
1086 
1089  //===========================================================================
1092  //===========================================================================
1093 
1094  private:
1095  static const QString homePage_;
1096 
1097  public slots:
1099  void showHelpBrowser(const QString &page = homePage_);
1100 
1101  signals:
1102  void changeHelpSite(QUrl);
1103 
1104  private:
1107 
1110  //===========================================================================
1113  //===========================================================================
1114 
1115 
1116  public slots:
1117 
1118  void slotShowPostProcessorManager();
1119 
1120  private:
1121  PostProcessorDialog* postProcessorDialog_;
1122 
1125  //===========================================================================
1128  //===========================================================================
1129 
1130 
1131  public slots:
1132 
1134  void slotShowRenderManager();
1135 
1137  void slotShowRenderObjectWidget();
1138 
1139  private:
1142 
1145  //===========================================================================
1148  //===========================================================================
1149 
1150  public slots:
1152  void stereoButtonContextMenu(const QPoint& _pos);
1153 
1157  void slotApplyStereoSettings(int _tmpParam = 0);
1158 
1159 
1160  private:
1163 
1166  //===========================================================================
1169  //===========================================================================
1170 
1171  public slots:
1173  void showAboutWidget();
1174 
1180  void addAboutInfo(QString _text, QString _tabName );
1181 
1182  private:
1187  void addCoreLicenseInfo();
1188 
1189  private:
1192 
1194  QMap<QString,QString> additionalAboutTabs_;
1195 
1198  //===========================================================================
1201  //===========================================================================
1202 
1203  public slots:
1205  void showOptionsWidget();
1206 
1207  signals:
1208  void applyOptions();
1209  void saveOptions();
1210 
1211  private:
1212 
1215 
1218  //===========================================================================
1221  //===========================================================================
1222  private slots:
1224  void slotAddToolbar(QToolBar* _toolbar);
1225 
1227  void slotRemoveToolbar(QToolBar* _toolbar);
1228 
1230  void getToolBar( QString _name, QToolBar*& _toolbar);
1231 
1232  private :
1233  QToolBar* mainToolbar_;
1234 
1235  std::vector< QToolBar* > toolbars_;
1236 
1239  //===========================================================================
1242  //===========================================================================
1243  public slots:
1244  void statusMessage(QString _message, int _timeout = 0);
1245 
1246  void clearStatusMessage();
1247 
1248  void setStatus( ApplicationStatus::applicationStatus _status);
1249 
1250  void addWidgetToStatusbar(QWidget* _widget);
1251 
1252  private:
1253  void setupStatusBar();
1254 
1255  private :
1256  ColorStatusBar* statusBar_;
1257 
1258  QLabel* statusIcon_;
1259 
1262  //===========================================================================
1265  //===========================================================================
1266 
1267  signals:
1268  void dragOpenFile(QString _filename);
1269 
1270  private slots:
1271  void startDrag( QMouseEvent* _event );
1272 
1273  void dragEnterEvent(QDragEnterEvent* _event);
1274 
1275  void dropEvent( QDropEvent* _event );
1276 
1279  private :
1280 
1281  std::vector<PluginInfo>& plugins_;
1282 
1283 
1284  //===========================================================================
1287  //===========================================================================
1288 
1289  private slots:
1290 
1292  void slotToggleStereoMode();
1293 
1295  void slotSetGlobalBackgroundColor();
1296 
1298  void slotSetContextBackgroundColor();
1299 
1300 
1301 
1303  void slotContextHomeView();
1304 
1306  void slotGlobalHomeView();
1307 
1308 
1309 
1311  void slotContextSetHomeView();
1312 
1314  void slotGlobalSetHomeView();
1315 
1316 
1317 
1319  void slotContextViewAll();
1320 
1322  void slotGlobalViewAll();
1323 
1324 
1326  void slotContextSwitchProjection();
1327 
1329  ACG::SceneGraph::CoordsysNode::ProjectionMode getCoordsysProjection();
1330 
1332  void slotContextSwitchCoordsysProjection();
1333 
1335  void slotGlobalPerspectiveProjection();
1336 
1338  void slotGlobalOrthographicProjection();
1339 
1340 
1342  void slotSetViewingDirection(QAction* _action);
1343 
1345  void slotLockRotation(bool _lock);
1346 
1347 
1348 
1350  void slotGlobalToggleAnimation();
1351 
1353  void slotGlobalChangeAnimation(bool _animation);
1354 
1356  void slotLocalChangeAnimation(bool _animation);
1357 
1358 
1359 
1361  void slotGlobalToggleBackFaceCulling();
1362 
1364  void slotGlobalChangeBackFaceCulling(bool _backFaceCulling);
1365 
1367  void slotLocalChangeBackFaceCulling(bool _backFaceCulling);
1368 
1369 
1370 
1372  void slotGlobalToggleTwoSidedLighting();
1373 
1375  void slotGlobalChangeTwoSidedLighting(bool _lighting);
1376 
1378  void slotLocalChangeTwoSidedLighting(bool _lighting);
1379 
1380 
1381 
1383  void slotGlobalToggleMultisampling();
1384 
1386  void slotGlobalChangeMultisampling(bool _multisampling);
1387 
1389  void slotLocalChangeMultisampling(bool _multisampling);
1390 
1391 
1393  void slotGlobalToggleMipmapping();
1394 
1396  void slotGlobalChangeMipmapping(bool _multisampling);
1397 
1399  void slotLocalChangeMipmapping(bool _mipmapping);
1400 
1401 
1403  void moveBack();
1404 
1406  void moveForward();
1407 
1409  void strafeLeft();
1410 
1412  void strafeRight();
1413 
1414  signals :
1418  void drawModeChanged(int _viewerId);
1419 
1420  private :
1422 
1425  //===========================================================================
1428  //===========================================================================
1429 
1430  public slots:
1431 
1432  bool examineMode() { return(actionMode_ == Viewer::ExamineMode ); };
1433  bool pickingMode() { return(actionMode_ == Viewer::PickingMode ); };
1434  bool lightMode() { return(actionMode_ == Viewer::LightMode ); };
1435  bool questionMode(){ return(actionMode_ == Viewer::QuestionMode ); };
1436 
1440  void setExamineMode() { setActionMode(Viewer::ExamineMode ); };
1441  void setPickingMode() { setActionMode(Viewer::PickingMode ); };
1442  void setQuestionMode(){ setActionMode(Viewer::QuestionMode ); };
1443 
1444  void setActionMode(const Viewer::ActionMode _am);
1445  void getActionMode(Viewer::ActionMode& _am);
1446 
1447  public:
1448  Viewer::ActionMode actionMode() { return actionMode_; };
1449  Viewer::ActionMode lastActionMode() { return lastActionMode_; };
1450 
1451  private :
1452  Viewer::ActionMode actionMode_, lastActionMode_;
1453 
1456  //===========================================================================
1459  //===========================================================================
1460 
1461  public:
1462 
1471  void addPickMode(const std::string& _name,
1472  bool _mouse_tracking = false,
1473  int _pos = -1,
1474  bool _visible = true,
1475  QCursor _cursor = Qt::ArrowCursor );
1476 
1479  void clearPickModes();
1480 
1483  const std::string& pickMode() const;
1484 
1488  void pickMode( int _id );
1489 
1490  void expandToolBoxWidget(QWidget *widget, bool expand);
1491 
1492  public slots:
1493 
1497  void setPickMode(const std::string& _name);
1498 
1499 
1500  void getPickMode(std::string& _name);
1501 
1503  void setActivePickToolBar(QToolBar* _tool);
1504 
1506  void hidePickToolBar();
1507 
1508  public slots:
1509 
1515  void setPickModeCursor(const std::string& _name, QCursor _cursor);
1516 
1522  void setPickModeMouseTracking(const std::string& _name, bool _mouseTracking);
1523 
1531  void setPickModeToolbar( const std::string& _mode , QToolBar * _toolbar );
1532 
1539  void removePickModeToolbar( const std::string& _mode );
1540 
1541  void actionPickMenu( QAction * _action );
1542 
1543  signals:
1546  void signalPickModeChanged(const std::string&);
1547 
1548  private:
1549 
1550  QMenu* pickMenu_;
1551 
1554  std::vector<PickMode> pick_modes_;
1555 
1558  std::string pick_mode_name_;
1559 
1563 
1567  std::vector<QAction*> extended_actions;
1568 
1569 
1571  void updatePickMenu();
1572 
1573  private slots:
1574 
1575  void hidePopupMenus();
1577 };
1578 
1579 
1580 //=============================================================================
1581 #endif // COREWIDGET_HH defined
1582 //=============================================================================
1583 
QAction * orthogonalProjectionAction_
This variable holds the global draw menu.
Definition: CoreWidget.hh:870
QMenu * viewerDrawMenu_
Draw Menu for per Viewer Draw Modes.
Definition: CoreWidget.hh:992
Viewer::ActionMode actionMode()
Definition: CoreWidget.hh:1448
QAction * globalBackfaceCullingAction_
Action to globally set backface culling.
Definition: CoreWidget.hh:876
std::vector< QAction * > extended_actions
Definition: CoreWidget.hh:1567
std::vector< MenuInfo > contextMenus_
All real context menu entries.
Definition: CoreWidget.hh:986
void showStatusBar(bool _state)
Show or hide Status Bar.
Definition: Core.cc:1068
LoggerWidget * logWidget_
Textedit at the bottom for log messages.
Definition: CoreWidget.hh:678
QActionGroup * viewGroup_
Group for all menu items.
Definition: CoreWidget.hh:867
QToolBar * viewerToolbar_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:810
void loadPlugin(const QString &_filename, const bool _silent, QString &_licenseErrors, QObject *_plugin=0)
Function for loading Plugins.
QMap< QString, QMenu * > menus_
All available menus.
Definition: CoreWidget.hh:801
Predefined datatypes.
Definition: DataTypes.hh:96
std::vector< PluginInfo > plugins_
List of all loaded plugins_.
Definition: Core.hh:1208
void resizeApplication(int _width, int _height)
resize the whole Application
Definition: Core.cc:1491
QMenu * pickMenu_
Definition: CoreWidget.hh:1550
void setPickingMode()
Definition: CoreWidget.hh:1441
void slotLog(Logtype _type, QString _message)
Console logger.
Definition: Logging.cc:97
QtGLGraphicsScene * glScene_
graphics scene used to paint gl context and widgets
Definition: CoreWidget.hh:702
Logtype
Log types for Message Window.
bool pickingMode()
Definition: CoreWidget.hh:1433
bool stereoActive_
The viewer with id _viewerId changed its draw Mode.
Definition: CoreWidget.hh:1421
~PickMode()
Destructor.
Definition: CoreWidget.hh:191
QMenu * contextMenu_
context Menu for the gl area
Definition: CoreWidget.hh:980
bool custom
Is this a user defined custom view mode or a plugin generated one.
Definition: CoreWidget.hh:139
QtMultiViewLayout * baseLayout_
Base layout that holds gl views.
Definition: CoreWidget.hh:711
void applyOptions()
after ini-files have been loaded and core is up or if options have been changed -> apply Options ...
int toolbarCount_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:812
QToolButton * questionButton_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:817
QAction * action
The context item.
Definition: CoreWidget.hh:170
bool questionMode()
Definition: CoreWidget.hh:1435
QMenu * contextSelectionMenu_
Context Menu containing all selection elements.
Definition: CoreWidget.hh:983
QSplitter * toolSplitter_
Spliter between toplevel objects and toolbox.
Definition: CoreWidget.hh:723
void showViewModeControls(bool _show)
Show or Hide the viewmode control widget.
Definition: Core.cc:1019
QSize defaultIconSize_
Show logger in splitter or not.
Definition: CoreWidget.hh:562
std::pair< KeyMap::iterator, KeyMap::iterator > KeyRange
typedefs
Definition: CoreWidget.hh:371
bool visible_
Definition: CoreWidget.hh:271
QStringList visibleToolboxes
List of Visible Toolboxes in this view mode.
Definition: CoreWidget.hh:142
QMenu * helpMenu_
Help Menu.
Definition: CoreWidget.hh:690
Implementation of the logger Widget.
Definition: loggerWidget.hh:70
QMenu * coordSysMenu_
Definition: CoreWidget.hh:999
ViewMode struct This struct contains a ViewMode and its status information such as used widgets...
Definition: CoreWidget.hh:129
ACG::SceneGraph::DrawModes::DrawMode activeDrawModes_
This variable holds the global draw menu.
Definition: CoreWidget.hh:887
std::vector< KeyBinding > coreKeys_
vector of keys registered to the core
Definition: CoreWidget.hh:391
QMenu * viewMenu_
View Menu.
Definition: CoreWidget.hh:792
QtGLGraphicsView * glView_
graphics view that holds the gl scene
Definition: CoreWidget.hh:705
ProjectionMode
projection mode
Definition: CoordsysNode.hh:93
QActionGroup * rendererGroup_
Group for all renderers.
Definition: CoreWidget.hh:864
StereoSettingsWidget * stereoSettingsWidget_
Widget to change stereo settings.
Definition: CoreWidget.hh:1162
QString snapshotName_
Create a snapshot of the whole app with fileDialog.
Definition: CoreWidget.hh:1010
QGraphicsWidget * centerWidget_
center widged
Definition: CoreWidget.hh:708
SideArea * toolBox_
Toolbox.
Definition: CoreWidget.hh:726
QAction * fileMenuEnd_
First entry after all relevant parts of the File Menu.
Definition: CoreWidget.hh:798
std::multimap< std::pair< int, Qt::KeyboardModifiers >, std::pair< QObject *, int > > KeyMap
typedefs
Definition: CoreWidget.hh:369
void showReducedMenuBar(bool reduced)
Core scripting engine.
Definition: Core.cc:2039
QString icon
Definition: CoreWidget.hh:136
QToolBar * pickToolBarExternal_
Extra toolbar not in scene for picking.
Definition: CoreWidget.hh:736
void startVideoCapture(QString _baseName, int _fps, bool _captureViewers)
Start video capturing.
Definition: Video.cc:69
std::vector< PickMode > pick_modes_
Definition: CoreWidget.hh:1554
QAction * AC_ShowViewModeControls_
Action for View Mode Widget Conrol in Menu.
Definition: CoreWidget.hh:696
QVector< QWidget * > toolWidgets_
a List of all widgets in the toolbar
Definition: CoreWidget.hh:573
bool tracking_
Definition: CoreWidget.hh:267
void resizeViewers(int _width, int _height)
resize the examinerViewer
Definition: Core.cc:1480
QMenu * viewModeMenu_
Submenu holding all ViewMode actions.
Definition: CoreWidget.hh:584
QSplitter * splitter_
Spliter between toplevel objects and the textedit at the bottom.
Definition: CoreWidget.hh:672
void setExamineMode()
Definition: CoreWidget.hh:1440
QStackedWidget * stackedWidget_
Container widget for holding multiple views.
Definition: CoreWidget.hh:1085
QActionGroup * drawGroupViewer_
DrawGroup for per Viewer Draw Modes.
Definition: CoreWidget.hh:989
PickToolBarMap curPickingToolbarItems_
Handle to picking toolbar.
Definition: CoreWidget.hh:733
ACG::QtWidgets::QtSceneGraphDialog * sceneGraphDialog_
Handle to picking toolbar.
Definition: CoreWidget.hh:746
QWidget * toolBoxArea_
Widget for toolBox.
Definition: CoreWidget.hh:717
void applicationSnapshotName(QString _name)
Set the baseName for the application snapshot.
Definition: Core.cc:1453
QList< SlotInfo > & coreSlots_
list of scripting slots from core
Definition: CoreWidget.hh:400
QMenu * toolsMenu_
Tools Menu.
Definition: CoreWidget.hh:795
QGLWidget * glWidget_
gl widget used as drawing area to paint the graphics scene
Definition: CoreWidget.hh:699
Struct containing information about pickModes.
Definition: CoreWidget.hh:184
QWidget * viewModeControlBox_
Group box containing Task Switcher Controls.
Definition: CoreWidget.hh:675
QToolButton * moveButton_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:815
QWidgetAction * viewModeChangePopupAction_
Handle to picking toolbar.
Definition: CoreWidget.hh:748
CursorPainter * cursorPainter_
Cursor handling.
Definition: CoreWidget.hh:742
QAction * viewModeButton_
a List of all widgets in the toolbar
Definition: CoreWidget.hh:581
QAction * globalTwosidedLightingAction_
Action to globally set two-sided lighting.
Definition: CoreWidget.hh:879
QToolBar * mainToolbar_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:1233
QMenu * algorithmMenu_
Algorithms Menu.
Definition: CoreWidget.hh:687
std::string pick_mode_name_
Definition: CoreWidget.hh:1558
InverseKeyMap invKeys_
mapping of all registered keys and the corresponding plugins to currently assigned keys ...
Definition: CoreWidget.hh:397
std::map< QToolBar *, QGraphicsProxyWidget * > PickToolBarMap
Handle to picking toolbar.
Definition: CoreWidget.hh:732
viewModeChangeWidget * modeChangeWidget
Handle to picking toolbar.
Definition: CoreWidget.hh:750
QStringList visibleToolbars
List of Toolbars in this view mode.
Definition: CoreWidget.hh:145
Viewer::ActionMode lastActionMode_
Definition: CoreWidget.hh:1449
Definition: Core.hh:139
RendererObjectWidget * rendererObjectWidget_
shows the widget for the rendermanager
Definition: CoreWidget.hh:1141
std::string name_
Name of the pickMode.
Definition: CoreWidget.hh:263
QToolButton * stereoButton_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:814
QToolBar * toolbar_
Definition: CoreWidget.hh:279
Class for the handling of simple configuration files.
Definition: INIFile.hh:105
OpenFlipper::Options::LoggerState loggerState_
Show logger in splitter or not.
Definition: CoreWidget.hh:560
void showToolbox(bool _state)
Show or hide toolbox.
Definition: Core.cc:1061
std::set< QToolBar * > registeredToolbars_
Store all toolbars that once have been registered.
Definition: CoreWidget.hh:739
static const QString homePage_
Pointer to the help Browser.
Definition: CoreWidget.hh:1095
QToolButton * viewModePopupBtn_
view mode gear icon at the upper left of the tool box
Definition: CoreWidget.hh:720
HelpWidget * helpWidget_
Pointer to the help Browser.
Definition: CoreWidget.hh:1106
QString name
Name of the View Mode.
Definition: CoreWidget.hh:132
LoggerState
State of the logging widget.
SideArea * getToolbox()
Show logger in splitter or not.
Definition: CoreWidget.hh:504
int pick_mode_idx_
Definition: CoreWidget.hh:1562
QComboBox * viewerLayoutBox_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:819
void clearAll()
Clear all data objects.
Definition: Core.cc:987
AboutWidget * aboutWidget_
Pointer to the about widget.
Definition: CoreWidget.hh:1191
int originalLoggerSize_
Size of the logging window ( defaults to 240 )
Definition: CoreWidget.hh:681
ActionMode
Enum listing action modes of the viewers.
std::vector< glViewer * > examiner_widgets_
Examiner Widget.
Definition: CoreWidget.hh:669
applicationStatus
Enum for the statusBar Status Icon.
void stopVideoCapture()
Stop video capturing.
Definition: Video.cc:110
void viewerSnapshot()
Take a snapshot from all viewers.
Definition: Core.cc:1459
QWidget * viewerDrawMenuWidget_
owns all the checkboxes of viewerDrawMenu_
Definition: CoreWidget.hh:995
QAction * globalAnimationAction_
Action to globally set animation.
Definition: CoreWidget.hh:873
QStringList visibleContextMenus
List of context Menus in this view mode.
Definition: CoreWidget.hh:148
QWidget * getToolboxArea()
Show logger in splitter or not.
Definition: CoreWidget.hh:503
void log(Logtype _type, QString _message)
Logg with OUT,WARN or ERR as type.
std::vector< QToolBar * > toolbars_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:1235
void moveToolBoxToTop(QString _name)
Move selected toolbox to top of side area.
Definition: scripting.cc:174
QMenu * fileMenu_
File Menu.
Definition: CoreWidget.hh:789
The Menu will be shown when the background was picked.
QAction * perspectiveProjectionAction_
This variable holds the global draw menu.
Definition: CoreWidget.hh:869
QAction * globalMultisamplingAction_
Action to globally set multisampling.
Definition: CoreWidget.hh:882
QMenu * recentFilesMenu_
QMenu containing the recently opened files.
Definition: CoreWidget.hh:684
bool shiftPressed_
Store the state of the shift key.
Definition: CoreWidget.hh:436
void moveToolBoxToBottom(QString _name)
Move selected toolbox to bottom of side area.
Definition: scripting.cc:183
QMenu * stackMenu_
QMenu containing the recently opened files.
Definition: CoreWidget.hh:1079
bool lightMode()
Definition: CoreWidget.hh:1434
QMenu * globalDrawMenu_
This variable holds the global draw menu.
Definition: CoreWidget.hh:856
OptionsWidget * optionsWidget_
Pointer to the OptionsWidget.
Definition: CoreWidget.hh:1214
QScrollArea * toolBoxScroll_
Toolbox scroll area.
Definition: CoreWidget.hh:729
ContextMenuType type
Type of the context Menu ( Context for what type .. Background,Object,Node)
Definition: CoreWidget.hh:176
KeyMap keys_
mapping of all keys to registered keys and the corresponding plugins
Definition: CoreWidget.hh:394
void setQuestionMode()
Definition: CoreWidget.hh:1442
QAction * globalMipmappingAction_
Action to globally set mipmapping.
Definition: CoreWidget.hh:885
QScrollArea * getToolboxScrollArea()
Show logger in splitter or not.
Definition: CoreWidget.hh:502
ACG::SceneGraph::DrawModes::DrawMode availableGlobalDrawModes_
This variable holds the global draw menu.
Definition: CoreWidget.hh:889
QtSlideWindow * slidingLogger_
Class that holds the animated log widget.
Definition: CoreWidget.hh:714
QActionGroup * drawGroup_
This variable holds the global draw menu.
Definition: CoreWidget.hh:861
QMenu * rendererMenu_
This variable holds the global renderer menu.
Definition: CoreWidget.hh:859
int snapshotCounter_
Create a snapshot of the whole app with fileDialog.
Definition: CoreWidget.hh:1011
QMenu * windowMenu_
Window Menu.
Definition: CoreWidget.hh:693
std::vector< StackWidgetInfo > stackWidgetList_
QMenu containing the recently opened files.
Definition: CoreWidget.hh:1081
QMap< QString, QString > additionalAboutTabs_
Additional tab information, that could be provided by plugins.
Definition: CoreWidget.hh:1194
void applicationSnapshot()
Take a snapshot from the whole app.
Definition: Core.cc:1447
RendererDialog * rendererDialog_
shows the widget for the rendermanager
Definition: CoreWidget.hh:1140
void saveOptions()
Save the current options to the standard ini file.
QCursor cursor_
Definition: CoreWidget.hh:275
void setViewMode(QString _viewMode)
Set the active ViewMode.
Definition: scripting.cc:140
DataType contextType
Type of objects for which the context Menu should be visible.
Definition: CoreWidget.hh:173
bool examineMode()
Definition: CoreWidget.hh:1432
QVector< ViewMode * > & viewModes_
List of currently available viewModes.
Definition: CoreWidget.hh:577
QToolButton * pickButton_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:816