diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp index fa09b603654..e500ffb92a8 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp @@ -343,7 +343,7 @@ void Polyhedron_demo_polylines_io_plugin::simplify() { Scene_polylines_item* item = qobject_cast(scene->item(scene->mainSelectionIndex())); bool ok; - double err = QInputDialog::getDouble(mw, "Squared Frechet Distance", "Enter the squared approximation error:", pow(0.01*item->diagonalBbox(),2),0,999,8,&ok); + double err = QInputDialog::getDouble(mw, "Squared Frechet Distance", "Enter the squared approximation error:", pow(0.01*item->bboxDiagonal(),2),0,999,8,&ok); if(!ok) return; for(Scene_polylines_item::Polylines_container::iterator diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Extrude_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Extrude_plugin.cpp index 308bd503d95..caea10065a9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Extrude_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Extrude_plugin.cpp @@ -404,8 +404,8 @@ private Q_SLOTS: // compute centroid Point c = CGAL::centroid(triangles.begin(),triangles.end()); - oliver_queen = new Scene_arrow_item(Vec(c.x(),c.y(),c.z()), fg_item->diagonalBbox() / 50.0f, - fg_item->diagonalBbox()/3.0f); + oliver_queen = new Scene_arrow_item(Vec(c.x(),c.y(),c.z()), fg_item->bboxDiagonal() / 50.0f, + fg_item->bboxDiagonal()/3.0f); Vec dir(plane.orthogonal_vector().x(), plane.orthogonal_vector().y(), plane.orthogonal_vector().z()); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp index 1cae60b9a70..5ecc8921433 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp @@ -192,7 +192,7 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveNeedlesAndCaps_tri QDialog dialog; Ui::NeedleDialog ui; ui.setupUi(&dialog); - ui.collapseBox->setValue(sm_item->diagonalBbox()*0.01); + ui.collapseBox->setValue(sm_item->bboxDiagonal()*0.01); if(dialog.exec() != QDialog::Accepted) return; CGAL::Polygon_mesh_processing::remove_almost_degenerate_faces(*sm_item->face_graph(), diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp index fc344cec857..68a1fe2c6d3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp @@ -928,7 +928,7 @@ void Polyhedron_demo_point_set_shape_detection_plugin::on_actionDetectShapesSM_t dialog.m_cluster_epsilon_field->setEnabled(false); dialog.groupBox_3->setEnabled(false); //todo: check default values - dialog.m_epsilon_field->setValue(0.01*sm_item->diagonalBbox()); + dialog.m_epsilon_field->setValue(0.01*sm_item->bboxDiagonal()); std::size_t nb_faces = mesh->number_of_faces(); dialog.m_min_pts_field->setValue((std::max)(static_cast(0.01*nb_faces), 1)); if(!dialog.exec()) return; diff --git a/Polyhedron/demo/Polyhedron/Scene_item.cpp b/Polyhedron/demo/Polyhedron/Scene_item.cpp index 1951ee8ff7c..1b54ec52993 100644 --- a/Polyhedron/demo/Polyhedron/Scene_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_item.cpp @@ -22,7 +22,7 @@ CGAL::Three::Scene_item::Scene_item(int buffers_size, int vaos_size) CGAL::QGLViewer::QGLViewerPool().first()->makeCurrent(); is_bbox_computed = false; - is_diag_bbox_computed = false; + is_bbox_diag_computed = false; for(int i=0; iis_diag_bbox_computed) +double Scene_item_rendering_helper::bboxDiagonal() const { + if(!priv->is_bbox_diag_computed) priv->compute_diag_bbox(); - priv->is_diag_bbox_computed = true; + priv->is_bbox_diag_computed = true; return priv->_diag_bbox; } diff --git a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp index 7ad2931f252..75bea895cfa 100644 --- a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp @@ -321,7 +321,7 @@ void Scene_points_with_normal_item_priv::compute_normals_and_vertices() const positions_selected_normals.resize(m_points->nb_selected_points() * 3); // we can't afford computing real average spacing just for display, 0.5% of bbox will do - average_spacing = 0.005 * item->diagonalBbox(); + average_spacing = 0.005 * item->bboxDiagonal(); normal_length = (std::min)(average_spacing, std::sqrt( region_of_interest.squared_radius() / 1000.)); length_factor = 10.0/100*normal_Slider->value(); diff --git a/Three/include/CGAL/Three/Scene_item.h b/Three/include/CGAL/Three/Scene_item.h index f22b9be5f52..ca65c413f3c 100644 --- a/Three/include/CGAL/Three/Scene_item.h +++ b/Three/include/CGAL/Three/Scene_item.h @@ -187,11 +187,11 @@ public: //! If the diagonal's length has never been computed, computes it and //! saves the result for further calls. //! @returns the item's bounding box's diagonal length. - virtual double diagonalBbox() const { - if(!is_diag_bbox_computed) - compute_diag_bbox(); - is_diag_bbox_computed = true; - return _diag_bbox; + virtual double bboxDiagonal() const { + if(!is_bbox_diag_computed) + compute_diag_bbox(); + is_bbox_diag_computed = true; + return _diag_bbox; } // Function about manipulation @@ -413,7 +413,7 @@ protected: mutable Bbox _bbox; mutable double _diag_bbox; mutable bool is_bbox_computed; - mutable bool is_diag_bbox_computed; + mutable bool is_bbox_diag_computed; virtual void compute_bbox()const{} virtual void compute_diag_bbox()const; // The four basic properties diff --git a/Three/include/CGAL/Three/Scene_item_rendering_helper.h b/Three/include/CGAL/Three/Scene_item_rendering_helper.h index f654139c2a6..72fd4ce154a 100644 --- a/Three/include/CGAL/Three/Scene_item_rendering_helper.h +++ b/Three/include/CGAL/Three/Scene_item_rendering_helper.h @@ -174,7 +174,7 @@ public: //! saves the result for further calls. //! @returns the item's bounding box's diagonal length. //! @todo must replace the one from Scene_item eventually - virtual double diagonalBbox() const Q_DECL_OVERRIDE; + virtual double bboxDiagonal() const Q_DECL_OVERRIDE; //! //! \brief newViewer adds Vaos for `viewer`. //! \param viewer the new viewer.