From 49e37f31b82eaf19a3d5bcc1c8b00f37ab7941af Mon Sep 17 00:00:00 2001 From: Nico Kruithof Date: Thu, 26 Oct 2006 18:57:24 +0000 Subject: [PATCH] The tests are working, if they finish in time ... --- .../NGHK_skin_surface_subdiv.cpp | 6 ++-- Skin_surface_3/include/CGAL/Skin_surface_3.h | 2 ++ .../CGAL/Skin_surface_quadratic_surface_3.h | 36 +++++++++---------- .../test/Skin_surface_3/degenerate_test.C | 2 +- .../test/Skin_surface_3/subdivision_test.C | 4 +-- .../test/Skin_surface_3/surface_test.C | 20 +++++------ 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Skin_surface_3/examples/Skin_surface_3/NGHK_skin_surface_subdiv.cpp b/Skin_surface_3/examples/Skin_surface_3/NGHK_skin_surface_subdiv.cpp index e3128cba1c8..69f7be8cd76 100644 --- a/Skin_surface_3/examples/Skin_surface_3/NGHK_skin_surface_subdiv.cpp +++ b/Skin_surface_3/examples/Skin_surface_3/NGHK_skin_surface_subdiv.cpp @@ -15,7 +15,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Skin_surface_traits_3 Traits; typedef CGAL::Skin_surface_3 Skin_surface_3; -typedef Skin_surface_3::RT RT; +typedef Skin_surface_3::FT FT; typedef Skin_surface_3::Weighted_point Weighted_point; typedef Weighted_point::Point Bare_point; typedef CGAL::Polyhedron_3 l; - RT shrinkfactor = 0.5; + FT shrinkfactor = 0.5; Weighted_point wp; std::ifstream in(argv[1]); @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) { std::cout << "Is closed: " << (p.is_closed() ? "Yes" : "No") << std::endl; std::ofstream out("mesh.off"); - write_polyhedron_with_normals(p, skin_surface, out); + write_polyhedron_with_normals(skin_surface, p, out); // out << p; return 0; diff --git a/Skin_surface_3/include/CGAL/Skin_surface_3.h b/Skin_surface_3/include/CGAL/Skin_surface_3.h index f524e4f8056..8dda8e1384e 100644 --- a/Skin_surface_3/include/CGAL/Skin_surface_3.h +++ b/Skin_surface_3/include/CGAL/Skin_surface_3.h @@ -256,6 +256,7 @@ private: return CMCT_Cell(); } +public: Simplex locate_mixed(const Bare_point &p, const Simplex &start = Simplex()) const; @@ -545,6 +546,7 @@ private: // NGHK: Make adaptive return 1; } +public: const Regular &get_regular_triangulation() const { return regular; } diff --git a/Skin_surface_3/include/CGAL/Skin_surface_quadratic_surface_3.h b/Skin_surface_3/include/CGAL/Skin_surface_quadratic_surface_3.h index f11c75b5d3f..7891bbf6a9f 100644 --- a/Skin_surface_3/include/CGAL/Skin_surface_quadratic_surface_3.h +++ b/Skin_surface_3/include/CGAL/Skin_surface_quadratic_surface_3.h @@ -26,24 +26,24 @@ template < class SkinSurfaceQuadraticSurfaceTraits_3 > class Skin_surface_quadratic_surface_3 { public: typedef SkinSurfaceQuadraticSurfaceTraits_3 K; - typedef typename K::RT RT; + typedef typename K::FT FT; typedef typename K::Point_3 Point; typedef typename K::Vector_3 Vector; typedef typename K::Segment_3 Segment; - typedef Weighted_point Weighted_point; + typedef Weighted_point Weighted_point; Skin_surface_quadratic_surface_3() : dim(-1), p(0,0,0), c(0) { for (int i=0; i<6; i++) Q[i] = 0; } - Skin_surface_quadratic_surface_3(RT Qinput[], Point p, RT c, int d) + Skin_surface_quadratic_surface_3(FT Qinput[], Point p, FT c, int d) : dim(10+d), p(p), c(c) { for (int i=0; i<6; i++) Q[i] = Qinput[i]; } int dim; - Skin_surface_quadratic_surface_3(Weighted_point wp0, RT s) + Skin_surface_quadratic_surface_3(Weighted_point wp0, FT s) : dim(0), p(wp0.point()), c(-s*(1-s)*wp0.weight()) { CGAL_PROFILER(std::string("Constructor : ") + @@ -53,7 +53,7 @@ public: } Skin_surface_quadratic_surface_3(Weighted_point wp0, Weighted_point wp1, - RT s) : dim(1) + FT s) : dim(1) { CGAL_PROFILER(std::string("Constructor : ") + std::string(CGAL_PRETTY_FUNCTION)); @@ -62,7 +62,7 @@ public: c = s*(1-s)*reg_traits.compute_squared_radius_smallest_orthogonal_sphere_3_object()(wp0,wp1); Vector t = wp0-wp1; - RT den = t*t; + FT den = t*t; Q[0] = (- t.x()*t.x()/den + (1-s)); Q[1] = (-2*t.y()*t.x()/den); @@ -76,7 +76,7 @@ public: Skin_surface_quadratic_surface_3(Weighted_point wp0, Weighted_point wp1, Weighted_point wp2, - RT s) : dim(2) + FT s) : dim(2) { CGAL_PROFILER(std::string("Constructor : ") + std::string(CGAL_PRETTY_FUNCTION)); @@ -86,7 +86,7 @@ public: Vector t = K().construct_orthogonal_vector_3_object()(wp0,wp1,wp2); - RT den = t*t; + FT den = t*t; Q[0] = -(- t.x()*t.x()/den + s); Q[1] = -(-2*t.y()*t.x()/den); @@ -101,7 +101,7 @@ public: Weighted_point wp1, Weighted_point wp2, Weighted_point wp3, - RT s) : dim(3) + FT s) : dim(3) { CGAL_PROFILER(std::string("Constructor : ") + std::string(CGAL_PRETTY_FUNCTION)); @@ -113,12 +113,12 @@ public: } template - RT value(Input_point const &x) const { + FT value(Input_point const &x) const { typedef Cartesian_converter Converter; - RT vx = Converter()(x.x()) - p.x(); - RT vy = Converter()(x.y()) - p.y(); - RT vz = Converter()(x.z()) - p.z(); + FT vx = Converter()(x.x()) - p.x(); + FT vy = Converter()(x.y()) - p.y(); + FT vz = Converter()(x.z()) - p.z(); return vx*(Q[0]*vx) + @@ -172,18 +172,18 @@ private: //template Vector compute_gradient(Point const &x) { - RT vx = x.x() - p.x(); - RT vy = x.y() - p.y(); - RT vz = x.z() - p.z(); + FT vx = x.x() - p.x(); + FT vy = x.y() - p.y(); + FT vz = x.z() - p.z(); return Vector(2*Q[0]*vx + Q[1]*vy + Q[3]*vz, Q[1]*vx + 2*Q[2]*vy + Q[4]*vz, Q[3]*vx + Q[4]*vy + 2*Q[5]*vz); } - RT Q[6]; + FT Q[6]; Point p; - RT c; + FT c; }; CGAL_END_NAMESPACE diff --git a/Skin_surface_3/test/Skin_surface_3/degenerate_test.C b/Skin_surface_3/test/Skin_surface_3/degenerate_test.C index 81e304349aa..957971f370d 100644 --- a/Skin_surface_3/test/Skin_surface_3/degenerate_test.C +++ b/Skin_surface_3/test/Skin_surface_3/degenerate_test.C @@ -11,7 +11,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Skin_surface_traits_3 Traits; typedef CGAL::Skin_surface_3 Skin_surface_3; -typedef Skin_surface_3::RT RT; +typedef Skin_surface_3::FT FT; typedef Skin_surface_3::Weighted_point Weighted_point; typedef Weighted_point::Point Bare_point; typedef CGAL::Polyhedron_3 Polyhedron; diff --git a/Skin_surface_3/test/Skin_surface_3/subdivision_test.C b/Skin_surface_3/test/Skin_surface_3/subdivision_test.C index cf279d29d07..a0a59f38556 100644 --- a/Skin_surface_3/test/Skin_surface_3/subdivision_test.C +++ b/Skin_surface_3/test/Skin_surface_3/subdivision_test.C @@ -11,7 +11,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Skin_surface_traits_3 Traits; typedef CGAL::Skin_surface_3 Skin_surface_3; -typedef Skin_surface_3::RT RT; +typedef Skin_surface_3::FT FT; typedef Skin_surface_3::Weighted_point Weighted_point; typedef Weighted_point::Point Bare_point; typedef CGAL::Polyhedron_3 Polyhedron; @@ -38,7 +38,7 @@ void construct_and_subdivide_mesh(Skin_surface_3 &skin_surface, CGAL::mesh_skin_surface_3(skin_surface, polyhedron); CGAL_assertion(polyhedron.is_valid() && polyhedron.is_closed()); - CGAL::subdivide_skin_surface_mesh_3(polyhedron, skin_surface); + CGAL::subdivide_skin_surface_mesh_3(skin_surface, polyhedron); CGAL_assertion(polyhedron.is_valid() && polyhedron.is_closed()); } diff --git a/Skin_surface_3/test/Skin_surface_3/surface_test.C b/Skin_surface_3/test/Skin_surface_3/surface_test.C index 832f480f0ba..332f23c5f47 100644 --- a/Skin_surface_3/test/Skin_surface_3/surface_test.C +++ b/Skin_surface_3/test/Skin_surface_3/surface_test.C @@ -12,7 +12,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Inexact_K; typedef CGAL::Skin_surface_traits_3 Traits; typedef CGAL::Skin_surface_3 Skin_surface_3; typedef Skin_surface_3::Simplex Simplex; -typedef Skin_surface_3::RT RT; +typedef Skin_surface_3::FT FT; typedef Skin_surface_3::Weighted_point Weighted_point; typedef Weighted_point::Point Bare_point; typedef CGAL::Polyhedron_3 Polyhedron; @@ -22,12 +22,10 @@ typedef CGAL::Skin_surface_quadratic_surface_3 Quadratic_surface; CGAL::Cartesian_converter e2i_converter; CGAL::Cartesian_converter i2e_converter; -typedef CGAL::Triangulation_3< - Exact_K, - CGAL::Triangulation_data_structure_3 - < CGAL::Triangulated_mixed_complex_vertex_3, - CGAL::Triangulated_mixed_complex_cell_3 > - > Triangulated_mixed_complex; +typedef CGAL::Triangulation_vertex_base_with_info_3 Vb; +typedef CGAL::Triangulation_cell_base_with_info_3 Cb; +typedef CGAL::Triangulation_data_structure_3 Tds; +typedef CGAL::Triangulation_3 Triangulated_mixed_complex; //typedef Skin_surface_3::Triangulated_mixed_complex Triangulated_mixed_complex; typedef Triangulated_mixed_complex::Vertex_handle Tmc_Vertex_handle; typedef Triangulated_mixed_complex::Finite_vertices_iterator @@ -63,14 +61,14 @@ public: if (tmc.is_infinite(vit->cell())) { std::cerr << "ERROR: is_infinite (main)" << std::endl; } - Quadratic_surface::RT val = vit->cell()->surf->value(vit->point()); + Quadratic_surface::FT val = vit->cell()->info()->value(vit->point()); std::list cells; tmc.incident_cells(vit, std::back_inserter(cells)); for (std::list::iterator cell = cells.begin(); cell != cells.end(); cell++) { if (!tmc.is_infinite(*cell)) { - Quadratic_surface::RT val2 = (*cell)->surf->value(vit->point()); + Quadratic_surface::FT val2 = (*cell)->info()->value(vit->point()); CGAL_assertion(val == val2); } } @@ -84,9 +82,9 @@ public: (cit->vertex(2)->point()-cit->vertex(0)->point())/4 + (cit->vertex(3)->point()-cit->vertex(0)->point())/4); if (tmc.tetrahedron(cit).has_on_bounded_side(i2e_converter(baryc))) { - Quadratic_surface::RT val1 = cit->surf->value(i2e_converter(baryc)); + Quadratic_surface::FT val1 = cit->info()->value(i2e_converter(baryc)); Simplex s = skin_surface.locate_mixed(baryc); - Quadratic_surface::RT val2 = + Quadratic_surface::FT val2 = skin_surface.construct_surface(s, Exact_K()).value(i2e_converter(baryc)); // std::cout << val1 << " " << val2 << " " << val2-val1 << std::endl; CGAL_assertion(val1==val2);