mirror of https://github.com/CGAL/cgal
Add is_empty()
This commit is contained in:
parent
8f1086f050
commit
29c6a7905f
|
|
@ -123,6 +123,19 @@ public:
|
||||||
|
|
||||||
bool is_plane() const { return (m_pgn.is_empty() && m_holes.empty()); }
|
bool is_plane() const { return (m_pgn.is_empty() && m_holes.empty()); }
|
||||||
|
|
||||||
|
bool is_empty() const
|
||||||
|
{
|
||||||
|
if(! outer_boundary().is_empty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for(const auto& h : holes()){
|
||||||
|
if(! h.is_empty()){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Polygon_2 m_pgn;
|
Polygon_2 m_pgn;
|
||||||
Holes_container m_holes;
|
Holes_container m_holes;
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,15 @@ public:
|
||||||
return bb;
|
return bb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_empty() const
|
||||||
|
{
|
||||||
|
for(const auto& pwh : polygons_with_holes()){
|
||||||
|
if(! pwh.is_empty()){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Polygon_with_holes_container m_polygons;
|
Polygon_with_holes_container m_polygons;
|
||||||
|
|
|
||||||
|
|
@ -47,5 +47,6 @@ int main()
|
||||||
|
|
||||||
CGAL::Bbox_2 bb = mp.bbox();
|
CGAL::Bbox_2 bb = mp.bbox();
|
||||||
std::cout << bb << std::endl;
|
std::cout << bb << std::endl;
|
||||||
|
assert(! mp.is_empty());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -314,7 +314,6 @@ public:
|
||||||
using Face_circulator = typename Triangulation::Face_circulator;
|
using Face_circulator = typename Triangulation::Face_circulator;
|
||||||
using Edge = typename Triangulation::Edge;
|
using Edge = typename Triangulation::Edge;
|
||||||
|
|
||||||
// TODO: Edge_map and Vertex_map use std::set and std::map with exact kernels since Point_2 can't be hashed otherwise
|
|
||||||
using Edge_map = typename std::conditional<std::is_floating_point<FT>::value,
|
using Edge_map = typename std::conditional<std::is_floating_point<FT>::value,
|
||||||
std::unordered_set<std::pair<Point_2, Point_2>,
|
std::unordered_set<std::pair<Point_2, Point_2>,
|
||||||
boost::hash<std::pair<Point_2, Point_2>>>,
|
boost::hash<std::pair<Point_2, Point_2>>>,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue