From de2ed8094796a555e1dc09beba939c3fd4f8147b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 4 Jun 2018 16:23:34 +0100 Subject: [PATCH 1/3] Add a typedef Point Point_ to be used in a method definition --- .../include/CGAL/Delaunay_triangulation_3.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index 331a661c73d..cd53582a99c 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -104,6 +104,7 @@ public: typedef typename Tr_Base::Lock_data_structure Lock_data_structure; typedef typename Gt::Point_3 Point; + typedef typename Gt::Point_3 Point_; typedef typename Gt::Segment_3 Segment; typedef typename Gt::Triangle_3 Triangle; typedef typename Gt::Tetrahedron_3 Tetrahedron; @@ -182,12 +183,12 @@ public: protected: Oriented_side - side_of_oriented_sphere(const Point &p0, const Point &p1, const Point &p2, - const Point &p3, const Point &t, bool perturb = false) const; + side_of_oriented_sphere(const Point_ &p0, const Point_ &p1, const Point_ &p2, + const Point_ &p3, const Point_ &t, bool perturb = false) const; Bounded_side - coplanar_side_of_bounded_circle(const Point &p, const Point &q, - const Point &r, const Point &s, bool perturb = false) const; + coplanar_side_of_bounded_circle(const Point_ &p, const Point_ &q, + const Point_ &r, const Point_ &s, bool perturb = false) const; // for dual: Point @@ -1408,8 +1409,8 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point &p, template < class Gt, class Tds, class Lds > Oriented_side Delaunay_triangulation_3:: -side_of_oriented_sphere(const Point &p0, const Point &p1, const Point &p2, - const Point &p3, const Point &p, bool perturb) const +side_of_oriented_sphere(const Point_ &p0, const Point_ &p1, const Point_ &p2, + const Point_ &p3, const Point_ &p, bool perturb) const { CGAL_triangulation_precondition( orientation(p0, p1, p2, p3) == POSITIVE ); @@ -1450,8 +1451,8 @@ side_of_oriented_sphere(const Point &p0, const Point &p1, const Point &p2, template < class Gt, class Tds, class Lds > Bounded_side Delaunay_triangulation_3:: -coplanar_side_of_bounded_circle(const Point &p0, const Point &p1, - const Point &p2, const Point &p, bool perturb) const +coplanar_side_of_bounded_circle(const Point_ &p0, const Point_ &p1, + const Point_ &p2, const Point_ &p, bool perturb) const { // In dim==2, we should even be able to assert orient == POSITIVE. CGAL_triangulation_precondition( coplanar_orientation(p0, p1, p2) From 4f0e1243256d5e95c938d943ec15dd1e77c1a622 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 5 Jun 2018 12:56:11 +0100 Subject: [PATCH 2/3] Undo adding the _. Instead remove the typedef ... Point; --- .../Scene_edit_polyhedron_item.h | 3 --- .../include/CGAL/Delaunay_triangulation_3.h | 17 ++++++++--------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h index 63d178be327..a5eaf6a28d5 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h @@ -162,9 +162,6 @@ typedef CGAL::Surface_mesh_deformation > Deform_sm_mesh; -typedef Deform_mesh::Point Point; -typedef Deform_sm_mesh::Point SM_Point; - /// For storing associated data with a group of control vertices template class Control_vertices_data diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index cd53582a99c..331a661c73d 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -104,7 +104,6 @@ public: typedef typename Tr_Base::Lock_data_structure Lock_data_structure; typedef typename Gt::Point_3 Point; - typedef typename Gt::Point_3 Point_; typedef typename Gt::Segment_3 Segment; typedef typename Gt::Triangle_3 Triangle; typedef typename Gt::Tetrahedron_3 Tetrahedron; @@ -183,12 +182,12 @@ public: protected: Oriented_side - side_of_oriented_sphere(const Point_ &p0, const Point_ &p1, const Point_ &p2, - const Point_ &p3, const Point_ &t, bool perturb = false) const; + side_of_oriented_sphere(const Point &p0, const Point &p1, const Point &p2, + const Point &p3, const Point &t, bool perturb = false) const; Bounded_side - coplanar_side_of_bounded_circle(const Point_ &p, const Point_ &q, - const Point_ &r, const Point_ &s, bool perturb = false) const; + coplanar_side_of_bounded_circle(const Point &p, const Point &q, + const Point &r, const Point &s, bool perturb = false) const; // for dual: Point @@ -1409,8 +1408,8 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point &p, template < class Gt, class Tds, class Lds > Oriented_side Delaunay_triangulation_3:: -side_of_oriented_sphere(const Point_ &p0, const Point_ &p1, const Point_ &p2, - const Point_ &p3, const Point_ &p, bool perturb) const +side_of_oriented_sphere(const Point &p0, const Point &p1, const Point &p2, + const Point &p3, const Point &p, bool perturb) const { CGAL_triangulation_precondition( orientation(p0, p1, p2, p3) == POSITIVE ); @@ -1451,8 +1450,8 @@ side_of_oriented_sphere(const Point_ &p0, const Point_ &p1, const Point_ &p2, template < class Gt, class Tds, class Lds > Bounded_side Delaunay_triangulation_3:: -coplanar_side_of_bounded_circle(const Point_ &p0, const Point_ &p1, - const Point_ &p2, const Point_ &p, bool perturb) const +coplanar_side_of_bounded_circle(const Point &p0, const Point &p1, + const Point &p2, const Point &p, bool perturb) const { // In dim==2, we should even be able to assert orient == POSITIVE. CGAL_triangulation_precondition( coplanar_orientation(p0, p1, p2) From e354edc64bf28f0dae00f8732d1d18c54be201ea Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 5 Jun 2018 14:56:12 +0100 Subject: [PATCH 3/3] Replace Point by Point_3 in Surface_mesher demo --- Surface_mesher/demo/Surface_mesher/volume.cpp | 40 +++++++++---------- Surface_mesher/demo/Surface_mesher/volume.h | 4 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Surface_mesher/demo/Surface_mesher/volume.cpp b/Surface_mesher/demo/Surface_mesher/volume.cpp index 5f0d705bcf3..99ddc77ea88 100644 --- a/Surface_mesher/demo/Surface_mesher/volume.cpp +++ b/Surface_mesher/demo/Surface_mesher/volume.cpp @@ -769,9 +769,9 @@ void Volume::display_marchin_cube() const unsigned int nbt = facets.size() / 9; for(unsigned int i=begin;isearchSeedsCheckBox->isChecked()) { - typedef std::vector > Seeds; + typedef std::vector > Seeds; Seeds seeds; { std::cerr << "Search seeds...\n"; @@ -905,13 +905,13 @@ void Volume::display_surface_mesher_result() it != end; ++it) { seeds_out << it->first << std::endl; - CGAL::Random_points_on_sphere_3 random_points_on_sphere_3(it->second); + CGAL::Random_points_on_sphere_3 random_points_on_sphere_3(it->second); Oracle::Intersect_3 intersect = oracle.intersect_3_object(); for(int i = 0; i < 20; ++i) { - const Point test = it->first + (*random_points_on_sphere_3++ - CGAL::ORIGIN); + const Point_3 test = it->first + (*random_points_on_sphere_3++ - CGAL::ORIGIN); CGAL::Object o = intersect(surface, Segment_3(it->first, test)); - if (const Point* intersection = CGAL::object_cast(&o)) { + if (const Point_3* intersection = CGAL::object_cast(&o)) { segments_out << "2 " << it->first << " " << *intersection << std::endl; del.insert(*intersection); } @@ -1043,8 +1043,8 @@ void Volume::display_surface_mesher_result() const int index = fit->second; // here "left" means nothing - const Point left_circumcenter = cell->circumcenter(); - const Point right_circumcenter = cell->neighbor(index)->circumcenter(); + const Point_3 left_circumcenter = cell->circumcenter(); + const Point_3 right_circumcenter = cell->neighbor(index)->circumcenter(); const Triangle_3 t = Triangle_3(cell->vertex(del.vertex_triple_index(index, 0))->point(), @@ -1253,8 +1253,8 @@ void Volume::draw() end = del.finite_edges_end(); eit != end; ++eit) { - const Point p1 = eit->first->vertex(eit->second)->point(); - const Point p2 = eit->first->vertex(eit->third)->point(); + const Point_3 p1 = eit->first->vertex(eit->second)->point(); + const Point_3 p2 = eit->first->vertex(eit->third)->point(); ::glVertex3d(p1.x(),p1.y(),p1.z()); ::glVertex3d(p2.x(),p2.y(),p2.z()); } @@ -1354,9 +1354,9 @@ void Volume::gl_draw_surface() if(c2t3.face_status(facet_cell, facet_index) == C2t3::NOT_IN_COMPLEX) { continue; } - const Point& a = facet_cell->vertex(del.vertex_triple_index(facet_index, 0))->point(); - const Point& b = facet_cell->vertex(del.vertex_triple_index(facet_index, 1))->point(); - const Point& c = facet_cell->vertex(del.vertex_triple_index(facet_index, 2))->point(); + const Point_3& a = facet_cell->vertex(del.vertex_triple_index(facet_index, 0))->point(); + const Point_3& b = facet_cell->vertex(del.vertex_triple_index(facet_index, 1))->point(); + const Point_3& c = facet_cell->vertex(del.vertex_triple_index(facet_index, 2))->point(); Vector n = CGAL::cross_product(b-a,c-a); n = n / std::sqrt(n*n); // unit normal if(m_inverse_normals) { @@ -1443,9 +1443,9 @@ void Volume::gl_draw_surface() else continue; // go to next facet } - const Point& a = opposite_cell->vertex(del.vertex_triple_index(opposite_index, 0))->point(); - const Point& b = opposite_cell->vertex(del.vertex_triple_index(opposite_index, 1))->point(); - const Point& c = opposite_cell->vertex(del.vertex_triple_index(opposite_index, 2))->point(); + const Point_3& a = opposite_cell->vertex(del.vertex_triple_index(opposite_index, 0))->point(); + const Point_3& b = opposite_cell->vertex(del.vertex_triple_index(opposite_index, 1))->point(); + const Point_3& c = opposite_cell->vertex(del.vertex_triple_index(opposite_index, 2))->point(); Vector n = CGAL::cross_product(b-a,c-a); n = n / std::sqrt(n*n); // unit normal if(m_inverse_normals) { @@ -1492,9 +1492,9 @@ void Volume::gl_draw_surface(Iterator begin, Iterator end, const QTreeWidgetItem ::glNormal3d(n.x(),n.y(),n.z()); const Triangle_3& t = f.get<0>(); - const Point& a = t[0]; - const Point& b = t[1]; - const Point& c = t[2]; + const Point_3& a = t[0]; + const Point_3& b = t[1]; + const Point_3& c = t[2]; ::glVertex3d(a.x(),a.y(),a.z()); ::glVertex3d(b.x(),b.y(),b.z()); diff --git a/Surface_mesher/demo/Surface_mesher/volume.h b/Surface_mesher/demo/Surface_mesher/volume.h index 408cb6d71ee..293c34efa51 100644 --- a/Surface_mesher/demo/Surface_mesher/volume.h +++ b/Surface_mesher/demo/Surface_mesher/volume.h @@ -43,7 +43,7 @@ struct Kernel : public Kernel1 { }; typedef Kernel::FT FT; -typedef Kernel::Point_3 Point; +typedef Kernel::Point_3 Point_3; typedef Kernel::Sphere_3 Sphere; typedef Kernel::Vector_3 Vector; typedef Kernel::Triangle_3 Triangle_3; @@ -53,7 +53,7 @@ typedef Kernel::Segment_3 Segment_3; typedef boost::tuple Facet; -typedef CBinary_image_3 Binary_image; +typedef CBinary_image_3 Binary_image; class QTreeWidgetItem;