From bd7fd4a91e3eb8fb1c616c19206221ff962732ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 5 Jun 2019 10:39:08 +0200 Subject: [PATCH] Clean useless code --- .../mesh_smoothing_example.cpp | 4 - .../Polygon_mesh_processing/smooth_shape.h | 89 ------------------- .../test_shape_smoothing.cpp | 28 ------ 3 files changed, 121 deletions(-) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_smoothing_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_smoothing_example.cpp index 3862a785c3e..87f5704476c 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_smoothing_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_smoothing_example.cpp @@ -6,8 +6,6 @@ #include #include -#include "glog/logging.h" - #include #include @@ -18,8 +16,6 @@ namespace PMP = CGAL::Polygon_mesh_processing; int main(int argc, char** argv) { - google::InitGoogleLogging(argv[0]); - const char* filename = argc > 1 ? argv[1] : "data/grid.off"; std::ifstream input(filename); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h index a7af4d0b5a1..a6935440483 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h @@ -246,95 +246,6 @@ void smooth_along_curvature_flow(TriangleMesh& tmesh, smooth_along_curvature_flow(faces(tmesh), tmesh, time, parameters::all_default()); } -namespace internal { - -// @todo clean that if it's useless -template -void solve_mcf(const FaceRange& faces, - TriangleMesh& tmesh, - const double time, - std::vector >& stiffness, - bool compute_stiffness, - const NamedParameters& np) -{ - using boost::choose_param; - using boost::get_param; - - typedef typename GetGeomTraits::type GeomTraits; - - typedef typename GetVertexPointMap::type VertexPointMap; - VertexPointMap vpmap = choose_param(get_param(np, internal_np::vertex_point), - get_property_map(CGAL::vertex_point, tmesh)); - - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::lookup_named_param_def < - internal_np::vertex_is_constrained_t, - NamedParameters, - Constant_property_map - > ::type VCMap; - VCMap vcmap = choose_param(get_param(np, internal_np::vertex_is_constrained), - Constant_property_map(false)); - - // nb_iterations - std::size_t nb_iterations = choose_param(get_param(np, internal_np::number_of_iterations), 1); - -#if defined(CGAL_EIGEN3_ENABLED) - #if EIGEN_VERSION_AT_LEAST(3,2,0) - typedef typename Eigen::SparseMatrix Eigen_sparse_matrix; - typedef typename Eigen::BiCGSTAB > Eigen_solver; - typedef CGAL::Eigen_solver_traits Default_solver; - #else - typedef bool Default_solver;//compilation should crash - //if no solver is provided and Eigen version < 3.2 - #endif -#else - typedef bool Default_solver;//compilation should crash - //if no solver is provided and Eigen version < 3.2 -#endif - -#if defined(CGAL_EIGEN3_ENABLED) - CGAL_static_assertion_msg( - (!boost::is_same::type, bool>::value) || EIGEN_VERSION_AT_LEAST(3, 2, 0), - "Eigen3 version 3.2 or later is required."); -#else - CGAL_static_assertion_msg( - (!boost::is_same::type, bool>::value), - "Eigen3 version 3.2 or later is required."); -#endif - - typedef typename GetSolver::type Sparse_solver; - typedef typename Sparse_solver::Matrix Eigen_matrix; - typedef typename Sparse_solver::Vector Eigen_vector; - Sparse_solver solver = choose_param(get_param(np, internal_np::sparse_linear_solver), Default_solver()); - - std::size_t n = vertices(tmesh).size(); - - Eigen_matrix A(n, n); - Eigen_vector bx(n), by(n), bz(n), Xx(n), Xy(n), Xz(n); - - if(compute_stiffness) - { - internal::Shape_smoother smoother(tmesh, vpmap, vcmap); - - smoother.init_smoothing(faces); - smoother.calculate_stiffness_matrix_elements(stiffness); - } - else - { - internal::Shape_smoother smoother(tmesh, vpmap, vcmap); - - smoother.init_smoothing(faces); - - for(std::size_t i=0; i -void test_demo_helpers(Mesh mesh) -{ -#ifdef CGAL_PMP_SMOOTHING_VERBOSE - std::cout << "-- test_demo_helpers --" << std::endl; -#endif - - const double time_step = 1e-2; - std::vector > stiffness; - - bool compute_stiffness = true; - PMP::internal::solve_mcf(faces(mesh), mesh, time_step, - stiffness, compute_stiffness, - CGAL::parameters::all_default()); - - compute_stiffness = false; - PMP::internal::solve_mcf(faces(mesh), mesh, time_step, - stiffness, compute_stiffness, - CGAL::parameters::all_default()); - -#ifdef CGAL_PMP_SMOOTHING_VERBOSE - std::ofstream out("output_devil_demo_helpers.off"); - out << mesh; - out.close(); -#endif -} - int main(int, char**) { const char* filename_devil = "data/mannequin-devil.off"; @@ -214,7 +187,6 @@ int main(int, char**) } input2.close(); - test_demo_helpers(mesh_devil); test_curvature_flow_time_step(mesh_devil); test_curvature_flow(mesh_pyramid); test_implicit_constrained_pyramid(mesh_pyramid);