From 96a17984b0208943ea442973914c64ce14172695 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 27 Jul 2017 15:02:28 +0200 Subject: [PATCH 1/6] Add color to the status text so it is more visible --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 15 ++++++++++++--- Polyhedron/demo/Polyhedron/MainWindow.h | 3 ++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 2b04ca30351..f34f555a618 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -792,22 +792,26 @@ void MainWindow::message(QString message, QString colorName, QString font) { message.remove(message.length()-1, 1); } statusBar()->showMessage(message, 5000); + QTimer::singleShot(5000, this, SLOT(resetStatusColor())); message = "" + - message + "
"; + message + "
"; message = "[" + QTime::currentTime().toString() + "] " + message; ui->consoleTextEdit->append(message); ui->consoleTextEdit->verticalScrollBar()->setValue(ui->consoleTextEdit->verticalScrollBar()->maximum()); } void MainWindow::information(QString text) { - this->message("INFO: " + text, ""); + statusBar()->setStyleSheet("color: blue"); + this->message("INFO: " + text, "blue"); } void MainWindow::warning(QString text) { - this->message("WARNING: " + text, "blue"); + statusBar()->setStyleSheet("color: orange"); + this->message("WARNING: " + text, "orange"); } void MainWindow::error(QString text) { + statusBar()->setStyleSheet("color: red"); this->message("ERROR: " + text, "red"); } @@ -2029,3 +2033,8 @@ void MainWindow::set_facegraph_mode_adapter(bool is_polyhedron) else set_face_graph_default_type(SURFACE_MESH); } + +void MainWindow::resetStatusColor() +{ + statusBar()->setStyleSheet("color: black"); +} diff --git a/Polyhedron/demo/Polyhedron/MainWindow.h b/Polyhedron/demo/Polyhedron/MainWindow.h index 92aea2f202f..ab541aaa8b0 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.h +++ b/Polyhedron/demo/Polyhedron/MainWindow.h @@ -349,7 +349,8 @@ protected Q_SLOTS: void on_actionRecenterScene_triggered(); //!Resizes the header of the scene view void resetHeader(); - + //!Reset the statusBar color to black + void resetStatusColor(); protected: QList createSubMenus(QList); /*! For each objects in the Geometric Objects view, loads the associated plugins. From 8b54f38b39837b907f7215dc0b86bb553f90e598 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 28 Jul 2017 11:02:53 +0200 Subject: [PATCH 2/6] restore default stylesheet instead of setting it to black --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index f34f555a618..7e5c31cf3be 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -2036,5 +2036,5 @@ void MainWindow::set_facegraph_mode_adapter(bool is_polyhedron) void MainWindow::resetStatusColor() { - statusBar()->setStyleSheet("color: black"); + statusBar()->setStyleSheet(""); } From 07731507c3b1e3f05a339fa836ad498c1a42c21d Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 31 Jul 2017 09:45:01 +0200 Subject: [PATCH 3/6] Use a lambda expression instead of a slot --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 6 +----- Polyhedron/demo/Polyhedron/MainWindow.h | 2 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 7e5c31cf3be..7d3410eaee1 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -792,7 +792,7 @@ void MainWindow::message(QString message, QString colorName, QString font) { message.remove(message.length()-1, 1); } statusBar()->showMessage(message, 5000); - QTimer::singleShot(5000, this, SLOT(resetStatusColor())); + QTimer::singleShot(5000, [this]{this->statusBar()->setStyleSheet("");}); message = "" + message + "
"; message = "[" + QTime::currentTime().toString() + "] " + message; @@ -2034,7 +2034,3 @@ void MainWindow::set_facegraph_mode_adapter(bool is_polyhedron) set_face_graph_default_type(SURFACE_MESH); } -void MainWindow::resetStatusColor() -{ - statusBar()->setStyleSheet(""); -} diff --git a/Polyhedron/demo/Polyhedron/MainWindow.h b/Polyhedron/demo/Polyhedron/MainWindow.h index ab541aaa8b0..581132870e9 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.h +++ b/Polyhedron/demo/Polyhedron/MainWindow.h @@ -349,8 +349,6 @@ protected Q_SLOTS: void on_actionRecenterScene_triggered(); //!Resizes the header of the scene view void resetHeader(); - //!Reset the statusBar color to black - void resetStatusColor(); protected: QList createSubMenus(QList); /*! For each objects in the Geometric Objects view, loads the associated plugins. From aa36342cf0d270b31f30e9848a125693b4f78db8 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 2 Aug 2017 14:00:07 +0200 Subject: [PATCH 4/6] Fix for the selected points that are not displayed if the current item is not the first in the list. --- .../Scene_points_with_normal_item.cpp | 61 ++++++++++--------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp index 991e7e3b60f..2ffffed9382 100644 --- a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp @@ -220,14 +220,16 @@ void Scene_points_with_normal_item_priv::initializeBuffers(CGAL::Three::Viewer_i item->buffers[Edges_vertices].release(); if (!(colors_points.empty())) - { - item->buffers[Points_colors].bind(); - item->buffers[Points_colors].allocate (colors_points.data(), - static_cast(colors_points.size()*sizeof(CGAL_data_type))); - program->enableAttributeArray("colors"); - program->setAttributeBuffer("colors",CGAL_GL_data_type,0,3); - item->buffers[Points_colors].release(); - } + { + item->buffers[Points_colors].bind(); + item->buffers[Points_colors].allocate (colors_points.data(), + static_cast(colors_points.size()*sizeof(CGAL_data_type))); + program->enableAttributeArray("colors"); + program->setAttributeBuffer("colors",CGAL_GL_data_type,0,3); + item->buffers[Points_colors].release(); + } + else + program->disableAttributeArray("colors"); item->vaos[Edges]->release(); @@ -253,22 +255,25 @@ void Scene_points_with_normal_item_priv::initializeBuffers(CGAL::Three::Viewer_i program->setAttributeBuffer("vertex",CGAL_GL_data_type,0,3); item->buffers[Edges_vertices].release(); if (!(colors_points.empty())) - { - item->buffers[Points_colors].bind(); - item->buffers[Points_colors].allocate (colors_points.data(), - static_cast(colors_points.size()*sizeof(CGAL_data_type))); - program->enableAttributeArray("colors"); - program->setAttributeBuffer("colors",CGAL_GL_data_type,0,3,6*sizeof(CGAL_data_type)); - item->buffers[Points_colors].release(); - colors_points.resize(0); - std::vector(colors_points).swap(colors_points); - } - + { + item->buffers[Points_colors].bind(); + item->buffers[Points_colors].allocate (colors_points.data(), + static_cast(colors_points.size()*sizeof(CGAL_data_type))); + program->enableAttributeArray("colors"); + program->setAttributeBuffer("colors",CGAL_GL_data_type,0,3,6*sizeof(CGAL_data_type)); + item->buffers[Points_colors].release(); + colors_points.resize(0); + std::vector(colors_points).swap(colors_points); + } + else + program->disableAttributeArray("colors"); item->vaos[ThePoints]->release(); program->release(); + if(item->has_normals()) { program = item->getShaderProgram(Scene_points_with_normal_item::PROGRAM_WITH_LIGHT, viewer); + program->bind(); item->vaos[TheShadedPoints]->bind(); item->buffers[Edges_vertices].bind(); program->enableAttributeArray("vertex"); @@ -316,11 +321,13 @@ void Scene_points_with_normal_item_priv::initializeBuffers(CGAL::Three::Viewer_i static_cast(6*sizeof(CGAL_GL_data_type))); } item->buffers[Edges_vertices].release(); + program->disableAttributeArray("colors"); item->vaos[Selected_points]->release(); program->release(); if(item->has_normals()) { program = item->getShaderProgram(Scene_points_with_normal_item::PROGRAM_WITH_LIGHT, viewer); + program->bind(); item->vaos[Selected_shaded_points]->bind(); item->buffers[Edges_vertices].bind(); program->enableAttributeArray("vertex"); @@ -330,7 +337,7 @@ void Scene_points_with_normal_item_priv::initializeBuffers(CGAL::Three::Viewer_i static_cast(6*sizeof(CGAL_GL_data_type))); item->buffers[Edges_vertices].release(); - + program->disableAttributeArray("colors"); item->buffers[Selected_points_normals].bind(); item->buffers[Selected_points_normals].allocate(positions_selected_normals.data(), static_cast(positions_selected_normals.size()*sizeof(CGAL_data_type))); @@ -750,8 +757,8 @@ void Scene_points_with_normal_item::drawPoints(CGAL::Three::Viewer_interface* vi viewer->glPointSize(d->point_Slider->value()); double ratio_displayed = 1.0; if ((viewer->inFastDrawing () || d->isPointSliderMoving()) - &&((d->nb_points + d->nb_selected_points)/3 > limit_fast_drawing)) // arbitrary large value - ratio_displayed = 3 * limit_fast_drawing / (double)(d->nb_points + d->nb_selected_points); + &&((d->nb_points )/3 > limit_fast_drawing)) // arbitrary large value + ratio_displayed = 3 * limit_fast_drawing / (double)(d->nb_points); // POINTS if(has_normals() && renderingMode() == ShadedPoints) @@ -770,7 +777,7 @@ void Scene_points_with_normal_item::drawPoints(CGAL::Three::Viewer_interface* vi if (!(d->m_points->has_colors()) || renderingMode() == ShadedPoints) d->program->setAttributeValue("colors", this->color()); viewer->glDrawArrays(GL_POINTS, 0, - static_cast(((std::size_t)(ratio_displayed * d->nb_points)/3))); + static_cast(((std::size_t)(ratio_displayed * (d->nb_points - d->nb_selected_points))/3))); if(has_normals() && renderingMode() == ShadedPoints) vaos[Scene_points_with_normal_item_priv::TheShadedPoints]->release(); @@ -778,9 +785,7 @@ void Scene_points_with_normal_item::drawPoints(CGAL::Three::Viewer_interface* vi vaos[Scene_points_with_normal_item_priv::ThePoints]->release(); d->program->release(); - // SELECTED POINTS - vaos[Scene_points_with_normal_item_priv::Selected_points]->bind(); if(has_normals() && renderingMode() == ShadedPoints) { vaos[Scene_points_with_normal_item_priv::Selected_shaded_points]->bind(); @@ -794,12 +799,12 @@ void Scene_points_with_normal_item::drawPoints(CGAL::Three::Viewer_interface* vi attribBuffers(viewer,PROGRAM_NO_SELECTION); } d->program->bind(); - d->program->setAttributeValue("colors", QColor(255,0,0)); + d->program->setAttributeValue("colors", QColor(Qt::red)); viewer->glDrawArrays(GL_POINTS, 0, static_cast(((std::size_t)(ratio_displayed * d->nb_selected_points)/3))); if(has_normals() && renderingMode() == ShadedPoints) - vaos[Scene_points_with_normal_item_priv::Selected_shaded_points]->bind(); + vaos[Scene_points_with_normal_item_priv::Selected_shaded_points]->release(); else vaos[Scene_points_with_normal_item_priv::Selected_points]->release(); d->program->release(); @@ -885,7 +890,7 @@ QMenu* Scene_points_with_normal_item::contextMenu() { QMenu *container = new QMenu(tr("Normals Length")); QWidgetAction *sliderAction = new QWidgetAction(0); - if((d->nb_points + d->nb_selected_points)/3 <= limit_fast_drawing) + if((d->nb_points)/3 <= limit_fast_drawing) { connect(d->normal_Slider, &QSlider::valueChanged, this, &Scene_points_with_normal_item::invalidateOpenGLBuffers); connect(d->normal_Slider, &QSlider::valueChanged, this, &Scene_points_with_normal_item::itemChanged); From c675a2ee91f4ba3968284b1590b7b034be006a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 8 Aug 2017 11:07:41 +0200 Subject: [PATCH 5/6] fix incorrect link to figure and use italic instead of MathJax --- Spatial_sorting/doc/Spatial_sorting/Spatial_sorting.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Spatial_sorting/doc/Spatial_sorting/Spatial_sorting.txt b/Spatial_sorting/doc/Spatial_sorting/Spatial_sorting.txt index de7ec05449f..048b7559de5 100644 --- a/Spatial_sorting/doc/Spatial_sorting/Spatial_sorting.txt +++ b/Spatial_sorting/doc/Spatial_sorting/Spatial_sorting.txt @@ -64,7 +64,7 @@ Hilbert mapping Now given a set of 2D points, they can be sorted in the order they have on such a space filling curve. Note that at each step, we split a square exactly at its center; we call this -subdivision policy: \f$middle\f$ policy (see \cgalFigureRef{Spatial_sorting_fig_Hilbert_median}). +subdivision policy: middle policy (see \cgalFigureRef{Spatial_sorting_fig_Hilbert_middle}). \cgalFigureBegin{Spatial_sorting_fig_Hilbert_middle,Hilbert-middle.png} Hilbert sort with middle policy @@ -75,7 +75,7 @@ as above, we subdivide it by splitting at the median point (in \f$ x\f$ or \f$ y\f$ directions alternating), we construct a 2-d tree adapted to the point set. This tree can be visited in a similar manner and we get also a suitable ordering of the points; we call this -subdivision policy: \f$median\f$ policy (see \cgalFigureRef{Spatial_sorting_fig_Hilbert_median}). +subdivision policy: median policy (see \cgalFigureRef{Spatial_sorting_fig_Hilbert_median}). \cgalFigureBegin{Spatial_sorting_fig_Hilbert_median,Hilbert-median.png} Hilbert sort with median policy From 7e6a8ec739b1d514d0bdd81ca82087b13d77184f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 8 Aug 2017 13:37:02 +0200 Subject: [PATCH 6/6] fix unused variable warning --- .../test/Polynomial/test_polynomial_Get_arithmetic_kernel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polynomial/test/Polynomial/test_polynomial_Get_arithmetic_kernel.cpp b/Polynomial/test/Polynomial/test_polynomial_Get_arithmetic_kernel.cpp index 4e84d506d3e..2513660179d 100644 --- a/Polynomial/test/Polynomial/test_polynomial_Get_arithmetic_kernel.cpp +++ b/Polynomial/test/Polynomial/test_polynomial_Get_arithmetic_kernel.cpp @@ -4,7 +4,7 @@ template void test_get_arithmetic_kernel(){ - typedef typename AK::Integer Integer; + CGAL_assertion_code(typedef typename AK::Integer Integer); { CGAL_assertion_code(typedef CGAL::Polynomial POLY;) CGAL_assertion_code(typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel AK_;)