Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2019-07-17 16:48:53 +0300
committerbubnikv <bubnikv@gmail.com>2019-07-17 16:48:53 +0300
commit3a74e7ab69fab1080f4245bfbf972cfe0b851129 (patch)
tree0b5fc99f8697e445aef032d49e034e8365f8b824 /src/admesh
parent4865240a9cd79069cc9e72bfa2e44451c55ef5c6 (diff)
WIP: Undo / Redo memory limiting by releasing the least recently
used snapshots. Memory limit set to 10% of physical system memory.
Diffstat (limited to 'src/admesh')
-rw-r--r--src/admesh/stl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/admesh/stl.h b/src/admesh/stl.h
index 2ac6c7fd2..9b1146f8d 100644
--- a/src/admesh/stl.h
+++ b/src/admesh/stl.h
@@ -127,6 +127,10 @@ struct stl_file {
this->stats.reset();
}
+ size_t memsize() const {
+ return sizeof(*this) + sizeof(stl_facet) * facet_start.size() + sizeof(stl_neighbors) * neighbors_start.size();
+ }
+
std::vector<stl_facet> facet_start;
std::vector<stl_neighbors> neighbors_start;
// Statistics
@@ -139,6 +143,10 @@ struct indexed_triangle_set
void clear() { indices.clear(); vertices.clear(); }
+ size_t memsize() const {
+ return sizeof(*this) + sizeof(stl_triangle_vertex_indices) * indices.size() + sizeof(stl_vertex) * vertices.size();
+ }
+
std::vector<stl_triangle_vertex_indices> indices;
std::vector<stl_vertex> vertices;
//FIXME add normals once we get rid of the stl_file from TriangleMesh completely.