diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-06 10:48:51 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-06 10:48:51 (GMT) |
commit | 2ff53c89ce5c1e30d6f001fdd4361b8fcad36e82 (patch) | |
tree | 3b4607c9e49d5eb53859086a6299dffbae5f67ca /module.cc | |
parent | 6575732286d3f8909972d3705b748c6cfc02f8a8 (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.cc | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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; } |