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