From e5aaab93d5fc63d0e665e40a567887d02d3ffba6 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 4 Sep 2018 10:29:54 +0200 Subject: [PATCH] Remove visibleBbox from scene. Working subviewer. --- GraphicsView/include/CGAL/Qt/qglviewer_impl.h | 2 - Polyhedron/demo/Polyhedron/MainWindow.cpp | 501 ++++++++---------- Polyhedron/demo/Polyhedron/Polyhedron_3.qrc | 2 + Polyhedron/demo/Polyhedron/Scene.cpp | 34 -- Polyhedron/demo/Polyhedron/Scene.h | 3 - Polyhedron/demo/Polyhedron/SubViewer.ui | 6 +- Polyhedron/demo/Polyhedron/resources/exit.png | Bin 0 -> 7417 bytes Polyhedron/demo/Polyhedron/resources/menu.png | Bin 0 -> 742 bytes 8 files changed, 230 insertions(+), 318 deletions(-) mode change 100644 => 100755 GraphicsView/include/CGAL/Qt/qglviewer_impl.h mode change 100644 => 100755 Polyhedron/demo/Polyhedron/MainWindow.cpp mode change 100644 => 100755 Polyhedron/demo/Polyhedron/Polyhedron_3.qrc mode change 100644 => 100755 Polyhedron/demo/Polyhedron/Scene.cpp mode change 100644 => 100755 Polyhedron/demo/Polyhedron/Scene.h mode change 100644 => 100755 Polyhedron/demo/Polyhedron/SubViewer.ui create mode 100644 Polyhedron/demo/Polyhedron/resources/exit.png create mode 100644 Polyhedron/demo/Polyhedron/resources/menu.png diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h old mode 100644 new mode 100755 index 7f4b87f713f..5e042575814 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -3183,9 +3183,7 @@ void CGAL::QGLViewer::drawVisualHints() { int size = 100; glViewport(width()*devicePixelRatio()-size, height()*devicePixelRatio()-size, size, size); glScissor (width()*devicePixelRatio()-size, height()*devicePixelRatio()-size, size, size); - glDisable(GL_DEPTH_TEST); glDrawArrays(GL_TRIANGLES, 0, static_cast(axis_size / 9)); - glEnable(GL_DEPTH_TEST); // The viewport and the scissor are restored. glScissor(scissor[0],scissor[1],scissor[2],scissor[3]); glViewport(viewport[0],viewport[1],viewport[2],viewport[3]); diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp old mode 100644 new mode 100755 index 1d2c6da5e9c..9ecbec450ac --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -135,272 +135,232 @@ MainWindow::MainWindow(bool verbose, QWidget* parent) : CGAL::Qt::DemosMainWindow(parent) { ui = new Ui::MainWindow; - ui->setupUi(this); - menuBar()->setNativeMenuBar(false); - searchAction = new QWidgetAction(0); - CGAL::Three::Three::s_mainwindow = this; - menu_map[ui->menuOperations->title()] = ui->menuOperations; - this->verbose = verbose; - // remove the Load Script menu entry, when the demo has not been compiled with QT_SCRIPT_LIB -#if !defined(QT_SCRIPT_LIB) - ui->menuBar->removeAction(ui->actionLoadScript); -#endif - // Save some pointers from ui, for latter use. - sceneView = ui->sceneView; - viewer = ui->viewer; - viewer->setObjectName("viewer"); - // do not save the state of the viewer (anoying) - viewer->setStateFileName(QString::null); + ui->setupUi(this); + menuBar()->setNativeMenuBar(false); + searchAction = new QWidgetAction(0); + CGAL::Three::Three::s_mainwindow = this; + menu_map[ui->menuOperations->title()] = ui->menuOperations; + this->verbose = verbose; + // remove the Load Script menu entry, when the demo has not been compiled with QT_SCRIPT_LIB + #if !defined(QT_SCRIPT_LIB) + ui->menuBar->removeAction(ui->actionLoadScript); + #endif + // Save some pointers from ui, for latter use. + sceneView = ui->sceneView; + viewer = ui->viewer; - // setup scene - scene = new Scene(this); - viewer->textRenderer()->setScene(scene); - viewer->setScene(scene); - CGAL::Three::Three::s_scene = scene; - CGAL::Three::Three::s_connectable_scene = scene; - { - QShortcut* shortcut = new QShortcut(QKeySequence(Qt::ALT+Qt::Key_Q), this); - connect(shortcut, SIGNAL(activated()), - this, SLOT(setFocusToQuickSearch())); - shortcut = new QShortcut(QKeySequence(Qt::Key_F5), this); - connect(shortcut, SIGNAL(activated()), - this, SLOT(reloadItem())); - shortcut = new QShortcut(QKeySequence(Qt::Key_F11), this); - connect(shortcut, SIGNAL(activated()), - this, SLOT(toggleFullScreen())); - } - setupViewer(viewer, 0); - - viewer->setKeyDescription(Qt::Key_R + Qt::CTRL, - tr("Recenters the viewer under the cursor. " - "If the cursor is not over any viewer, " - "then all viewers are recentered.")); - - proxyModel = new QSortFilterProxyModel(this); - proxyModel->setSourceModel(scene); - SceneDelegate *delegate = new SceneDelegate(this); - delegate->setProxy(proxyModel); - delegate->setScene(scene); - - - connect(ui->searchEdit, SIGNAL(textChanged(QString)), - proxyModel, SLOT(setFilterFixedString(QString))); - sceneView->setModel(proxyModel); - - // setup the sceneview: delegation and columns sizing... - sceneView->setItemDelegate(delegate); - resetHeader(); - - // setup connections - connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), - this, SLOT(updateInfo())); - - connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), - this, SLOT(updateDisplayInfo())); - - connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), - viewer, SLOT(update())); - - connect(scene, SIGNAL(updated()), - viewer, SLOT(update())); - connect(viewer, &Viewer::needNewContext, - [this](){create();}); - - - connect(scene, SIGNAL(updated()), - this, SLOT(selectionChanged())); - - connect(scene, SIGNAL(itemAboutToBeDestroyed(CGAL::Three::Scene_item*)), - this, SLOT(removeManipulatedFrame(CGAL::Three::Scene_item*))); - - connect(scene, SIGNAL(updated_bbox(bool)), - this, SLOT(updateViewersBboxes(bool))); - - connect(scene, SIGNAL(selectionChanged(int)), - this, SLOT(selectSceneItem(int))); - - connect(scene, SIGNAL(itemPicked(const QModelIndex &)), - this, SLOT(recenterSceneView(const QModelIndex &))); - - connect(sceneView->selectionModel(), - SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & ) ), - this, SLOT(updateInfo())); - - connect(sceneView->selectionModel(), - SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & ) ), - this, SLOT(updateDisplayInfo())); - - connect(sceneView->selectionModel(), - SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & ) ), - this, SLOT(selectionChanged())); - - sceneView->setContextMenuPolicy(Qt::CustomContextMenu); - connect(sceneView, SIGNAL(customContextMenuRequested(const QPoint & )), - this, SLOT(showSceneContextMenu(const QPoint &))); - - connect(sceneView, SIGNAL(expanded(QModelIndex)), - this, SLOT(setExpanded(QModelIndex))); - - connect(sceneView, SIGNAL(collapsed(QModelIndex)), - this, SLOT(setCollapsed(QModelIndex))); - connect(this, SIGNAL(collapsed(QModelIndex)), - scene, SLOT(setCollapsed(QModelIndex))); - connect(this, SIGNAL(expanded(QModelIndex)), - scene, SLOT(setExpanded(QModelIndex))); - - connect(scene, SIGNAL(restoreCollapsedState()), - this, SLOT(restoreCollapseState())); - - connect(viewer, SIGNAL(selected(int)), - this, SLOT(selectSceneItem(int))); - connect(viewer, SIGNAL(selectedPoint(double, double, double)), - this, SLOT(showSelectedPoint(double, double, double))); - - connect(viewer, SIGNAL(selectionRay(double, double, double, - double, double, double)), - scene, SIGNAL(selectionRay(double, double, double, - double, double, double))); - - connect(viewer, SIGNAL(requestContextMenu(QPoint)), - this, SLOT(contextMenuRequested(QPoint))); - connect(viewer, SIGNAL(sendMessage(QString)), - this, SLOT(information(QString))); - - // The contextMenuPolicy of infoLabel is now the default one, so that one - // can easily copy-paste its text. - // connect(ui->infoLabel, SIGNAL(customContextMenuRequested(const QPoint & )), - // this, SLOT(showSceneContextMenu(const QPoint &))); - connect(ui->actionRecenterScene, SIGNAL(triggered()), - viewer, SLOT(update())); - connect(ui->actionDrawTwoSides, SIGNAL(toggled(bool)), - viewer, SLOT(setTwoSides(bool))); - connect(ui->actionSwitchProjection, SIGNAL(toggled(bool)), - viewer, SLOT(SetOrthoProjection(bool))); - - // add the "About CGAL..." and "About demo..." entries - this->addAboutCGAL(); - this->addAboutDemo(":/cgal/Polyhedron_3/about.html"); - - // Connect the button "addButton" with actionLoad - ui->addButton->setDefaultAction(ui->actionLoad); - // Same with "removeButton" and "duplicateButton" - ui->removeButton->setDefaultAction(ui->actionErase); - ui->duplicateButton->setDefaultAction(ui->actionDuplicate); - - // Connect actionQuit (Ctrl+Q) and qApp->quit() - connect(ui->actionQuit, SIGNAL(triggered()), - this, SLOT(quit())); - // Connect "Select all items" - connect(ui->actionSelectAllItems, SIGNAL(triggered()), - this, SLOT(selectAll())); - - connect(ui->actionColorItems, SIGNAL(triggered()), - this, SLOT(colorItems())); - - // Recent files menu - this->addRecentFiles(ui->menuFile, ui->actionQuit); - connect(this, SIGNAL(openRecentFile(QString)), - this, SLOT(open(QString))); - - // Reset the "Operation menu" - clearMenu(ui->menuOperations); - -#ifdef QT_SCRIPT_LIB - std::cerr << "Enable scripts.\n"; - script_engine = new QScriptEngine(this); - qScriptRegisterMetaType(script_engine, - myScene_itemToScriptValue, - myScene_itemFromScriptValue); -# ifdef QT_SCRIPTTOOLS_LIB - QScriptEngineDebugger* debugger = new QScriptEngineDebugger(this); - debugger->setObjectName("qt script debugger"); - QAction* debuggerMenuAction = - menuBar()->addMenu(debugger->createStandardMenu()); - debuggerMenuAction->setText(tr("Qt Script &Debug")); - for(unsigned int i = 0; i < 9; ++i) - { - QDockWidget* dock = new QDockWidget(debug_widgets_names[i], this); - dock->setObjectName(debug_widgets_names[i]); - dock->setWidget(debugger->widget(debug_widgets[i])); - this->QMainWindow::addDockWidget(Qt::BottomDockWidgetArea, dock); - dock->hide(); - } - debugger->setAutoShowStandardWindow(false); - debugger->attachTo(script_engine); -# endif // QT_SCRIPTTOOLS_LIB - QScriptValue fun = script_engine->newFunction(myPrintFunction); - script_engine->globalObject().setProperty("print", fun); - - // evaluate_script("print('hello', 'world', 'from QtScript!')"); - QScriptValue mainWindowObjectValue = script_engine->newQObject(this); - script_engine->globalObject().setProperty("main_window", mainWindowObjectValue); - - QScriptValue sceneObjectValue = script_engine->newQObject(scene); - mainWindowObjectValue.setProperty("scene", sceneObjectValue); - script_engine->globalObject().setProperty("scene", sceneObjectValue); - - QScriptValue viewerObjectValue = script_engine->newQObject(viewer); - mainWindowObjectValue.setProperty("viewer", viewerObjectValue); - script_engine->globalObject().setProperty("viewer", viewerObjectValue); - - QScriptValue cameraObjectValue = script_engine->newQObject(viewer->camera()); - viewerObjectValue.setProperty("camera", cameraObjectValue); - script_engine->globalObject().setProperty("camera", cameraObjectValue); - - evaluate_script("var plugins = new Array();"); -# ifdef QT_SCRIPTTOOLS_LIB - QScriptValue debuggerObjectValue = script_engine->newQObject(debugger); - script_engine->globalObject().setProperty("debugger", debuggerObjectValue); -# endif -#endif - - readSettings(); // Among other things, the column widths are stored. - - // Load plugins, and re-enable actions that need it. - operationSearchBar.setPlaceholderText("Research..."); - searchAction->setDefaultWidget(&operationSearchBar); - connect(&operationSearchBar, &QLineEdit::textChanged, - this, &MainWindow::filterOperations); - loadPlugins(); - - // Setup the submenu of the View menu that can toggle the dockwidgets - Q_FOREACH(QDockWidget* widget, findChildren()) { - ui->menuDockWindows->addAction(widget->toggleViewAction()); - } - ui->menuDockWindows->removeAction(ui->dummyAction); - - - this->readState("MainWindow", Size|State); - - //Manages the group_item creation - actionAddToGroup= new QAction("Add New Group", this); - - if(actionAddToGroup) { - connect(actionAddToGroup, SIGNAL(triggered()), - this, SLOT(makeNewGroup())); - } - - QMenu* menuFile = findChild("menuFile"); - insertActionBeforeLoadPlugin(menuFile, actionAddToGroup); - statistics_dlg = NULL; - statistics_ui = new Ui::Statistics_on_item_dialog(); - - actionResetDefaultLoaders = new QAction("Reset Default Loaders",this); - -#ifdef QT_SCRIPT_LIB - // evaluate_script("print(plugins);"); - Q_FOREACH(QAction* action, findChildren()) { - if(action->objectName() != "") { - QScriptValue objectValue = script_engine->newQObject(action); - script_engine->globalObject().setProperty(action->objectName(), - objectValue); + // setup scene + scene = new Scene(this); + CGAL::Three::Three::s_scene = scene; + CGAL::Three::Three::s_connectable_scene = scene; + { + QShortcut* shortcut = new QShortcut(QKeySequence(Qt::ALT+Qt::Key_Q), this); + connect(shortcut, SIGNAL(activated()), + this, SLOT(setFocusToQuickSearch())); + shortcut = new QShortcut(QKeySequence(Qt::Key_F5), this); + connect(shortcut, SIGNAL(activated()), + this, SLOT(reloadItem())); + shortcut = new QShortcut(QKeySequence(Qt::Key_F11), this); + connect(shortcut, SIGNAL(activated()), + this, SLOT(toggleFullScreen())); } - } - // debugger->action(QScriptEngineDebugger::InterruptAction)->trigger(); -#endif - // setup menu filtering - connect(ui->menuOperations, SIGNAL(aboutToShow()), this, SLOT(filterOperations())); + proxyModel = new QSortFilterProxyModel(this); + proxyModel->setSourceModel(scene); + SceneDelegate *delegate = new SceneDelegate(this); + delegate->setProxy(proxyModel); + delegate->setScene(scene); + + + connect(ui->searchEdit, SIGNAL(textChanged(QString)), + proxyModel, SLOT(setFilterFixedString(QString))); + sceneView->setModel(proxyModel); + + // setup the sceneview: delegation and columns sizing... + sceneView->setItemDelegate(delegate); + resetHeader(); + + // setup connections + connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), + this, SLOT(updateInfo())); + + connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), + this, SLOT(updateDisplayInfo())); + + connect(viewer, &Viewer::needNewContext, + [this](){create();}); + + + connect(scene, SIGNAL(updated()), + this, SLOT(selectionChanged())); + + connect(scene, SIGNAL(itemAboutToBeDestroyed(CGAL::Three::Scene_item*)), + this, SLOT(removeManipulatedFrame(CGAL::Three::Scene_item*))); + + connect(scene, SIGNAL(updated_bbox(bool)), + this, SLOT(updateViewersBboxes(bool))); + + connect(scene, SIGNAL(selectionChanged(int)), + this, SLOT(selectSceneItem(int))); + + connect(scene, SIGNAL(itemPicked(const QModelIndex &)), + this, SLOT(recenterSceneView(const QModelIndex &))); + + connect(sceneView->selectionModel(), + SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & ) ), + this, SLOT(updateInfo())); + + connect(sceneView->selectionModel(), + SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & ) ), + this, SLOT(updateDisplayInfo())); + + connect(sceneView->selectionModel(), + SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & ) ), + this, SLOT(selectionChanged())); + + sceneView->setContextMenuPolicy(Qt::CustomContextMenu); + connect(sceneView, SIGNAL(customContextMenuRequested(const QPoint & )), + this, SLOT(showSceneContextMenu(const QPoint &))); + + connect(sceneView, SIGNAL(expanded(QModelIndex)), + this, SLOT(setExpanded(QModelIndex))); + + connect(sceneView, SIGNAL(collapsed(QModelIndex)), + this, SLOT(setCollapsed(QModelIndex))); + connect(this, SIGNAL(collapsed(QModelIndex)), + scene, SLOT(setCollapsed(QModelIndex))); + connect(this, SIGNAL(expanded(QModelIndex)), + scene, SLOT(setExpanded(QModelIndex))); + + connect(scene, SIGNAL(restoreCollapsedState()), + this, SLOT(restoreCollapseState())); + + setupViewer(viewer, nullptr); + + // add the "About CGAL..." and "About demo..." entries + this->addAboutCGAL(); + this->addAboutDemo(":/cgal/Polyhedron_3/about.html"); + + // Connect the button "addButton" with actionLoad + ui->addButton->setDefaultAction(ui->actionLoad); + // Same with "removeButton" and "duplicateButton" + ui->removeButton->setDefaultAction(ui->actionErase); + ui->duplicateButton->setDefaultAction(ui->actionDuplicate); + + // Connect actionQuit (Ctrl+Q) and qApp->quit() + connect(ui->actionQuit, SIGNAL(triggered()), + this, SLOT(quit())); + // Connect "Select all items" + connect(ui->actionSelectAllItems, SIGNAL(triggered()), + this, SLOT(selectAll())); + + connect(ui->actionColorItems, SIGNAL(triggered()), + this, SLOT(colorItems())); + + // Recent files menu + this->addRecentFiles(ui->menuFile, ui->actionQuit); + connect(this, SIGNAL(openRecentFile(QString)), + this, SLOT(open(QString))); + + // Reset the "Operation menu" + clearMenu(ui->menuOperations); + + #ifdef QT_SCRIPT_LIB + std::cerr << "Enable scripts.\n"; + script_engine = new QScriptEngine(this); + qScriptRegisterMetaType(script_engine, + myScene_itemToScriptValue, + myScene_itemFromScriptValue); + # ifdef QT_SCRIPTTOOLS_LIB + QScriptEngineDebugger* debugger = new QScriptEngineDebugger(this); + debugger->setObjectName("qt script debugger"); + QAction* debuggerMenuAction = + menuBar()->addMenu(debugger->createStandardMenu()); + debuggerMenuAction->setText(tr("Qt Script &Debug")); + for(unsigned int i = 0; i < 9; ++i) + { + QDockWidget* dock = new QDockWidget(debug_widgets_names[i], this); + dock->setObjectName(debug_widgets_names[i]); + dock->setWidget(debugger->widget(debug_widgets[i])); + this->QMainWindow::addDockWidget(Qt::BottomDockWidgetArea, dock); + dock->hide(); + } + debugger->setAutoShowStandardWindow(false); + debugger->attachTo(script_engine); + # endif // QT_SCRIPTTOOLS_LIB + QScriptValue fun = script_engine->newFunction(myPrintFunction); + script_engine->globalObject().setProperty("print", fun); + + // evaluate_script("print('hello', 'world', 'from QtScript!')"); + QScriptValue mainWindowObjectValue = script_engine->newQObject(this); + script_engine->globalObject().setProperty("main_window", mainWindowObjectValue); + + QScriptValue sceneObjectValue = script_engine->newQObject(scene); + mainWindowObjectValue.setProperty("scene", sceneObjectValue); + script_engine->globalObject().setProperty("scene", sceneObjectValue); + + QScriptValue viewerObjectValue = script_engine->newQObject(viewer); + mainWindowObjectValue.setProperty("viewer", viewerObjectValue); + script_engine->globalObject().setProperty("viewer", viewerObjectValue); + + QScriptValue cameraObjectValue = script_engine->newQObject(viewer->camera()); + viewerObjectValue.setProperty("camera", cameraObjectValue); + script_engine->globalObject().setProperty("camera", cameraObjectValue); + + evaluate_script("var plugins = new Array();"); + # ifdef QT_SCRIPTTOOLS_LIB + QScriptValue debuggerObjectValue = script_engine->newQObject(debugger); + script_engine->globalObject().setProperty("debugger", debuggerObjectValue); + # endif + #endif + + readSettings(); // Among other things, the column widths are stored. + + // Load plugins, and re-enable actions that need it. + operationSearchBar.setPlaceholderText("Research..."); + searchAction->setDefaultWidget(&operationSearchBar); + connect(&operationSearchBar, &QLineEdit::textChanged, + this, &MainWindow::filterOperations); + loadPlugins(); + + // Setup the submenu of the View menu that can toggle the dockwidgets + Q_FOREACH(QDockWidget* widget, findChildren()) { + ui->menuDockWindows->addAction(widget->toggleViewAction()); + } + ui->menuDockWindows->removeAction(ui->dummyAction); + + + this->readState("MainWindow", Size|State); + + //Manages the group_item creation + actionAddToGroup= new QAction("Add New Group", this); + + if(actionAddToGroup) { + connect(actionAddToGroup, SIGNAL(triggered()), + this, SLOT(makeNewGroup())); + } + + QMenu* menuFile = findChild("menuFile"); + insertActionBeforeLoadPlugin(menuFile, actionAddToGroup); + statistics_dlg = NULL; + statistics_ui = new Ui::Statistics_on_item_dialog(); + + actionResetDefaultLoaders = new QAction("Reset Default Loaders",this); + + #ifdef QT_SCRIPT_LIB + // evaluate_script("print(plugins);"); + Q_FOREACH(QAction* action, findChildren()) { + if(action->objectName() != "") { + QScriptValue objectValue = script_engine->newQObject(action); + script_engine->globalObject().setProperty(action->objectName(), + objectValue); + } + } + // debugger->action(QScriptEngineDebugger::InterruptAction)->trigger(); + #endif + + // setup menu filtering + connect(ui->menuOperations, SIGNAL(aboutToShow()), this, SLOT(filterOperations())); } //Recursive function that do a pass over a menu and its sub-menus(etc.) and hide them when they are empty @@ -883,8 +843,7 @@ void MainWindow::updateViewersBboxes(bool recenter) void MainWindow::computeViewerBBox(CGAL::qglviewer::Vec& min, CGAL::qglviewer::Vec& max) { - const Scene::Bbox bbox = scene->visibleBbox(); - const Scene::Bbox all_bbox = scene->bbox(); + const Scene::Bbox bbox = scene->bbox(); const double xmin = bbox.xmin(); const double ymin = bbox.ymin(); const double zmin = bbox.zmin(); @@ -892,20 +851,12 @@ void MainWindow::computeViewerBBox(CGAL::qglviewer::Vec& min, CGAL::qglviewer::V const double ymax = bbox.ymax(); const double zmax = bbox.zmax(); - const double axmin = all_bbox.xmin(); - const double aymin = all_bbox.ymin(); - const double azmin = all_bbox.zmin(); - const double axmax = all_bbox.xmax(); - const double aymax = all_bbox.ymax(); - const double azmax = all_bbox.zmax(); - min = CGAL::qglviewer::Vec(xmin, ymin, zmin); max= CGAL::qglviewer::Vec(xmax, ymax, zmax); - CGAL::qglviewer::Vec abbox_center((axmin+axmax)/2, (aymin+aymax)/2, (azmin+azmax)/2), - bbox_center((xmin+xmax)/2, (ymin+ymax)/2, (zmin+zmax)/2); + CGAL::qglviewer::Vec bbox_center((xmin+xmax)/2, (ymin+ymax)/2, (zmin+zmax)/2); CGAL::qglviewer::Vec offset(0,0,0); @@ -2103,7 +2054,6 @@ void MainWindow::setAddKeyFrameKeyboardModifiers(::Qt::KeyboardModifiers m) void MainWindow::on_actionRecenterScene_triggered() { scene->computeBbox(); - scene->computeVisibleBbox(); CGAL::qglviewer::Vec min, max; computeViewerBBox(min, max); Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()) @@ -2583,7 +2533,6 @@ void MainWindow::on_actionAdd_Viewer_triggered() void MainWindow::recenterViewer() { scene->computeBbox(); - scene->computeVisibleBbox(); CGAL::qglviewer::Vec min, max; computeViewerBBox(min, max); Viewer* target = qobject_cast(childAt(cursor().pos())); diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_3.qrc b/Polyhedron/demo/Polyhedron/Polyhedron_3.qrc old mode 100644 new mode 100755 index 1a5085550c0..494c9d9f04a --- a/Polyhedron/demo/Polyhedron/Polyhedron_3.qrc +++ b/Polyhedron/demo/Polyhedron/Polyhedron_3.qrc @@ -31,6 +31,8 @@ resources/pss_inter.png resources/pss_diff.png resources/help_button.png + resources/exit.png + resources/menu.png resources/about.html diff --git a/Polyhedron/demo/Polyhedron/Scene.cpp b/Polyhedron/demo/Polyhedron/Scene.cpp old mode 100644 new mode 100755 index f3bc3ed16f7..cf1596e3fe0 --- a/Polyhedron/demo/Polyhedron/Scene.cpp +++ b/Polyhedron/demo/Polyhedron/Scene.cpp @@ -1201,7 +1201,6 @@ void Scene::itemVisibilityChanged(CGAL::Three::Scene_item* item) && !item->isEmpty()) { //does not recenter - computeVisibleBbox(); Q_EMIT updated_bbox(false); } } @@ -1664,34 +1663,6 @@ void Scene::adjustIds(Item_id removed_id) } } -void Scene::computeVisibleBbox() -{ - if(m_entries.empty()) - { - last_visible_bbox = Bbox(0,0,0,0,0,0); - return; - } - - bool bbox_initialized = false; - Bbox bbox = Bbox(0,0,0,0,0,0); - Q_FOREACH(CGAL::Three::Scene_item* item, m_entries) - { - if(item->isFinite() && !item->isEmpty() && item->visible()) { - if(bbox_initialized) { - - bbox = bbox + item->bbox(); - } - else { - bbox = item->bbox(); - bbox_initialized = true; - - } - } - - } - last_visible_bbox = bbox; -} - void Scene::computeBbox() { if(m_entries.empty()) @@ -1740,11 +1711,6 @@ void Scene::removeViewer(Viewer_interface *viewer) } } -Scene::Bbox Scene::visibleBbox() const -{ - return last_visible_bbox; -} - void Scene::initGL(Viewer_interface *viewer) { viewer->makeCurrent(); diff --git a/Polyhedron/demo/Polyhedron/Scene.h b/Polyhedron/demo/Polyhedron/Scene.h old mode 100644 new mode 100755 index a99fcc438b2..5dc5c0bb9b6 --- a/Polyhedron/demo/Polyhedron/Scene.h +++ b/Polyhedron/demo/Polyhedron/Scene.h @@ -94,9 +94,7 @@ public: void updatePrimitiveIds(Viewer_interface *, Scene_item *item) Q_DECL_OVERRIDE; bool testDisplayId(double x, double y, double z, CGAL::Three::Viewer_interface* viewer) Q_DECL_OVERRIDE; Bbox bbox() const Q_DECL_OVERRIDE; - Bbox visibleBbox() const ; void computeBbox(); - void computeVisibleBbox(); double len_diagonal() const Q_DECL_OVERRIDE { Bbox box = bbox(); @@ -286,7 +284,6 @@ private: QMap vaos; mutable QOpenGLBuffer vbo[2]; Bbox last_bbox; - Bbox last_visible_bbox; }; // end class Scene class QAbstractProxyModel; diff --git a/Polyhedron/demo/Polyhedron/SubViewer.ui b/Polyhedron/demo/Polyhedron/SubViewer.ui old mode 100644 new mode 100755 index 9a7104eef15..62a56d47ccc --- a/Polyhedron/demo/Polyhedron/SubViewer.ui +++ b/Polyhedron/demo/Polyhedron/SubViewer.ui @@ -37,8 +37,8 @@ - - :/cgal/icons/menu:/cgal/icons/menu + + resources/menu.pngresources/menu.png @@ -61,7 +61,7 @@ - :/cgal/icons/exit:/cgal/icons/exit + :/cgal/icons/resources/exit.png:/cgal/icons/resources/exit.png diff --git a/Polyhedron/demo/Polyhedron/resources/exit.png b/Polyhedron/demo/Polyhedron/resources/exit.png new file mode 100644 index 0000000000000000000000000000000000000000..419b86b7a3caae547e26aedc3b8ce636bb61ae7d GIT binary patch literal 7417 zcmVWFU8GbZ8()Nlj2>E@cM*032OOL_t(|+U=cruq{_r z#(#b8x$}FFkN_`<3=$QD3S&%2$Or@!#Q~8)0!Bzc0|COIl|Tpy2_U4<_yP!shy^G} zK^R03&?FE{APHKeKvJNkXe1ai@bd0>2LIS=zuu>BpYGke&(Pgxt*TS^-TS)x?B2b< z{?@eDiWn}D^8x7NCw)0**iWBhvW^{xWPN{;`(lD)_W71`4|%XY$7Wr(%$T$0p~yIfJ@>rpj(W_K zTtCCsY|r`Z0Ln15%>ixsIhO(w-^uD{04W;sAflAxe80yR7pKjJk_XbXp6NUjKc_aNHe~%Jxow8Itj84m5bJSz*C)jD!WA>SkQI9}1so;pv!U~^QUh7Sq?FtW98yHZYNw#gN0y0w z#U1=pmEGK!Q5_rlR;k;VDRAv^+}Akgdz@o#I{+!nIw1^V)hsv3D~Udz$&CV!9hbg2 z&WAT{U3r`fZro!Y#hS<)bEn|??x(3(K~{dw?^*i@`X!DXr{^N=yZQyj+@Ii>8S|JY zG2f$F6KTh~nY%&v5~^ak=OojJ)hnh_MI*f*aLxgM^a@@enZwmjpcMs*N=2j}pf1|I zBD9IOE=C0rW;avyQ>d)3Y@$*TaM%}lQ6s$tblT3zAq+Cd;O2LCf3Jc=r3&g*83u_$ z83bTne!Ba3d-8jS!Oimu6qRW+NOw{U;xfk^g9(q_giRAEI8>U#AVt4;&H+P|P^;#g zzblKV)Qv$%GDuN`xhh%9`I)RTp`ua+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HuMN-;>A@UlNG zs#W%|BfY0ax=PKA^j^Su1A)R2)l3;gr49^I zG>l;ZH4rEat!knSqEdAR39V`}z#v5~pbVnYWCrOggQzHjjFCY?t3{}&Op8H6>S9Gr zsjR4?k_D2|l@*&<)kH<5^xAHhL}gl#(T%Glf2Pr2(PPJ{s}37S-dOXForIn}>M>7h zzDKbpvc_CW(`hFzFZhMFArDi7taEKvYy>fb@|LQ*K{B6%`eyJFn}- zQjeC3N{S6)<$J)d3Ub_BEBoP4;72V%Uc@r2$cJsNmAyVPg;4P$nyr$jxUu#XASahQG|ySl!N^AW1nNPjva^i>?`mYD-#^E r&v%s>^CaiH?3xG}vwN+falrov>Nyr}{0_S}00000NkvXXu0mjfm6r^% literal 0 HcmV?d00001 diff --git a/Polyhedron/demo/Polyhedron/resources/menu.png b/Polyhedron/demo/Polyhedron/resources/menu.png new file mode 100644 index 0000000000000000000000000000000000000000..7656f00f11083eb4ceb6b987a9fec37f03fadebd GIT binary patch literal 742 zcmeAS@N?(olHy`uVBq!ia0vp^CqS5k4M?tyST_$yu_bxCyDx`7I;J! zGca%qgD@k*tT_@uLG}_)Usv{roKhU7>RJI4Gk`*}nIRD+&iT2ysd*(pE(3#eQEFmI zYKlU6W=V#EyQgnJie4%^0|S$nr;B4q#jUq@H?Cq<6le<+{rpc~#vr%LAts{Z|C2et z#KhbCZ#pIAuU*SlV;8Q!4^YxgTTR@J5+XQh7 zA)$bvFU(ePGfq8h)lA%AIO-NArbgi}*Ji1+9AHCE0-#W3VUmu!E8aVcJ-*Tjl-xXB L{an^LB{Ts5JZ{fN literal 0 HcmV?d00001