75 #include <OpenFlipper/BasePlugin/ViewInterface.hh> 78 #include <OpenFlipper/widgets/coreWidget/SideArea.hh> 79 #include <OpenFlipper/widgets/coreWidget/ColorStatusBar.hh> 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> 88 #include <QMainWindow> 89 #include <QStackedWidget> 95 #include <QFutureWatcher> 97 #include <QDockWidget> 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> 108 #include <OpenFlipper/Core/PluginInfo.hh> 110 #include <ACG/QtWidgets/QtSceneGraphWidget.hh> 112 #include <ACG/Scenegraph/DrawModes.hh> 113 #include <ACG/Scenegraph/CoordsysNode.hh> 115 #include <OpenFlipper/INIFile/INIFile.hh> 118 #include "../viewModeWidget/viewModeChangeWidget.hh" 188 PickMode(
const std::string& _n,
const bool _t,
const bool _v, QCursor _c, QToolBar *_tb = 0 );
198 void visible(
const bool _visible);
204 bool visible()
const;
210 std::string
name()
const;
219 void tracking(
const bool _tracking);
226 bool tracking()
const;
233 QCursor cursor()
const;
242 void cursor(
const QCursor _cursor);
251 void toolbar(QToolBar* _toolbar);
258 QToolBar* toolbar()
const;
293 CoreWidget( QVector<ViewMode*>& _viewModes, std::vector<PluginInfo>& _plugins, QList< SlotInfo >& _coreSlots );
301 void addEmptyObjectMenu();
306 void recentOpen(QAction*);
315 void closeEvent ( QCloseEvent * event );
324 void log(QString _message);
336 virtual void keyPressEvent (QKeyEvent* _e);
337 virtual void keyReleaseEvent(QKeyEvent* _e);
344 bool event( QEvent *event );
346 bool eventFilter(QObject *_obj, QEvent *_event);
353 void PluginKeyEvent(QKeyEvent* );
358 void PluginKeyReleaseEvent(QKeyEvent* );
361 void registerKey(
int _key, Qt::KeyboardModifiers _modifiers, QString _description,
362 bool _multiUse =
false);
365 void call( QString _expression ,
bool& _success );
369 typedef std::multimap< std::pair< int, Qt::KeyboardModifiers > , std::pair< QObject*, int > >
KeyMap;
371 typedef std::pair< KeyMap::iterator, KeyMap::iterator >
KeyRange;
375 void registerCoreKeys();
381 void coreKeyPressEvent();
384 void coreKeyPressEvent (QKeyEvent* _e);
385 void coreKeyReleaseEvent(QKeyEvent* _e);
387 KeyBinding getKeyBinding(QObject* _plugin,
int _keyIndex );
388 QString getRPCName(QObject* _plugin );
408 void slotRegisterKey(
int _key, Qt::KeyboardModifiers _modifiers, QString _description,
409 bool _multiUse =
false);
416 void slotAddKeyMapping(
int _key, Qt::KeyboardModifiers _modifiers, QObject* _plugin,
int _keyBindingID);
423 void slotRegisterSlotKeyBindings();
427 void loadKeyBindings(
INIFile& _ini);
430 void saveKeyBindings(
INIFile& _ini);
465 void startVideoCaptureDialog();
477 void addRecent(QString _filename,
DataType _type);
492 void showLoggerInSplitView(
bool _show);
495 void updateInSceneLoggerGeometry();
498 void setForceNativeCursor (
bool _state );
500 QSize defaultIconSize();
509 void toggleFullscreen();
512 void setFullscreen(
bool _state );
521 void toggleToolbox();
527 void toggleStatusBar();
533 void showMenuBar(
bool _state );
536 void toggleMenuBar();
539 void toggleToolBar();
542 void showToolBar(
bool _state );
545 void toolBarVisChanged(
bool _state );
548 void toolBoxVisChanged(
bool _state );
551 void statusBarVisChanged(
bool _state );
554 void menuBarVisChanged(
bool _state );
557 void fullScreenChanged(
bool _state );
589 void initViewModes( );
592 void slotAddViewModeToolboxes(QString _mode, QStringList _usedWidgets);
595 void slotAddViewModeToolboxes(QString _mode,
bool _custom, QStringList _usedWidgets);
598 void slotAddViewModeToolbars(QString _mode, QStringList _usedToolbars);
601 void slotAddViewModeToolbars(QString _mode,
bool _custom, QStringList _usedToolbars);
604 void slotAddViewModeContextMenus(QString _mode, QStringList _usedToolbars);
607 void slotAddViewModeContextMenus(QString _mode,
bool _custom, QStringList _usedToolbars);
610 void slotAddViewModeComplete(QString _mode ,
bool _custom, QStringList _toolboxes, QStringList _toolbars, QStringList _contextmenus);
613 void slotSetViewModeIcon(QString _mode, QString _iconName);
616 void slotSetViewModeIcon(QString _mode,
bool _custom, QString _iconName);
619 void slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus,
bool _expandAll =
false);
622 void setToolBoxOrientationOnTheRight(
bool _toolBoxRight);
628 void slotHideContextMenu();
632 void slotRemoveViewMode(QString _name);
635 void slotSetViewMode( QAction* action);
638 void slotViewModeDialog();
641 void closeChangeViewModePopup();
644 void slotUpdateExaminer(
unsigned _id);
649 void setViewMode( QString _mode,
bool _expandAll =
false );
758 void slotShowSceneGraphDialog();
763 void slotActivateExaminer ();
774 void sceneRectChanged(
const QRectF &rect);
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);
830 void slotUpdateGlobalDrawMenu();
833 void slotUpdateRendererMenu();
836 void setViewerLayout(
int _idx);
840 void nextViewerLayout();
843 void slotGlobalDrawMenu(QAction * _action);
846 void slotViewMenuAboutToShow();
849 void slotGlobalRendererMenu(QAction * _action);
852 void slotGlobalPostProcessorMenu(QAction * _action);
900 void updateContextMenu(
int);
903 void updateContextMenuNode(
int);
906 void updateContextMenuBackground();
911 void slotCustomContextMenu(
const QPoint& _point );
920 void slotAddContextItemToViewMode( QAction* _entry );
923 void slotPasteView( );
926 void slotPasteViewAndWindow( );
929 void slotSetView( QString view );
932 void slotSetViewAndWindowGeometry( QString view );
935 void slotCopyView( );
938 void slotViewerDrawMenu( QAction * _action );
941 void slotPostProcessorMenu( QAction * _action);
944 void slotRenderMenu( QAction * _action);
947 void slotUpdateViewerDrawMenu();
950 void slotExaminerSnapshot();
953 void slotSwitchWheels(
bool _state);
956 void slotSwitchNavigation(
bool _egomode);
959 void slotSnapshotName();
962 void slotCoordSysVisibility(
bool _visible);
969 void updatePopupMenu(
const QPoint& _point);
971 void updatePopupMenuCoordsysNode(QMenu* _menu ,
const int _part);
972 void updatePopupMenuObject(QMenu* _menu ,
BaseObjectData* _object );
973 void updatePopupMenuBackground(QMenu* _menu ,
const QPoint& _point);
976 bool addContextMenus( QMenu* _menu ,
ContextMenuType _type,
int _id = -1);
1016 void viewerSnapshotDialog();
1022 void applicationSnapshotDialog();
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);
1046 void writeImageAsynchronously(QImage* _image,
const QString _name);
1051 std::map<QFutureWatcher<void>*,QFuture<void>*> watcher_garbage_;
1058 void delete_garbage();
1068 void slotGetStackWidget( QString _name, QWidget*& _widget );
1069 void slotAddStackWidget( QString _name, QWidget* _widget );
1070 void slotUpdateStackWidget( QString _name, QWidget* _widget );
1072 void slotViewMenuAction( QAction * _action);
1074 void slotUpdateStackMenu();
1099 void showHelpBrowser(
const QString &page = homePage_);
1102 void changeHelpSite(QUrl);
1118 void slotShowPostProcessorManager();
1134 void slotShowRenderManager();
1137 void slotShowRenderObjectWidget();
1152 void stereoButtonContextMenu(
const QPoint& _pos);
1157 void slotApplyStereoSettings(
int _tmpParam = 0);
1173 void showAboutWidget();
1180 void addAboutInfo(QString _text, QString _tabName );
1187 void addCoreLicenseInfo();
1205 void showOptionsWidget();
1224 void slotAddToolbar(QToolBar* _toolbar);
1227 void slotRemoveToolbar(QToolBar* _toolbar);
1230 void getToolBar( QString _name, QToolBar*& _toolbar);
1244 void statusMessage(QString _message,
int _timeout = 0);
1246 void clearStatusMessage();
1250 void addWidgetToStatusbar(QWidget* _widget);
1253 void setupStatusBar();
1258 QLabel* statusIcon_;
1268 void dragOpenFile(QString _filename);
1271 void startDrag( QMouseEvent* _event );
1273 void dragEnterEvent(QDragEnterEvent* _event);
1275 void dropEvent( QDropEvent* _event );
1292 void slotToggleStereoMode();
1295 void slotSetGlobalBackgroundColor();
1298 void slotSetContextBackgroundColor();
1303 void slotContextHomeView();
1306 void slotGlobalHomeView();
1311 void slotContextSetHomeView();
1314 void slotGlobalSetHomeView();
1319 void slotContextViewAll();
1322 void slotGlobalViewAll();
1326 void slotContextSwitchProjection();
1332 void slotContextSwitchCoordsysProjection();
1335 void slotGlobalPerspectiveProjection();
1338 void slotGlobalOrthographicProjection();
1342 void slotSetViewingDirection(QAction* _action);
1345 void slotLockRotation(
bool _lock);
1350 void slotGlobalToggleAnimation();
1353 void slotGlobalChangeAnimation(
bool _animation);
1356 void slotLocalChangeAnimation(
bool _animation);
1361 void slotGlobalToggleBackFaceCulling();
1364 void slotGlobalChangeBackFaceCulling(
bool _backFaceCulling);
1367 void slotLocalChangeBackFaceCulling(
bool _backFaceCulling);
1372 void slotGlobalToggleTwoSidedLighting();
1375 void slotGlobalChangeTwoSidedLighting(
bool _lighting);
1378 void slotLocalChangeTwoSidedLighting(
bool _lighting);
1383 void slotGlobalToggleMultisampling();
1386 void slotGlobalChangeMultisampling(
bool _multisampling);
1389 void slotLocalChangeMultisampling(
bool _multisampling);
1393 void slotGlobalToggleMipmapping();
1396 void slotGlobalChangeMipmapping(
bool _multisampling);
1399 void slotLocalChangeMipmapping(
bool _mipmapping);
1418 void drawModeChanged(
int _viewerId);
1434 bool lightMode() {
return(actionMode_ == Viewer::LightMode ); };
1471 void addPickMode(
const std::string& _name,
1472 bool _mouse_tracking =
false,
1474 bool _visible =
true,
1475 QCursor _cursor = Qt::ArrowCursor );
1479 void clearPickModes();
1483 const std::string& pickMode()
const;
1488 void pickMode(
int _id );
1490 void expandToolBoxWidget(QWidget *widget,
bool expand);
1497 void setPickMode(
const std::string& _name);
1500 void getPickMode(std::string& _name);
1503 void setActivePickToolBar(QToolBar* _tool);
1506 void hidePickToolBar();
1515 void setPickModeCursor(
const std::string& _name, QCursor _cursor);
1522 void setPickModeMouseTracking(
const std::string& _name,
bool _mouseTracking);
1531 void setPickModeToolbar(
const std::string& _mode , QToolBar * _toolbar );
1539 void removePickModeToolbar(
const std::string& _mode );
1541 void actionPickMenu( QAction * _action );
1546 void signalPickModeChanged(
const std::string&);
1571 void updatePickMenu();
1575 void hidePopupMenus();
1581 #endif // COREWIDGET_HH defined
QAction * orthogonalProjectionAction_
This variable holds the global draw menu.
QMenu * viewerDrawMenu_
Draw Menu for per Viewer Draw Modes.
Viewer::ActionMode actionMode()
QAction * globalBackfaceCullingAction_
Action to globally set backface culling.
std::vector< QAction * > extended_actions
std::vector< MenuInfo > contextMenus_
All real context menu entries.
void showStatusBar(bool _state)
Show or hide Status Bar.
LoggerWidget * logWidget_
Textedit at the bottom for log messages.
QActionGroup * viewGroup_
Group for all menu items.
QToolBar * viewerToolbar_
Called by Plugins to add a Toolbar.
void loadPlugin(const QString &_filename, const bool _silent, QString &_licenseErrors, QObject *_plugin=0)
Function for loading Plugins.
QMap< QString, QMenu * > menus_
All available menus.
std::vector< PluginInfo > plugins_
List of all loaded plugins_.
void resizeApplication(int _width, int _height)
resize the whole Application
void slotLog(Logtype _type, QString _message)
Console logger.
QtGLGraphicsScene * glScene_
graphics scene used to paint gl context and widgets
Logtype
Log types for Message Window.
bool stereoActive_
The viewer with id _viewerId changed its draw Mode.
QMenu * contextMenu_
context Menu for the gl area
bool custom
Is this a user defined custom view mode or a plugin generated one.
QtMultiViewLayout * baseLayout_
Base layout that holds gl views.
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.
QToolButton * questionButton_
Called by Plugins to add a Toolbar.
QAction * action
The context item.
QMenu * contextSelectionMenu_
Context Menu containing all selection elements.
QSplitter * toolSplitter_
Spliter between toplevel objects and toolbox.
void showViewModeControls(bool _show)
Show or Hide the viewmode control widget.
QSize defaultIconSize_
Show logger in splitter or not.
std::pair< KeyMap::iterator, KeyMap::iterator > KeyRange
typedefs
QStringList visibleToolboxes
List of Visible Toolboxes in this view mode.
QMenu * helpMenu_
Help Menu.
Implementation of the logger Widget.
ViewMode struct This struct contains a ViewMode and its status information such as used widgets...
ACG::SceneGraph::DrawModes::DrawMode activeDrawModes_
This variable holds the global draw menu.
std::vector< KeyBinding > coreKeys_
vector of keys registered to the core
QMenu * viewMenu_
View Menu.
QtGLGraphicsView * glView_
graphics view that holds the gl scene
ProjectionMode
projection mode
QActionGroup * rendererGroup_
Group for all renderers.
StereoSettingsWidget * stereoSettingsWidget_
Widget to change stereo settings.
QString snapshotName_
Create a snapshot of the whole app with fileDialog.
QGraphicsWidget * centerWidget_
center widged
SideArea * toolBox_
Toolbox.
QAction * fileMenuEnd_
First entry after all relevant parts of the File Menu.
std::multimap< std::pair< int, Qt::KeyboardModifiers >, std::pair< QObject *, int > > KeyMap
typedefs
void showReducedMenuBar(bool reduced)
Core scripting engine.
QToolBar * pickToolBarExternal_
Extra toolbar not in scene for picking.
void startVideoCapture(QString _baseName, int _fps, bool _captureViewers)
Start video capturing.
std::vector< PickMode > pick_modes_
QAction * AC_ShowViewModeControls_
Action for View Mode Widget Conrol in Menu.
QVector< QWidget * > toolWidgets_
a List of all widgets in the toolbar
void resizeViewers(int _width, int _height)
resize the examinerViewer
QMenu * viewModeMenu_
Submenu holding all ViewMode actions.
QSplitter * splitter_
Spliter between toplevel objects and the textedit at the bottom.
QStackedWidget * stackedWidget_
Container widget for holding multiple views.
QActionGroup * drawGroupViewer_
DrawGroup for per Viewer Draw Modes.
PickToolBarMap curPickingToolbarItems_
Handle to picking toolbar.
ACG::QtWidgets::QtSceneGraphDialog * sceneGraphDialog_
Handle to picking toolbar.
QWidget * toolBoxArea_
Widget for toolBox.
void applicationSnapshotName(QString _name)
Set the baseName for the application snapshot.
QList< SlotInfo > & coreSlots_
list of scripting slots from core
QMenu * toolsMenu_
Tools Menu.
QGLWidget * glWidget_
gl widget used as drawing area to paint the graphics scene
Struct containing information about pickModes.
QWidget * viewModeControlBox_
Group box containing Task Switcher Controls.
QToolButton * moveButton_
Called by Plugins to add a Toolbar.
QWidgetAction * viewModeChangePopupAction_
Handle to picking toolbar.
CursorPainter * cursorPainter_
Cursor handling.
QAction * viewModeButton_
a List of all widgets in the toolbar
QAction * globalTwosidedLightingAction_
Action to globally set two-sided lighting.
QToolBar * mainToolbar_
Called by Plugins to add a Toolbar.
QMenu * algorithmMenu_
Algorithms Menu.
std::string pick_mode_name_
InverseKeyMap invKeys_
mapping of all registered keys and the corresponding plugins to currently assigned keys ...
std::map< QToolBar *, QGraphicsProxyWidget * > PickToolBarMap
Handle to picking toolbar.
viewModeChangeWidget * modeChangeWidget
Handle to picking toolbar.
QStringList visibleToolbars
List of Toolbars in this view mode.
Viewer::ActionMode lastActionMode_
RendererObjectWidget * rendererObjectWidget_
shows the widget for the rendermanager
std::string name_
Name of the pickMode.
QToolButton * stereoButton_
Called by Plugins to add a Toolbar.
Class for the handling of simple configuration files.
OpenFlipper::Options::LoggerState loggerState_
Show logger in splitter or not.
void showToolbox(bool _state)
Show or hide toolbox.
std::set< QToolBar * > registeredToolbars_
Store all toolbars that once have been registered.
static const QString homePage_
Pointer to the help Browser.
QToolButton * viewModePopupBtn_
view mode gear icon at the upper left of the tool box
HelpWidget * helpWidget_
Pointer to the help Browser.
QString name
Name of the View Mode.
LoggerState
State of the logging widget.
SideArea * getToolbox()
Show logger in splitter or not.
QComboBox * viewerLayoutBox_
Called by Plugins to add a Toolbar.
void clearAll()
Clear all data objects.
AboutWidget * aboutWidget_
Pointer to the about widget.
int originalLoggerSize_
Size of the logging window ( defaults to 240 )
ActionMode
Enum listing action modes of the viewers.
std::vector< glViewer * > examiner_widgets_
Examiner Widget.
applicationStatus
Enum for the statusBar Status Icon.
void stopVideoCapture()
Stop video capturing.
void viewerSnapshot()
Take a snapshot from all viewers.
QWidget * viewerDrawMenuWidget_
owns all the checkboxes of viewerDrawMenu_
QAction * globalAnimationAction_
Action to globally set animation.
QStringList visibleContextMenus
List of context Menus in this view mode.
QWidget * getToolboxArea()
Show logger in splitter or not.
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.
void moveToolBoxToTop(QString _name)
Move selected toolbox to top of side area.
QMenu * fileMenu_
File Menu.
The Menu will be shown when the background was picked.
QAction * perspectiveProjectionAction_
This variable holds the global draw menu.
QAction * globalMultisamplingAction_
Action to globally set multisampling.
QMenu * recentFilesMenu_
QMenu containing the recently opened files.
bool shiftPressed_
Store the state of the shift key.
void moveToolBoxToBottom(QString _name)
Move selected toolbox to bottom of side area.
QMenu * stackMenu_
QMenu containing the recently opened files.
QMenu * globalDrawMenu_
This variable holds the global draw menu.
OptionsWidget * optionsWidget_
Pointer to the OptionsWidget.
QScrollArea * toolBoxScroll_
Toolbox scroll area.
ContextMenuType type
Type of the context Menu ( Context for what type .. Background,Object,Node)
KeyMap keys_
mapping of all keys to registered keys and the corresponding plugins
QAction * globalMipmappingAction_
Action to globally set mipmapping.
QScrollArea * getToolboxScrollArea()
Show logger in splitter or not.
ACG::SceneGraph::DrawModes::DrawMode availableGlobalDrawModes_
This variable holds the global draw menu.
QtSlideWindow * slidingLogger_
Class that holds the animated log widget.
QActionGroup * drawGroup_
This variable holds the global draw menu.
QMenu * rendererMenu_
This variable holds the global renderer menu.
int snapshotCounter_
Create a snapshot of the whole app with fileDialog.
QMenu * windowMenu_
Window Menu.
std::vector< StackWidgetInfo > stackWidgetList_
QMenu containing the recently opened files.
QMap< QString, QString > additionalAboutTabs_
Additional tab information, that could be provided by plugins.
void applicationSnapshot()
Take a snapshot from the whole app.
RendererDialog * rendererDialog_
shows the widget for the rendermanager
void saveOptions()
Save the current options to the standard ini file.
void setViewMode(QString _viewMode)
Set the active ViewMode.
DataType contextType
Type of objects for which the context Menu should be visible.
QVector< ViewMode * > & viewModes_
List of currently available viewModes.
QToolButton * pickButton_
Called by Plugins to add a Toolbar.