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