mirror of https://github.com/CGAL/cgal
Added CGAL_TRACE_STREAM object (== cerr if DEBUG_TRACE is defined, else nothing)
This commit is contained in:
parent
a43c578eeb
commit
8f1e17abcf
|
|
@ -37,6 +37,7 @@
|
||||||
#include <CGAL/average_spacing_3.h>
|
#include <CGAL/average_spacing_3.h>
|
||||||
#include <CGAL/merge_epsilon_nearest_points_3.h>
|
#include <CGAL/merge_epsilon_nearest_points_3.h>
|
||||||
#include <CGAL/random_simplification_points_3.h>
|
#include <CGAL/random_simplification_points_3.h>
|
||||||
|
#include <CGAL/surface_reconstruction_assertions.h>
|
||||||
|
|
||||||
// STL
|
// STL
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
@ -938,15 +939,13 @@ void CPoissonDoc::OnReconstructionPoissonSurfaceMeshing()
|
||||||
m_sm_radius*size, // upper bound of Delaunay balls radii
|
m_sm_radius*size, // upper bound of Delaunay balls radii
|
||||||
m_sm_distance_poisson*size); // upper bound of distance to surface
|
m_sm_distance_poisson*size); // upper bound of distance to surface
|
||||||
|
|
||||||
#ifdef DEBUG_TRACE
|
CGAL_TRACE_STREAM << " make_surface_mesh(dichotomy error="<<m_sm_error_bound<<" * point set radius,\n"
|
||||||
std::cerr << " make_surface_mesh(dichotomy error="<<m_sm_error_bound<<" * point set radius,\n"
|
<< " sphere center=("<<sm_sphere_center << "),\n"
|
||||||
<< " sphere center=("<<sm_sphere_center << "),\n"
|
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
||||||
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
<< " angle="<<m_sm_angle << " degrees,\n"
|
||||||
<< " angle="<<m_sm_angle << " degrees,\n"
|
<< " radius="<<m_sm_radius<<" * p.s.r.,\n"
|
||||||
<< " radius="<<m_sm_radius<<" * p.s.r.,\n"
|
<< " distance="<<m_sm_distance_poisson<<" * p.s.r.,\n"
|
||||||
<< " distance="<<m_sm_distance_poisson<<" * p.s.r.,\n"
|
<< " Non_manifold_tag)\n";
|
||||||
<< " Non_manifold_tag)\n";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// meshing surface
|
// meshing surface
|
||||||
CGAL::make_surface_mesh(m_surface_mesher_c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
CGAL::make_surface_mesh(m_surface_mesher_c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
||||||
|
|
@ -1241,9 +1240,7 @@ void CPoissonDoc::OnReconstructionApssReconstruction()
|
||||||
m_surface.clear();
|
m_surface.clear();
|
||||||
|
|
||||||
// Create implicit function
|
// Create implicit function
|
||||||
#ifdef DEBUG_TRACE
|
CGAL_TRACE_STREAM << " APSS_implicit_function(knn="<<m_number_of_neighbours << ")\n";
|
||||||
std::cerr << " APSS_implicit_function(knn="<<m_number_of_neighbours << ")\n";
|
|
||||||
#endif
|
|
||||||
m_apss_function = new APSS_implicit_function(m_points.begin(), m_points.end(),
|
m_apss_function = new APSS_implicit_function(m_points.begin(), m_points.end(),
|
||||||
m_number_of_neighbours);
|
m_number_of_neighbours);
|
||||||
|
|
||||||
|
|
@ -1274,15 +1271,13 @@ void CPoissonDoc::OnReconstructionApssReconstruction()
|
||||||
m_sm_radius*size, // upper bound of Delaunay balls radii
|
m_sm_radius*size, // upper bound of Delaunay balls radii
|
||||||
m_sm_distance_apss*size); // upper bound of distance to surface
|
m_sm_distance_apss*size); // upper bound of distance to surface
|
||||||
|
|
||||||
#ifdef DEBUG_TRACE
|
CGAL_TRACE_STREAM << " make_surface_mesh(dichotomy error="<<m_sm_error_bound<<" * point set radius,\n"
|
||||||
std::cerr << " make_surface_mesh(dichotomy error="<<m_sm_error_bound<<" * point set radius,\n"
|
<< " sphere center=("<<sm_sphere_center << "),\n"
|
||||||
<< " sphere center=("<<sm_sphere_center << "),\n"
|
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
||||||
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
<< " angle="<<m_sm_angle << " degrees,\n"
|
||||||
<< " angle="<<m_sm_angle << " degrees,\n"
|
<< " radius="<<m_sm_radius<<" * p.s.r.,\n"
|
||||||
<< " radius="<<m_sm_radius<<" * p.s.r.,\n"
|
<< " distance="<<m_sm_distance_apss<<" * p.s.r.,\n"
|
||||||
<< " distance="<<m_sm_distance_apss<<" * p.s.r.,\n"
|
<< " Non_manifold_tag)\n";
|
||||||
<< " Non_manifold_tag)\n";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// meshing surface
|
// meshing surface
|
||||||
CGAL::make_surface_mesh(m_surface_mesher_c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
CGAL::make_surface_mesh(m_surface_mesher_c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
#include <CGAL/Point_with_normal_3.h>
|
#include <CGAL/Point_with_normal_3.h>
|
||||||
#include <CGAL/IO/surface_reconstruction_output.h>
|
#include <CGAL/IO/surface_reconstruction_output.h>
|
||||||
#include <CGAL/IO/surface_reconstruction_read_xyz.h>
|
#include <CGAL/IO/surface_reconstruction_read_xyz.h>
|
||||||
|
#include <CGAL/surface_reconstruction_assertions.h>
|
||||||
|
|
||||||
// This test
|
// This test
|
||||||
#include "enriched_polyhedron.h"
|
#include "enriched_polyhedron.h"
|
||||||
|
|
@ -204,9 +205,7 @@ int main(int argc, char * argv[])
|
||||||
std::cerr << "Compute implicit function...\n";
|
std::cerr << "Compute implicit function...\n";
|
||||||
|
|
||||||
// Create implicit function
|
// Create implicit function
|
||||||
#ifdef DEBUG_TRACE
|
CGAL_TRACE_STREAM << " APSS_implicit_function(knn="<<number_of_neighbours << ")\n";
|
||||||
std::cerr << " APSS_implicit_function(knn="<<number_of_neighbours << ")\n";
|
|
||||||
#endif
|
|
||||||
APSS_implicit_function apss_function(pwns.begin(), pwns.end(),
|
APSS_implicit_function apss_function(pwns.begin(), pwns.end(),
|
||||||
number_of_neighbours);
|
number_of_neighbours);
|
||||||
|
|
||||||
|
|
@ -252,15 +251,13 @@ int main(int argc, char * argv[])
|
||||||
sm_radius*size, // upper bound of Delaunay balls radii
|
sm_radius*size, // upper bound of Delaunay balls radii
|
||||||
sm_distance*size); // upper bound of distance to surface
|
sm_distance*size); // upper bound of distance to surface
|
||||||
|
|
||||||
#ifdef DEBUG_TRACE
|
CGAL_TRACE_STREAM << " make_surface_mesh(dichotomy error="<<sm_error_bound<<" * point set radius,\n"
|
||||||
std::cerr << " make_surface_mesh(dichotomy error="<<sm_error_bound<<" * point set radius,\n"
|
<< " sphere center=("<<sm_sphere_center << "),\n"
|
||||||
<< " sphere center=("<<sm_sphere_center << "),\n"
|
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
||||||
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
<< " angle="<<sm_angle << " degrees,\n"
|
||||||
<< " angle="<<sm_angle << " degrees,\n"
|
<< " radius="<<sm_radius<<" * p.s.r.,\n"
|
||||||
<< " radius="<<sm_radius<<" * p.s.r.,\n"
|
<< " distance="<<sm_distance<<" * p.s.r.,\n"
|
||||||
<< " distance="<<sm_distance<<" * p.s.r.,\n"
|
<< " Non_manifold_tag)\n";
|
||||||
<< " Non_manifold_tag)\n";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// meshing surface
|
// meshing surface
|
||||||
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
#include <CGAL/Point_with_normal_3.h>
|
#include <CGAL/Point_with_normal_3.h>
|
||||||
#include <CGAL/IO/surface_reconstruction_output.h>
|
#include <CGAL/IO/surface_reconstruction_output.h>
|
||||||
#include <CGAL/IO/surface_reconstruction_read_xyz.h>
|
#include <CGAL/IO/surface_reconstruction_read_xyz.h>
|
||||||
|
#include <CGAL/surface_reconstruction_assertions.h>
|
||||||
|
|
||||||
// This test
|
// This test
|
||||||
#include "enriched_polyhedron.h"
|
#include "enriched_polyhedron.h"
|
||||||
|
|
@ -263,15 +264,13 @@ int main(int argc, char * argv[])
|
||||||
sm_radius*size, // upper bound of Delaunay balls radii
|
sm_radius*size, // upper bound of Delaunay balls radii
|
||||||
sm_distance*size); // upper bound of distance to surface
|
sm_distance*size); // upper bound of distance to surface
|
||||||
|
|
||||||
#ifdef DEBUG_TRACE
|
CGAL_TRACE_STREAM << " make_surface_mesh(dichotomy error="<<sm_error_bound<<" * point set radius,\n"
|
||||||
std::cerr << " make_surface_mesh(dichotomy error="<<sm_error_bound<<" * point set radius,\n"
|
<< " sphere center=("<<sm_sphere_center << "),\n"
|
||||||
<< " sphere center=("<<sm_sphere_center << "),\n"
|
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
||||||
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
<< " angle="<<sm_angle << " degrees,\n"
|
||||||
<< " angle="<<sm_angle << " degrees,\n"
|
<< " radius="<<sm_radius<<" * p.s.r.,\n"
|
||||||
<< " radius="<<sm_radius<<" * p.s.r.,\n"
|
<< " distance="<<sm_distance<<" * p.s.r.,\n"
|
||||||
<< " distance="<<sm_distance<<" * p.s.r.,\n"
|
<< " Non_manifold_tag)\n";
|
||||||
<< " Non_manifold_tag)\n";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// meshing surface
|
// meshing surface
|
||||||
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
||||||
|
|
|
||||||
|
|
@ -290,10 +290,8 @@ public:
|
||||||
/// TODO: add parameters to compute_implicit_function()?
|
/// TODO: add parameters to compute_implicit_function()?
|
||||||
bool compute_implicit_function()
|
bool compute_implicit_function()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_TRACE
|
|
||||||
CGAL::Timer task_timer; task_timer.start();
|
CGAL::Timer task_timer; task_timer.start();
|
||||||
std::cerr << "Delaunay refinement...\n";
|
CGAL_TRACE_STREAM << "Delaunay refinement...\n";
|
||||||
#endif
|
|
||||||
|
|
||||||
// Delaunay refinement
|
// Delaunay refinement
|
||||||
int nb_vertices = m_dt.number_of_vertices();
|
int nb_vertices = m_dt.number_of_vertices();
|
||||||
|
|
@ -302,24 +300,20 @@ public:
|
||||||
const FT enlarge_ratio = 1.5;
|
const FT enlarge_ratio = 1.5;
|
||||||
delaunay_refinement(quality,max_vertices,enlarge_ratio,50000);
|
delaunay_refinement(quality,max_vertices,enlarge_ratio,50000);
|
||||||
|
|
||||||
#ifdef DEBUG_TRACE
|
|
||||||
// Print status
|
// Print status
|
||||||
long memory = CGAL::Memory_sizer().virtual_size();
|
long memory = CGAL::Memory_sizer().virtual_size();
|
||||||
int nb_vertices2 = m_dt.number_of_vertices();
|
int nb_vertices2 = m_dt.number_of_vertices();
|
||||||
std::cerr << "Delaunay refinement: " << "added " << nb_vertices2-nb_vertices << " Steiner points, "
|
CGAL_TRACE_STREAM << "Delaunay refinement: " << "added " << nb_vertices2-nb_vertices << " Steiner points, "
|
||||||
<< task_timer.time() << " seconds, "
|
<< task_timer.time() << " seconds, "
|
||||||
<< (memory>>20) << " Mb allocated"
|
<< (memory>>20) << " Mb allocated"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
task_timer.reset();
|
task_timer.reset();
|
||||||
#endif
|
|
||||||
|
|
||||||
// Smooth normals field.
|
// Smooth normals field.
|
||||||
// Commented out as it shrinks the reconstructed model.
|
// Commented out as it shrinks the reconstructed model.
|
||||||
//extrapolate_normals();
|
//extrapolate_normals();
|
||||||
|
|
||||||
#ifdef DEBUG_TRACE
|
CGAL_TRACE_STREAM << "Solve Poisson equation...\n";
|
||||||
std::cerr << "Solve Poisson equation...\n";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// Compute the Poisson indicator function f()
|
/// Compute the Poisson indicator function f()
|
||||||
/// at each vertex of the triangulation.
|
/// at each vertex of the triangulation.
|
||||||
|
|
@ -336,14 +330,12 @@ public:
|
||||||
// - f() < 0 inside the surface.
|
// - f() < 0 inside the surface.
|
||||||
set_contouring_value(median_value_at_input_vertices());
|
set_contouring_value(median_value_at_input_vertices());
|
||||||
|
|
||||||
#ifdef DEBUG_TRACE
|
|
||||||
// Print status
|
// Print status
|
||||||
/*long*/ memory = CGAL::Memory_sizer().virtual_size();
|
/*long*/ memory = CGAL::Memory_sizer().virtual_size();
|
||||||
std::cerr << "Solve Poisson equation: " << task_timer.time() << " seconds, "
|
CGAL_TRACE_STREAM << "Solve Poisson equation: " << task_timer.time() << " seconds, "
|
||||||
<< (memory>>20) << " Mb allocated"
|
<< (memory>>20) << " Mb allocated"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
task_timer.reset();
|
task_timer.reset();
|
||||||
#endif
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -296,4 +296,10 @@
|
||||||
#define CGAL_TRACE if (false) printf
|
#define CGAL_TRACE if (false) printf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_TRACE
|
||||||
|
#define CGAL_TRACE_STREAM std::cerr
|
||||||
|
#else
|
||||||
|
#define CGAL_TRACE_STREAM if (false) std::cerr
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
#include <CGAL/Point_with_normal_3.h>
|
#include <CGAL/Point_with_normal_3.h>
|
||||||
#include <CGAL/IO/surface_reconstruction_output.h>
|
#include <CGAL/IO/surface_reconstruction_output.h>
|
||||||
#include <CGAL/IO/surface_reconstruction_read_xyz.h>
|
#include <CGAL/IO/surface_reconstruction_read_xyz.h>
|
||||||
|
#include <CGAL/surface_reconstruction_assertions.h>
|
||||||
|
|
||||||
// This test
|
// This test
|
||||||
#include "enriched_polyhedron.h"
|
#include "enriched_polyhedron.h"
|
||||||
|
|
@ -200,9 +201,7 @@ int main(int argc, char * argv[])
|
||||||
std::cerr << "Compute implicit function...\n";
|
std::cerr << "Compute implicit function...\n";
|
||||||
|
|
||||||
// Create implicit function
|
// Create implicit function
|
||||||
#ifdef DEBUG_TRACE
|
CGAL_TRACE_STREAM << " APSS_implicit_function(knn="<<number_of_neighbours << ")\n";
|
||||||
std::cerr << " APSS_implicit_function(knn="<<number_of_neighbours << ")\n";
|
|
||||||
#endif
|
|
||||||
APSS_implicit_function apss_function(pwns.begin(), pwns.end(),
|
APSS_implicit_function apss_function(pwns.begin(), pwns.end(),
|
||||||
number_of_neighbours);
|
number_of_neighbours);
|
||||||
|
|
||||||
|
|
@ -249,15 +248,13 @@ int main(int argc, char * argv[])
|
||||||
sm_radius*size, // upper bound of Delaunay balls radii
|
sm_radius*size, // upper bound of Delaunay balls radii
|
||||||
sm_distance*size); // upper bound of distance to surface
|
sm_distance*size); // upper bound of distance to surface
|
||||||
|
|
||||||
#ifdef DEBUG_TRACE
|
CGAL_TRACE_STREAM << " make_surface_mesh(dichotomy error="<<sm_error_bound<<" * point set radius,\n"
|
||||||
std::cerr << " make_surface_mesh(dichotomy error="<<sm_error_bound<<" * point set radius,\n"
|
<< " sphere center=("<<sm_sphere_center << "),\n"
|
||||||
<< " sphere center=("<<sm_sphere_center << "),\n"
|
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
||||||
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
<< " angle="<<sm_angle << " degrees,\n"
|
||||||
<< " angle="<<sm_angle << " degrees,\n"
|
<< " radius="<<sm_radius<<" * p.s.r.,\n"
|
||||||
<< " radius="<<sm_radius<<" * p.s.r.,\n"
|
<< " distance="<<sm_distance<<" * p.s.r.,\n"
|
||||||
<< " distance="<<sm_distance<<" * p.s.r.,\n"
|
<< " Non_manifold_tag)\n";
|
||||||
<< " Non_manifold_tag)\n";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// meshing surface
|
// meshing surface
|
||||||
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
#include <CGAL/Point_with_normal_3.h>
|
#include <CGAL/Point_with_normal_3.h>
|
||||||
#include <CGAL/IO/surface_reconstruction_output.h>
|
#include <CGAL/IO/surface_reconstruction_output.h>
|
||||||
#include <CGAL/IO/surface_reconstruction_read_xyz.h>
|
#include <CGAL/IO/surface_reconstruction_read_xyz.h>
|
||||||
|
#include <CGAL/surface_reconstruction_assertions.h>
|
||||||
|
|
||||||
// This test
|
// This test
|
||||||
#include "enriched_polyhedron.h"
|
#include "enriched_polyhedron.h"
|
||||||
|
|
@ -267,15 +268,13 @@ int main(int argc, char * argv[])
|
||||||
sm_radius*size, // upper bound of Delaunay balls radii
|
sm_radius*size, // upper bound of Delaunay balls radii
|
||||||
sm_distance*size); // upper bound of distance to surface
|
sm_distance*size); // upper bound of distance to surface
|
||||||
|
|
||||||
#ifdef DEBUG_TRACE
|
CGAL_TRACE_STREAM << " make_surface_mesh(dichotomy error="<<sm_error_bound<<" * point set radius,\n"
|
||||||
std::cerr << " make_surface_mesh(dichotomy error="<<sm_error_bound<<" * point set radius,\n"
|
<< " sphere center=("<<sm_sphere_center << "),\n"
|
||||||
<< " sphere center=("<<sm_sphere_center << "),\n"
|
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
||||||
<< " sphere radius="<<sm_sphere_radius/size<<" * p.s.r.,\n"
|
<< " angle="<<sm_angle << " degrees,\n"
|
||||||
<< " angle="<<sm_angle << " degrees,\n"
|
<< " radius="<<sm_radius<<" * p.s.r.,\n"
|
||||||
<< " radius="<<sm_radius<<" * p.s.r.,\n"
|
<< " distance="<<sm_distance<<" * p.s.r.,\n"
|
||||||
<< " distance="<<sm_distance<<" * p.s.r.,\n"
|
<< " Non_manifold_tag)\n";
|
||||||
<< " Non_manifold_tag)\n";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// meshing surface
|
// meshing surface
|
||||||
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Non_manifold_tag());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue