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)
This commit is contained in:
Shihao Wu 2015-02-19 17:27:24 +02:00
parent ad20bfab93
commit 053ee4d507
2 changed files with 4 additions and 15 deletions

View File

@ -38,7 +38,7 @@
#include <boost/property_map.hpp>
#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> 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,

View File

@ -190,15 +190,10 @@ void Rich_grid<Kernel>::init(std::vector<Rich_point<Kernel> > &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;