67 #include <OpenFlipper/BasePlugin/ViewInterface.hh> 70 #include <OpenFlipper/widgets/coreWidget/SideArea.hh> 71 #include <OpenFlipper/widgets/coreWidget/ColorStatusBar.hh> 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> 80 #include <QMainWindow> 81 #include <QStackedWidget> 87 #include <QFutureWatcher> 89 #include <QDockWidget> 91 #include <OpenFlipper/common/OFGLWidget.hh> 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> 103 #include <OpenFlipper/Core/PluginInfo.hh> 105 #include <ACG/QtWidgets/QtSceneGraphWidget.hh> 107 #include <ACG/Scenegraph/DrawModes.hh> 108 #include <ACG/Scenegraph/CoordsysNode.hh> 110 #include <OpenFlipper/INIFile/INIFile.hh> 113 #include "../viewModeWidget/viewModeChangeWidget.hh" 183 PickMode(
const std::string& _n,
const bool _t,
const bool _v, QCursor _c, QToolBar *_tb = 0 );
193 void visible(
const bool _visible);
199 bool visible()
const;
205 std::string
name()
const;
214 void tracking(
const bool _tracking);
221 bool tracking()
const;
228 QCursor cursor()
const;
237 void cursor(
const QCursor _cursor);
246 void toolbar(QToolBar* _toolbar);
253 QToolBar* toolbar()
const;
288 CoreWidget( QVector<ViewMode*>& _viewModes, QList< SlotInfo >& _coreSlots );
296 void addEmptyObjectMenu();
301 void recentOpen(QAction*);
310 void closeEvent ( QCloseEvent * event );
319 void log(QString _message);
331 virtual void keyPressEvent (QKeyEvent* _e);
332 virtual void keyReleaseEvent(QKeyEvent* _e);
339 bool event( QEvent *event );
341 bool eventFilter(QObject *_obj, QEvent *_event);
348 void PluginKeyEvent(QKeyEvent* );
353 void PluginKeyReleaseEvent(QKeyEvent* );
356 void registerKey(
int _key, Qt::KeyboardModifiers _modifiers, QString _description,
357 bool _multiUse =
false);
360 void call( QString _expression ,
bool& _success );
364 typedef std::multimap< std::pair< int, Qt::KeyboardModifiers > , std::pair< QObject*, int > >
KeyMap;
366 typedef std::pair< KeyMap::iterator, KeyMap::iterator >
KeyRange;
370 void registerCoreKeys();
376 void coreKeyPressEvent();
379 void coreKeyPressEvent (QKeyEvent* _e);
380 void coreKeyReleaseEvent(QKeyEvent* _e);
382 KeyBinding getKeyBinding(QObject* _plugin,
int _keyIndex );
383 QString getRPCName(QObject* _plugin );
403 void slotRegisterKey(
int _key, Qt::KeyboardModifiers _modifiers, QString _description,
404 bool _multiUse =
false);
411 void slotAddKeyMapping(
int _key, Qt::KeyboardModifiers _modifiers, QObject* _plugin,
int _keyBindingID);
418 void slotRegisterSlotKeyBindings();
422 void loadKeyBindings(
INIFile& _ini);
425 void saveKeyBindings(
INIFile& _ini);
456 std::vector<PluginInfo>&
plugins();
473 void startVideoCaptureDialog();
485 void addRecent(QString _filename,
DataType _type);
500 void showLoggerInSplitView(
bool _show);
503 void updateInSceneLoggerGeometry();
506 void setForceNativeCursor (
bool _state );
508 QSize defaultIconSize();
517 void toggleFullscreen();
520 void setFullscreen(
bool _state );
529 void toggleToolbox();
535 void toggleStatusBar();
541 void showMenuBar(
bool _state );
544 void toggleMenuBar();
547 void toggleToolBar();
550 void showToolBar(
bool _state );
553 void toolBarVisChanged(
bool _state );
556 void toolBoxVisChanged(
bool _state );
559 void statusBarVisChanged(
bool _state );
562 void menuBarVisChanged(
bool _state );
565 void fullScreenChanged(
bool _state );
597 void initViewModes( );
600 void slotAddViewModeToolboxes(QString _mode, QStringList _usedWidgets);
603 void slotAddViewModeToolboxes(QString _mode,
bool _custom, QStringList _usedWidgets);
606 void slotAddViewModeToolbars(QString _mode, QStringList _usedToolbars);
609 void slotAddViewModeToolbars(QString _mode,
bool _custom, QStringList _usedToolbars);
612 void slotAddViewModeContextMenus(QString _mode, QStringList _usedToolbars);
615 void slotAddViewModeContextMenus(QString _mode,
bool _custom, QStringList _usedToolbars);
618 void slotAddViewModeComplete(QString _mode ,
bool _custom, QStringList _toolboxes, QStringList _toolbars, QStringList _contextmenus);
621 void slotSetViewModeIcon(QString _mode, QString _iconName);
624 void slotSetViewModeIcon(QString _mode,
bool _custom, QString _iconName);
627 void slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus,
bool _expandAll =
false);
630 void setToolBoxOrientationOnTheRight(
bool _toolBoxRight);
636 void slotHideContextMenu();
640 void slotRemoveViewMode(QString _name);
643 void slotSetViewMode( QAction* action);
646 void slotViewModeDialog();
649 void closeChangeViewModePopup();
652 void slotUpdateExaminer(
unsigned _id);
657 void setViewMode( QString _mode,
bool _expandAll =
false );
766 void slotShowSceneGraphDialog();
771 void slotActivateExaminer ();
782 void sceneRectChanged(
const QRectF &rect);
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);
841 void slotUpdateGlobalDrawMenu();
844 void slotUpdateRendererMenu();
847 void setViewerLayout(
int _idx);
851 void nextViewerLayout();
854 void slotGlobalDrawMenu(QAction * _action);
857 void slotViewMenuAboutToShow();
860 void slotGlobalRendererMenu(QAction * _action);
863 void slotGlobalPostProcessorMenu(QAction * _action);
911 void updateContextMenu(
int);
914 void updateContextMenuNode(
int);
917 void updateContextMenuBackground();
922 void slotCustomContextMenu(
const QPoint& _point );
931 void slotAddContextItemToViewMode( QAction* _entry );
934 void slotPasteView( );
937 void slotPasteViewAndWindow( );
940 void slotSetView( QString view );
943 void slotSetViewAndWindowGeometry( QString view );
946 void slotCopyView( );
949 void slotViewerDrawMenu( QAction * _action );
952 void slotPostProcessorMenu( QAction * _action);
955 void slotRenderMenu( QAction * _action);
958 void slotUpdateViewerDrawMenu();
961 void slotExaminerSnapshot();
964 void slotSwitchWheels(
bool _state);
967 void slotSwitchNavigation(
bool _egomode);
970 void slotSnapshotName();
973 void slotCoordSysVisibility(
bool _visible);
980 void updatePopupMenu(
const QPoint& _point);
982 void updatePopupMenuCoordsysNode(QMenu* _menu ,
const int _part);
983 void updatePopupMenuObject(QMenu* _menu ,
BaseObjectData* _object );
984 void updatePopupMenuBackground(QMenu* _menu ,
const QPoint& _point);
987 bool addContextMenus( QMenu* _menu ,
ContextMenuType _type,
int _id = -1);
1027 void viewerSnapshotDialog();
1033 void applicationSnapshotDialog();
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);
1057 void writeImageAsynchronously(QImage* _image,
const QString _name);
1062 std::map<QFutureWatcher<void>*,QFuture<void>*> watcher_garbage_;
1069 void delete_garbage();
1079 void slotGetStackWidget( QString _name, QWidget*& _widget );
1080 void slotAddStackWidget( QString _name, QWidget* _widget );
1081 void slotUpdateStackWidget( QString _name, QWidget* _widget );
1083 void slotViewMenuAction( QAction * _action);
1085 void slotUpdateStackMenu();
1110 void showHelpBrowser(
const QString &page = homePage_);
1113 void changeHelpSite(QUrl);
1129 void slotShowPostProcessorManager();
1145 void slotShowRenderManager();
1148 void slotShowRenderObjectWidget();
1163 void stereoButtonContextMenu(
const QPoint& _pos);
1168 void slotApplyStereoSettings(
int _tmpParam = 0);
1184 void showAboutWidget();
1191 void addAboutInfo(QString _text, QString _tabName );
1198 void addCoreLicenseInfo();
1216 void showOptionsWidget();
1237 void showPythonScriptInterpreter();
1251 void slotAddToolbar(QToolBar* _toolbar);
1254 void slotRemoveToolbar(QToolBar* _toolbar);
1257 void getToolBar( QString _name, QToolBar*& _toolbar);
1271 void statusMessage(QString _message,
int _timeout = 0);
1273 void clearStatusMessage();
1277 void addWidgetToStatusbar(QWidget* _widget);
1280 void setupStatusBar();
1285 QLabel* statusIcon_;
1295 void dragOpenFile(QString _filename);
1298 void startDrag( QMouseEvent* _event );
1300 void dragEnterEvent(QDragEnterEvent* _event);
1302 void dropEvent( QDropEvent* _event );
1314 void slotToggleStereoMode();
1317 void slotSetGlobalBackgroundColor();
1320 void slotSetContextBackgroundColor();
1325 void slotContextHomeView();
1328 void slotGlobalHomeView();
1333 void slotContextSetHomeView();
1336 void slotGlobalSetHomeView();
1341 void slotContextViewAll();
1344 void slotGlobalViewAll();
1348 void slotContextSwitchProjection();
1354 void slotContextSwitchCoordsysProjection();
1357 void slotGlobalPerspectiveProjection();
1360 void slotGlobalOrthographicProjection();
1364 void slotSetViewingDirection(QAction* _action);
1367 void slotLockRotation(
bool _lock);
1372 void slotGlobalToggleAnimation();
1375 void slotGlobalChangeAnimation(
bool _animation);
1378 void slotLocalChangeAnimation(
bool _animation);
1383 void slotGlobalToggleBackFaceCulling();
1386 void slotGlobalChangeBackFaceCulling(
bool _backFaceCulling);
1389 void slotLocalChangeBackFaceCulling(
bool _backFaceCulling);
1394 void slotGlobalToggleTwoSidedLighting();
1397 void slotGlobalChangeTwoSidedLighting(
bool _lighting);
1400 void slotLocalChangeTwoSidedLighting(
bool _lighting);
1405 void slotGlobalToggleMultisampling();
1408 void slotGlobalChangeMultisampling(
bool _multisampling);
1411 void slotLocalChangeMultisampling(
bool _multisampling);
1415 void slotGlobalToggleMipmapping();
1418 void slotGlobalChangeMipmapping(
bool _multisampling);
1421 void slotLocalChangeMipmapping(
bool _mipmapping);
1440 void drawModeChanged(
int _viewerId);
1456 bool lightMode() {
return(actionMode_ == Viewer::LightMode ); };
1493 void addPickMode(
const std::string& _name,
1494 bool _mouse_tracking =
false,
1496 bool _visible =
true,
1497 QCursor _cursor = Qt::ArrowCursor );
1501 void clearPickModes();
1505 const std::string& pickMode()
const;
1510 void pickMode(
int _id );
1512 void expandToolBoxWidget(QWidget *widget,
bool expand);
1519 void setPickMode(
const std::string& _name);
1522 void getPickMode(std::string& _name);
1525 void setActivePickToolBar(QToolBar* _tool);
1528 void hidePickToolBar();
1537 void setPickModeCursor(
const std::string& _name, QCursor _cursor);
1544 void setPickModeMouseTracking(
const std::string& _name,
bool _mouseTracking);
1553 void setPickModeToolbar(
const std::string& _mode , QToolBar * _toolbar );
1561 void removePickModeToolbar(
const std::string& _mode );
1563 void actionPickMenu( QAction * _action );
1568 void signalPickModeChanged(
const std::string&);
1593 void updatePickMenu();
1597 void hidePopupMenus();
1603 #endif // COREWIDGET_HH defined std::multimap< std::pair< int, Qt::KeyboardModifiers >, std::pair< QObject *, int > > KeyMap
typedefs
QAction * globalMipmappingAction_
Action to globally set mipmapping.
QToolButton * viewModePopupBtn_
view mode gear icon at the upper left of the tool box
LoggerWidget * logWidget_
Textedit at the bottom for log messages.
QStringList visibleContextMenus
List of context Menus in this view mode.
QString snapshotName_
Create a snapshot of the whole app with fileDialog.
QMenu * helpMenu_
Help Menu.
QComboBox * viewerLayoutBox_
Called by Plugins to add a Toolbar.
int snapshotCounter_
Create a snapshot of the whole app with fileDialog.
QMap< QString, QMenu * > menus_
All available menus.
bool custom
Is this a user defined custom view mode or a plugin generated one.
std::vector< QToolBar *> toolbars_
Called by Plugins to add a Toolbar.
void setViewMode(QString _viewMode)
Set the active ViewMode.
Logtype
Log types for Message Window.
bool shiftPressed_
Store the state of the shift key.
QGraphicsWidget * centerWidget_
center widged
QSplitter * splitter_
Spliter between toplevel objects and the textedit at the bottom.
LoggerState
State of the logging widget.
void showReducedMenuBar(bool reduced)
Core scripting engine.
QStringList visibleToolbars
List of Toolbars in this view mode.
std::vector< MenuInfo > contextMenus_
All real context menu entries.
QToolButton * stereoButton_
Called by Plugins to add a Toolbar.
QWidget * toolBoxArea_
Widget for toolBox.
void stopVideoCapture()
Stop video capturing.
QActionGroup * drawGroupViewer_
DrawGroup for per Viewer Draw Modes.
QVector< QWidget * > toolWidgets_
a List of all widgets in the toolbar
CursorPainter * cursorPainter_
Cursor handling.
QAction * globalMultisamplingAction_
Action to globally set multisampling.
QToolButton * moveButton_
Called by Plugins to add a Toolbar.
QAction * globalAnimationAction_
Action to globally set animation.
AboutWidget * aboutWidget_
Pointer to the about widget.
StereoSettingsWidget * stereoSettingsWidget_
Widget to change stereo settings.
QString name
Name of the View Mode.
void loadPlugin(const QString &_filename, const bool _silent, QString &_licenseErrors, QObject *_plugin=0)
Function for loading Plugins.
void resizeApplication(int _width, int _height)
resize the whole Application
QMap< QString, QString > additionalAboutTabs_
Additional tab information, that could be provided by plugins.
QMenu * viewModeMenu_
Submenu holding all ViewMode actions.
ACG::QtWidgets::QtSceneGraphDialog * sceneGraphDialog_
Handle to picking toolbar.
The Menu will be shown when the background was picked.
QtGLGraphicsScene * glScene_
graphics scene used to paint gl context and widgets
QWidget * viewModeControlBox_
Group box containing Task Switcher Controls.
bool stereoActive_
The viewer with id _viewerId changed its draw Mode.
SideArea * toolBox_
Toolbox.
QActionGroup * viewGroup_
Group for all menu items.
void log(Logtype _type, QString _message)
Logg with OUT,WARN or ERR as type.
QMenu * recentFilesMenu_
QMenu containing the recently opened files.
void viewerSnapshot()
Take a snapshot from all viewers.
QAction * action
The context item.
QAction * orthogonalProjectionAction_
This variable holds the global draw menu.
QWidget * getToolboxArea()
Show logger in splitter or not.
QMenu * algorithmMenu_
Algorithms Menu.
QAction * AC_ShowViewModeControls_
Action for View Mode Widget Conrol in Menu.
QAction * viewModeButton_
a List of all widgets in the toolbar
QMenu * viewerDrawMenu_
Draw Menu for per Viewer Draw Modes.
QMenu * contextSelectionMenu_
Context Menu containing all selection elements.
ActionMode
Enum listing action modes of the viewers.
SideArea * getToolbox()
Show logger in splitter or not.
static const QString homePage_
Pointer to the help Browser.
QActionGroup * rendererGroup_
Group for all renderers.
QSize defaultIconSize_
Show logger in splitter or not.
void clearAll()
Clear all data objects.
QMenu * toolsMenu_
Tools Menu.
int originalLoggerSize_
Size of the logging window ( defaults to 240 )
QMenu * contextMenu_
context Menu for the gl area
QScrollArea * toolBoxScroll_
Toolbox scroll area.
std::vector< KeyBinding > coreKeys_
vector of keys registered to the core
QMenu * rendererMenu_
This variable holds the global renderer menu.
Viewer::ActionMode lastActionMode_
OptionsWidget * optionsWidget_
Pointer to the OptionsWidget.
applicationStatus
Enum for the statusBar Status Icon.
std::vector< PluginInfo > & plugins()
Index of Plugins toolbox widget.
QWidgetAction * viewModeChangePopupAction_
Handle to picking toolbar.
void applicationSnapshotName(QString _name)
Set the baseName for the application snapshot.
QList< SlotInfo > & coreSlots_
list of scripting slots from core
ProjectionMode
projection mode
QToolBar * pickToolBarExternal_
Extra toolbar not in scene for picking.
QToolButton * pickButton_
Called by Plugins to add a Toolbar.
KeyMap keys_
mapping of all keys to registered keys and the corresponding plugins
Struct containing information about pickModes.
QActionGroup * drawGroup_
This variable holds the global draw menu.
QStringList visibleToolboxes
List of Visible Toolboxes in this view mode.
ViewMode struct This struct contains a ViewMode and its status information such as used widgets...
viewModeChangeWidget * modeChangeWidget
Handle to picking toolbar.
QToolBar * mainToolbar_
Called by Plugins to add a Toolbar.
OFGLWidget * glWidget_
gl widget used as drawing area to paint the graphics scene
RendererObjectWidget * rendererObjectWidget_
shows the widget for the rendermanager
std::vector< PickMode > pick_modes_
PythonWidget * pythonWidget_
Pointer to the about widget.
std::string name_
Name of the pickMode.
QMenu * globalDrawMenu_
This variable holds the global draw menu.
QAction * globalBackfaceCullingAction_
Action to globally set backface culling.
void applicationSnapshot()
Take a snapshot from the whole app.
QtSlideWindow * slidingLogger_
Class that holds the animated log widget.
void applyOptions()
after ini-files have been loaded and core is up or if options have been changed -> apply Options ...
QWidget * viewerDrawMenuWidget_
owns all the checkboxes of viewerDrawMenu_
void saveOptions()
Save the current options to the standard ini file.
std::vector< QAction * > extended_actions
QToolButton * questionButton_
Called by Plugins to add a Toolbar.
QMenu * fileMenu_
File Menu.
void showToolbox(bool _state)
Show or hide toolbox.
QMenu * stackMenu_
QMenu containing the recently opened files.
OpenFlipper::Options::LoggerState loggerState_
Show logger in splitter or not.
QAction * fileMenuEnd_
First entry after all relevant parts of the File Menu.
QScrollArea * getToolboxScrollArea()
Show logger in splitter or not.
InverseKeyMap invKeys_
mapping of all registered keys and the corresponding plugins to currently assigned keys ...
std::vector< glViewer *> examiner_widgets_
Examiner Widget.
void resizeViewers(int _width, int _height)
resize the examinerViewer
QMenu * pythonMenu_
Python Menu.
std::pair< KeyMap::iterator, KeyMap::iterator > KeyRange
typedefs
RendererDialog * rendererDialog_
shows the widget for the rendermanager
HelpWidget * helpWidget_
Pointer to the help Browser.
QMenu * windowMenu_
Window Menu.
ACG::SceneGraph::DrawModes::DrawMode availableGlobalDrawModes_
This variable holds the global draw menu.
std::map< QToolBar *, QGraphicsProxyWidget * > PickToolBarMap
Handle to picking toolbar.
QtMultiViewLayout * baseLayout_
Base layout that holds gl views.
ACG::SceneGraph::DrawModes::DrawMode activeDrawModes_
This variable holds the global draw menu.
std::vector< StackWidgetInfo > stackWidgetList_
QMenu containing the recently opened files.
void moveToolBoxToTop(QString _name)
Move selected toolbox to top of side area.
QStackedWidget * stackedWidget_
Container widget for holding multiple views.
DataType contextType
Type of objects for which the context Menu should be visible.
void startVideoCapture(QString _baseName, int _fps, bool _captureViewers)
Start video capturing.
QtGLGraphicsView * glView_
graphics view that holds the gl scene
QToolBar * viewerToolbar_
Called by Plugins to add a Toolbar.
void showViewModeControls(bool _show)
Show or Hide the viewmode control widget.
QVector< ViewMode * > & viewModes_
List of currently available viewModes.
void moveToolBoxToBottom(QString _name)
Move selected toolbox to bottom of side area.
void slotLog(Logtype _type, QString _message)
Console logger.
std::set< QToolBar * > registeredToolbars_
Store all toolbars that once have been registered.
Implementation of the logger Widget.
QMenu * viewMenu_
View Menu.
PickToolBarMap curPickingToolbarItems_
Handle to picking toolbar.
Viewer::ActionMode actionMode()
std::string pick_mode_name_
int toolbarCount_
Called by Plugins to add a Toolbar.
ContextMenuType type
Type of the context Menu ( Context for what type .. Background,Object,Node)
QSplitter * toolSplitter_
Spliter between toplevel objects and toolbox.
void showStatusBar(bool _state)
Show or hide Status Bar.
QAction * globalTwosidedLightingAction_
Action to globally set two-sided lighting.
QAction * perspectiveProjectionAction_
This variable holds the global draw menu.
Class for the handling of simple configuration files.