diff options
Diffstat (limited to 'src/CGAL_Nef_polyhedron.cc')
-rw-r--r-- | src/CGAL_Nef_polyhedron.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/CGAL_Nef_polyhedron.cc b/src/CGAL_Nef_polyhedron.cc index 6ed2d90..0f1e7ca 100644 --- a/src/CGAL_Nef_polyhedron.cc +++ b/src/CGAL_Nef_polyhedron.cc @@ -61,9 +61,15 @@ CGAL_Nef_polyhedron &CGAL_Nef_polyhedron::minkowski(const CGAL_Nef_polyhedron &o int CGAL_Nef_polyhedron::weight() const { - if (this->dim == 2) return this->p2->explorer().number_of_vertices(); - if (this->dim == 3) return this->p3->number_of_vertices(); - return 0; + size_t memsize = sizeof(CGAL_Nef_polyhedron); + if (this->dim == 2) { + memsize += sizeof(CGAL_Nef_polyhedron2) + + this->p2->explorer().number_of_vertices() * sizeof(CGAL_Nef_polyhedron2::Explorer::Vertex) + + this->p2->explorer().number_of_halfedges() * sizeof(CGAL_Nef_polyhedron2::Explorer::Halfedge) + + this->p2->explorer().number_of_edges() * sizeof(CGAL_Nef_polyhedron2::Explorer::Face); + } + if (this->dim == 3) memsize += this->p3->bytes(); + return memsize; } /*! |