mirror of https://github.com/CGAL/cgal
fix 2D case
This commit is contained in:
parent
73fd95ab6b
commit
c419f74c23
|
|
@ -302,12 +302,11 @@ public:
|
|||
typename AT::Bounding_box operator()(ConstPrimitiveIterator first,
|
||||
ConstPrimitiveIterator beyond) const
|
||||
{
|
||||
typename AT::Bounding_box bbox = m_traits.compute_bbox(*first,m_traits.bbm);
|
||||
for(++first; first != beyond; ++first)
|
||||
{
|
||||
bbox = bbox + m_traits.compute_bbox(*first,m_traits.bbm);
|
||||
}
|
||||
return bbox;
|
||||
return std::accumulate(first, beyond,
|
||||
typename AT::Bounding_box{} /* empty bbox */,
|
||||
[this](const typename AT::Bounding_box& bbox, const Primitive& pr) {
|
||||
return bbox + m_traits.compute_bbox(pr, m_traits.bbm);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -199,9 +199,7 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
/// returns the axis-aligned bounding box of the whole tree.
|
||||
/// \pre `!empty()`
|
||||
const Bounding_box bbox() const {
|
||||
CGAL_precondition(!empty());
|
||||
if(size() > 1)
|
||||
return root_node()->bbox();
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue