Developer Documentation
MenuBar.cc
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 //
54 // CLASS CoreWidget - IMPLEMENTATION
55 //
56 //=============================================================================
57 
58 
59 //== INCLUDES =================================================================
60 
61 #include "CoreWidget.hh"
62 
63 //== IMPLEMENTATION ==========================================================
64 
65 
66 
67 void CoreWidget::slotAddMenubarAction( QAction* _action , QString _name ) {
68 
69  if (!menus_.contains(_name))
70  return;
71 
72  if (_name == FILEMENU) {
73  fileMenu_->insertSeparator(fileMenuEnd_);
74  fileMenu_->insertAction(fileMenuEnd_, _action);
75  } else if (_name == ALGORITHMMENU) {
76 
77  // We insert the algorithms menu if it is not available yet
78  if ( menuBar()->actions().contains(helpMenu_->menuAction()) )
79  menuBar()->insertMenu(helpMenu_->menuAction(), algorithmMenu_);
80 
81  menus_[_name]->addAction(_action);
82  } else {
83  menus_[_name]->addAction(_action);
84  }
85 
86 }
87 
88 void CoreWidget::slotAddMenubarActions( std::vector<QAction*> _actions , QString _name ) {
89 
90  if (!menus_.contains(_name))
91  return;
92 
93  if (_name == FILEMENU) {
94  fileMenu_->insertSeparator(fileMenuEnd_);
95  for (std::vector<QAction*>::iterator it = _actions.begin(); it != _actions.end(); ++it )
96  fileMenu_->insertAction(fileMenuEnd_, *it);
97  } else if (_name == ALGORITHMMENU) {
98 
99  // We insert the algorithms menu if it is not available yet
100  if ( menuBar()->actions().contains(helpMenu_->menuAction()) )
101  menuBar()->insertMenu(helpMenu_->menuAction(), algorithmMenu_);
102 
103  for (std::vector<QAction*>::iterator it = _actions.begin(); it != _actions.end(); ++it )
104  menus_[_name]->addAction(*it);
105  } else {
106  for (std::vector<QAction*>::iterator it = _actions.begin(); it != _actions.end(); ++it )
107  menus_[_name]->addAction(*it);
108  }
109 
110 }
111 
112 //=============================================================================
113 
114 void CoreWidget::slotGetMenubarMenu (QString _name, QMenu *& _menu, bool _create)
115 {
116  //if menu already exists, return it
117  if (menus_.contains (_name))
118  _menu = menus_[_name];
119  //otherwise create a new one
120  else if (_create)
121  {
122  _menu = new QMenu(_name);
123  menus_[_name] = _menu;
124  //we have to install an event filter to get event information (e.g. what this)
125  _menu->installEventFilter(this);
126  //guarantee that helpMenu_ is always at the end of all menus
127  menuBar()->insertAction(helpMenu_->menuAction() ,_menu->menuAction ());
128  }
129  //otherwise no menu was found
130  else
131  _menu = NULL;
132 }
133 
134 
135 //=============================================================================
136 
137 bool CoreWidget::eventFilter(QObject *_obj, QEvent *_event)
138 {
139  //WhatsThisClicked event for hyperlinks in 'whats this' boxes
140  if( _event->type() == QEvent::WhatsThisClicked )
141  {
142  QWhatsThisClickedEvent *wtcEvent = static_cast<QWhatsThisClickedEvent*>(_event);
143  QWhatsThis::hideText();
144  this->showHelpBrowser(wtcEvent->href());
145  return true;
146  }
147 
148  return _obj->event(_event);
149 }
150 
151 //=============================================================================
152 
153 void CoreWidget::showReducedMenuBar(bool reduced) {
154  for (std::vector<QAction*>::iterator it = extended_actions.begin(); it != extended_actions.end(); ++it) {
155  (*it)->setVisible(!reduced);
156  }
157 }
158 
160 {
161 
162  // ======================================================================
163  // File Menu
164  // ======================================================================
165  fileMenu_ = new QMenu( FILEMENU );
166  menuBar()->addMenu( fileMenu_ );
167  menus_[tr("File")] = fileMenu_;
168 
169  //Clear all
170  QAction* AC_clear_all = new QAction(tr("Clear All"), this);;
171  AC_clear_all->setStatusTip(tr("Clear all Objects"));
172  AC_clear_all->setWhatsThis(tr("Close all open Objects"));
173  AC_clear_all->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"edit-clear.png"));
174  connect(AC_clear_all, SIGNAL(triggered()), this, SIGNAL(clearAll()));
175  fileMenu_->addAction(AC_clear_all);
176 
177  fileMenu_->addSeparator();
178 
179  //Load object
180  QAction* AC_Load = new QAction(tr("Load Object"), this);
181  AC_Load->setStatusTip(tr("Load an object"));
182  AC_Load->setWhatsThis(tr("Load a new object"));
183  AC_Load->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"document-open.png"));
184  connect(AC_Load, SIGNAL(triggered()), this, SIGNAL(loadMenu()));
185  fileMenu_->addAction(AC_Load);
186 
187  //Add empty object
188  QAction* AC_AddEmpty = new QAction(tr("Add Empty Object"), this);
189  AC_AddEmpty->setStatusTip(tr("Add an empty object"));
190  AC_AddEmpty->setWhatsThis(tr("Creates a new empty object of a given type"));
191  AC_AddEmpty->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"add-empty-object.png"));
192  connect(AC_AddEmpty, SIGNAL(triggered()), this, SIGNAL(addEmptyObjectMenu()));
193  fileMenu_->addAction(AC_AddEmpty);
194  extended_actions.push_back(AC_AddEmpty);
195  extended_actions.push_back(fileMenu_->addSeparator());
196 
197  //Save object
198  QAction* AC_Save = new QAction(tr("Save Objects"), this);
199 // AC_Save->setShortcut (Qt::CTRL + Qt::Key_S);
200  AC_Save->setStatusTip(tr("Save current objects"));
201  AC_Save->setWhatsThis(tr("Save current objects"));
202  AC_Save->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"document-save.png"));
203  connect(AC_Save, SIGNAL(triggered()), this, SIGNAL(saveMenu()));
204  fileMenu_->addAction(AC_Save);
205  extended_actions.push_back(AC_Save);
206 
207  //Save object to
208  QAction* AC_Save_to = new QAction(tr("Save Objects to"), this);
209  AC_Save_to->setStatusTip(tr("Save current Object(s) to"));
210  AC_Save_to->setWhatsThis(tr("Save current Object(s) under a new name"));
211  AC_Save_to->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"document-save-as.png"));
212  connect(AC_Save_to, SIGNAL(triggered()), this, SIGNAL(saveToMenu()));
213  fileMenu_->addAction(AC_Save_to);
214 
215  extended_actions.push_back(fileMenu_->addSeparator());
216 
217  //Load ini
218  QAction* AC_load_ini = new QAction(tr("Load Settings"), this);
219  AC_load_ini->setStatusTip(tr("Load Settings from INI file"));
220  AC_load_ini->setWhatsThis(tr("Load a previous settings from file (objects,colors,...)"));
221  AC_load_ini->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"load-settings.png"));
222  connect(AC_load_ini, SIGNAL(triggered()), this, SIGNAL(loadIniMenu()));
223  fileMenu_->addAction(AC_load_ini);
224  extended_actions.push_back(AC_load_ini);
225 
226  //Save ini
227  QAction* AC_save_ini = new QAction(tr("Save Settings"), this);
228  AC_save_ini->setStatusTip(tr("Save current settings to INI file"));
229  AC_save_ini->setWhatsThis(tr("Save settings to file (objects,colors,...)"));
230  AC_save_ini->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"save-settings.png"));
231  connect(AC_save_ini, SIGNAL(triggered()), this, SIGNAL(saveIniMenu()));
232  fileMenu_->addAction(AC_save_ini);
233  extended_actions.push_back(AC_save_ini);
234 
235  extended_actions.push_back(fileMenu_->addSeparator());
236 
237  //Options
238  QAction* AC_Options = new QAction(tr("Options"), this);
239  AC_Options->setStatusTip(tr("Edit OpenFlipper Options"));
240  AC_Options->setWhatsThis(tr("Edit OpenFlipper Options"));
241  AC_Options->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"options.png"));
242  connect(AC_Options, SIGNAL(triggered()), this, SLOT(showOptionsWidget()));
243  fileMenu_->addAction(AC_Options);
244 
245  //Remember entry of menu (required for adding File Menu entries from plugins)
246  fileMenuEnd_ = fileMenu_->addSeparator();
247 
248  //Recent files
249  recentFilesMenu_ = new QMenu(tr("Recent Files"));
250  recentFilesMenu_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"document-open-recent.png"));
251  recentFilesMenu_->setWhatsThis(tr("Open recent files"));
252  connect(recentFilesMenu_,SIGNAL(triggered(QAction*)),this,SIGNAL(recentOpen(QAction*)));
253  fileMenu_->addMenu(recentFilesMenu_);
254 
255  fileMenu_->addSeparator();
256 
257  //Main Application exit menu entry
258  QAction* AC_exit = new QAction(tr("Exit"), this);;
259  AC_exit->setShortcut (Qt::CTRL + Qt::Key_Q);
260  AC_exit->setStatusTip(tr("Exit Application"));
261  recentFilesMenu_->setWhatsThis(tr("Close OpenFlipper"));
262  AC_exit->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"application-exit.png"));
263  connect(AC_exit, SIGNAL(triggered()), this, SIGNAL(exit()));
264  fileMenu_->addAction(AC_exit);
265 
266  // ======================================================================
267  // View Menu
268  // ======================================================================
269  viewMenu_ = new QMenu( VIEWMENU );
270  menuBar()->addMenu(viewMenu_ );
271  menus_[tr("View")] = viewMenu_;
272 
274  extended_actions.push_back(
275  viewMenu_->addMenu(globalDrawMenu_));
276 
277  //============================================================================================================
278  // Rendering options Menu
279  //============================================================================================================
280 
281  QMenu* renderingOptionsMenu = new QMenu(tr("Global Rendering Options"),viewMenu_);
282  renderingOptionsMenu->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"core_renderingOptions.png") );
283  extended_actions.push_back(
284  viewMenu_->addMenu(renderingOptionsMenu));
285 
286  orthogonalProjectionAction_ = new QAction( tr("Switch Viewers to Orthogonal Projection"), renderingOptionsMenu );;
287  orthogonalProjectionAction_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"orthogonal.png") );
288  orthogonalProjectionAction_->setCheckable( false );
289  orthogonalProjectionAction_->setToolTip( tr("Switch to orthogonal projection mode."));
290  orthogonalProjectionAction_->setWhatsThis( tr("Switch projection mode<br><br>"
291  "Switch to <b>orthogonal</b> projection mode."));
292  connect( orthogonalProjectionAction_,SIGNAL( triggered() ), this, SLOT( slotGlobalOrthographicProjection() ) );
293  renderingOptionsMenu->addAction( orthogonalProjectionAction_);
294 
295  perspectiveProjectionAction_ = new QAction( tr("Switch Viewers to Perspective Projection"), viewMenu_ );;
296  perspectiveProjectionAction_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"perspective.png") );
297  perspectiveProjectionAction_->setCheckable( false );
298  perspectiveProjectionAction_->setStatusTip( tr("Switch to perspective projection mode."));
299  perspectiveProjectionAction_->setWhatsThis( tr("Switch projection mode<br><br>"
300  "Switch to <b>perspective</b> projection mode."));
301  connect( perspectiveProjectionAction_,SIGNAL( triggered() ), this, SLOT( slotGlobalPerspectiveProjection() ) );
302  renderingOptionsMenu->addAction( perspectiveProjectionAction_);
303 
304  // =====================
305 
306  globalAnimationAction_ = renderingOptionsMenu->addAction(tr("Global Animation"));
307  globalAnimationAction_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"animation.png") );
308  connect(globalAnimationAction_, SIGNAL(triggered(bool)), this , SLOT( slotGlobalToggleAnimation() ) );
309 
310  //======================
311 
312  globalBackfaceCullingAction_ = renderingOptionsMenu->addAction(tr("Global Backface Culling"));
313  globalBackfaceCullingAction_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"backFaceCulling.png") );
314  connect(globalBackfaceCullingAction_, SIGNAL(triggered(bool)), this , SLOT( slotGlobalToggleBackFaceCulling() ) );
315 
316  //======================
317 
318  globalTwosidedLightingAction_ = renderingOptionsMenu->addAction(tr("Global Two-sided Lighting"));
319  globalTwosidedLightingAction_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"twosidedLighting.png") );
320  connect(globalTwosidedLightingAction_, SIGNAL(triggered(bool)), this , SLOT( slotGlobalToggleTwoSidedLighting() ) );
321 
322  //======================
323 
324  globalMultisamplingAction_ = renderingOptionsMenu->addAction(tr("Global Multisampling"));
325  globalMultisamplingAction_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"multisampling.png") );
326  connect(globalMultisamplingAction_, SIGNAL(triggered(bool)), this , SLOT( slotGlobalToggleMultisampling()) );
327  //======================
328 
329  globalMipmappingAction_ = renderingOptionsMenu->addAction(tr("Global Mipmapping"));
330  globalMipmappingAction_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"mipmapping.png") );
331  connect(globalMipmappingAction_, SIGNAL(triggered(bool)), this , SLOT( slotGlobalToggleMipmapping()) );
332 
333 
334  //============================================================================================================
335  // Global renderer menu
336  //============================================================================================================
337 
339 
340  //============================================================================================================
341  // Other toplevel actions
342  //============================================================================================================
343 
344  viewMenu_->addSeparator();
345 
346  //============================================================================================================
347  // Post processor Manager
348  //============================================================================================================
349 
350  QString iconPath = OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator();
351  QAction* showPostProcessorDialog = new QAction(tr("Show post processor manager"),this);
352  showPostProcessorDialog->setIcon(QIcon(iconPath+"postprocessors.png"));
353  connect(showPostProcessorDialog,SIGNAL(triggered()),this,SLOT(slotShowPostProcessorManager()));
354  viewMenu_->addAction(showPostProcessorDialog);
355 
356  viewMenu_->addSeparator();
357 
358  //====================================================================================================
359 
360 
361  QAction* navigationSwitchAction = new QAction( tr("First-person Navigation"), viewMenu_ );
362  navigationSwitchAction->setCheckable( true );
363  navigationSwitchAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"core_firstPersonMode.png") );
364  navigationSwitchAction->setStatusTip( tr("Switch between normal and first-person navigation mode."));
365  navigationSwitchAction->setWhatsThis( tr("Switch between normal and first-person navigation mode."));
366  navigationSwitchAction->setChecked( false );
367 
368  connect( navigationSwitchAction, SIGNAL( toggled(bool) ), this, SLOT( slotSwitchNavigation(bool) ) );
369  viewMenu_->addAction( navigationSwitchAction);
370  extended_actions.push_back(navigationSwitchAction);
371 
372  viewMenu_->addSeparator();
373 
374  connect( viewMenu_,SIGNAL( aboutToShow() ), this, SLOT( slotViewMenuAboutToShow() ) );
375 
376  QAction* homeAction = new QAction(tr("Restore Home View"),viewMenu_);
377  homeAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"go-home.png") );
378  homeAction->setCheckable( false );
379  homeAction->setStatusTip( tr("Restore <b>home</b> view."));
380  homeAction->setWhatsThis( tr("Restore home view<br><br>"
381  "Resets the view to the home view"));
382  viewMenu_->addAction( homeAction );
383  connect( homeAction,SIGNAL( triggered() ), this, SLOT( slotGlobalHomeView() ) );
384 
385 
386  QAction* setHomeAction = new QAction( tr("Set Home View") , viewMenu_ );
387  setHomeAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"set-home.png") );
388  setHomeAction->setCheckable( false );
389  setHomeAction->setStatusTip( tr("Set <b>home</b> view"));
390  setHomeAction->setWhatsThis( tr("Store home view<br><br>"
391  "Stores the current view as the home view"));
392  viewMenu_->addAction( setHomeAction);
393  connect( setHomeAction,SIGNAL( triggered() ), this, SLOT( slotGlobalSetHomeView() ) );
394 
395  QAction* viewAllAction = new QAction( tr("View all"), viewMenu_ );
396  viewAllAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"viewall.png") );
397  viewAllAction->setCheckable( false );
398  viewAllAction->setStatusTip( tr("View all.") );
399  viewAllAction->setWhatsThis( tr("View all<br><br>"
400  "Move the objects in the scene so that"
401  " the whole scene is visible."));
402  connect( viewAllAction,SIGNAL( triggered() ), this, SLOT( slotGlobalViewAll() ) );
403  viewMenu_->addAction( viewAllAction);
404 
405  viewMenu_->addSeparator();
406 
407  QAction* snapShotAction = new QAction( tr("Viewer Snapshot"), viewMenu_ );
408  snapShotAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"viewerSnapshot.png") );
409  snapShotAction->setCheckable( false );
410  snapShotAction->setStatusTip( tr("Take a snapshot from all viewers."));
411  snapShotAction->setWhatsThis( tr("Viewer Snapshot<br><br>"
412  "Take a snapshot of all viewers at once."));
413  snapShotAction->setShortcut (Qt::Key_F2);
414  connect( snapShotAction,SIGNAL( triggered() ), this, SLOT( viewerSnapshotDialog() ) );
415  viewMenu_->addAction( snapShotAction);
416 
417  QAction* appSnapShotAction = new QAction( tr("Application Snapshot"), viewMenu_ );
418  appSnapShotAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"snapshot.png") );
419  appSnapShotAction->setCheckable( false );
420  appSnapShotAction->setStatusTip( tr("Take a snapshot from OpenFlipper."));
421  appSnapShotAction->setWhatsThis( tr("Snapshot<br><br>"
422  "Take a snapshot from OpenFlipper."));
423  connect( appSnapShotAction,SIGNAL( triggered() ), this, SLOT( applicationSnapshotDialog() ) );
424  viewMenu_->addAction( appSnapShotAction);
425 
426  viewMenu_->addSeparator();
427 
428  QAction* wheelSwitchAction = new QAction( tr("Show / hide wheels"), viewMenu_ );
429  wheelSwitchAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"core_wheels.png") );
430  wheelSwitchAction->setCheckable( true );
431  wheelSwitchAction->setStatusTip( tr("Show / hide navigation wheels in viewer widget."));
432  wheelSwitchAction->setWhatsThis( tr("Show / hide navigation wheels in viewer widget.<br><br>"
433  " These wheels appear in the corners of the viewports. "
434  " Use wheels to rotate and scale scene."));
435 
436  if(OpenFlipperSettings().value("Core/Gui/glViewer/showControlWheels").toBool() )
437  wheelSwitchAction->setChecked(true);
438 
439  connect( wheelSwitchAction,SIGNAL( toggled(bool) ), this, SLOT( slotSwitchWheels(bool) ) );
440  viewMenu_->addAction( wheelSwitchAction);
441 
442  QAction* coordSys = viewMenu_->addAction(tr("Coordinate Systems"));
443  coordSys->setCheckable(true);
444  coordSys->setChecked(true);
445  coordSys->setStatusTip(tr("Toggle visibility of the coordinate systems"));
446  coordSys->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"coordsys.png") );
447  connect(coordSys, SIGNAL(triggered(bool)), this, SLOT( slotCoordSysVisibility(bool) ) );
448 
449  viewMenu_->addSeparator();
450 
451  QAction* setGlobalBackgroundColor = new QAction(tr("Set Background Color"), this);;
452  setGlobalBackgroundColor->setToolTip(tr("Set Background Color for all viewers"));
453  setGlobalBackgroundColor->setStatusTip(tr("Set Background Color for all viewers"));
454  setGlobalBackgroundColor->setWhatsThis(tr("Set Background Color for all viewers"));
455  setGlobalBackgroundColor->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"BackgroundColor.png") );
456  connect(setGlobalBackgroundColor, SIGNAL(triggered()), this, SLOT(slotSetGlobalBackgroundColor()));
457  viewMenu_->addAction(setGlobalBackgroundColor);
458 
459  //===========================================================================================================================
460  // Tools Menu
461  //===========================================================================================================================
462 
463  toolsMenu_ = new QMenu( TOOLSMENU );
464  menuBar()->addMenu(toolsMenu_ );
465  menus_[tr("Tools")] = toolsMenu_;
466 
467  QAction* sceneGraphAction = new QAction( tr("Show SceneGraph ") ,toolsMenu_ );
468  sceneGraphAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"scenegraph.png") );
469  sceneGraphAction->setCheckable( false );
470  sceneGraphAction->setToolTip( tr("Show scene graph viewer.") );
471  sceneGraphAction->setWhatsThis( tr("Toggle scene graph viewer<br><br>"
472  "The scene graph viewer enables you to examine the "
473  "displayed scene graph and to modify certain nodes.<br><br>" ) );
474  QObject::connect( sceneGraphAction, SIGNAL( triggered() ),
475  this, SLOT( slotShowSceneGraphDialog() ) );
476  toolsMenu_->addAction( sceneGraphAction);
477  extended_actions.push_back(sceneGraphAction);
478 
479  toolsMenu_->addSeparator();
480 
481  QAction* startVideoCaptureAction = new QAction( tr("Start Video Capture ") ,toolsMenu_ );
482  startVideoCaptureAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"video-start.png") );
483  startVideoCaptureAction->setCheckable( false );
484  startVideoCaptureAction->setToolTip( tr("Start video capturing.") );
485  startVideoCaptureAction->setWhatsThis( tr("Start to capture a video sequence of the user actions")) ;
486  toolsMenu_->addAction( startVideoCaptureAction );
487  connect(startVideoCaptureAction, SIGNAL(triggered()), this, SLOT(startVideoCaptureDialog()) );
488 
489  QAction* stopVideoCaptureAction = new QAction( tr("Stop Video Capture ") ,toolsMenu_ );
490  stopVideoCaptureAction->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"video-stop.png") );
491  stopVideoCaptureAction->setCheckable( false );
492  stopVideoCaptureAction->setToolTip( tr("Stop video capturing." ));
493  stopVideoCaptureAction->setWhatsThis( tr("Stop Video capturing" ));
494 
495  toolsMenu_->addAction( stopVideoCaptureAction);
496  connect(stopVideoCaptureAction, SIGNAL(triggered()), this, SIGNAL(stopVideoCapture()) );
497 
498  extended_actions.push_back(startVideoCaptureAction);
499  extended_actions.push_back(stopVideoCaptureAction);
500 
501  toolsMenu_->addSeparator();
502 
503  //show plugins
504  QAction* AC_Plugins = new QAction(tr("Plugins"), this);
505  AC_Plugins->setStatusTip(tr("Show loaded plugins"));
506  AC_Plugins->setWhatsThis(tr("Show loaded plugins"));
507  AC_Plugins->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"network-connect.png"));
508  connect(AC_Plugins, SIGNAL(triggered()), this, SIGNAL(showPlugins()));
509  toolsMenu_->addAction(AC_Plugins);
510 
511  // ======================================================================
512  // Window Menu
513  // ======================================================================
514  windowMenu_ = new QMenu(tr("Windows"));
515  menuBar()->addMenu(windowMenu_);
516  menus_[tr("Windows")] = windowMenu_;
517 
518 
519  // Show or Hide the View Mode Controls
520  AC_ShowViewModeControls_ = new QAction(tr("Show View Mode Controls"), this);
521  AC_ShowViewModeControls_->setStatusTip(tr("Show or Hide View Mode Control Widget"));
522  // AC_HelpBrowser->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"help-browser.png"));
523  AC_ShowViewModeControls_->setWhatsThis(tr("Show or Hide View Mode Control Widget"));
524  AC_ShowViewModeControls_->setCheckable(true);
525  AC_ShowViewModeControls_->setChecked( ! OpenFlipperSettings().value("Core/Gui/TaskSwitcher/Hide",false).toBool() );
526  connect(AC_ShowViewModeControls_, SIGNAL(toggled( bool )), this, SLOT(showViewModeControls(bool)));
529 
530  // Show or Hide the View Mode Controls
531  QAction* AC_ShowToolbox = new QAction(tr("Show Toolboxes"), this);
532  AC_ShowToolbox->setStatusTip(tr("Show or Hide the Toolbox Widget"));
533  // AC_HelpBrowser->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"help-browser.png"));
534  AC_ShowToolbox->setWhatsThis(tr("Show or Hide the Toolbox Widget"));
535  AC_ShowToolbox->setCheckable(true);
536  AC_ShowToolbox->setChecked( ! OpenFlipperSettings().value("Core/Gui/ToolBoxes/hidden",false).toBool() );
537  connect(AC_ShowToolbox, SIGNAL( triggered()), this, SLOT(toggleToolbox()));
538  connect(this,SIGNAL(toolBoxVisChanged(bool)),AC_ShowToolbox,SLOT(setChecked(bool)));
539  windowMenu_->addAction(AC_ShowToolbox);
540 
541  // Show or Hide the Status bar
542  QAction* AC_ShowStatusBar = new QAction(tr("Show Statusbar"), this);
543  AC_ShowStatusBar->setStatusTip(tr("Show or Hide the Statusbar"));
544  AC_ShowStatusBar->setWhatsThis(tr("Show or Hide the Statusbar"));
545  AC_ShowStatusBar->setCheckable(true);
546  AC_ShowStatusBar->setChecked( !OpenFlipperSettings().value("Core/Gui/StatusBar/hidden",false).toBool());
547  connect(AC_ShowStatusBar,SIGNAL(triggered()),this,SLOT(toggleStatusBar()));
548  connect(this,SIGNAL(statusBarVisChanged(bool)),AC_ShowStatusBar,SLOT(setChecked(bool)));
549  windowMenu_->addAction(AC_ShowStatusBar);
550 
551  // Show or Hide the Menu bar
552  QAction* AC_ShowMenuBar = new QAction(tr("Show Menubar"), this);
553  AC_ShowMenuBar->setStatusTip(tr("Show or Hide the Menubar"));
554  AC_ShowMenuBar->setWhatsThis(tr("Show or Hide the Menubar"));
555  AC_ShowMenuBar->setCheckable(true);
556  AC_ShowMenuBar->setChecked( !OpenFlipperSettings().value("Core/Gui/MenuBar/hidden",false).toBool());
557  connect(AC_ShowMenuBar,SIGNAL(triggered()),this,SLOT(toggleMenuBar()));
558  connect(this,SIGNAL(menuBarVisChanged(bool)),AC_ShowMenuBar,SLOT(setChecked(bool)));
559  windowMenu_->addAction(AC_ShowMenuBar);
560  extended_actions.push_back(AC_ShowMenuBar);
561 
562  // Show or Hide the Tool bar
563  QAction* AC_ShowToolBar = new QAction(tr("Show Toolbar"), this);
564  AC_ShowToolBar->setStatusTip(tr("Show or Hide the Toolbar"));
565  AC_ShowToolBar->setWhatsThis(tr("Show or Hide the Toolbar"));
566  AC_ShowToolBar->setCheckable(true);
567  AC_ShowToolBar->setChecked( !OpenFlipperSettings().value("Core/Gui/ToolBar/hidden",false).toBool());
568  connect(AC_ShowToolBar,SIGNAL(triggered()),this,SLOT(toggleToolBar()));
569  connect(this,SIGNAL(toolBarVisChanged(bool)),AC_ShowToolBar,SLOT(setChecked(bool)));
570  windowMenu_->addAction(AC_ShowToolBar);
571 
572  // Enable or Disable Fullscreen Mode
573  QAction* AC_Fullscreen = new QAction(tr("Fullscreen"), this);
574  AC_Fullscreen->setStatusTip(tr("Enable or Disable the Fullscreen"));
575  AC_Fullscreen->setWhatsThis(tr("Enable or Disable the Fullscreen"));
576  AC_Fullscreen->setCheckable(true);
577  AC_Fullscreen->setChecked( OpenFlipperSettings().value("Core/Gui/fullscreen", false ).toBool() );
578  connect(AC_Fullscreen,SIGNAL(triggered()),this,SLOT(toggleFullscreen()));
579  connect(this,SIGNAL(fullScreenChanged(bool)),AC_Fullscreen,SLOT(setChecked(bool)));
580  windowMenu_->addAction(AC_Fullscreen);
581 
582  // ======================================================================
583  // Algorithms Menu
584  // ======================================================================
585  algorithmMenu_ = new QMenu( ALGORITHMMENU );
586  menus_[tr("Algorithms")] = algorithmMenu_;
587 
588  // ======================================================================
589  // help Menu
590  // ======================================================================
591  helpMenu_ = new QMenu(tr("Help"));
592  menuBar()->addMenu(helpMenu_);
593  menus_[tr("Help")] = helpMenu_;
594 
595  //Open Help Browser
596  QAction* AC_HelpBrowser = new QAction(tr("Help"), this);
597  AC_HelpBrowser->setStatusTip(tr("Open Help Browser with Documentation"));
598  AC_HelpBrowser->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"help-browser.png"));
599  AC_HelpBrowser->setWhatsThis(tr("Open the <b>Help Browser</b>"));
600  connect(AC_HelpBrowser, SIGNAL(triggered()), this, SLOT(showHelpBrowser()));
601  helpMenu_->addAction(AC_HelpBrowser);
602 
603  //Switch to whats this mode
604  QAction* AC_Whats_this = QWhatsThis::createAction ( this );
605  AC_Whats_this->setStatusTip(tr("Enter What's this Mode"));
606  AC_Whats_this->setWhatsThis(tr("Get information about a specific Button/Widget/..."));
607  helpMenu_->addAction(AC_Whats_this);
608 
609  helpMenu_->addSeparator();
610 
611  //About Action
612  QAction* AC_About = new QAction(tr("About"), this);
613  AC_About->setStatusTip(tr("About OpenFlipper"));
614  AC_About->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"help-about.png"));
615  AC_About->setWhatsThis(tr("This entry shows information about <b>OpenFlipper</b>"));
616  connect(AC_About, SIGNAL(triggered()), this, SLOT(showAboutWidget()));
617  helpMenu_->addAction(AC_About);
618 
619  // Add Menu entries to the main Toolbar
620  mainToolbar_->addAction(AC_Load);
621  mainToolbar_->addAction(AC_AddEmpty);
622  mainToolbar_->addSeparator();
623  mainToolbar_->addAction(AC_Save);
624  mainToolbar_->addAction(AC_Save_to);
625  mainToolbar_->addSeparator();
626  mainToolbar_->addAction(AC_load_ini);
627  mainToolbar_->addAction(AC_save_ini);
628 
629 
630  // install event filters for what is this event
631  // todo: why doesn't go any event through CoreWidget::event from menus? i don't get it
632  fileMenu_->installEventFilter(this);
633  viewMenu_->installEventFilter(this);
634  toolsMenu_->installEventFilter(this);
635  windowMenu_->installEventFilter(this);
636  algorithmMenu_->installEventFilter(this);
637  helpMenu_->installEventFilter(this);
638 }
639 
640 
642 
643  uint enabledCount = 0;
644 
645  for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
647  enabledCount++;
648  }
649 
650  if ( enabledCount != 0 ) {
651  globalAnimationAction_->setToolTip(tr("Disable animation for all viewers"));
652  globalAnimationAction_->setStatusTip(tr("Disable animation for all viewers"));
653  globalAnimationAction_->setText(tr("Disable animation"));
654  } else {
655  globalAnimationAction_->setToolTip(tr("Enable animation for all viewers"));
656  globalAnimationAction_->setStatusTip(tr("Enable animation for all viewers"));
657  globalAnimationAction_->setText(tr("Enable animation"));
658  }
659 
660  //=============================================================================================================================
661 
662  enabledCount = 0;
663 
664  for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
666  enabledCount++;
667  }
668 
669  if ( enabledCount != 0 ) {
670  globalBackfaceCullingAction_->setToolTip(tr("Disable backface culling for all viewers"));
671  globalBackfaceCullingAction_->setStatusTip(tr("Disable backface culling for all viewers"));
672  globalBackfaceCullingAction_->setText(tr("Disable backface culling"));
673  } else {
674  globalBackfaceCullingAction_->setToolTip(tr("Enable backface culling for all viewers"));
675  globalBackfaceCullingAction_->setStatusTip(tr("Enable backface culling for all viewers"));
676  globalBackfaceCullingAction_->setText(tr("Enable backface culling"));
677  }
678 
679  //=============================================================================================================================
680 
681  enabledCount = 0;
682 
683  for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
685  enabledCount++;
686  }
687 
688  if ( enabledCount != 0 ) {
689  globalTwosidedLightingAction_->setToolTip(tr("Disable two-sided lighting for all viewers"));
690  globalTwosidedLightingAction_->setStatusTip(tr("Disable two-sided lighting for all viewers"));
691  globalTwosidedLightingAction_->setText(tr("Disable two-sided lighting"));
692  } else {
693  globalTwosidedLightingAction_->setToolTip(tr("Enable two-sided lighting for all viewers"));
694  globalTwosidedLightingAction_->setStatusTip(tr("Enable two-sided lighting for all viewers"));
695  globalTwosidedLightingAction_->setText(tr("Enable two-sided lighting"));
696  }
697 
698  //=============================================================================================================================
699 
700  enabledCount = 0;
701 
702  for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
704  enabledCount++;
705  }
706 
707  if ( enabledCount != 0 ) {
708  globalMultisamplingAction_->setToolTip(tr("Disable multisampling for all viewers"));
709  globalMultisamplingAction_->setStatusTip(tr("Disable multisampling for all viewers"));
710  globalMultisamplingAction_->setText(tr("Disable multisampling"));
711  } else {
712  globalMultisamplingAction_->setToolTip(tr("Enable multisampling for all viewers"));
713  globalMultisamplingAction_->setStatusTip(tr("Enable multisampling for all viewers"));
714  globalMultisamplingAction_->setText(tr("Enable multisampling"));
715  }
716 
717  //=============================================================================================================================
718 
719  enabledCount = 0;
720 
721  for ( int i = 0 ; i< PluginFunctions::viewers(); ++i ) {
723  enabledCount++;
724  }
725 
726  if ( enabledCount != 0 ) {
727  globalMipmappingAction_->setToolTip(tr("Disable mipmapping for all viewers"));
728  globalMipmappingAction_->setStatusTip(tr("Disable mipmapping for all viewers"));
729  globalMipmappingAction_->setText(tr("Disable mipmapping"));
730  } else {
731  globalMipmappingAction_->setToolTip(tr("Enable mipmapping for all viewers"));
732  globalMipmappingAction_->setStatusTip(tr("Enable mipmapping for all viewers"));
733  globalMipmappingAction_->setText(tr("Enable mipmapping"));
734  }
735 
736  //=============================================================================================================================
737 
738  int perspectiveCount = 0;
739  int orthogonalCount = 0;
740 
741  for ( int i = 0 ; i < PluginFunctions::viewers() ; ++i ) {
742  if ( examiner_widgets_[ i ]->projectionMode() == glViewer::PERSPECTIVE_PROJECTION )
743  perspectiveCount++;
744  else
745  orthogonalCount++;
746  }
747 
748  if ( perspectiveCount == PluginFunctions::viewers() )
749  perspectiveProjectionAction_->setVisible(false);
750  else
751  perspectiveProjectionAction_->setVisible(true);
752 
753  if ( orthogonalCount == PluginFunctions::viewers() )
754  orthogonalProjectionAction_->setVisible(false);
755  else
756  orthogonalProjectionAction_->setVisible(true);
757 
758 }
759 
761 
762  // Add the menu if it does not exist yet
763  if ( rendererMenu_ == 0 ) {
764 
765  QString iconPath = OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator();
766 
767  rendererMenu_ = new QMenu(tr("Global Renderer"),viewMenu_);
768  rendererMenu_->setIcon(QIcon(iconPath+"renderers.png"));
769  extended_actions.push_back(viewMenu_->addMenu(rendererMenu_));
770 
771 
772  connect(rendererMenu_,SIGNAL(aboutToShow () ) , this, SLOT(slotUpdateRendererMenu() ) );
773  }
774 
775  // delete the old renerer group if it exists
776  if ( rendererGroup_ ) {
777 
778  disconnect( rendererGroup_ , SIGNAL( triggered( QAction * ) ),
779  this , SLOT( slotGlobalRendererMenu( QAction * ) ) );
780 
781  delete( rendererGroup_ );
782  rendererGroup_ = 0;
783 
784  }
785 
786  // Recreate actionGroup
787  rendererGroup_ = new QActionGroup( this );
788  rendererGroup_->setExclusive( true );
789 
790 // // Add the options for all active renderers
791 // for ( int i = 0 ; i < PluginFunctions::viewers() ; ++i) {
792 //
793 // //Get the options action for the currently active renderer
794 // if( renderManager()[ renderManager().activeId( i )]->optionsAction != 0 ) {
795 // rendererMenu_->addAction(renderManager()[ renderManager().activeId(i) ]->optionsAction );
796 // }
797 // }
798 
799 // rendererMenu_->addSeparator();
800 
801  // Add the renderers
802  for ( unsigned int i = 0 ; i < renderManager().available() ; ++i) {
803 
804  // Add a new Action with the renderer name
805  QAction * action = new QAction( renderManager()[i]->name, rendererGroup_ );
806  action->setCheckable( true );
807 
808  // Check if this processor is currently active
809  if ( renderManager().activeId(PluginFunctions::activeExaminer() ) == i )
810  action->setChecked(true);
811 
812  // Remember the id for the processor
813  action->setData(QVariant(i));
814  }
815 
816  // Remove old data
817  rendererMenu_->clear();
818 
819  // Add all new actions from the group to the menu
820  rendererMenu_->addActions( rendererGroup_->actions() );
821 
822  // Connect signal of group to our managing slot
823  connect( rendererGroup_ , SIGNAL( triggered( QAction * ) ),
824  this , SLOT( slotGlobalRendererMenu( QAction * ) ) );
825 
826 
827 }
828 
830  if ( drawGroup_ ) {
831 
832  disconnect( drawGroup_ , SIGNAL( triggered( QAction * ) ),
833  this , SLOT( slotGlobalDrawMenu( QAction * ) ) );
834  delete( drawGroup_ );
835  drawGroup_ = 0;
836 
837  }
838 
839  // Recreate drawGroup
840  drawGroup_ = new QActionGroup( this );
841  drawGroup_->setExclusive( false );
842 
843  connect( drawGroup_ , SIGNAL( triggered( QAction * ) ),
844  this , SLOT( slotGlobalDrawMenu( QAction * ) ) );
845 
846  if ( !globalDrawMenu_ ) {
847 
848  QIcon icon;
849  icon.addFile(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"drawModes.png");
850  globalDrawMenu_ = new QMenu(tr("Set Global DrawMode"));
851  globalDrawMenu_->setTearOffEnabled(true);
852  globalDrawMenu_->setIcon(icon);
853 
854  connect(globalDrawMenu_,SIGNAL(aboutToShow () ) , this, SLOT(slotUpdateGlobalDrawMenu() ) );
855  }
856 
857  // Collect available draw Modes
858  // Single pass action, draw modes independent from multipass rendering
861  availableGlobalDrawModes_ = actionAvailable.drawModes();
862 
863  // Get currently active drawModes
865  for ( int i = 1 ; i < PluginFunctions::viewers(); ++i )
867 
868  // Convert to ids
869  std::vector< ACG::SceneGraph::DrawModes::DrawMode > availDrawModeIds;
870  availDrawModeIds = availableGlobalDrawModes_.getAtomicDrawModes() ;
871 
872  globalDrawMenu_->clear();
873 
874  for ( unsigned int i = 0; i < availDrawModeIds.size(); ++i )
875  {
876  ACG::SceneGraph::DrawModes::DrawMode id = availDrawModeIds[i];
877  std::string descr = id.description();
878 
879  QAction * action = new QAction( descr.c_str(), drawGroup_ );
880  action->setCheckable( true );
881  action->setChecked( activeDrawModes_.containsAtomicDrawMode(id) );
882  }
883 
884  globalDrawMenu_->addActions( drawGroup_->actions() );
885 
886 }
887 
888 void CoreWidget::slotGlobalRendererMenu(QAction * _action) {
889 
890  unsigned int mode = _action->data().toUInt();
891 
892  QString defaultRendererName = renderManager()[mode]->name;
893 
894  // Set renderer for all viewers
895  for ( int i = 0 ; i < PluginFunctions::viewers() ; ++i)
896  {
897  renderManager().setActive(mode,i);
898  QString defaultRendererKey = "Viewer" + QString::number(i)+"/DefaultRenderer";
899  OpenFlipperSettings().setValue(defaultRendererKey,defaultRendererName);
900  }
901 
902 }
903 
905 
906  unsigned int mode = _action->data().toUInt();
907 
908  // Set postprocessor for all viewers
909  for ( int i = 0 ; i < PluginFunctions::viewers() ; ++i)
910  postProcessorManager().setActive(mode,i);
911 
912 }
913 
914 void CoreWidget::slotGlobalDrawMenu(QAction * _action) {
915 
916  //======================================================================================
917  // Get the mode toggled
918  //======================================================================================
920  std::vector< ACG::SceneGraph::DrawModes::DrawMode > availDrawModeIds;
921  availDrawModeIds = availableGlobalDrawModes_.getAtomicDrawModes();
922  for ( unsigned int i = 0; i < availDrawModeIds.size(); ++i )
923  {
924  QString descr = QString( ( availDrawModeIds[i].description() ).c_str() );
925 
926  if ( descr == _action->text() ) {
927  mode = availDrawModeIds[i];
928  break;
929  }
930  }
931 
932  if ( qApp->keyboardModifiers() & Qt::ShiftModifier )
934  else
935  activeDrawModes_ = mode ;
936 
938 }
939 
940 
941 //=============================================================================
void slotAddMenubarAction(QAction *_action, QString _name)
File Menu.
Definition: MenuBar.cc:67
QAction * orthogonalProjectionAction_
This variable holds the global draw menu.
Definition: CoreWidget.hh:870
void slotViewMenuAboutToShow()
Called before the view Menu is shown.
Definition: MenuBar.cc:641
QAction * globalBackfaceCullingAction_
Action to globally set backface culling.
Definition: CoreWidget.hh:876
std::vector< QAction * > extended_actions
Definition: CoreWidget.hh:1567
void slotGlobalViewAll()
Change view on all viewers to view complete scene.
void showReducedMenuBar(bool reduced)
typedefs
Definition: MenuBar.cc:153
void applicationSnapshotDialog()
Create a snapshot of the whole app with fileDialog.
void slotGlobalSetHomeView()
Set the home position for all viewers.
QMap< QString, QMenu * > menus_
All available menus.
Definition: CoreWidget.hh:801
void animation(bool _state)
set 2-sided lighting on/off
void slotUpdateRendererMenu()
Setup and update the global renderer menu.
Definition: MenuBar.cc:760
void fullScreenChanged(bool _state)
will be emitted if the fullscreen state is changed (_state = true => in fullscreen) ...
#define TOOLSMENU
The Menu will be added inside the Tools Menu.
void slotGlobalToggleAnimation()
If animation is disabled in all viewers, enable it in all viewers. Otherwise disable it...
bool eventFilter(QObject *_obj, QEvent *_event)
typedefs
Definition: MenuBar.cc:137
void slotCoordSysVisibility(bool _visible)
Hide coordinate systems in all viewers.
void showHelpBrowser(const QString &page=homePage_)
Display the help Browser.
Definition: Help.cc:71
std::vector< DrawMode > getAtomicDrawModes() const
Separates this drawMode into a list of all separate atomic draw modes.
bool backFaceCulling()
Get current state of backface culling.
QMenu * helpMenu_
Help Menu.
Definition: CoreWidget.hh:690
void slotGlobalHomeView()
Set the viewer to home position.
ACG::SceneGraph::DrawModes::DrawMode activeDrawModes_
This variable holds the global draw menu.
Definition: CoreWidget.hh:887
void slotSwitchNavigation(bool _egomode)
Switch navigation mode.
QMenu * viewMenu_
View Menu.
Definition: CoreWidget.hh:792
QActionGroup * rendererGroup_
Group for all renderers.
Definition: CoreWidget.hh:864
ACG::SceneGraph::BaseNode * getRootNode()
Get the root node for data objects.
void toggleFullscreen()
Set application to Fullscreen and back.
Definition: CoreWidget.cc:703
void toolBarVisChanged(bool _state)
will be emitted if the visibility of the toolbar is changed
int viewers()
Get the number of viewers.
QAction * fileMenuEnd_
First entry after all relevant parts of the File Menu.
Definition: CoreWidget.hh:798
void statusBarVisChanged(bool _state)
will be emitted if the visibility of the statusbar is changed
unsigned int available()
number of available renderers
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
void menuBarVisChanged(bool _state)
will be emitted if the visibility of the menubar is changed
QAction * AC_ShowViewModeControls_
Action for View Mode Widget Conrol in Menu.
Definition: CoreWidget.hh:696
void setupMenuBar()
Setup the main menubar.
Definition: MenuBar.cc:159
void toggleToolBar()
Hide or show current toolbar.
Definition: CoreWidget.cc:844
#define ALGORITHMMENU
The Menu will be added inside the Algorithms Menu.
void viewerSnapshotDialog()
Create a snapshot of the whole app with fileDialog.
#define FILEMENU
The Menu will be added inside the File Menu.
void mipmapping(bool _state)
set mipmapping on/off
QMenu * toolsMenu_
Tools Menu.
Definition: CoreWidget.hh:795
void slotSwitchWheels(bool _state)
Show / hide wheels.
void toolBoxVisChanged(bool _state)
will be emitted if the visibility of the toolbox is changed
void slotUpdateGlobalDrawMenu()
Setup and update the global draw menu.
Definition: MenuBar.cc:829
void setValue(const QString &key, const QVariant &value)
Wrapper function which makes it possible to enable Debugging output with -DOPENFLIPPER_SETTINGS_DEBUG...
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
void multisampling(bool _state)
set multisampling on/off
Viewer::ViewerProperties & viewerProperties(int _id)
Get the viewer properties Use this functions to get basic viewer properties such as backgroundcolor o...
QMenu * algorithmMenu_
Algorithms Menu.
Definition: CoreWidget.hh:687
DrawModes::DrawMode drawModes() const
Get the collected draw modes.
Definition: SceneGraph.hh:588
void slotGlobalOrthographicProjection()
Toggle projection mode of all viewers to orthographic projection.
void traverse(BaseNode *_node, Action &_action)
Definition: SceneGraph.hh:143
void slotAddMenubarActions(std::vector< QAction * > _actions, QString _name)
File Menu.
Definition: MenuBar.cc:88
void showAboutWidget()
Display the about widget.
Definition: About.cc:91
unsigned int activeExaminer()
Get the id of the examiner which got the last mouse events.
void twoSidedLighting(bool _state)
set 2-sided lighting on/off
void slotSetGlobalBackgroundColor()
Set Background Color for all viewers at once.
void slotGlobalToggleMipmapping()
If mipmapping is disabled in all viewers, enable it in all viewers. Otherwise disable it...
void clearAll()
Clear all data objects.
Definition: Core.cc:987
void slotShowSceneGraphDialog()
Definition: CoreWidget.cc:1038
DrawMode NONE
not a valid draw mode
Definition: DrawModes.cc:77
std::vector< glViewer * > examiner_widgets_
Examiner Widget.
Definition: CoreWidget.hh:669
void stopVideoCapture()
Stop video capturing.
Definition: Video.cc:110
void slotGlobalToggleTwoSidedLighting()
If two-sided lighting is disabled in all viewers, enable it in all viewers. Otherwise disable it...
QAction * globalAnimationAction_
Action to globally set animation.
Definition: CoreWidget.hh:873
ACG::SceneGraph::DrawModes::DrawMode drawMode(int _viewer)
Get the current draw Mode of a Viewer.
void slotGlobalPerspectiveProjection()
Toggle projection mode of all viewers to perspective projection.
void slotGlobalToggleMultisampling()
If multisampling is disabled in all viewers, enable it in all viewers. Otherwise disable it...
#define VIEWMENU
The Menu will be added inside the View Menu.
void slotGlobalPostProcessorMenu(QAction *_action)
Called when the global postprocessor is selected.
Definition: MenuBar.cc:904
void slotGetMenubarMenu(QString _name, QMenu *&_menu, bool _create)
File Menu.
Definition: MenuBar.cc:114
void showOptionsWidget()
Display the Options Browser.
Definition: CoreWidget.cc:940
bool containsAtomicDrawMode(DrawMode _atomicDrawMode) const
Check whether an Atomic DrawMode is active in this draw Mode.
QMenu * fileMenu_
File Menu.
Definition: CoreWidget.hh:789
void slotGlobalDrawMenu(QAction *_action)
Called when the global drawMode is selected.
Definition: MenuBar.cc:914
void toggleStatusBar()
Change visibility of the Status Bar.
Definition: StatusBar.cc:150
QAction * perspectiveProjectionAction_
This variable holds the global draw menu.
Definition: CoreWidget.hh:869
QAction * globalMultisamplingAction_
Action to globally set multisampling.
Definition: CoreWidget.hh:882
void slotGlobalToggleBackFaceCulling()
If backface culling is disabled in all viewers, enable it in all viewers. Otherwise disable it...
QMenu * recentFilesMenu_
QMenu containing the recently opened files.
Definition: CoreWidget.hh:684
void toggleToolbox()
Hide or show toolbox area.
Definition: CoreWidget.cc:762
void setActive(unsigned int _active, int _id)
set the active renderer
QMenu * globalDrawMenu_
This variable holds the global draw menu.
Definition: CoreWidget.hh:856
QAction * globalMipmappingAction_
Action to globally set mipmapping.
Definition: CoreWidget.hh:885
void setActive(unsigned int _active, int _viewerId)
set the active post processor for viewer
void slotGlobalRendererMenu(QAction *_action)
Called when the global renderer is selected.
Definition: MenuBar.cc:888
ACG::SceneGraph::DrawModes::DrawMode availableGlobalDrawModes_
This variable holds the global draw menu.
Definition: CoreWidget.hh:889
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
QMenu * windowMenu_
Window Menu.
Definition: CoreWidget.hh:693
void setDrawMode(const ACG::SceneGraph::DrawModes::DrawMode &_mode, int _viewer)
Set the draw Mode of a Viewer. .
void toggleMenuBar()
Hide or show menu bar.
Definition: CoreWidget.cc:836
void showViewModeControls(bool _show)
Hide or show the View Mode controls.
Definition: CoreWidget.cc:733