Add Mpwh::bbox()

This commit is contained in:
Andreas Fabri 2024-04-16 10:28:19 +01:00
parent 5d6874df85
commit c8c67472b0
2 changed files with 12 additions and 0 deletions

View File

@ -101,6 +101,16 @@ public:
Size number_of_polygons_with_holes() const { return static_cast<Size>(m_polygons.size()); } Size number_of_polygons_with_holes() const { return static_cast<Size>(m_polygons.size()); }
Bbox_2 bbox() const
{
Bbox_2 bb;
for(const auto& pwh : polygons_with_holes()){
bb += pwh.bbox();
}
return bb;
}
protected: protected:
Polygon_with_holes_container m_polygons; Polygon_with_holes_container m_polygons;
}; };

View File

@ -45,5 +45,7 @@ int main()
std::cout << mp << std::endl; std::cout << mp << std::endl;
CGAL::Bbox_2 bb = mp.bbox();
return 0; return 0;
} }