From c74bca8d653e4c78977dc50ee7fdc8bdb4d095fc Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 23 Apr 2020 09:27:26 +0200 Subject: [PATCH] More errors and warnigns --- .../box_d_do_intersect_polylines.cpp | 24 ++++++------ .../test_repair_polygon_soup.cpp | 38 +++++++++---------- .../Point_set_item_classification.cpp | 2 +- .../PCA/Scene_facegraph_transform_item.cpp | 8 ++-- .../Surface_mesh/Parameterization_plugin.cpp | 20 +++++----- 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/Box_intersection_d/examples/Box_intersection_d/box_d_do_intersect_polylines.cpp b/Box_intersection_d/examples/Box_intersection_d/box_d_do_intersect_polylines.cpp index c5558b246f8..f026b909d3e 100644 --- a/Box_intersection_d/examples/Box_intersection_d/box_d_do_intersect_polylines.cpp +++ b/Box_intersection_d/examples/Box_intersection_d/box_d_do_intersect_polylines.cpp @@ -4,15 +4,15 @@ #include -template +template class Polylines_do_intersect { - typedef typename Polyline::const_iterator Iterator; + typedef typename Poly::const_iterator Iterator; typedef typename std::iterator_traits::value_type Point_2; typedef typename CGAL::Kernel_traits::Kernel::Segment_2 Segment_2; typedef CGAL::Bbox_2 Bbox_2; - const Polyline& pA, &pB; + const Poly& pA, &pB; struct Box : public CGAL::Box_intersection_d::Box_with_handle_d { @@ -31,9 +31,9 @@ class Polylines_do_intersect class Overlap { - const Polyline& pA, &pB; + const Poly& pA, &pB; public: - Overlap(const Polyline& pA, const Polyline& pB) + Overlap(const Poly& pA, const Poly& pB) : pA(pA), pB(pB) {} @@ -49,7 +49,7 @@ class Polylines_do_intersect public: - Polylines_do_intersect(const Polyline& pA, const Polyline& pB) + Polylines_do_intersect(const Poly& pA, const Poly& pB) : pA(pA), pB(pB) {} @@ -83,22 +83,22 @@ public: }; -template -bool polylines_do_intersect(const Polyline& pA,const Polyline& pB) +template +bool polylines_do_intersect(const Poly& pA,const Poly& pB) { - Polylines_do_intersect pdi(pA,pB); + Polylines_do_intersect pdi(pA,pB); return pdi(); } typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point_2; -typedef std::vector Polyline; +typedef std::vector CGAL_polyline; int main() { - Polyline pA = { Point_2(0,0), Point_2(1,0) }; - Polyline pB = { Point_2(0,0), Point_2(0,1), Point_2(2,1) , Point_2(1,0)}; + CGAL_polyline pA = { Point_2(0,0), Point_2(1,0) }; + CGAL_polyline pB = { Point_2(0,0), Point_2(0,1), Point_2(2,1) , Point_2(1,0)}; if(polylines_do_intersect(pA,pB)){ std::cout << "intersection" << std::endl; diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_repair_polygon_soup.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_repair_polygon_soup.cpp index eec039ec43e..dd1ac38d01a 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_repair_polygon_soup.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_repair_polygon_soup.cpp @@ -19,7 +19,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_3 Point_3; typedef CGAL::Surface_mesh Mesh; -typedef std::vector Polygon; +typedef std::vector CGAL_polygon; void test_polygon_canonicalization(const bool verbose = false) { @@ -34,8 +34,8 @@ void test_polygon_canonicalization(const bool verbose = false) points.push_back(Point_3(1,1,-2)); // #5 // empty - Polygon polygon; - Polygon canonical_polygon = PMP::internal::construct_canonical_polygon(points, polygon, K()); + CGAL_polygon polygon; + CGAL_polygon canonical_polygon = PMP::internal::construct_canonical_polygon(points, polygon, K()); assert(canonical_polygon.empty()); // 1 point @@ -76,7 +76,7 @@ void test_polygon_canonicalization(const bool verbose = false) // all cyclic permutations for(std::size_t i=0, end=polygon.size(); i points; - std::vector polygons; + std::vector polygons; // empty std::size_t res = PMP::merge_duplicate_points_in_polygon_soup(points, polygons); @@ -126,7 +126,7 @@ void test_merge_duplicate_points(const bool /*verbose*/ = false) points.push_back(Point_3(1,1,0)); // #5 // identical to #2 points.push_back(Point_3(0,0,0)); // #6 // idental to #0 - Polygon polygon; + CGAL_polygon polygon; polygon.push_back(0); polygon.push_back(1); polygon.push_back(2); polygons.push_back(polygon); @@ -146,7 +146,7 @@ void test_merge_duplicate_points(const bool /*verbose*/ = false) for(std::size_t i=0, psn=polygons.size(); i points; - std::vector polygons; + std::vector polygons; points.push_back(Point_3(0,0,0)); // #0 points.push_back(Point_3(1,0,0)); // #1 @@ -180,7 +180,7 @@ void test_merge_duplicate_polygons(const bool /*verbose*/ = false) // ------------------------------------------------------- // 1 polygon - Polygon polygon; + CGAL_polygon polygon; polygon.push_back(0); polygon.push_back(1); polygon.push_back(2); polygons.push_back(polygon); @@ -257,7 +257,7 @@ void test_merge_duplicate_polygons(const bool /*verbose*/ = false) assert(all_duplicate_polygons[0].size() == 2 && all_duplicate_polygons[1].size() == 3); // Keep one for each duplicate - std::vector polygons_copy(polygons); + std::vector polygons_copy(polygons); res = PMP::merge_duplicate_polygons_in_polygon_soup(points, polygons_copy, params::all_default()); assert(res == 3 && polygons_copy.size() == 3); @@ -281,7 +281,7 @@ void test_simplify_polygons(const bool /*verbose*/ = false) std::cout << "test simplify_polygons... " << std::endl; std::vector points; - std::vector polygons; + std::vector polygons; points.push_back(Point_3(0,0,0)); // #0 points.push_back(Point_3(1,2,0)); // #1 @@ -292,7 +292,7 @@ void test_simplify_polygons(const bool /*verbose*/ = false) points.push_back(Point_3(0,0,0)); // #6 // ------ - Polygon polygon; + CGAL_polygon polygon; polygon.push_back(0); polygon.push_back(2); polygon.push_back(4); polygons.push_back(polygon); @@ -355,13 +355,13 @@ void test_remove_invalid_polygons(const bool /*verbose*/ = false) // points are not actually needed since only the size of the polygons is considered std::vector points; - std::vector polygons; + std::vector polygons; std::size_t res = PMP::internal::remove_invalid_polygons_in_polygon_soup(points, polygons); assert(res == 0 && polygons.size() == 0); // non-trivial polygon - Polygon polygon; + CGAL_polygon polygon; polygon.push_back(0); polygon.push_back(2); polygon.push_back(4); polygons.push_back(polygon); @@ -431,7 +431,7 @@ void test_remove_isolated_points(const bool verbose = false) std::cout << "test remove_isolated_points... " << std::endl; std::vector points; - std::vector polygons; + std::vector polygons; // everything empty std::size_t res = test_remove_isolated_points_data_set(points, polygons, verbose); @@ -449,7 +449,7 @@ void test_remove_isolated_points(const bool verbose = false) res = test_remove_isolated_points_data_set(points_copy, polygons, verbose); assert(res == 6 && points_copy.empty() && polygons.empty()); - Polygon polygon; + CGAL_polygon polygon; polygon.push_back(0); polygon.push_back(2); polygon.push_back(4); polygons.push_back(polygon); @@ -467,7 +467,7 @@ void test_slit_pinched_polygons(const bool /*verbose*/ = false) std::cout << "test split_pinched_polygons... " << std::endl; std::vector points; - std::vector polygons; + std::vector polygons; // everything empty std::size_t res = PMP::internal::split_pinched_polygons_in_polygon_soup(points, polygons); @@ -481,7 +481,7 @@ void test_slit_pinched_polygons(const bool /*verbose*/ = false) points.push_back(Point_3(1,1,0)); // #5 // no pinch - Polygon polygon; + CGAL_polygon polygon; polygon.push_back(0); polygon.push_back(2); polygon.push_back(4); polygons.push_back(polygon); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp index bdca3ace2e5..b284a275a42 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp @@ -429,7 +429,7 @@ void Point_set_item_classification::change_color (int index, float* vmin, float* for (Point_set::const_iterator it = m_points->point_set()->begin(); it != m_points->point_set()->first_selected(); ++ it) { - float v = std::max (0.f, (std::min)(1.f, m_label_probabilities[corrected_index][*it])); + float v = (std::max)(0.f, (std::min)(1.f, m_label_probabilities[corrected_index][*it])); m_points->point_set()->set_color(*it, ramp.r(v) * 255, ramp.g(v) * 255, ramp.b(v) * 255); } } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.cpp index 83348567eec..71cc00c5933 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.cpp @@ -123,10 +123,10 @@ Scene_facegraph_transform_item::compute_bbox() const { ++it) { bbox = bbox + get(vpmap, *it).bbox(); } - CGAL::qglviewer::Vec min(bbox.xmin(),bbox.ymin(),bbox.zmin()); - CGAL::qglviewer::Vec max(bbox.xmax(),bbox.ymax(),bbox.zmax()); - setBbox(Bbox(min.x,min.y,min.z, - max.x,max.y,max.z)); + CGAL::qglviewer::Vec vmin(bbox.xmin(),bbox.ymin(),bbox.zmin()); + CGAL::qglviewer::Vec vmax(bbox.xmax(),bbox.ymax(),bbox.zmax()); + setBbox(Bbox(vmin.x,vmin.y,vmin.z, + vmax.x,vmax.y,vmax.z)); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp index 8a945f71d76..ba2a234e0fa 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp @@ -907,7 +907,7 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio } //end for each component QApplication::restoreOverrideCursor(); - QPointF min(FLT_MAX, FLT_MAX), max(-FLT_MAX, -FLT_MAX); + QPointF pmin(FLT_MAX, FLT_MAX), pmax(-FLT_MAX, -FLT_MAX); SMesh::Property_map umap; SMesh::Property_map vmap; @@ -926,14 +926,14 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio FT v = uv_pm[target(hd, sMesh)].y(); put(umap, *it, static_cast(u)); put(vmap, *it, static_cast(v)); - if(umax.x()) - max.setX(u); - if(vmax.y()) - max.setY(v); + if(upmax.x()) + pmax.setX(u); + if(vpmax.y()) + pmax.setY(v); } Components* components = new Components(0); @@ -948,7 +948,7 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio } Scene_textured_facegraph_item* new_item = new Scene_textured_facegraph_item(tMesh); - UVItem *projection = new UVItem(components,new_item->textured_face_graph(), uv_borders, QRectF(min, max)); + UVItem *projection = new UVItem(components,new_item->textured_face_graph(), uv_borders, QRectF(pmin, pmax)); projection->set_item_name(new_item_name); new_item->setName(new_item_name);