Developer Documentation
CoreWidget.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 
45 
46 //=============================================================================
47 //
48 // CLASS MViewWidget - IMPLEMENTATION
49 //
50 //=============================================================================
51 
52 
53 //== INCLUDES =================================================================
54 
55 // -------------------- mview
56 #include "CoreWidget.hh"
57 
58 // -------------------- OpenFlipper Includes
59 #include <OpenFlipper/common/RecentFiles.hh>
60 #include <OpenFlipper/BasePlugin/PluginFunctionsCore.hh>
61 
62 #include <OpenFlipper/widgets/videoCaptureDialog/VideoCaptureDialog.hh>
63 
65 #include <ACG/GL/ShaderCache.hh>
67 
68 
69 // -------------------- Qt event Includes
70 #include <QGLFormat>
71 
72 #define WIDGET_HEIGHT 800
73 #define WIDGET_WIDTH 800
74 
75 //== IMPLEMENTATION ==========================================================
76 
77 PickMode::PickMode(const std::string& _n, const bool _t, const bool _v, QCursor _c, QToolBar *_tb ) :
78  name_(_n),
79  tracking_(_t),
80  visible_(_v),
81  cursor_(_c),
82  toolbar_(_tb)
83 {
84 
85 }
86 
87 void PickMode::visible(const bool _visible) {
88  visible_ = _visible;
89 }
90 
91 bool PickMode::visible() const {
92  return visible_;
93 }
94 
95 std::string PickMode::name() const {
96  return name_;
97 }
98 
99 void PickMode::tracking(bool _tracking) {
100  tracking_ = _tracking;
101 }
102 
103 bool PickMode::tracking() const {
104  return tracking_;
105 }
106 
107 void PickMode::cursor(const QCursor _cursor) {
108  cursor_ = _cursor;
109 }
110 
111 QCursor PickMode::cursor() const{
112  return cursor_;
113 }
114 
115 void PickMode::toolbar(QToolBar* _toolbar) {
116  toolbar_ = _toolbar;
117 }
118 
119 QToolBar * PickMode::toolbar() const {
120  return toolbar_;
121 }
122 
123 
124 
125 
126 
127 
128 
129 
134 CoreWidget( QVector<ViewMode*>& _viewModes,
135  QList< SlotInfo >& _coreSlots ) :
136  QMainWindow(),
137  coreSlots_(_coreSlots),
138  shiftPressed_(false),
139  viewModes_(_viewModes),
140  viewModeButton_(0),
141  viewModeMenu_(0),
142  splitter_(0),
143  logWidget_(0),
144  recentFilesMenu_(0),
145  helpMenu_(0),
146  windowMenu_(0),
147  AC_ShowViewModeControls_(0),
148  pickToolBarExternal_(0),
149  cursorPainter_(0),
150  sceneGraphDialog_(0),
151  viewModeChangePopupAction_(0),
152  modeChangeWidget(0),
153  fileMenu_(0),
154  viewMenu_(0),
155  pythonMenu_(0),
156  toolsMenu_(0),
157  fileMenuEnd_(0),
158  stereoButton_(0),
159  moveButton_(0),
160  pickButton_(0),
161  questionButton_(0),
162  globalDrawMenu_(0),
163  rendererMenu_(0),
164  drawGroup_(0),
165  rendererGroup_(0),
166  viewGroup_(0),
167  perspectiveProjectionAction_(0),
168  activeDrawModes_(0),
169  availableGlobalDrawModes_(0),
170  contextMenu_(0),
171  contextSelectionMenu_(0),
172  drawGroupViewer_(0),
173  viewerDrawMenu_(0),
174  viewerDrawMenuWidget_(0),
175  coordSysMenu_(0),
176  snapshotName_(""),
177  snapshotCounter_(0),
178  stackMenu_(0),
179  helpWidget_(0),
180  postProcessorDialog_(0),
181  rendererDialog_(0),
182  rendererObjectWidget_(0),
183  stereoSettingsWidget_(0),
184  aboutWidget_(0),
185  optionsWidget_(0),
186  pythonWidget_(0),
187  stereoActive_(false),
188  actionMode_(Viewer::PickingMode),
189  lastActionMode_(Viewer::ExamineMode),
190  pickMenu_(0),
191  pick_mode_name_(""),
192  pick_mode_idx_(-1)
193 {
194 
195  setupStatusBar();
196 
197  defaultIconSize_ = iconSize();
198 
199  toolSplitter_ = new QSplitter(Qt::Horizontal,this);
200 
201  setCentralWidget(toolSplitter_);
202 
203  splitter_ = new QSplitter(Qt::Vertical,toolSplitter_);
204  stackedWidget_ = new QStackedWidget(splitter_);
205 
206  // Construct GL context & widget
208  baseLayout_->setContentsMargins(0,0,0,0);
209 
210  glWidget_ = new OFGLWidget();
211  glWidget_->makeCurrent();
212 
214 
217 
218  // is stereo possible, use it?
219  OpenFlipper::Options::glStereo(glWidget_->format().stereo(), true);
220 
221  glView_->setViewport(glWidget_);
222  glView_->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
223  glView_->setScene(glScene_);
224  glView_->setFrameStyle(QFrame::NoFrame);
225 
226  // gl widget as parent to make sure that the CursorPainter will be deleted before
228  cursorPainter_->setForceNative (OpenFlipperSettings().value("Core/Gui/glViewer/nativeMouse",false).toBool() );
230  glScene_->setCursorPainter (cursorPainter_);
231 
232  centerWidget_ = new QGraphicsWidget;
233  glScene_->addItem(centerWidget_);
234  centerWidget_->setGeometry (glScene_->sceneRect ());
235 
236  connect ( glView_, SIGNAL( sceneRectChanged( const QRectF & ) ),
237  this, SLOT( sceneRectChanged( const QRectF & ) ) );
238 
239  stackedWidget_->addWidget(glView_);
240  stackWidgetList_.push_back( StackWidgetInfo( false, "3D Examiner Widget", glView_ ) );
241 
242  // ======================================================================
243  // Set up the logging window
244  // ======================================================================
245 
246  slidingLogger_ = new QtSlideWindow (tr("Log Viewer"), centerWidget_);
247 
249  logWidget_->setSizePolicy( QSizePolicy ( QSizePolicy::Preferred , QSizePolicy::Preferred ) );
250  logWidget_->resize( splitter_->width() ,240);
251 
253  loggerState_ = OpenFlipper::Options::Normal;
254 
255  QList<int> wsizes(splitter_->sizes());
256  // Set initial values to have a usable state
257  wsizes[0] = 480;
258  wsizes[1] = 240;
259  splitter_->setSizes(wsizes);
260 
261  if (OpenFlipper::Options::loggerState() == OpenFlipper::Options::InScene) {
262 
264  showLoggerInSplitView(false);
265  loggerState_ = OpenFlipper::Options::InScene;
266 
267  } else if (OpenFlipper::Options::loggerState() == OpenFlipper::Options::Hidden) {
268 
269  showLoggerInSplitView(false);
270  loggerState_ = OpenFlipper::Options::Hidden;
271  } else {
272 
273  showLoggerInSplitView(true);
274  }
275 
276 
277  // ======================================================================
278  // Create examiner
279  // ======================================================================
280 
281  // First we analyze the scenegraph
282  unsigned int maxPases = 1;
283  ACG::Vec3d bbmin,bbmax;
285 
286  if ( !OpenFlipperSettings().value("Core/Gui/glViewer/useMultipleViewers",true).toBool() ) {
287 
288  glViewer* examinerWidget = new glViewer(glScene_,
289  glWidget_,
291  centerWidget_);
292 
293  examiner_widgets_.push_back(examinerWidget);
294 
295  examinerWidget->sceneGraph( PluginFunctions::getSceneGraphRootNode(), maxPases,bbmin,bbmax );
296 
297  baseLayout_->addItem(examinerWidget, 0);
298 
299  cursorPainter_->registerViewer (examinerWidget);
300 
301  } else {
302 
303 
304  // Create examiners
305  for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
306  glViewer* newWidget = new glViewer(glScene_,
307  glWidget_,
309  centerWidget_);
310 
311  examiner_widgets_.push_back(newWidget);
312 
313  connect (&PluginFunctions::viewerProperties(i), SIGNAL( getPickMode(std::string&) ),
314  this, SLOT( getPickMode(std::string&) ),Qt::DirectConnection );
315  connect (&PluginFunctions::viewerProperties(i), SIGNAL( setPickMode(const std::string) ),
316  this, SLOT( setPickMode(const std::string) ),Qt::DirectConnection );
318  this, SLOT( getActionMode(Viewer::ActionMode&) ),Qt::DirectConnection );
320  this, SLOT( setActionMode(const Viewer::ActionMode)), Qt::DirectConnection );
321 
322  connect (&PluginFunctions::viewerProperties(i), SIGNAL( drawModeChanged(int)), this, SIGNAL(drawModeChanged(int)));
323  }
324 
325  // Initialize all examiners
326  for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
327  examiner_widgets_[i]->sceneGraph( PluginFunctions::getSceneGraphRootNode(), maxPases,bbmin,bbmax );
329  }
330 
335  }
336 
337  // Make examiner available to the plugins ( defined in PluginFunctions.hh)
339 
340  centerWidget_->setLayout(baseLayout_);
341 
342 
343  ACG::ShaderCache::getInstance()->setTimeCheck(OpenFlipperSettings().value("Core/File/ReloadShaders",false).toBool());
344  ACG::ShaderCache::getInstance()->setDebugOutputDir(OpenFlipperSettings().value("Core/File/ShaderOutputDir","").toString().toUtf8());
345 
346  // ======================================================================
347  // Setup dragging for examiner widget
348  // ======================================================================
349  for ( uint i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
350 
351  connect( examiner_widgets_[i], SIGNAL(startDragEvent( QMouseEvent*)),
352  this, SLOT(startDrag(QMouseEvent* )));
353  connect( examiner_widgets_[i], SIGNAL(dragEnterEvent( QDragEnterEvent*)),
354  this, SLOT(dragEnterEvent(QDragEnterEvent* )));
355  connect( examiner_widgets_[i], SIGNAL(dropEvent( QDropEvent*)),
356  this, SLOT(dropEvent(QDropEvent* )));
357  connect (examiner_widgets_[i], SIGNAL(signalMakeActive ()),
358  this, SLOT(slotActivateExaminer()));
359 
360  connect (examiner_widgets_[i], SIGNAL(statusMessage(QString, int)),
361  statusBar_, SLOT(showMessage(const QString&, int)));
362  }
363 
364 
365  // ======================================================================
366  // Create main Toolbar
367  // ======================================================================
368 
369  mainToolbar_ = new QToolBar(tr("Main Toolbar"));
370  mainToolbar_->setWindowTitle(tr("Main Toolbar"));
371  mainToolbar_->setObjectName(tr("MainToolbar"));
373 
374  // ======================================================================
375  // Get Toolbar from examiner and integrate it into main window
376  // ======================================================================
377 
378 
379  // Create the toolbar
380  viewerToolbar_ = new QToolBar( tr("Viewer Toolbar" ), this );
381  viewerToolbar_->setOrientation(Qt::Vertical);
382  viewerToolbar_->setAllowedAreas(Qt::AllToolBarAreas);
383  viewerToolbar_->setIconSize(QSize(20,20));
384  viewerToolbar_->setObjectName(tr("ViewerToolbar"));
385 
387 
388  moveButton_ = new QToolButton( viewerToolbar_ );
389  moveButton_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"transform-move.png") );
390  moveButton_->setMinimumSize( 16, 16 );
391  moveButton_->setMaximumSize( 32, 32 );
392  moveButton_->setCheckable(true);
393  moveButton_->setToolTip( tr("Switch to <b>move</b> mode.") );
394  moveButton_->setWhatsThis(tr(
395  "Switch to <b>move</b> mode.<br>"
396  "<ul><li><b>Rotate</b> using <b>left</b> mouse button.</li>"
397  "<li><b>Translate</b> using <b>middle</b> mouse button.</li>"
398  "<li><b>Zoom</b> using <b>left+middle</b> mouse buttons.</li></ul>" ));
399 
400  connect( moveButton_,SIGNAL( clicked() ), this, SLOT( setExamineMode() ) );
401 /*
402  connect( this, SIGNAL( actionModeChanged( Viewer::ActionMode ) ),
403  this, SLOT( slotActionModeChanged(Viewer::ActionMode) ) );*/
404 
405  viewerToolbar_->addWidget( moveButton_ )->setText(tr("Move"));
406  moveButton_->setChecked(true);
407 
408 
409  pickButton_ = new QToolButton( viewerToolbar_ );
410  pickButton_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"pick.png") );
411  pickButton_->setMinimumSize( 16, 16 );
412  pickButton_->setMaximumSize( 32, 32 );
413  pickButton_->setCheckable(true);
414  pickButton_->setToolTip(tr("Switch to <b>picking</b> mode."));
415  pickButton_->setWhatsThis(tr(
416  "Switch to <b>picking</b> mode.<br>"
417  "Use picking functions like flipping edges.<br>"
418  "To change the mode use the right click<br>"
419  "context menu in the viewer."));
420  connect( pickButton_,SIGNAL( clicked() ), this, SLOT( setPickingMode() ) );
421  viewerToolbar_->addWidget( pickButton_)->setText(tr("Pick"));
422 
423 
424  questionButton_ = new QToolButton( viewerToolbar_ );
425  questionButton_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"help-about.png") );
426  questionButton_->setMinimumSize( 16, 16 );
427  questionButton_->setMaximumSize( 32, 32 );
428  questionButton_->setCheckable(true);
429  questionButton_->setToolTip(tr("Switch to <b>identification</b> mode."));
430  questionButton_->setWhatsThis(tr(
431  "Switch to <b>identification</b> mode.<br>"
432  "Use identification mode to get information "
433  "about objects. Click on an object and see "
434  "the log output for information about the "
435  "object."));
436  connect( questionButton_,SIGNAL( clicked() ), this, SLOT( setQuestionMode() ) );
437  viewerToolbar_->addWidget( questionButton_)->setText(tr("Question"));
438 
439  viewerLayoutBox_ = new QComboBox( viewerToolbar_ );
440  viewerLayoutBox_->setMinimumSize( 32, 16 );
441  viewerLayoutBox_->setMaximumSize( 64, 32 );
442  viewerLayoutBox_->setToolTip(tr("Switch <b>viewer layout</b>."));
443  viewerLayoutBox_->setWhatsThis(tr(
444  "Switch <b>viewer layout</b>.<br>"
445  "Select the desired viewer layout. "
446  "Possible layouts are: "
447  "<ul> "
448  "<li>Single viewer</li>"
449  "<li>Double viewer</li>"
450  "<li>Multiple viewers (grid)</li>"
451  "<li>Multiple viewers (hsplit)</li>"
452  "</ul>"));
453 
454  viewerLayoutBox_->addItem(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"singleviewmode.png"), "");
455  viewerLayoutBox_->addItem(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"doubleviewmode.png"), "");
456  viewerLayoutBox_->addItem(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"multiviewmode1.png"), "");
457  viewerLayoutBox_->addItem(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"multiviewmode2.png"), "");
458 
459  viewerLayoutBox_->setIconSize(QSize(22,22));
460 
461  connect( viewerLayoutBox_,SIGNAL( activated(int) ), this, SLOT( setViewerLayout(int) ) );
462 
463  extended_actions.push_back(viewerToolbar_->addWidget( viewerLayoutBox_ ));
464 
465  extended_actions.push_back(viewerToolbar_->addSeparator());
466 
467  if (OpenFlipper::Options::stereo())
468  {
469  stereoButton_ = new QToolButton( viewerToolbar_ );
470  stereoButton_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"mono.png") );
471  stereoButton_->setMinimumSize( 16, 16 );
472  stereoButton_->setMaximumSize( 32, 32 );
473  stereoButton_->setCheckable( true );
474  stereoButton_->setToolTip(tr( "Toggle stereo viewing"));
475  // We want a custom context menu
476  stereoButton_->setContextMenuPolicy(Qt::CustomContextMenu);
477  stereoButton_->setWhatsThis(tr(
478  "Toggle stereo mode<br><br>"
479  "Use this button to switch between stereo "
480  "and mono view. To use this feature you need "
481  "a stereo capable graphics card and a stereo "
482  "display/projection system."));
483  connect( stereoButton_, SIGNAL( clicked() ), this , SLOT( slotToggleStereoMode() ) );
484  // Custom context menu
485  connect( stereoButton_, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(stereoButtonContextMenu(const QPoint &)));
486  QAction *stereoAction = viewerToolbar_->addWidget( stereoButton_ );
487  stereoAction->setText( tr("Stereo"));
488  extended_actions.push_back(stereoAction);
489  }
490 
491 
492  addToolBar(Qt::TopToolBarArea,viewerToolbar_);
493 
494  // Remember logger size
495  wsizes = splitter_->sizes();
496 
497  if(wsizes.size() > 1) {
498  originalLoggerSize_ = wsizes[1];
499  } else {
500  originalLoggerSize_ = 240;
501  }
502 
503  // ======================================================================
504  // Create ToolBox area
505  // ======================================================================
506 
507  toolBoxArea_ = new QWidget (toolSplitter_);
508 
509  viewModeControlBox_ = new QWidget();
510 
511  QHBoxLayout *hLayout = new QHBoxLayout;
512 
513  //vmChangeButton_ = new QPushButton(tr("Change View Mode"));
514  //QPushButton* vmEditButton = new QPushButton(tr("Edit View Modes"));
515 
516  /*
517  * Set up view mode popup button.
518  */
519  viewModePopupBtn_ = new QToolButton();
520  viewModePopupBtn_->setAutoRaise(true);
521  //viewModePopupBtn->setText(QString::fromUtf8("âš™"));
522  viewModePopupBtn_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"preferences.png"));
523  viewModePopupBtn_->setIconSize(QSize(16, 16));
524  viewModePopupBtn_->setPopupMode(QToolButton::InstantPopup);
525 
526  //init widget
528  modeChangeWidget->setWindowIcon(OpenFlipper::Options::OpenFlipperIcon());
529  connect(modeChangeWidget,
530  SIGNAL(changeView(QString, QStringList, QStringList, QStringList)),
531  this,
532  SLOT(slotChangeView(QString, QStringList, QStringList, QStringList)));
533 
534  viewModeChangePopupAction_ = new QWidgetAction(viewModePopupBtn_);
535  viewModeChangePopupAction_->setDefaultWidget(modeChangeWidget);
537 
538 
539  hLayout->setContentsMargins(0, 0, 0, 0);
540  hLayout->addStretch(1);
541  hLayout->addWidget(viewModePopupBtn_);
542  viewModeControlBox_->setLayout (hLayout);
543 
544  connect(modeChangeWidget->editViewModes_pb, SIGNAL(clicked()),
545  this, SLOT(slotViewModeDialog()));
546  connect(modeChangeWidget, SIGNAL(wantClose()),
547  this, SLOT(closeChangeViewModePopup()));
548 
549 
550  toolBoxScroll_ = new QScrollArea ();
551  toolBox_ = new SideArea ();
552  toolBoxScroll_->setContentsMargins(0, 0, 0, 0);
553  toolBoxScroll_->setWidget (toolBox_);
554  toolBoxScroll_->setWidgetResizable (true);
555  toolBoxScroll_->setFrameStyle (QFrame::StyledPanel);
556 
557  QVBoxLayout *vLayout = new QVBoxLayout;
558  vLayout->addWidget(viewModeControlBox_);
559  vLayout->addWidget(toolBoxScroll_);
560  vLayout->setContentsMargins(0, 0, 0, 0);
561  vLayout->setSpacing(0);
562 
563  if ( OpenFlipperSettings().value("Core/Gui/TaskSwitcher/Hide",false).toBool() ) {
564  viewModeControlBox_->hide();
565  if (viewModeButton_)
566  viewModeButton_->setVisible(false);
567  }
568 
569  toolBoxArea_->setLayout (vLayout);
570 
571  wsizes = toolSplitter_->sizes();
572 
573  // if the toolbox should be on the right, use the defaults. Otherwise, we have to reorder them.
574  if ( OpenFlipperSettings().value("Core/Gui/ToolBoxes/ToolBoxOnTheRight", true).toBool() ) {
575 
576  // Set relative sizes of windows
577  wsizes[0] = 480;
578  wsizes[1] = 240;
579  toolSplitter_->setSizes(wsizes);
580  } else {
581 
582  // Show tool box on the left side of the main window
583  toolSplitter_->insertWidget(0, toolBoxArea_);
584  toolSplitter_->insertWidget(1, splitter_);
585 
586  // Default sizes are swaped when toolbox is on the left.
587  wsizes[0] = 240;
588  wsizes[1] = 480;
589  toolSplitter_->setSizes(wsizes);
590  }
591 
592  // ======================================================================
593  // Context menu setup
594  // ======================================================================
595 
596  for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
597  connect( examiner_widgets_[i] , SIGNAL(signalCustomContextMenuRequested( const QPoint&) ) ,
598  this , SLOT( slotCustomContextMenu( const QPoint&) ) );
599  }
600 
601  contextMenu_ = new QMenu(this);
602  contextSelectionMenu_ = new QMenu(tr("Selection"),0);
603 
604  setupMenuBar();
605 
606  statusBar_->showMessage(tr("Ready"), 5000);
607 
609 
610  setExamineMode();
611 
612  setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
613 
614  // Create stereo settings widget
616  // Make it look like a dialog
617  stereoSettingsWidget_->setWindowFlags(Qt::Popup);
618  // Connect combo boxes and sliders to local slots
619  connect(stereoSettingsWidget_->stereoOpengl, SIGNAL(clicked()),
620  this, SLOT(slotApplyStereoSettings()));
621  connect(stereoSettingsWidget_->stereoAnaglyph, SIGNAL(clicked()),
622  this, SLOT(slotApplyStereoSettings()));
623  connect(stereoSettingsWidget_->stereoCustomAnaglyph, SIGNAL(clicked()),
624  this, SLOT(slotApplyStereoSettings()));
625 
626  connect(stereoSettingsWidget_->focalDistance, SIGNAL(sliderReleased()),
627  this, SLOT(slotApplyStereoSettings()));
628  connect(stereoSettingsWidget_->eyeDistance, SIGNAL(editingFinished()),
629  this, SLOT(slotApplyStereoSettings()));
630 
631  // Close button
632  connect(stereoSettingsWidget_->closeButton, SIGNAL(clicked()),
633  stereoSettingsWidget_, SLOT(hide()));
634 
635 
636  // ======================================================================
637  // Help Browser start up
638  // ======================================================================
639 
640  helpWidget_ = new HelpWidget(this,homePage_,false);
641  connect(this, SIGNAL(changeHelpSite(QUrl)), helpWidget_, SLOT(activateLink(QUrl)));
642  helpWidget_->hide();
643 
644 
645  // Add the core license information about used libraries
647 
648 }
649 
650 
651 //-----------------------------------------------------------------------------
652 
653 
655 
656 }
657 
658 //-----------------------------------------------------------------------------
659 
660 
661 std::vector<PluginInfo>& CoreWidget::plugins() {
662  return PluginStorage::plugins();
663 };
664 
665 //-----------------------------------------------------------------------------
666 
669 void
671 
672  bool fullScreen = OpenFlipperSettings().value("Core/Gui/fullscreen", false ).toBool();
673 
674  setFullscreen( !fullScreen );
675 }
676 
677 //-----------------------------------------------------------------------------
678 
681 void
683  if ( _state )
684  setWindowState( windowState() | Qt::WindowFullScreen);
685  else {
686  if ( windowState() & Qt::WindowFullScreen )
687  setWindowState( windowState() ^ Qt::WindowFullScreen);
688  }
689 
690  OpenFlipperSettings().setValue("Core/Gui/fullscreen", bool( windowState() & Qt::WindowFullScreen) );
691 
692  show();
693 
694  emit fullScreenChanged( _state );
695 }
696 
697 //-----------------------------------------------------------------------------
698 
699 void
701  // Only change if the actual setting has changed!
702  if ( OpenFlipper::Options::gui() && ( !_show != OpenFlipperSettings().value("Core/Gui/TaskSwitcher/Hide",false).toBool() ) ) {
703 
704  // Update setting in Conf storage
705  OpenFlipperSettings().setValue("Core/Gui/TaskSwitcher/Hide",!_show);
706 
707  // Update The Checkbox in the Menu
708  AC_ShowViewModeControls_->blockSignals(true);
709  AC_ShowViewModeControls_->setChecked( _show );
710  AC_ShowViewModeControls_->blockSignals(false);
711 
712  if ( _show ) {
713  viewModeControlBox_->show();
714  viewModeButton_->setVisible(true);
715  } else {
716  viewModeControlBox_->hide();
717  viewModeButton_->setVisible(false);
718  }
719 
720  }
721 
722 }
723 
724 //-----------------------------------------------------------------------------
725 
728 void
730 
731  //toggle
732  showToolbox( OpenFlipperSettings().value("Core/Gui/ToolBoxes/hidden",false).toBool() );
733 
734 }
735 
736 //-----------------------------------------------------------------------------
737 
740 void
741 CoreWidget::showToolbox( bool _state ) {
742 
743  //toggle
744  OpenFlipperSettings().setValue("Core/Gui/ToolBoxes/hidden",!_state);
745 
746  if ( OpenFlipperSettings().value("Core/Gui/ToolBoxes/hidden",false).toBool() ){
747 
748  //hide ViewMode Selection Widget
749  toolBoxArea_->setVisible(false);
750 
751  }else{
752  //show last view mode
753  toolBoxArea_->setVisible(true);
754  }
755  emit toolBoxVisChanged(_state);
756 }
757 //-----------------------------------------------------------------------------
758 void CoreWidget::showMenuBar( bool _state )
759 {
760  OpenFlipperSettings().setValue("Core/Gui/MenuBar/hidden",!_state);
761 
762  if ( _state ){
763 
764  //hide ViewMode Selection Widget
765  menuBar()->show();
766 
767  }else{
768  //show last view mode
769  menuBar()->hide();
770  }
771  emit menuBarVisChanged(_state);
772 }
773 //-----------------------------------------------------------------------------
775 void CoreWidget::showToolBar( bool _state )
776 {
777  OpenFlipperSettings().setValue("Core/Gui/Toolbar/hidden",!_state);
778  if ( !_state )
779  {
780  //hide main toolbar
781  if ( ! mainToolbar_->isFloating() )
782  mainToolbar_->hide();
783 
784  //hide viewer toolbar
785  if ( ! viewerToolbar_->isFloating() )
786  viewerToolbar_->hide();
787 
788  for (uint p=0; p < plugins().size(); p++)
789  for ( uint j = 0 ; j < plugins()[p].toolbars.size(); ++j ) {
790  if ( ! plugins()[p].toolbars[j].second->isFloating() )
791  plugins()[p].toolbars[j].second->hide();
792  }
793  }
794  else
795  {
796  //show toolbars
797  setViewMode( OpenFlipper::Options::currentViewMode() );
798  }
799  emit toolBarVisChanged(_state);
800 }
801 //-----------------------------------------------------------------------------
804 {
805  bool hidden = OpenFlipperSettings().value("Core/Gui/MenuBar/hidden",false).toBool();
806  showMenuBar( hidden );
807 }
808 
809 //-----------------------------------------------------------------------------
812 {
813  bool hidden = OpenFlipperSettings().value("Core/Gui/Toolbar/hidden",false).toBool();
814  showToolBar( hidden );
815 }
816 
817 
818 //=============================================================================
819 
821  QList<int> wsizes;
822 
823  // Is toolbox currently on the right hand side?
824  bool currentstate = toolSplitter_->widget(1) == toolBoxArea_;
825 
826  if ( _toolBoxRight != currentstate ) {
827 
828  if(_toolBoxRight ) {
829 
830  // Show tool box on the right side of the main window
831  toolSplitter_->insertWidget(0, splitter_);
832  toolSplitter_->insertWidget(1, toolBoxArea_);
833  } else {
834 
835  // Show tool box on the left side of the main window
836  toolSplitter_->insertWidget(0, toolBoxArea_);
837  toolSplitter_->insertWidget(1, splitter_);
838  }
839 
840  // Store new setting
841  OpenFlipperSettings().setValue("Core/Gui/ToolBoxes/ToolBoxOnTheRight",_toolBoxRight);
842 
843  // remove the windowstates definition for the toolboxes, as it changed anyway.
844  QSettings windowStates(QDir::home().absolutePath() + OpenFlipper::Options::dirSeparator() + ".OpenFlipper" +
845  OpenFlipper::Options::dirSeparator() + "WindowStates.dat", QSettings::IniFormat);
846 
847  windowStates.value("Core/ToolSplitter");
848 
849  }
850 
851 
852 
853  toolSplitter_->refresh();
854 }
855 
856 
857 //=============================================================================
858 
859 void
860 CoreWidget::addRecent(QString _filename, DataType _type)
861 {
862  //dont add objects to recentMenu while loadind Settings
863  if ( OpenFlipper::Options::sceneGraphUpdatesBlocked() ) return;
864 
865  OpenFlipper::Options::addRecentFile(_filename, _type);
866 
867  updateRecent();
868 
869 }
870 
871 //=============================================================================
872 
873 void
875 {
876  if ( recentFilesMenu_ == NULL)
877  return;
878 
879  recentFilesMenu_->clear();
880 
881  QStringList recentFiles = OpenFlipperSettings().value("Core/File/RecentFiles", QStringList()).toStringList();
882  QStringList recentTypes = OpenFlipperSettings().value("Core/File/RecentTypes", QStringList()).toStringList();
883 
884  for (int i = 0 ; i < recentFiles.size() ; ++i ) {
885 
886  QFileInfo fi(recentFiles[i]);
887 
888  QAction* newAction = 0;
889 
890  if (fi.suffix() == "ini") {
891  newAction = recentFilesMenu_->addAction(QIcon(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator()+"Settings-Icon.png"), recentFiles[i]);
892  newAction->setData( QVariant( QString("Unknown") ) );
893  } else {
894  newAction = recentFilesMenu_->addAction(typeIcon( typeId(recentTypes[i]) ), recentFiles[i]);
895  newAction->setData( QVariant( recentTypes[i]) );
896  }
897 
898  }
899  // Workaround for QMenu issue on MacOS: https://bugreports.qt.io/browse/QTBUG-63848
900  // Without this, the recent files menu entries are all disabled after using the menu once:
901  // https://www.graphics.rwth-aachen.de:9000/OpenFlipper-Free/OpenFlipper-Free/issues/139
902  recentFilesMenu_->setEnabled(false);
903  recentFilesMenu_->setEnabled(true);
904 }
905 
906 void
907 CoreWidget::closeEvent ( QCloseEvent * /* event */ ) {
908  emit exit();
909 }
910 
912 
913  if ( OpenFlipper::Options::nogui() )
914  return;
915 
916  if ( optionsWidget_ == 0 ) {
918  connect(optionsWidget_,SIGNAL(applyOptions()),this,SIGNAL(applyOptions()));
919  connect(optionsWidget_,SIGNAL(saveOptions()),this,SIGNAL(saveOptions()));
920  connect(optionsWidget_,SIGNAL(addKeyMapping(int,Qt::KeyboardModifiers,QObject*,int)),
921  this, SLOT(slotAddKeyMapping(int,Qt::KeyboardModifiers,QObject*,int)));
922 
923  optionsWidget_->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
924  }
925 
926  //show the optionsWidget centered
927  QPoint center;
928  center.setX( x() + width() / 2 );
929  center.setY( y() + height() / 2 );
930 
931  optionsWidget_->setGeometry(center.x() - optionsWidget_->width() / 2,
932  center.y() - optionsWidget_->height()/ 2, optionsWidget_->width(), optionsWidget_->height());
933 
934  optionsWidget_->show();
935 
936 }
937 
939 
940  if ( OpenFlipperSettings().value("Core/Gui/glViewer/useMultipleViewers",true).toBool() ) {
941 
942  switch (baseLayout_->mode()) {
943  case QtMultiViewLayout::SingleView:
945  baseLayout_->setMode(QtMultiViewLayout::DoubleView);
946 
947  // Update combo box in the toolbar
948  viewerLayoutBox_->setCurrentIndex(1);
949  break;
950  case QtMultiViewLayout::DoubleView:
952  baseLayout_->setMode(QtMultiViewLayout::Grid);
953 
954  // Update combo box in the toolbar
955  viewerLayoutBox_->setCurrentIndex(2);
956  break;
957  case QtMultiViewLayout::Grid:
959  baseLayout_->setMode(QtMultiViewLayout::HSplit);
960 
961  // Update combo box in the toolbar
962  viewerLayoutBox_->setCurrentIndex(3);
963  break;
964  case QtMultiViewLayout::HSplit:
966  baseLayout_->setMode(QtMultiViewLayout::SingleView);
967 
968  // Update combo box in the toolbar
969  viewerLayoutBox_->setCurrentIndex(0);
970  break;
971  }
972  }
973 }
974 
975 
976 void
978 
979  if ( OpenFlipperSettings().value("Core/Gui/glViewer/useMultipleViewers",true).toBool() ) {
980 
981  switch (_idx) {
982  case 0:
984  baseLayout_->setMode(QtMultiViewLayout::SingleView);
985  break;
986  case 1:
988  baseLayout_->setMode(QtMultiViewLayout::DoubleView);
989  break;
990  case 2:
992  baseLayout_->setMode(QtMultiViewLayout::Grid);
993  break;
994  case 3:
996  baseLayout_->setMode(QtMultiViewLayout::HSplit);
997  break;
998  default:
999  emit log(LOGERR,tr("Requested illegal multiview mode!"));
1000  break;
1001  }
1002 
1003  viewerLayoutBox_->setCurrentIndex(_idx);
1004  }
1005 
1006 }
1007 
1008 void
1010 {
1012  {
1013  if (!sceneGraphDialog_)
1014  {
1016 
1017  for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
1018  connect(examiner_widgets_[i], SIGNAL(signalSceneGraphChanged(ACG::SceneGraph::BaseNode*)),
1020 
1021  connect(sceneGraphDialog_, SIGNAL(signalNodeChanged(ACG::SceneGraph::BaseNode*)),
1022  examiner_widgets_[i], SLOT(updateGL()));
1023  }
1024 
1025  }
1026 
1027  sceneGraphDialog_->setGeneratorMap(PluginFunctions::getSceneGraphGeneratorList() );
1028  sceneGraphDialog_->show();
1029  }
1030 }
1031 
1032 //-----------------------------------------------------------------------------
1033 
1034 void
1035 CoreWidget::sceneRectChanged(const QRectF &rect)
1036 {
1037  centerWidget_->setGeometry (rect);
1039 }
1040 
1041 //-----------------------------------------------------------------------------
1042 
1043 void
1044 CoreWidget::startVideoCaptureDialog(){
1045 
1046  VideoCaptureDialog* dialog = new VideoCaptureDialog();
1047  dialog->setModal(false);
1048 
1049  connect(dialog, SIGNAL(startVideoCapture(QString,int,bool)), this, SIGNAL(startVideoCapture(QString,int,bool)) );
1050  connect(dialog, SIGNAL(resizeViewers(int,int)), this, SIGNAL(resizeViewers(int,int)) );
1051  connect(dialog, SIGNAL(resizeApplication(int,int)), this, SIGNAL(resizeApplication(int,int)) );
1052 
1053  dialog->show();
1054 }
1055 
1056 //-----------------------------------------------------------------------------
1057 
1059 {
1060  glViewer* examiner = dynamic_cast<glViewer*>(QObject::sender());
1061 
1062  if (!examiner)
1063  return;
1064 
1065  for ( uint i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
1066 
1067  if (examiner == examiner_widgets_[i])
1068  {
1070  if (postProcessorDialog_)
1071  postProcessorDialog_->refresh();
1072  break;
1073  }
1074  }
1075 }
1076 
1077 //-----------------------------------------------------------------------------
1078 
1081 {
1082  cursorPainter_->setForceNative (_state);
1083 }
1084 
1085 //-----------------------------------------------------------------------------
1086 
1087 bool CoreWidget::event( QEvent *_event )
1088 {
1089 
1090  //WhatsThisClicked event for hyperlinks in 'whats this' boxes
1091  if( _event->type() == QEvent::WhatsThisClicked )
1092  {
1093  QWhatsThisClickedEvent *wtcEvent = static_cast<QWhatsThisClickedEvent*>(_event);
1094  QWhatsThis::hideText();
1095  this->showHelpBrowser(wtcEvent->href());
1096  return true;
1097  }
1098 
1099  return QMainWindow::event(_event);
1100 }
1101 
1102 //=============================================================================
1103 
void slotActivateExaminer()
Definition: CoreWidget.cc:1058
void setViewMode(QString _mode, bool _expandAll=false)
Set the view Mode to the given Mode.
Definition: viewMode.cc:316
QToolButton * viewModePopupBtn_
view mode gear icon at the upper left of the tool box
Definition: CoreWidget.hh:728
static ShaderCache * getInstance()
Return instance of the ShaderCache singleton.
Definition: ShaderCache.cc:84
LoggerWidget * logWidget_
Textedit at the bottom for log messages.
Definition: CoreWidget.hh:686
void slotViewModeDialog()
Show a dialog in which the viewMode can be edited.
Definition: viewMode.cc:327
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
void setPrimary(unsigned int _i)
Sets primary element for SingleView and HSplit.
void closeChangeViewModePopup()
Closes the change view mode popup.
Definition: viewMode.cc:340
QComboBox * viewerLayoutBox_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:830
void slotAddKeyMapping(int _key, Qt::KeyboardModifiers _modifiers, QObject *_plugin, int _keyBindingID)
add a new key Mapping
Definition: keyHandling.cc:330
void toggleFullscreen()
Set application to Fullscreen and back.
Definition: CoreWidget.cc:670
bool visible() const
PickMode visible.
Definition: CoreWidget.cc:91
void toolBoxVisChanged(bool _state)
will be emitted if the visibility of the toolbox is changed
void slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus, bool _expandAll=false)
Slot for Changing visible toolWidgets.
Definition: viewMode.cc:347
QGraphicsWidget * centerWidget_
center widged
Definition: CoreWidget.hh:716
QSplitter * splitter_
Spliter between toplevel objects and the textedit at the bottom.
Definition: CoreWidget.hh:680
void shareGLWidget(OFGLWidget *_widget)
Sets the main QGLWidget for gl data sharing.
void setToolBoxOrientationOnTheRight(bool _toolBoxRight)
Set orientation of tool box (either on the right or the left side of the screen)
Definition: CoreWidget.cc:820
void showViewModeControls(bool _show)
Hide or show the View Mode controls.
Definition: CoreWidget.cc:700
QToolButton * stereoButton_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:825
QWidget * toolBoxArea_
Widget for toolBox.
Definition: CoreWidget.hh:725
void closeEvent(QCloseEvent *event)
Called on applications close.
Definition: CoreWidget.cc:907
CursorPainter * cursorPainter_
Cursor handling.
Definition: CoreWidget.hh:750
QToolButton * moveButton_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:826
unsigned int activeExaminer()
Get the id of the examiner which got the last mouse events.
void showOptionsWidget()
Display the Options Browser.
Definition: CoreWidget.cc:911
void setViewers(std::vector< glViewer * > _viewerWidgets)
Set the internal Viewer pointer ( DO NOT USE!! )
void addRecent(QString _filename, DataType _type)
Add a recent file and update menu.
Definition: CoreWidget.cc:860
void toggleToolBar()
Hide or show current toolbar.
Definition: CoreWidget.cc:811
void showHelpBrowser(const QString &page=homePage_)
Display the help Browser.
Definition: Help.cc:65
StereoSettingsWidget * stereoSettingsWidget_
Widget to change stereo settings.
Definition: CoreWidget.hh:1173
void slotShowSceneGraphDialog()
Definition: CoreWidget.cc:1009
void registerViewer(glViewer *_viewer)
Add a glViewer that will use this CursorPainter.
void updateRecent()
Update the recent files menu.
Definition: CoreWidget.cc:874
void setForceNativeCursor(bool _state)
Use native or gl painted cursor.
Definition: CoreWidget.cc:1080
void setValue(const QString &key, const QVariant &value)
Wrapper function which makes it possible to enable Debugging output with -DOPENFLIPPER_SETTINGS_DEBUG...
ACG::QtWidgets::QtSceneGraphDialog * sceneGraphDialog_
Handle to picking toolbar.
Definition: CoreWidget.hh:754
QtGLGraphicsScene * glScene_
graphics scene used to paint gl context and widgets
Definition: CoreWidget.hh:710
QWidget * viewModeControlBox_
Group box containing Task Switcher Controls.
Definition: CoreWidget.hh:683
std::vector< PluginInfo > & plugins()
Convenient way to access plugin list.
Definition: CoreWidget.cc:661
void setActionMode(const Viewer::ActionMode _am)
Definition: picking.cc:62
void setDebugOutputDir(const char *_outputDir)
Enable debug output of generated shaders to specified directory.
Definition: ShaderCache.cc:604
bool stereoActive_
The viewer with id _viewerId changed its draw Mode.
Definition: CoreWidget.hh:1443
SideArea * toolBox_
Toolbox.
Definition: CoreWidget.hh:734
void setTimeCheck(bool _on)
enable or disable checking of the time step of each file
Definition: ShaderCache.hh:171
void getPickMode(std::string &_name)
Definition: picking.cc:173
void slotAddToolbar(QToolBar *_toolbar)
Called by Plugins to add a Toolbar.
void setViewerLayout(int _idx)
Change viewer layout that was selected in the combo box.
Definition: CoreWidget.cc:977
QMenu * recentFilesMenu_
QMenu containing the recently opened files.
Definition: CoreWidget.hh:692
void setActiveExaminer(const unsigned int _id)
Set the active id of the examiner which got the last mouse events.
void setMode(MultiViewMode _mode)
Sets layout mode.
QAction * AC_ShowViewModeControls_
Action for View Mode Widget Conrol in Menu.
Definition: CoreWidget.hh:704
void setExamineMode()
Definition: CoreWidget.hh:1462
void menuBarVisChanged(bool _state)
will be emitted if the visibility of the menubar is changed
void addCoreLicenseInfo()
Add license information about core parts.
QAction * viewModeButton_
a List of all widgets in the toolbar
Definition: CoreWidget.hh:589
QMenu * contextSelectionMenu_
Context Menu containing all selection elements.
Definition: CoreWidget.hh:994
void refresh()
refreshes the content of the dialog with current examiner
ActionMode
Enum listing action modes of the viewers.
void analyzeSceneGraph(ACG::SceneGraph::BaseNode *_root, unsigned int &_maxPasses, ACG::Vec3d &_bbmin, ACG::Vec3d &_bbmax)
Analyze the SceneGraph <ACG/Scenegraph/SceneGraphAnalysis.hh>
static const QString homePage_
Pointer to the help Browser.
Definition: CoreWidget.hh:1106
void stereoButtonContextMenu(const QPoint &_pos)
Creates custom context menu for stereo viewer settings.
Definition: viewMode.cc:462
QSize defaultIconSize_
Show logger in splitter or not.
Definition: CoreWidget.hh:570
void showToolbox(bool _state)
Show or hide toolbox.
Definition: CoreWidget.cc:741
void dropEvent(QDropEvent *_event)
Definition: dragAndDrop.cc:142
QToolBar * toolbar() const
PickMode toolbar.
Definition: CoreWidget.cc:119
int originalLoggerSize_
Size of the logging window ( defaults to 240 )
Definition: CoreWidget.hh:689
QMenu * contextMenu_
context Menu for the gl area
Definition: CoreWidget.hh:991
void slotApplyStereoSettings(int _tmpParam=0)
Definition: viewMode.cc:484
QCursor cursor_
Definition: CoreWidget.hh:270
QScrollArea * toolBoxScroll_
Toolbox scroll area.
Definition: CoreWidget.hh:737
std::vector< KeyBinding > coreKeys_
vector of keys registered to the core
Definition: CoreWidget.hh:386
bool tracking() const
PickMode mouse tracking.
Definition: CoreWidget.cc:103
Viewer::ViewerProperties & viewerProperties(int _id)
Get the viewer properties Use this functions to get basic viewer properties such as backgroundcolor o...
bool event(QEvent *event)
typedefs
Definition: CoreWidget.cc:1087
OptionsWidget * optionsWidget_
Pointer to the OptionsWidget.
Definition: CoreWidget.hh:1225
DLLEXPORT QIcon & typeIcon(DataType _id)
Get an QIcon associated with the given DataType.
Definition: Types.cc:212
void setPickingMode()
Definition: CoreWidget.hh:1463
QWidgetAction * viewModeChangePopupAction_
Handle to picking toolbar.
Definition: CoreWidget.hh:756
void changeHelpSite(QUrl)
Pointer to the help Browser.
void addItem(QGraphicsWidget *_item, unsigned int _pos)
Adds Widget to Layout.
~CoreWidget()
destructor
Definition: CoreWidget.cc:654
QToolButton * pickButton_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:827
void sceneGraph(ACG::SceneGraph::BaseNode *_root, unsigned int _maxPasses, ACG::Vec3d _bbmin, ACG::Vec3d _bbmax, const bool _resetTrackBall=false)
QToolBar * toolbar_
Definition: CoreWidget.hh:274
void sceneRectChanged(const QRectF &rect)
Definition: CoreWidget.cc:1035
void dragEnterEvent(QDragEnterEvent *_event)
Definition: dragAndDrop.cc:128
viewModeChangeWidget * modeChangeWidget
Handle to picking toolbar.
Definition: CoreWidget.hh:758
std::string name() const
PickMode Name.
Definition: CoreWidget.cc:95
QToolBar * mainToolbar_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:1260
void setFullscreen(bool _state)
Enable or disable fullscreen mode.
Definition: CoreWidget.cc:682
OFGLWidget * glWidget_
gl widget used as drawing area to paint the graphics scene
Definition: CoreWidget.hh:707
void setPickMode(const std::string &_name)
Definition: picking.cc:158
void updateGeometry()
recalculate geometry
std::string name_
Name of the pickMode.
Definition: CoreWidget.hh:258
QtSlideWindow * slidingLogger_
Class that holds the animated log widget.
Definition: CoreWidget.hh:722
CoreWidget(QVector< ViewMode *> &_viewModes, QList< SlotInfo > &_coreSlots)
constructor
Definition: CoreWidget.cc:134
void getActionMode(Viewer::ActionMode &_am)
Definition: picking.cc:152
void setEnabled(bool _enabled)
Enabled/Disables gl cursor painting.
void registerCoreKeys()
Register all events related to the core.
Definition: keyHandling.cc:502
Predefined datatypes.
Definition: DataTypes.hh:83
std::vector< QAction * > extended_actions
Definition: CoreWidget.hh:1589
QToolButton * questionButton_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:828
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
bool tracking_
Definition: CoreWidget.hh:262
void setForceNative(bool _enabled)
Enabled/Disables native cursors.
void saveOptions()
Pointer to the OptionsWidget.
void fullScreenChanged(bool _state)
will be emitted if the fullscreen state is changed (_state = true => in fullscreen) ...
OpenFlipper::Options::LoggerState loggerState_
Show logger in splitter or not.
Definition: CoreWidget.hh:568
InverseKeyMap invKeys_
mapping of all registered keys and the corresponding plugins to currently assigned keys ...
Definition: CoreWidget.hh:392
std::vector< glViewer *> examiner_widgets_
Examiner Widget.
Definition: CoreWidget.hh:677
HelpWidget * helpWidget_
Pointer to the help Browser.
Definition: CoreWidget.hh:1117
void toggleToolbox()
Hide or show toolbox area.
Definition: CoreWidget.cc:729
bool visible_
Definition: CoreWidget.hh:266
QtMultiViewLayout * baseLayout_
Base layout that holds gl views.
Definition: CoreWidget.hh:719
MultiViewMode mode() const
Retruns current layout modes.
std::vector< StackWidgetInfo > stackWidgetList_
QMenu containing the recently opened files.
Definition: CoreWidget.hh:1092
void setGeneratorMap(QMap< std::string, SceneGraphWidgetGenerator * > _map)
Set a complete generator map (this will overwrite the existing one!
void toggleMenuBar()
Hide or show menu bar.
Definition: CoreWidget.cc:803
QStackedWidget * stackedWidget_
Container widget for holding multiple views.
Definition: CoreWidget.hh:1096
void applyOptions()
Pointer to the OptionsWidget.
QtGLGraphicsView * glView_
graphics view that holds the gl scene
Definition: CoreWidget.hh:713
QToolBar * viewerToolbar_
Called by Plugins to add a Toolbar.
Definition: CoreWidget.hh:821
void slotToggleStereoMode()
Enable or disable Stereo.
QVector< ViewMode * > & viewModes_
List of currently available viewModes.
Definition: CoreWidget.hh:585
void showLoggerInSplitView(bool _show)
Show logger in splitter or not.
void setupMenuBar()
Setup the main menubar.
Definition: MenuBar.cc:153
void toolBarVisChanged(bool _state)
will be emitted if the visibility of the toolbar is changed
PickMode(const std::string &_n, const bool _t, const bool _v, QCursor _c, QToolBar *_tb=0)
Constructor.
Definition: CoreWidget.cc:77
Implementation of the logger Widget.
Definition: loggerWidget.hh:61
DLLEXPORT DataType typeId(QString _name)
Given a dataType Identifier string this function will return the id of the datatype.
Definition: Types.cc:139
void startDrag(QMouseEvent *_event)
Definition: dragAndDrop.cc:67
void drawModeChanged(int _viewerId)
The viewer with id _viewerId changed its draw Mode.
void showMenuBar(bool _state)
Show or hide menubar.
Definition: CoreWidget.cc:758
QSplitter * toolSplitter_
Spliter between toplevel objects and toolbox.
Definition: CoreWidget.hh:731
void showToolBar(bool _state)
Show or hide toolbar, emits toolBarToggled( bool _state )
Definition: CoreWidget.cc:775
ACG::SceneGraph::BaseNode * getSceneGraphRootNode()
get scenegraph root node
void attachWidget(QWidget *_m)
attach a child widget
void slotCustomContextMenu(const QPoint &_point)
This slot is called by the examiner widgets gl area when a context menu is requested.
Definition: ContextMenu.cc:60
QCursor cursor() const
PickMode cursor.
Definition: CoreWidget.cc:111
void nextViewerLayout()
Switches over to the next view mode.
Definition: CoreWidget.cc:938
void setQuestionMode()
Definition: CoreWidget.hh:1464