summaryrefslogtreecommitdiff
path: root/src/CGAL_Nef_polyhedron.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-01-06 18:10:33 (GMT)
committerMarius Kintel <marius@kintel.net>2012-01-09 23:01:50 (GMT)
commitfe3362faf825016606a8bcd60669c16965b0599c (patch)
tree1cfccc34acf462d9faefdfb8662c48cde878cbf9 /src/CGAL_Nef_polyhedron.cc
parentc4695872392a6d1415752934be55c81de57de87e (diff)
Started on cache size management: Let cache sizes be read from Preferences, measure cache sizes in bytes
Diffstat (limited to 'src/CGAL_Nef_polyhedron.cc')
-rw-r--r--src/CGAL_Nef_polyhedron.cc12
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;
}
/*!
contact: Jan Huwald // Impressum