Merge pull request #1862 from sloriot/PMP-no_PSP_dependency

remove dependancy to PSP
This commit is contained in:
Sebastien Loriot 2017-01-30 15:54:05 +01:00 committed by GitHub
commit f78edd214d
4 changed files with 44 additions and 14 deletions

View File

@ -25,8 +25,9 @@
#include <CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h>
#ifdef CGAL_PMP_HOLE_FILLING_DEBUG
#include <CGAL/Timer.h>
#include <CGAL/trace.h>
#endif
#include <CGAL/boost/graph/iterator.h>
#include <CGAL/boost/graph/Euler_operations.h>
#include <vector>
@ -111,7 +112,9 @@ triangulate_hole_polygon_mesh(PolygonMesh& pmesh,
typedef std::map<vertex_descriptor, int> Vertex_map;
typedef typename Vertex_map::iterator Vertex_map_it;
#ifdef CGAL_PMP_HOLE_FILLING_DEBUG
CGAL::Timer timer; timer.start();
#endif
std::vector<Point_3> P, Q;
std::vector<halfedge_descriptor> P_edges;
@ -186,7 +189,9 @@ triangulate_hole_polygon_mesh(PolygonMesh& pmesh,
#endif
;
CGAL_TRACE_STREAM << "Hole filling: " << timer.time() << " sc." << std::endl; timer.reset();
#ifdef CGAL_PMP_HOLE_FILLING_DEBUG
std:cerr << "Hole filling: " << timer.time() << " sc." << std::endl; timer.reset();
#endif
return std::make_pair(tracer.out, weight);
}

View File

@ -28,7 +28,6 @@
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
#include <CGAL/iterator.h>
#include <CGAL/trace.h>
#include <CGAL/use.h>
#include <CGAL/Kernel/global_functions_3.h>
#include <CGAL/squared_distance_3.h>
@ -1229,7 +1228,9 @@ triangulate_hole_polyline(const PointRange1& points,
typename WeightCalculator::Weight w = use_delaunay_triangulation ?
Fill_DT().operator()(P,Q,tracer,WC) :
Fill().operator()(P,Q,tracer,WC);
CGAL_TRACE_STREAM << w << std::endl;
#ifdef CGAL_PMP_HOLE_FILLING_DEBUG
std::cerr << w << std::endl;
#endif
return w;
}

View File

@ -28,8 +28,9 @@
#include <set>
#include <CGAL/assertions.h>
#include <CGAL/Polygon_mesh_processing/Weights.h>
#ifdef CGAL_PMP_FAIR_DEBUG
#include <CGAL/Timer.h>
#include <CGAL/trace.h>
#endif
#include <iterator>
namespace CGAL {
@ -133,7 +134,9 @@ public:
boost::end(vertices));
if(interior_vertices.empty()) { return true; }
#ifdef CGAL_PMP_FAIR_DEBUG
CGAL::Timer timer; timer.start();
#endif
const std::size_t nb_vertices = interior_vertices.size();
Solver_vector X(nb_vertices), Bx(nb_vertices);
Solver_vector Y(nb_vertices), By(nb_vertices);
@ -157,7 +160,9 @@ public:
int v_id = static_cast<int>(vertex_id_map[vd]);
compute_row(vd, v_id, A, Bx[v_id], By[v_id], Bz[v_id], 1, vertex_id_map, depth);
}
CGAL_TRACE_STREAM << "**Timer** System construction: " << timer.time() << std::endl; timer.reset();
#ifdef CGAL_PMP_FAIR_DEBUG
std:cerr << "**Timer** System construction: " << timer.time() << std::endl; timer.reset();
#endif
// factorize
double D;
@ -166,7 +171,9 @@ public:
CGAL_warning(!"pre_factor failed!");
return false;
}
CGAL_TRACE_STREAM << "**Timer** System factorization: " << timer.time() << std::endl; timer.reset();
#ifdef CGAL_PMP_FAIR_DEBUG
std::cerr << "**Timer** System factorization: " << timer.time() << std::endl; timer.reset();
#endif
// solve
bool is_all_solved = solver.linear_solver(Bx, X) && solver.linear_solver(By, Y) && solver.linear_solver(Bz, Z);
@ -174,7 +181,9 @@ public:
CGAL_warning(!"linear_solver failed!");
return false;
}
CGAL_TRACE_STREAM << "**Timer** System solver: " << timer.time() << std::endl; timer.reset();
#ifdef CGAL_PMP_FAIR_DEBUG
std::cerr << "**Timer** System solver: " << timer.time() << std::endl; timer.reset();
#endif
/* This relative error is to large for cases that the results are not good */

View File

@ -30,8 +30,9 @@
#include <list>
#include <CGAL/assertions.h>
#include <CGAL/trace.h>
#ifdef CGAL_PMP_FAIR_DEBUG
#include <CGAL/Timer.h>
#endif
#include <CGAL/squared_distance_3.h>
#include <CGAL/Kernel/global_functions_3.h>
#include <CGAL/boost/graph/iterator.h>
@ -168,7 +169,9 @@ private:
collect_interior_edges(faces, border_edges, interior_edges, included_map);
collect_interior_edges(new_faces, border_edges, interior_edges, included_map);
CGAL_TRACE_STREAM << "Test " << interior_edges.size() << " edges " << std::endl;
#ifndef CGAL_PMP_REFINE_DEBUG
std::cerr << "Test " << interior_edges.size() << " edges " << std::endl;
#endif
//do not just use std::set (included_map) for iteration, the order effects the output (we like to make it deterministic)
BOOST_FOREACH(halfedge_descriptor h, interior_edges)
{
@ -177,7 +180,9 @@ private:
}
}
CGAL_TRACE_STREAM << "|flips| = " << flips << std::endl;
#ifndef CGAL_PMP_REFINE_DEBUG
std::cerr << "|flips| = " << flips << std::endl;
#endif
return flips > 0;
}
@ -308,24 +313,34 @@ public:
calculate_scale_attribute(faces, interior_map, scale_attribute, accept_internal_facets);
std::vector<face_descriptor> all_faces(boost::begin(faces), boost::end(faces));
#ifdef CGAL_PMP_REFINE_DEBUG
CGAL::Timer total_timer; total_timer.start();
#endif
for(int i = 0; i < 10; ++i)
{
std::vector<face_descriptor> new_faces;
#ifdef CGAL_PMP_REFINE_DEBUG
CGAL::Timer timer; timer.start();
#endif
bool is_subdivided = subdivide(all_faces, border_edges, scale_attribute, vertex_out, facet_out, new_faces, alpha);
CGAL_TRACE_STREAM << "**Timer** subdivide() :" << timer.time() << std::endl; timer.reset();
#ifdef CGAL_PMP_REFINE_DEBUG
std::cerr << "**Timer** subdivide() :" << timer.time() << std::endl; timer.reset();
#endif
if(!is_subdivided)
break;
bool is_relaxed = relax(faces, new_faces, border_edges);
CGAL_TRACE_STREAM << "**Timer** relax() :" << timer.time() << std::endl;
#ifdef CGAL_PMP_REFINE_DEBUG
std::cerr << "**Timer** relax() :" << timer.time() << std::endl;
#endif
if(!is_relaxed)
break;
all_faces.insert(all_faces.end(), new_faces.begin(), new_faces.end());
}
CGAL_TRACE_STREAM << "**Timer** TOTAL: " << total_timer.time() << std::endl;
#ifdef CGAL_PMP_REFINE_DEBUG
std::cerr << "**Timer** TOTAL: " << total_timer.time() << std::endl;
#endif
}
}; //end class Refine_Polyhedron_3