diff options
author | Marius Kintel <marius@kintel.net> | 2013-05-25 19:21:17 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-05-25 19:21:17 (GMT) |
commit | 9740232b080ac3d2fe87309fb51a892faf6ea913 (patch) | |
tree | 974ac256413de1111a085d12cad7bc3f755792dd /src/csgterm.h | |
parent | fef8dba56bae76f6e876656cee603fc895fa0955 (diff) | |
parent | e60744776193d5dc3f22e7a4a9f3afa8b8664e30 (diff) |
Merge branch 'master' into issue364
Diffstat (limited to 'src/csgterm.h')
-rw-r--r-- | src/csgterm.h | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/src/csgterm.h b/src/csgterm.h index 566ebc3..94878e5 100644 --- a/src/csgterm.h +++ b/src/csgterm.h @@ -18,6 +18,12 @@ public: TYPE_DIFFERENCE }; + enum Flag { + FLAG_NONE = 0x00, + FLAG_BACKGROUND = 0x01, + FLAG_HIGHLIGHT = 0x03 + }; + static shared_ptr<CSGTerm> createCSGTerm(type_e type, shared_ptr<CSGTerm> left, shared_ptr<CSGTerm> right); static shared_ptr<CSGTerm> createCSGTerm(type_e type, CSGTerm *left, CSGTerm *right); @@ -27,6 +33,7 @@ public: shared_ptr<CSGTerm> left; shared_ptr<CSGTerm> right; BoundingBox bbox; + Flag flag; CSGTerm(const shared_ptr<PolySet> &polyset, const Transform3d &matrix, const Color4f &color, const std::string &label); ~CSGTerm(); @@ -46,19 +53,34 @@ private: friend class CSGChain; }; +class CSGChainObject +{ +public: + CSGChainObject(shared_ptr<PolySet> polyset, + const Transform3d &matrix, + const Color4f &color, + CSGTerm::type_e type, + const std::string &label, + CSGTerm::Flag flag = CSGTerm::FLAG_NONE) + : polyset(polyset), matrix(matrix), color(color), type(type), label(label), flag(flag) {} + + shared_ptr<PolySet> polyset; + Transform3d matrix; + Color4f color; + CSGTerm::type_e type; + std::string label; + CSGTerm::Flag flag; +}; + class CSGChain { public: - std::vector<shared_ptr<PolySet> > polysets; - std::vector<Transform3d> matrices; - std::vector<Color4f> colors; - std::vector<CSGTerm::type_e> types; - std::vector<std::string> labels; + std::vector<CSGChainObject> objects; - CSGChain(); + CSGChain() {}; - void add(const shared_ptr<PolySet> &polyset, const Transform3d &m, const Color4f &color, CSGTerm::type_e type, std::string label); - void import(shared_ptr<CSGTerm> term, CSGTerm::type_e type = CSGTerm::TYPE_UNION); + void import(shared_ptr<CSGTerm> term, CSGTerm::type_e type = CSGTerm::TYPE_UNION, + CSGTerm::Flag flag = CSGTerm::FLAG_NONE); std::string dump(bool full = false); BoundingBox getBoundingBox() const; |