fixed bug introduced in 2d4c254

This commit is contained in:
Dmitry Anisimov 2021-04-07 13:53:10 +02:00
parent 4033bc14f3
commit 841ad3b8b1
2 changed files with 8 additions and 7 deletions

View File

@ -620,20 +620,20 @@ int main(int argc, char** argv) {
// Tests. // Tests.
Approximate_hd_wrapper apprx_hd(num_samples); Approximate_hd_wrapper apprx_hd(num_samples);
// Naive_bounded_error_hd_wrapper naive_hd(error_bound); Naive_bounded_error_hd_wrapper naive_hd(error_bound);
Bounded_error_hd_wrapper bound_hd(error_bound); Bounded_error_hd_wrapper bound_hd(error_bound);
// --- Testing basic properties. // --- Testing basic properties.
// test_synthetic_data(apprx_hd); // test_synthetic_data(apprx_hd);
// test_synthetic_data(naive_hd); // test_synthetic_data(naive_hd);
// test_synthetic_data(bound_hd); test_synthetic_data(bound_hd);
// --- Compare on common meshes. // --- Compare on common meshes.
// test_one_versus_another(apprx_hd, naive_hd); // test_one_versus_another(apprx_hd, naive_hd);
// test_one_versus_another(naive_hd, bound_hd); // test_one_versus_another(naive_hd, bound_hd);
// test_one_versus_another(bound_hd, apprx_hd); test_one_versus_another(bound_hd, apprx_hd);
// --- Compare on real meshes. // --- Compare on real meshes.

View File

@ -67,13 +67,13 @@ namespace CGAL {
const AABBTraits& traits, const AABBTraits& traits,
const TriangleMesh& tm2, const TriangleMesh& tm2,
const VPM2& vpm2, const VPM2& vpm2,
const double h_upper_current_global, const double /*h_upper_current_global*/,
const double h_lower_init, const double h_upper_init, const double h_lower_init, const double h_upper_init,
const double h_v0_lower_init, const double h_v1_lower_init, const double h_v2_lower_init const double h_v0_lower_init, const double h_v1_lower_init, const double h_v2_lower_init
) )
: m_traits(traits), m_tm2(tm2), m_vpm2(vpm2) { : m_traits(traits), m_tm2(tm2), m_vpm2(vpm2) {
// Initialize the global and local bounds with the given values // Initialize the global and local bounds with the given values
h_upper_global = h_upper_current_global; // h_upper_global = h_upper_current_global;
h_local_lower = h_lower_init; h_local_lower = h_lower_init;
h_local_upper = h_upper_init; h_local_upper = h_upper_init;
h_v0_lower = h_v0_lower_init; h_v0_lower = h_v0_lower_init;
@ -181,7 +181,8 @@ namespace CGAL {
// Check whether investigating the bbox can still lower the Hausdorff // Check whether investigating the bbox can still lower the Hausdorff
// distance and improve the current global bound. If so, enter the box. // distance and improve the current global bound. If so, enter the box.
if ( dist <= std::min(h_local_lower, h_upper_global) ) { // if ( dist <= std::min(h_local_lower, h_upper_global) ) {
if ( dist <= h_local_lower ) {
return std::make_pair(true, -dist); return std::make_pair(true, -dist);
} else { } else {
return std::make_pair(false, 0); return std::make_pair(false, 0);
@ -206,7 +207,7 @@ namespace CGAL {
// its vertex point map // its vertex point map
const VPM2& m_vpm2; const VPM2& m_vpm2;
// Current global upper bound on the Hausdorff distance // Current global upper bound on the Hausdorff distance
double h_upper_global; // double h_upper_global;
// Local Hausdorff bounds for the query triangle // Local Hausdorff bounds for the query triangle
double h_local_upper; double h_local_upper;
double h_local_lower; double h_local_lower;