diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-07-03 07:51:22 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-07-03 07:51:22 (GMT) |
commit | cb6dbb3a37602a9113b970477fdffc827e239baa (patch) | |
tree | d1df82ebfa09ed529de1e1a6abb336586f008160 /polyset.cc | |
parent | 5c239e7868842195189c9c5782ba8a07c948f1e5 (diff) |
Clifford Wolf:
Added caching of cgal nef polyhydrons
git-svn-id: http://svn.clifford.at/openscad/trunk@49 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'polyset.cc')
-rw-r--r-- | polyset.cc | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -256,8 +256,16 @@ PolySet *AbstractPolyNode::render_polyset(render_mode_e) const CGAL_Nef_polyhedron AbstractPolyNode::render_cgal_nef_polyhedron() const { + QString cache_id = cgal_nef_cache_id(); + if (cgal_nef_cache.contains(cache_id)) { + progress_report(); + return *cgal_nef_cache[cache_id]; + } + PolySet *ps = render_polyset(RENDER_CGAL); CGAL_Nef_polyhedron N = ps->render_cgal_nef_polyhedron(); + + cgal_nef_cache.insert(cache_id, new CGAL_Nef_polyhedron(N), N.number_of_vertices()); progress_report(); delete ps; return N; |