summaryrefslogtreecommitdiff
path: root/src/csgterm.h
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-09-11 05:33:18 (GMT)
committerMarius Kintel <marius@kintel.net>2011-09-11 05:33:18 (GMT)
commitc0641d6916775309d64944ca121cc736f0c8d7a1 (patch)
tree801e0b5d67d13ff4773c5906c9cb68d271a2be02 /src/csgterm.h
parent09cc0496f7ce61e2bcbce80e067e0fac8054599a (diff)
Reenabled PolySet caching. Pass shared_ptrs to polysets around to better manage memory
Diffstat (limited to 'src/csgterm.h')
-rw-r--r--src/csgterm.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/csgterm.h b/src/csgterm.h
index 2a89ef1..c12b7ae 100644
--- a/src/csgterm.h
+++ b/src/csgterm.h
@@ -4,6 +4,7 @@
#include <string>
#include <vector>
#include "polyset.h"
+#include "memory.h"
class CSGTerm
{
@@ -16,7 +17,7 @@ public:
};
type_e type;
- PolySet *polyset;
+ shared_ptr<PolySet> polyset;
std::string label;
CSGTerm *left;
CSGTerm *right;
@@ -24,7 +25,7 @@ public:
double color[4];
int refcounter;
- CSGTerm(PolySet *polyset, const double matrix[16], const double color[4], const std::string &label);
+ CSGTerm(const shared_ptr<PolySet> &polyset, const double matrix[16], const double color[4], const std::string &label);
CSGTerm(type_e type, CSGTerm *left, CSGTerm *right);
CSGTerm *normalize();
@@ -38,7 +39,7 @@ public:
class CSGChain
{
public:
- std::vector<PolySet*> polysets;
+ std::vector<shared_ptr<PolySet> > polysets;
std::vector<double*> matrices;
std::vector<double*> colors;
std::vector<CSGTerm::type_e> types;
@@ -46,7 +47,7 @@ public:
CSGChain();
- void add(PolySet *polyset, double *m, double *color, CSGTerm::type_e type, std::string label);
+ void add(const shared_ptr<PolySet> &polyset, double *m, double *color, CSGTerm::type_e type, std::string label);
void import(CSGTerm *term, CSGTerm::type_e type = CSGTerm::TYPE_UNION);
std::string dump();
contact: Jan Huwald // Impressum