diff options
author | Marius Kintel <marius@kintel.net> | 2011-12-06 00:16:54 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-12-06 00:17:03 (GMT) |
commit | 65a5aa23bfd78718972082f82eb7366d01a968a6 (patch) | |
tree | 756394b55f73d9927fa61e8438d9ddf70d6d3dda /src/csgterm.h | |
parent | d392ee33f6eb57d2d08a7a7703fb9118aa82698c (diff) |
Refactoring: Use shared_ptr instead of our own shared pointer implementation for CSGTerm
Diffstat (limited to 'src/csgterm.h')
-rw-r--r-- | src/csgterm.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/csgterm.h b/src/csgterm.h index 1d9d9fd..1895839 100644 --- a/src/csgterm.h +++ b/src/csgterm.h @@ -21,20 +21,19 @@ public: type_e type; shared_ptr<PolySet> polyset; std::string label; - CSGTerm *left; - CSGTerm *right; + shared_ptr<CSGTerm> left; + shared_ptr<CSGTerm> right; Transform3d m; double color[4]; - int refcounter; CSGTerm(const shared_ptr<PolySet> &polyset, const Transform3d &matrix, const double color[4], const std::string &label); + CSGTerm(type_e type, shared_ptr<CSGTerm> left, shared_ptr<CSGTerm> right); CSGTerm(type_e type, CSGTerm *left, CSGTerm *right); + ~CSGTerm(); - CSGTerm *normalize(); - CSGTerm *normalize_tail(); + static shared_ptr<CSGTerm> normalize(shared_ptr<CSGTerm> &term); + static shared_ptr<CSGTerm> normalize_tail(shared_ptr<CSGTerm> &term); - CSGTerm *link(); - void unlink(); std::string dump(); }; @@ -50,7 +49,7 @@ public: CSGChain(); void add(const shared_ptr<PolySet> &polyset, const Transform3d &m, double *color, CSGTerm::type_e type, std::string label); - void import(CSGTerm *term, CSGTerm::type_e type = CSGTerm::TYPE_UNION); + void import(shared_ptr<CSGTerm> term, CSGTerm::type_e type = CSGTerm::TYPE_UNION); std::string dump(); BoundingBox getBoundingBox() const; |