From 5c1ad941408f49e539c4b14d12c93afaf774ee20 Mon Sep 17 00:00:00 2001 From: Julian Stahl Date: Thu, 15 Sep 2022 18:09:26 +0200 Subject: [PATCH] Rename algorithms and use data_file_path --- Isosurfacing_3/benchmark/Isosurfacing_3/benchmark.cpp | 8 +++----- .../examples/Isosurfacing_3/all_cartesian_cube.cpp | 6 ++---- .../Isosurfacing_3/dual_contouring_cartesian_grid.cpp | 2 +- .../Isosurfacing_3/dual_contouring_implicit_iwp.cpp | 2 +- .../Isosurfacing_3/dual_contouring_mesh_offset.cpp | 4 ++-- .../examples/Isosurfacing_3/dual_contouring_octree.cpp | 2 +- .../marching_cubes_cartesian_grid_sphere.cpp | 2 +- .../Isosurfacing_3/marching_cubes_implicit_sphere.cpp | 2 +- .../examples/Isosurfacing_3/marching_cubes_inrimage.cpp | 4 ++-- .../Isosurfacing_3/marching_cubes_mesh_offset.cpp | 4 ++-- .../test/Isosurfacing_3/test_dual_contouring.cpp | 3 +-- .../test/Isosurfacing_3/test_marching_cubes.cpp | 3 +-- 12 files changed, 18 insertions(+), 24 deletions(-) diff --git a/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark.cpp b/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark.cpp index 833a5472523..d8f6ec2103f 100644 --- a/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark.cpp +++ b/Isosurfacing_3/benchmark/Isosurfacing_3/benchmark.cpp @@ -247,15 +247,13 @@ int main(int argc, char* argv[]) { #if defined ALGO_MARCHING_CUBES std::cout << "ALGO_MARCHING_CUBES" << std::endl; - CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes(scenario.domain(), scenario.iso(), points, - polygons); + CGAL::Isosurfacing::marching_cubes(scenario.domain(), scenario.iso(), points, polygons, false); #elif defined ALGO_DUAL_CONTOURING std::cout << "ALGO_DUAL_CONTOURING" << std::endl; - CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(scenario.domain(), scenario.iso(), points, polygons); + CGAL::Isosurfacing::dual_contouring(scenario.domain(), scenario.iso(), points, polygons); #else std::cout << "no algorithm selected!" << std::endl; - CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes(scenario.domain(), scenario.iso(), points, - polygons); + CGAL::Isosurfacing::marching_cubes(scenario.domain(), scenario.iso(), points, polygons); #endif const int64_t ms = timer.stop(); diff --git a/Isosurfacing_3/examples/Isosurfacing_3/all_cartesian_cube.cpp b/Isosurfacing_3/examples/Isosurfacing_3/all_cartesian_cube.cpp index 86d686fc117..79ac89e3182 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/all_cartesian_cube.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/all_cartesian_cube.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include typedef CGAL::Simple_cartesian Kernel; @@ -68,9 +67,8 @@ int main() { Polygon_range polygons_mc, polygons_tmc, polygons_dc; // execute marching cubes, topologically correct marching cubes and dual contouring with an isovalue of 0.8 - CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes(domain, 0.88, points_mc, polygons_mc); - CGAL::Isosurfacing::make_triangle_mesh_using_tmc(domain, 0.88, points_tmc, polygons_tmc); - CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(domain, 0.88, points_dc, polygons_dc); + CGAL::Isosurfacing::marching_cubes(domain, 0.88, points_mc, polygons_mc); + CGAL::Isosurfacing::dual_contouring(domain, 0.88, points_dc, polygons_dc); // save the results in the OFF format CGAL::IO::write_OFF("result_mc.off", points_mc, polygons_mc); diff --git a/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_cartesian_grid.cpp b/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_cartesian_grid.cpp index 66568f1f018..c4ad83a107a 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_cartesian_grid.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_cartesian_grid.cpp @@ -40,7 +40,7 @@ int main() { Point_range points; Polygon_range polygons; - CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(domain, 0.8, points, polygons); + CGAL::Isosurfacing::dual_contouring(domain, 0.8, points, polygons); CGAL::IO::write_OFF("result.off", points, polygons); } diff --git a/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_implicit_iwp.cpp b/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_implicit_iwp.cpp index 450efcce412..f40b5ade29a 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_implicit_iwp.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_implicit_iwp.cpp @@ -45,7 +45,7 @@ int main() { Polygon_range polygons; // execute marching cubes with an isovalue of 0 - CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(domain, 0.0f, points, polygons); + CGAL::Isosurfacing::dual_contouring(domain, 0.0f, points, polygons); // save the result in the OFF format CGAL::IO::write_OFF("result.off", points, polygons); diff --git a/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_mesh_offset.cpp b/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_mesh_offset.cpp index c976a4c6c12..866dd6a9b34 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_mesh_offset.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_mesh_offset.cpp @@ -25,7 +25,7 @@ typedef std::vector Point_range; typedef std::vector> Polygon_range; int main() { - const std::string input_name = "../../../data/bunny.off"; + const std::string input_name = CGAL::data_file_path("bunny.off"); const Vector grid_spacing(0.005, 0.005, 0.005); const FT offset_value = 0.01; @@ -65,7 +65,7 @@ int main() { Point_range points; Polygon_range polygons; - CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(domain, offset_value, points, polygons); + CGAL::Isosurfacing::dual_contouring(domain, offset_value, points, polygons); CGAL::IO::write_OFF("result.off", points, polygons); } diff --git a/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_octree.cpp b/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_octree.cpp index 6220f58e044..457839aa2c8 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_octree.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_octree.cpp @@ -87,7 +87,7 @@ int main() { Point_range points; Polygon_range polygons; - CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(octree_domain, 0.8, points, polygons); + CGAL::Isosurfacing::dual_contouring(octree_domain, 0.8, points, polygons); CGAL::IO::write_OFF("result.off", points, polygons); } diff --git a/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_cartesian_grid_sphere.cpp b/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_cartesian_grid_sphere.cpp index 897f7ce458c..a43fb409f48 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_cartesian_grid_sphere.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_cartesian_grid_sphere.cpp @@ -41,7 +41,7 @@ int main() { Polygon_range polygons; // execute marching cubes with an isovalue of 0.8 - CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes(domain, 0.8f, points, polygons); + CGAL::Isosurfacing::marching_cubes(domain, 0.8f, points, polygons); // save the result in the OFF format CGAL::IO::write_OFF("result.off", points, polygons); diff --git a/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_implicit_sphere.cpp b/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_implicit_sphere.cpp index 7b53dae8ab1..28ded19e538 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_implicit_sphere.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_implicit_sphere.cpp @@ -26,7 +26,7 @@ int main() { Polygon_range polygons; // execute marching cubes with an isovalue of 0.8 - CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes(domain, 0.8f, points, polygons); + CGAL::Isosurfacing::marching_cubes(domain, 0.8f, points, polygons); // save the result in the OFF format CGAL::IO::write_OFF("result.off", points, polygons); diff --git a/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_inrimage.cpp b/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_inrimage.cpp index 917dd62534a..e67b269a17d 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_inrimage.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_inrimage.cpp @@ -14,7 +14,7 @@ typedef std::vector> Polygon_range; int main() { - const std::string fname = "../../../data/skull_2.9.inr"; + const std::string fname = CGAL::data_file_path("skull_2.9.inr"); // TODO: get other examples with rights // load the image CGAL::Image_3 image; @@ -34,7 +34,7 @@ int main() { Polygon_range polygons; // execute marching cubes with an isovalue of 2.9 - CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes(domain, 2.9, points, polygons); + CGAL::Isosurfacing::marching_cubes(domain, 2.9, points, polygons); // save the result in the OFF format CGAL::IO::write_OFF("result.off", points, polygons); diff --git a/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_mesh_offset.cpp b/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_mesh_offset.cpp index e782337e111..851f85b125f 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_mesh_offset.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_mesh_offset.cpp @@ -35,7 +35,7 @@ inline Kernel::FT distance_to_mesh(const Tree& tree, const Point& p) { } int main() { - const std::string input_name = "../../../data/bunny.off"; + const std::string input_name = CGAL::data_file_path("bunny.off"); const int n_voxels = 20; const FT offset_value = -0.03; @@ -89,7 +89,7 @@ int main() { Polygon_range polygons; // execute marching cubes with an isovalue equal to the offset - CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes(domain, offset_value, points, polygons); + CGAL::Isosurfacing::marching_cubes(domain, offset_value, points, polygons); // save the result in the OFF format CGAL::IO::write_OFF("result.off", points, polygons); diff --git a/Isosurfacing_3/test/Isosurfacing_3/test_dual_contouring.cpp b/Isosurfacing_3/test/Isosurfacing_3/test_dual_contouring.cpp index 9d045540806..98d011f2b2a 100644 --- a/Isosurfacing_3/test/Isosurfacing_3/test_dual_contouring.cpp +++ b/Isosurfacing_3/test/Isosurfacing_3/test_dual_contouring.cpp @@ -72,8 +72,7 @@ int main() { { ScopeTimer timer; - CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(implicit_domain, 0.8f, points, - polygons); + CGAL::Isosurfacing::dual_contouring(implicit_domain, 0.8f, points, polygons); } // TODO: compare results with mesh_3 diff --git a/Isosurfacing_3/test/Isosurfacing_3/test_marching_cubes.cpp b/Isosurfacing_3/test/Isosurfacing_3/test_marching_cubes.cpp index 7f6553510c0..321711a1c04 100644 --- a/Isosurfacing_3/test/Isosurfacing_3/test_marching_cubes.cpp +++ b/Isosurfacing_3/test/Isosurfacing_3/test_marching_cubes.cpp @@ -13,8 +13,7 @@ struct Sphere_function { template void run(const Domain_& domain, const FT iso_value, Point_range& points, Polygon_range& polygons) { - CGAL::Isosurfacing::make_triangle_mesh_using_marching_cubes(domain, iso_value, points, - polygons); + CGAL::Isosurfacing::marching_cubes(domain, iso_value, points, polygons); } void test_implicit_sphere() {