-
Notifications
You must be signed in to change notification settings - Fork 0
/
QuantumDescription.h
118 lines (96 loc) · 2.3 KB
/
QuantumDescription.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#ifndef _H_QUANTUM_DESCRIPTION
#define _H_QUANTUM_DESCRIPTION
#include "QuantumMath.h"
#include <string>
#include <map>
#include <list>
#include <exception>
using std::string;
using std::map;
using std::list;
class CommonEvaluator;
class ExpressionEvaluator;
class ValueEvaluator;
class VisualObject;
class GeneralCubicData;
class RealVariable;
class Animator;
class DefinedField;
class PointList;
struct yyValueType
{
number realNum;
string str;
CommonEvaluator* expr;
ExpressionEvaluator* field;
RealVariable* var;
ValueEvaluator* value;
Range range;
int integer;
PointList* points;
vecR3 real3;
};
#define YYSTYPE yyValueType
struct ParsePosition
{
int line;
};
extern ParsePosition curPosition;
class DescError : public std::exception
{
public:
string message;
ParsePosition pos;
DescError(string msg)
: message(msg), pos(curPosition) {}
~DescError() throw() {}
virtual const char* what () const throw() {return message.c_str();}
};
class RangeMismatch : public DescError
{
public:
RangeMismatch(Range /*x1*/,Range /*y1*/,Range /*z1*/,
Range /*x2*/,Range /*y2*/,Range /*z2*/)
: DescError("Range Mismatch") {}
};
enum
{
kBoxNone = 0,
kBoxWhite = 1,
kBoxColored = 2,
kBoxOneCustomColor = 3,
kBoxThreeCustomColors = 4
};
struct SceneOptions
{
int boxType;
int boxDivisions;
Range xr,yr,zr;
Range fogRange;
vecR3 backgroundColor;
vecR3 boxColorX;
vecR3 boxColorY;
vecR3 boxColorZ;
SceneOptions();
};
typedef map<string, DefinedField*> definedFieldsMap;
typedef map<string, RealVariable*> definedRealVariablesMap;
typedef map<string, int> identifierTypeMap;
typedef list<VisualObject*> theVisualObjectsList;
//typedef list<RealVariable*> realVariablesList;
typedef list<Animator*> theAnimationsList;
extern definedFieldsMap definedFields;
extern definedRealVariablesMap definedRealVariables;
extern identifierTypeMap definedIdentifierTypes;
extern theVisualObjectsList theVisualObjects;
//extern realVariablesList unnamedVariables;
extern theAnimationsList theAnimations;
extern SceneOptions theSceneOptions;
void RegisterIdentifierAs(string s, int type);
void RegisterFieldFunctionID(string s);
void RegisterStandardFunctionID(string s);
void DefineRealVariable(RealVariable *var);
// in QuantumGL.cp:
void ResizeDisplayTo(int w, int h);
void ReleaseDescription();
#endif