From 053ee4d5079fb635d25d8042f83c0cd9df20445b Mon Sep 17 00:00:00 2001 From: Shihao Wu Date: Thu, 19 Feb 2015 17:27:24 +0200 Subject: [PATCH] Fixed the bug of not initializing CGAL::Bbox_3 In Debug mode, the default CGAL::Bbox_3 is not (0,0,0,0,0,0) --- .../include/CGAL/edge_aware_upsample_point_set.h | 14 ++++---------- .../include/CGAL/internal/Rich_grid.h | 5 ----- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h index a315f85cc84..54773b52795 100644 --- a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h +++ b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h @@ -38,7 +38,7 @@ #include #endif -#define CGAL_DEBUG_MODE +//#define CGAL_DEBUG_MODE namespace CGAL { @@ -333,7 +333,7 @@ edge_aware_upsample_point_set( typename Kernel::FT neighbor_radius, ///< ///< indicates the radius of the largest hole that should be filled. ///< The default value is set to 3 times the average spacing of the point set. - ///< If the value given by user is smaller than the default value, + ///< If the value given by user is smaller than the average spacing, ///< the function will use the default value instead. const unsigned int number_of_output_points,///< number of output ///< points to generate. @@ -366,7 +366,7 @@ edge_aware_upsample_point_set( point_pmap, nb_neighbors); - if (neighbor_radius < average_spacing * 3.0) + if (neighbor_radius < average_spacing * 1.0) { neighbor_radius = average_spacing * 3.0; #ifdef CGAL_DEBUG_MODE @@ -374,14 +374,11 @@ edge_aware_upsample_point_set( #endif } - Timer task_timer; // copy rich point set std::vector rich_point_set(number_of_input); - CGAL::Bbox_3 bbox; - Point p_temp(0., 0., 0.); - bbox += p_temp.bbox(); + CGAL::Bbox_3 bbox(0., 0., 0., 0., 0., 0.); ForwardIterator it = first; // point iterator for(unsigned int i = 0; it != beyond; ++it, ++i) @@ -399,9 +396,6 @@ edge_aware_upsample_point_set( CGAL_point_set_processing_precondition(rich_point_set[i].normal.squared_length() > 1e-10); } - std::cout << bbox.xmin() << " " << bbox.xmax() << " " << bbox.ymin() << " " << bbox.ymin() << " " << std::endl; - system("Pause"); - // compute neighborhood rich_grid_internal::compute_ball_neighbors_one_self(rich_point_set, bbox, diff --git a/Point_set_processing_3/include/CGAL/internal/Rich_grid.h b/Point_set_processing_3/include/CGAL/internal/Rich_grid.h index 51ae4ba72fc..d2da5aa3ce6 100644 --- a/Point_set_processing_3/include/CGAL/internal/Rich_grid.h +++ b/Point_set_processing_3/include/CGAL/internal/Rich_grid.h @@ -190,15 +190,10 @@ void Rich_grid::init(std::vector > &vert, radius = _radius; - std::cout << "bbox.xmax() " << bbox.xmax() << std::endl; - std::cout << "bbox.xmin() " << bbox.xmin() << std::endl; - x_side = (unsigned int)ceil((bbox.xmax() - bbox.xmin()) / radius); y_side = (unsigned int)ceil((bbox.ymax() - bbox.ymin()) / radius); z_side = (unsigned int)ceil((bbox.zmax() - bbox.zmin()) / radius); - std::cout << "x side " << x_side << std::endl; - x_side = (x_side > 0) ? x_side : 1; y_side = (y_side > 0) ? y_side : 1; z_side = (z_side > 0) ? z_side : 1;