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,
|
typename AT::Bounding_box operator()(ConstPrimitiveIterator first,
|
||||||
ConstPrimitiveIterator beyond) const
|
ConstPrimitiveIterator beyond) const
|
||||||
{
|
{
|
||||||
typename AT::Bounding_box bbox = m_traits.compute_bbox(*first,m_traits.bbm);
|
return std::accumulate(first, beyond,
|
||||||
for(++first; first != beyond; ++first)
|
typename AT::Bounding_box{} /* empty bbox */,
|
||||||
{
|
[this](const typename AT::Bounding_box& bbox, const Primitive& pr) {
|
||||||
bbox = bbox + m_traits.compute_bbox(*first,m_traits.bbm);
|
return bbox + m_traits.compute_bbox(pr, m_traits.bbm);
|
||||||
}
|
});
|
||||||
return bbox;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -199,9 +199,7 @@ namespace CGAL {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// returns the axis-aligned bounding box of the whole tree.
|
/// returns the axis-aligned bounding box of the whole tree.
|
||||||
/// \pre `!empty()`
|
|
||||||
const Bounding_box bbox() const {
|
const Bounding_box bbox() const {
|
||||||
CGAL_precondition(!empty());
|
|
||||||
if(size() > 1)
|
if(size() > 1)
|
||||||
return root_node()->bbox();
|
return root_node()->bbox();
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue