Skip to content

Commit

Permalink
Add Mpwh::bbox()
Browse files Browse the repository at this point in the history
  • Loading branch information
afabri committed Apr 16, 2024
1 parent 5d6874d commit c8c6747
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Polygon/include/CGAL/Multipolygon_with_holes_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ class Multipolygon_with_holes_2 {

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:
Polygon_with_holes_container m_polygons;
};
Expand Down
2 changes: 2 additions & 0 deletions Polygon/test/Polygon/Multipolygon_with_holes_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@ int main()

std::cout << mp << std::endl;

CGAL::Bbox_2 bb = mp.bbox();

return 0;
}

0 comments on commit c8c6747

Please sign in to comment.