mirror of https://github.com/CGAL/cgal
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:
parent
ad20bfab93
commit
053ee4d507
|
|
@ -38,7 +38,7 @@
|
||||||
#include <boost/property_map.hpp>
|
#include <boost/property_map.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CGAL_DEBUG_MODE
|
//#define CGAL_DEBUG_MODE
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
@ -333,7 +333,7 @@ edge_aware_upsample_point_set(
|
||||||
typename Kernel::FT neighbor_radius, ///<
|
typename Kernel::FT neighbor_radius, ///<
|
||||||
///< indicates the radius of the largest hole that should be filled.
|
///< 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.
|
///< 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.
|
///< the function will use the default value instead.
|
||||||
const unsigned int number_of_output_points,///< number of output
|
const unsigned int number_of_output_points,///< number of output
|
||||||
///< points to generate.
|
///< points to generate.
|
||||||
|
|
@ -366,7 +366,7 @@ edge_aware_upsample_point_set(
|
||||||
point_pmap,
|
point_pmap,
|
||||||
nb_neighbors);
|
nb_neighbors);
|
||||||
|
|
||||||
if (neighbor_radius < average_spacing * 3.0)
|
if (neighbor_radius < average_spacing * 1.0)
|
||||||
{
|
{
|
||||||
neighbor_radius = average_spacing * 3.0;
|
neighbor_radius = average_spacing * 3.0;
|
||||||
#ifdef CGAL_DEBUG_MODE
|
#ifdef CGAL_DEBUG_MODE
|
||||||
|
|
@ -374,14 +374,11 @@ edge_aware_upsample_point_set(
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Timer task_timer;
|
Timer task_timer;
|
||||||
|
|
||||||
// copy rich point set
|
// copy rich point set
|
||||||
std::vector<Rich_point> rich_point_set(number_of_input);
|
std::vector<Rich_point> rich_point_set(number_of_input);
|
||||||
CGAL::Bbox_3 bbox;
|
CGAL::Bbox_3 bbox(0., 0., 0., 0., 0., 0.);
|
||||||
Point p_temp(0., 0., 0.);
|
|
||||||
bbox += p_temp.bbox();
|
|
||||||
|
|
||||||
ForwardIterator it = first; // point iterator
|
ForwardIterator it = first; // point iterator
|
||||||
for(unsigned int i = 0; it != beyond; ++it, ++i)
|
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);
|
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
|
// compute neighborhood
|
||||||
rich_grid_internal::compute_ball_neighbors_one_self(rich_point_set,
|
rich_grid_internal::compute_ball_neighbors_one_self(rich_point_set,
|
||||||
bbox,
|
bbox,
|
||||||
|
|
|
||||||
|
|
@ -190,15 +190,10 @@ void Rich_grid<Kernel>::init(std::vector<Rich_point<Kernel> > &vert,
|
||||||
|
|
||||||
radius = _radius;
|
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);
|
x_side = (unsigned int)ceil((bbox.xmax() - bbox.xmin()) / radius);
|
||||||
y_side = (unsigned int)ceil((bbox.ymax() - bbox.ymin()) / radius);
|
y_side = (unsigned int)ceil((bbox.ymax() - bbox.ymin()) / radius);
|
||||||
z_side = (unsigned int)ceil((bbox.zmax() - bbox.zmin()) / 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;
|
x_side = (x_side > 0) ? x_side : 1;
|
||||||
y_side = (y_side > 0) ? y_side : 1;
|
y_side = (y_side > 0) ? y_side : 1;
|
||||||
z_side = (z_side > 0) ? z_side : 1;
|
z_side = (z_side > 0) ? z_side : 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue