From 83ed34b6f2b121abf345380590e2c2cc43359964 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 2 Jun 2020 16:04:53 +0200 Subject: [PATCH 1/7] reduce limit for triggering offset --- 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 ee2274122fe..3951ba10c1c 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -1027,7 +1027,7 @@ void MainWindow::computeViewerBBox(CGAL::qglviewer::Vec& vmin, CGAL::qglviewer:: double l_dist = (std::max)((std::abs)(bbox_center.x - viewer->offset().x), (std::max)((std::abs)(bbox_center.y - viewer->offset().y), (std::abs)(bbox_center.z - viewer->offset().z))); - if((std::log2)(l_dist/bbox_diag) > 13.0 ) + if((std::log2)(l_dist/bbox_diag) > 11.0 ) for(int i=0; i<3; ++i) { offset[i] = -bbox_center[i]; From dac2ad159e4924a281225f05e8ef215072ec5fcf Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 2 Jun 2020 16:08:30 +0200 Subject: [PATCH 2/7] Fix path in partition --- .../Plugins/Operations_on_polyhedra/PartitionDialog.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/PartitionDialog.ui b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/PartitionDialog.ui index 1c939c87a9c..91f3b989f8a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/PartitionDialog.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/PartitionDialog.ui @@ -67,7 +67,7 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tip: To split your mesh according to the result of this operation, you can click on </p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Operations-&gt;Operations on Polyhedra-&gt;Split Selected Polyhedra</span></p></body></html> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Operations-&gt;Polygon Mesh Processing-&gt;Split Selected Polyhedra</span></p></body></html> From 8adf6511ffbc6e4c85d3399bb74648636dd0c39a Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 3 Jun 2020 09:31:46 +0200 Subject: [PATCH 3/7] Fix Polygon soup description --- Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp index dfe4f2898f5..e4d61b95ef9 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp @@ -512,7 +512,7 @@ Scene_polygon_soup_item::toolTip() const return QString(); QString str = QObject::tr("

%1 (mode: %5, color: %6)
" - "Polygons soup

" + "Polygon soup

" "

Number of vertices: %2
" "Number of polygons: %3

") .arg(this->name()) From ee4f996043e752ef00c64a369929a1c5a93e0680 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 3 Jun 2020 11:24:18 +0200 Subject: [PATCH 4/7] Add a clone to the c3t3 and fix an error in the cutting plane orientation --- Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp | 12 ++++++++++-- Polyhedron/demo/Polyhedron/Scene_c3t3_item.h | 5 ++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp index 01c192db153..1595716a2c9 100644 --- a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp @@ -157,7 +157,7 @@ public : const EPICK::Plane_3& plane = qobject_cast(this->parent())->plane(); float shrink_factor = qobject_cast(this->parent())->getShrinkFactor(); QVector4D cp = cgal_plane_to_vector4d(plane); - getTriangleContainer(0)->setPlane(cp); + getTriangleContainer(0)->setPlane(-cp); getTriangleContainer(0)->setShrinkFactor(shrink_factor); // positions_poly is also used for the faces in the cut plane // and changes when the cut plane is moved @@ -569,8 +569,10 @@ Scene_c3t3_item::Scene_c3t3_item(const C3t3& c3t3, bool is_surface) : Scene_group_item("unnamed") , d(new Scene_c3t3_item_priv(c3t3, this)) { - d->reset_cut_plane(); common_constructor(is_surface); + d->reset_cut_plane(); + c3t3_changed(); + changed(); } Scene_c3t3_item::~Scene_c3t3_item() @@ -2097,5 +2099,11 @@ void Scene_c3t3_item::newViewer(Viewer_interface *viewer) d->computeIntersections(viewer); } } + +Scene_c3t3_item* Scene_c3t3_item::clone() const +{ + return new Scene_c3t3_item(d->c3t3, d->is_surface); +} + #include "Scene_c3t3_item.moc" diff --git a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.h b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.h index 1c2e4316451..90b02e87c7b 100644 --- a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.h @@ -101,9 +101,8 @@ public: { return Scene_item::bbox(); } - Scene_c3t3_item* clone() const Q_DECL_OVERRIDE{ - return 0; - } + + Scene_c3t3_item* clone() const Q_DECL_OVERRIDE; bool load_binary(std::istream& is); From 9551708e88667b7d27121a2ec7ea3388c41c8090 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 3 Jun 2020 15:02:58 +0200 Subject: [PATCH 5/7] Fix crash in skeletonization --- Three/include/CGAL/Three/Scene_group_item.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Three/include/CGAL/Three/Scene_group_item.h b/Three/include/CGAL/Three/Scene_group_item.h index 3f46883a8c7..626e69240ab 100644 --- a/Three/include/CGAL/Three/Scene_group_item.h +++ b/Three/include/CGAL/Three/Scene_group_item.h @@ -245,8 +245,12 @@ public Q_SLOTS: { for(int i = 0; i < children.size(); ++i) { - if(children[i] >= removed_id) + if(children[i] > removed_id) --children[i]; + else if(children[i] == removed_id)//child has been removed from the scene, it doesn't exist anymore. + { + children.removeAll(removed_id); + } } } private: From 05c36b37ec768f1e1a7aa6684422c9a3bddd1b0d Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 3 Jun 2020 17:13:39 +0200 Subject: [PATCH 6/7] clean-up --- .../include/CGAL/Polygon_mesh_processing/distance.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h index de1b924c658..d85c07a8566 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h @@ -29,7 +29,7 @@ #include #ifdef CGAL_LINKED_WITH_TBB -#include "tbb/parallel_reduce.h" +#include #include #include #endif // CGAL_LINKED_WITH_TBB @@ -82,7 +82,7 @@ struct Distance_computation{ const PointRange& sample_points; Point_3 initial_hint; double distance; - //constro + //constructor Distance_computation( const AABB_tree& tree, const Point_3& p, @@ -92,7 +92,7 @@ struct Distance_computation{ , initial_hint(p) , distance(-1) {} - //split constro + //split constructor Distance_computation(Distance_computation& s, tbb::split ) : tree(s.tree) , sample_points(s.sample_points) From 45343e39a001d2dbbf3155ccfb4fd45f40a55705 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 4 Jun 2020 09:55:23 +0200 Subject: [PATCH 7/7] Protect std::max --- .../include/CGAL/Polygon_mesh_processing/distance.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h index d85c07a8566..08f6d8c997d 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h @@ -117,7 +117,7 @@ struct Distance_computation{ distance = hdist; } - void join( Distance_computation& rhs ) {distance = std::max(rhs.distance, distance); } + void join( Distance_computation& rhs ) {distance = (std::max)(rhs.distance, distance); } }; #endif