mirror of https://github.com/CGAL/cgal
avoid usage of min(double, float)
This commit is contained in:
parent
026049cf8e
commit
63f6c9de77
|
|
@ -177,7 +177,7 @@ struct Sizing_field_with_aabb_tree
|
||||||
<< ", index=#" << CGAL::IO::oformat(id) << "): ";
|
<< ", index=#" << CGAL::IO::oformat(id) << "): ";
|
||||||
}
|
}
|
||||||
#endif // CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
#endif // CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
||||||
double result = d_;
|
FT result = d_;
|
||||||
if(dim == 0) {
|
if(dim == 0) {
|
||||||
if(dt.dimension() < 1) {
|
if(dt.dimension() < 1) {
|
||||||
#ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
#ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
||||||
|
|
@ -218,7 +218,7 @@ struct Sizing_field_with_aabb_tree
|
||||||
}
|
}
|
||||||
const FT dist = CGAL_NTS sqrt(CGAL::squared_distance( nearest, p));
|
const FT dist = CGAL_NTS sqrt(CGAL::squared_distance( nearest, p));
|
||||||
// std::cerr << (std::min)(dist / FT(1.5), d_) << "\n";
|
// std::cerr << (std::min)(dist / FT(1.5), d_) << "\n";
|
||||||
result = (std::min)(dist / FT(2), result);
|
result = (std::min)(dist * FT(0.5), result);
|
||||||
|
|
||||||
// now search in the AABB tree
|
// now search in the AABB tree
|
||||||
typename Corners_indices::const_iterator ids_it = corners_indices.find(p);
|
typename Corners_indices::const_iterator ids_it = corners_indices.find(p);
|
||||||
|
|
@ -240,10 +240,10 @@ struct Sizing_field_with_aabb_tree
|
||||||
|
|
||||||
if(projection_traits.found()) {
|
if(projection_traits.found()) {
|
||||||
result =
|
result =
|
||||||
(std::min)(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) *
|
(std::min)(FT(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) *
|
||||||
CGAL_NTS
|
CGAL_NTS
|
||||||
sqrt(CGAL::squared_distance(p,
|
sqrt(CGAL::squared_distance(p,
|
||||||
projection_traits.closest_point())),
|
projection_traits.closest_point()))),
|
||||||
result);
|
result);
|
||||||
#ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
#ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
||||||
{
|
{
|
||||||
|
|
@ -312,10 +312,10 @@ struct Sizing_field_with_aabb_tree
|
||||||
projection_traits.closest_point_and_primitive().second)) == 0);
|
projection_traits.closest_point_and_primitive().second)) == 0);
|
||||||
|
|
||||||
result =
|
result =
|
||||||
(std::min)(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) *
|
(std::min)(FT(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) *
|
||||||
CGAL_NTS
|
CGAL_NTS
|
||||||
sqrt(CGAL::squared_distance(p,
|
sqrt(CGAL::squared_distance(p,
|
||||||
projection_traits.closest_point())),
|
projection_traits.closest_point()))),
|
||||||
result);
|
result);
|
||||||
|
|
||||||
#ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
#ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
||||||
|
|
@ -479,9 +479,9 @@ struct Sizing_field_with_aabb_tree
|
||||||
std::cerr << " closest_point: " << closest_intersection << "\n"
|
std::cerr << " closest_point: " << closest_intersection << "\n"
|
||||||
<< " distance = " << CGAL_NTS sqrt(sqd_intersection) << std::endl;
|
<< " distance = " << CGAL_NTS sqrt(sqd_intersection) << std::endl;
|
||||||
#endif // CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
#endif // CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
||||||
double new_result =
|
FT new_result =
|
||||||
(std::min)(0.45 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) *
|
(std::min)(FT(0.45 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) *
|
||||||
CGAL_NTS sqrt(sqd_intersection),
|
CGAL_NTS sqrt(sqd_intersection)),
|
||||||
d_);
|
d_);
|
||||||
|
|
||||||
#ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
#ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue