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..08f6d8c997d 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) @@ -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 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]; 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> diff --git a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp index 085d63abf76..9e8beb2e5a7 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() @@ -2098,5 +2100,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); 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()) 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: