diff options
author | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-30 04:26:05 (GMT) |
---|---|---|
committer | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-30 04:26:05 (GMT) |
commit | 191dc4857c852f1867e80cd9d03a6d1c0921dcb1 (patch) | |
tree | 4a6421d50eb6cf70924fc0ba06afccf10df00650 /src/value.h | |
parent | 6940d171812565209efe679a5d923417c3f47d4a (diff) |
header file reorg
git-svn-id: http://svn.clifford.at/openscad/trunk@365 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/value.h')
-rw-r--r-- | src/value.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/value.h b/src/value.h new file mode 100644 index 0000000..3491cbb --- /dev/null +++ b/src/value.h @@ -0,0 +1,68 @@ +#ifndef VALUE_H_ +#define VALUE_H_ + +#include <QVector> +#include <QString> + +class Value +{ +public: + enum type_e { + UNDEFINED, + BOOL, + NUMBER, + RANGE, + VECTOR, + STRING + }; + + enum type_e type; + + bool b; + double num; + QVector<Value*> vec; + double range_begin; + double range_step; + double range_end; + QString text; + + Value(); + ~Value(); + + Value(bool v); + Value(double v); + Value(const QString &t); + + Value(const Value &v); + Value& operator = (const Value &v); + + Value operator ! () const; + Value operator && (const Value &v) const; + Value operator || (const Value &v) const; + + Value operator + (const Value &v) const; + Value operator - (const Value &v) const; + Value operator * (const Value &v) const; + Value operator / (const Value &v) const; + Value operator % (const Value &v) const; + + Value operator < (const Value &v) const; + Value operator <= (const Value &v) const; + Value operator == (const Value &v) const; + Value operator != (const Value &v) const; + Value operator >= (const Value &v) const; + Value operator > (const Value &v) const; + + Value inv() const; + + bool getnum(double &v) const; + bool getv2(double &x, double &y) const; + bool getv3(double &x, double &y, double &z) const; + + QString dump() const; + +private: + void reset_undef(); +}; + +#endif |