Generalize orthosphere radius threshold computation to non-cubic domains

This commit is contained in:
Mael Rouxel-Labbé 2022-11-29 12:15:24 +01:00
parent 7789d060fb
commit c255b51b4b
1 changed files with 13 additions and 9 deletions

View File

@ -181,7 +181,7 @@ private:
FT orthosphere_radius_threshold;
/// This container stores all the cells whose orthosphere radius is larger
/// than the treshold `orthosphere_radius_threshold`.
/// than the threshold `orthosphere_radius_threshold`.
boost::unordered_set<Cell_handle, Cell_handle_hash> cells_with_too_big_orthoball;
class Cover_manager
@ -220,13 +220,20 @@ public:
};
public:
FT compute_cover_threshold() const
{
FT min_span = (std::min)({ domain().xmax() - domain().xmin(),
domain().ymax() - domain().ymin(),
domain().zmax() - domain().zmin() });
return FT(0.015625) * CGAL::square(min_span);
}
/** @name Creation */
Periodic_3_regular_triangulation_3(const Iso_cuboid& domain = Iso_cuboid(0, 0, 0, 1, 1, 1),
const Geometric_traits& gt = Geometric_traits())
: Tr_Base(domain, gt)
{
orthosphere_radius_threshold = FT(0.015625) * (domain.xmax() - domain.xmin())
* (domain.xmax() - domain.xmin());
orthosphere_radius_threshold = compute_cover_threshold();
}
template < typename InputIterator >
@ -236,8 +243,7 @@ public:
bool is_large_point_set = false)
: Tr_Base(domain, gt)
{
orthosphere_radius_threshold = FT(0.015625) * (domain.xmax() - domain.xmin())
* (domain.xmax() - domain.xmin());
orthosphere_radius_threshold = compute_cover_threshold();
insert(first, last, is_large_point_set);
}
@ -383,8 +389,7 @@ public:
virtual void update_cover_data_after_setting_domain ()
{
orthosphere_radius_threshold = FT(0.015625) * (domain().xmax() - domain().xmin())
* (domain().xmax() - domain().xmin());
orthosphere_radius_threshold = compute_cover_threshold();
}
// the function below is used in `convert_to_1_sheeted_covering()` of P3T3
@ -1750,8 +1755,7 @@ operator>> (std::istream& is, Periodic_3_regular_triangulation_3<GT, TDS>& tr)
is >> static_cast<Tr_Base&>(tr);
tr.orthosphere_radius_threshold = FT(0.015625) * (tr.domain().xmax() - tr.domain().xmin())
* (tr.domain().xmax() - tr.domain().xmin());
tr.orthosphere_radius_threshold = tr.compute_cover_threshold();
tr.insert_cells_with_too_big_orthoball(tr.cells_begin(), tr.cells_end());