summaryrefslogtreecommitdiff
path: root/src/state.h
blob: 9b9e09d93f6b2fe6bc8681d104dfc1b5ded12260 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef STATE_H_
#define STATE_H_

class State
{
public:
  State(const class AbstractNode *parent) 
    : 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
contact: Jan Huwald // Impressum