summaryrefslogtreecommitdiff
path: root/module.cc
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-06 10:48:51 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-06 10:48:51 (GMT)
commit2ff53c89ce5c1e30d6f001fdd4361b8fcad36e82 (patch)
tree3b4607c9e49d5eb53859086a6299dffbae5f67ca /module.cc
parent6575732286d3f8909972d3705b748c6cfc02f8a8 (diff)
Clifford Wolf:
Added caching of messages along wioth synthesis products git-svn-id: http://svn.clifford.at/openscad/trunk@215 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'module.cc')
-rw-r--r--module.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/module.cc b/module.cc
index 2ddfaa4..84db4a4 100644
--- a/module.cc
+++ b/module.cc
@@ -231,16 +231,22 @@ QString AbstractNode::mk_cache_id() const
#ifdef ENABLE_CGAL
-QCache<QString, CGAL_Nef_polyhedron> AbstractNode::cgal_nef_cache(100000);
+AbstractNode::cgal_nef_cache_entry::cgal_nef_cache_entry(CGAL_Nef_polyhedron N) :
+ N(N), msg(print_messages_stack.last()) { };
+
+QCache<QString, AbstractNode::cgal_nef_cache_entry> AbstractNode::cgal_nef_cache(100000);
static CGAL_Nef_polyhedron render_cgal_nef_polyhedron_backend(const AbstractNode *that, bool intersect)
{
QString cache_id = that->mk_cache_id();
if (that->cgal_nef_cache.contains(cache_id)) {
that->progress_report();
- return *that->cgal_nef_cache[cache_id];
+ PRINT(that->cgal_nef_cache[cache_id]->msg);
+ return that->cgal_nef_cache[cache_id]->N;
}
+ print_messages_push();
+
bool first = true;
CGAL_Nef_polyhedron N;
foreach (AbstractNode *v, that->children) {
@@ -263,8 +269,10 @@ static CGAL_Nef_polyhedron render_cgal_nef_polyhedron_backend(const AbstractNode
}
}
- that->cgal_nef_cache.insert(cache_id, new CGAL_Nef_polyhedron(N), N.weight());
+ that->cgal_nef_cache.insert(cache_id, new AbstractNode::cgal_nef_cache_entry(N), N.weight());
that->progress_report();
+ print_messages_pop();
+
return N;
}
contact: Jan Huwald // Impressum