diff options
author | Marius Kintel <marius@kintel.net> | 2010-08-28 15:34:22 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2010-10-31 00:42:38 (GMT) |
commit | 93f3d4a1b6251523428179261dc070df44b0b317 (patch) | |
tree | ee5d79ad52a46d3249cebcb4085673298656091f /src/state.h | |
parent | c868525c6760f97d4cdaf59d35d38becdda4bdf5 (diff) |
CSGTermRenderer refactoring: Added matrix to traversal state
Diffstat (limited to 'src/state.h')
-rw-r--r-- | src/state.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/state.h b/src/state.h index 7ac8e9f..9b9e09d 100644 --- a/src/state.h +++ b/src/state.h @@ -5,24 +5,31 @@ class State { public: State(const class AbstractNode *parent) - : parentnode(parent), isprefix(false), ispostfix(false), numchildren(0) { } + : parentnode(parent), isprefix(false), ispostfix(false), numchildren(0) { + for (int i=0;i<20;i++) this->m[i] = 0.0; + } virtual ~State() {} void setPrefix(bool on) { this->isprefix = on; } void setPostfix(bool on) { this->ispostfix = on; } void setNumChildren(unsigned int numc) { this->numchildren = numc; } void setParent(const AbstractNode *parent) { this->parentnode = parent; } + void setMatrix(const double m[20]) { memcpy(this->m, m, sizeof(m)); } bool isPrefix() const { return this->isprefix; } bool isPostfix() const { return this->ispostfix; } unsigned int numChildren() const { return this->numchildren; } const AbstractNode *parent() const { return this->parentnode; } + const double *matrix() const { return this->m; } private: const AbstractNode * parentnode; bool isprefix; bool ispostfix; unsigned int numchildren; + + // Transformation matrix incl. color. FIXME: Generalize such state variables? + double m[20]; }; #endif |