summaryrefslogtreecommitdiff
path: root/csgterm.cc
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-07-28 12:53:52 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-07-28 12:53:52 (GMT)
commit7b4cc84cdab040d92b4b98a2ce1fcfaea829bb5a (patch)
treead1b64122844847e2727cdc377356db5dbe63198 /csgterm.cc
parentb7cb05dbbd8d9d249c21178bc0adc747c2f5fc17 (diff)
Clifford Wolf:
Added dxf polyset caching git-svn-id: http://svn.clifford.at/openscad/trunk@83 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'csgterm.cc')
-rw-r--r--csgterm.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/csgterm.cc b/csgterm.cc
index 6835f40..ae8dfb0 100644
--- a/csgterm.cc
+++ b/csgterm.cc
@@ -22,13 +22,15 @@
#include "openscad.h"
-CSGTerm::CSGTerm(PolySet *polyset, QString label)
+CSGTerm::CSGTerm(PolySet *polyset, double m[16], QString label)
{
this->type = PRIMITIVE;
this->polyset = polyset;
this->label = label;
this->left = NULL;
this->right = NULL;
+ for (int i = 0; i < 16; i++)
+ this->m[i] = m[i];
refcounter = 1;
}
@@ -141,7 +143,7 @@ void CSGTerm::unlink()
{
if (--refcounter <= 0) {
if (polyset)
- delete polyset;
+ polyset->unlink();
if (left)
left->unlink();
if (right)
@@ -165,9 +167,10 @@ CSGChain::CSGChain()
{
}
-void CSGChain::add(PolySet *polyset, CSGTerm::type_e type, QString label)
+void CSGChain::add(PolySet *polyset, double *m, CSGTerm::type_e type, QString label)
{
polysets.append(polyset);
+ matrices.append(m);
types.append(type);
labels.append(label);
}
@@ -175,7 +178,7 @@ void CSGChain::add(PolySet *polyset, CSGTerm::type_e type, QString label)
void CSGChain::import(CSGTerm *term, CSGTerm::type_e type)
{
if (term->type == CSGTerm::PRIMITIVE) {
- add(term->polyset, type, term->label);
+ add(term->polyset, term->m, type, term->label);
} else {
import(term->left, type);
import(term->right, term->type);
contact: Jan Huwald // Impressum