mirror of https://github.com/CGAL/cgal
fix bbox computation in c3t3_item
This commit is contained in:
parent
0a1ecead08
commit
0523d04cf4
|
|
@ -418,17 +418,18 @@ void Scene_c3t3_item::compute_bbox() const {
|
|||
if (isEmpty())
|
||||
_bbox = Bbox();
|
||||
else {
|
||||
|
||||
CGAL::Bbox_3 result = c3t3().vertices_in_complex_begin()->point().bbox();
|
||||
for (C3t3::Vertices_in_complex_iterator
|
||||
vit = ++c3t3().vertices_in_complex_begin(),
|
||||
end = c3t3().vertices_in_complex_end();
|
||||
vit != end; ++vit)
|
||||
CGAL::Bbox_3 result =
|
||||
c3t3().cells_in_complex_begin()->vertex(0)->point().bbox();
|
||||
for (C3t3::Cells_in_complex_iterator
|
||||
cit = ++c3t3().cells_in_complex_begin(),
|
||||
cend = c3t3().cells_in_complex_end();
|
||||
cit != cend; ++cit)
|
||||
{
|
||||
result = result + vit->point().bbox();
|
||||
result = result + cit->vertex(0)->point().bbox();
|
||||
//only one vertex should be a satisfactory approximation
|
||||
}
|
||||
_bbox = Bbox(result.xmin(), result.ymin(), result.zmin(),
|
||||
result.xmax(), result.ymax(), result.zmax());
|
||||
result.xmax(), result.ymax(), result.zmax());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,8 @@ public:
|
|||
|
||||
bool isFinite() const { return true; }
|
||||
bool isEmpty() const {
|
||||
return c3t3().triangulation().number_of_vertices() == 0;
|
||||
return c3t3().triangulation().number_of_vertices() == 0
|
||||
|| c3t3().number_of_cells() == 0;
|
||||
}
|
||||
|
||||
void compute_bbox() const;
|
||||
|
|
|
|||
Loading…
Reference in New Issue