diff options
author | Marius Kintel <marius@kintel.net> | 2011-09-11 05:37:14 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-09-11 05:37:14 (GMT) |
commit | 9afeded46c0e9023002dc04ba6131adcb39762b1 (patch) | |
tree | 0096a12ce36a5b39aa18d7ec5da45c05eb3d42dd /src/csgterm.cc | |
parent | b087e68e5430c3dde6adfe452becbaba0f680196 (diff) | |
parent | dc7eeb30d06a928a30ee47a765be3e5a61288d35 (diff) |
Merge branch 'polyset-cleanup' into visitor
Diffstat (limited to 'src/csgterm.cc')
-rw-r--r-- | src/csgterm.cc | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/csgterm.cc b/src/csgterm.cc index f24a41a..8306aaf 100644 --- a/src/csgterm.cc +++ b/src/csgterm.cc @@ -47,24 +47,17 @@ */ -CSGTerm::CSGTerm(PolySet *polyset, const double matrix[16], const double color[4], const std::string &label) +CSGTerm::CSGTerm(const shared_ptr<PolySet> &polyset, const double matrix[16], const double color[4], const std::string &label) + : type(TYPE_PRIMITIVE), polyset(polyset), label(label), left(NULL), right(NULL) { - this->type = TYPE_PRIMITIVE; - this->polyset = polyset; - this->label = label; - this->left = NULL; - this->right = NULL; for (int i = 0; i < 16; i++) this->m[i] = matrix[i]; for (int i = 0; i < 4; i++) this->color[i] = color[i]; refcounter = 1; } CSGTerm::CSGTerm(type_e type, CSGTerm *left, CSGTerm *right) + : type(type), left(left), right(right) { - this->type = type; - this->polyset = NULL; - this->left = left; - this->right = right; refcounter = 1; } @@ -167,8 +160,6 @@ CSGTerm *CSGTerm::link() void CSGTerm::unlink() { if (--refcounter <= 0) { - if (polyset) - polyset->unlink(); if (left) left->unlink(); if (right) @@ -197,7 +188,7 @@ CSGChain::CSGChain() { } -void CSGChain::add(PolySet *polyset, double *m, double *color, CSGTerm::type_e type, std::string label) +void CSGChain::add(const shared_ptr<PolySet> &polyset, double *m, double *color, CSGTerm::type_e type, std::string label) { polysets.push_back(polyset); matrices.push_back(m); |