FreeWRL / FreeX3D
4.3.0
GeneratedCode.c
1
/*
2
3
GeneratedCode.c: generated by VRMLC.pm. DO NOT MODIFY, MODIFY VRMLC.pm INSTEAD.
4
5
*/
6
7
/****************************************************************************
8
This file is part of the FreeWRL/FreeX3D Distribution.
9
10
Copyright 2009 CRC Canada. (http://www.crc.gc.ca)
11
12
FreeWRL/FreeX3D is free software: you can redistribute it and/or modify
13
it under the terms of the GNU Lesser Public License as published by
14
the Free Software Foundation, either version 3 of the License, or
15
(at your option) any later version.
16
17
FreeWRL/FreeX3D is distributed in the hope that it will be useful,
18
but WITHOUT ANY WARRANTY; without even the implied warranty of
19
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
GNU General Public License for more details.
21
22
You should have received a copy of the GNU General Public License
23
along with FreeWRL/FreeX3D. If not, see <http://www.gnu.org/licenses/>.
24
****************************************************************************/
25
26
27
#include <config.h>
28
#include <system.h>
29
#include <display.h>
30
31
#include <vrml_parser/Structs.h>
32
#include <main/headers.h>
33
#include <input/EAIHeaders.h>
34
35
char
mapFieldTypeToEAItype (
int
st) {
36
switch
(st) {
37
case
FIELDTYPE_SFFloat:
return
EAI_SFFloat;
38
case
FIELDTYPE_MFFloat:
return
EAI_MFFloat;
39
case
FIELDTYPE_SFBool:
return
EAI_SFBool;
40
case
FIELDTYPE_MFBool:
return
EAI_MFBool;
41
case
FIELDTYPE_SFInt32:
return
EAI_SFInt32;
42
case
FIELDTYPE_MFInt32:
return
EAI_MFInt32;
43
case
FIELDTYPE_SFTime:
return
EAI_SFTime;
44
case
FIELDTYPE_MFTime:
return
EAI_MFTime;
45
case
FIELDTYPE_SFDouble:
return
EAI_SFDouble;
46
case
FIELDTYPE_MFDouble:
return
EAI_MFDouble;
47
case
FIELDTYPE_SFNode:
return
EAI_SFNode;
48
case
FIELDTYPE_MFNode:
return
EAI_MFNode;
49
case
FIELDTYPE_SFColor:
return
EAI_SFColor;
50
case
FIELDTYPE_MFColor:
return
EAI_MFColor;
51
case
FIELDTYPE_SFColorRGBA:
return
EAI_SFColorRGBA;
52
case
FIELDTYPE_MFColorRGBA:
return
EAI_MFColorRGBA;
53
case
FIELDTYPE_SFRotation:
return
EAI_SFRotation;
54
case
FIELDTYPE_MFRotation:
return
EAI_MFRotation;
55
case
FIELDTYPE_SFVec2f:
return
EAI_SFVec2f;
56
case
FIELDTYPE_MFVec2f:
return
EAI_MFVec2f;
57
case
FIELDTYPE_SFVec3f:
return
EAI_SFVec3f;
58
case
FIELDTYPE_MFVec3f:
return
EAI_MFVec3f;
59
case
FIELDTYPE_SFVec4f:
return
EAI_SFVec4f;
60
case
FIELDTYPE_MFVec4f:
return
EAI_MFVec4f;
61
case
FIELDTYPE_SFVec2d:
return
EAI_SFVec2d;
62
case
FIELDTYPE_MFVec2d:
return
EAI_MFVec2d;
63
case
FIELDTYPE_SFVec3d:
return
EAI_SFVec3d;
64
case
FIELDTYPE_MFVec3d:
return
EAI_MFVec3d;
65
case
FIELDTYPE_SFVec4d:
return
EAI_SFVec4d;
66
case
FIELDTYPE_MFVec4d:
return
EAI_MFVec4d;
67
case
FIELDTYPE_SFString:
return
EAI_SFString;
68
case
FIELDTYPE_MFString:
return
EAI_MFString;
69
case
FIELDTYPE_SFImage:
return
EAI_SFImage;
70
case
FIELDTYPE_MFImage:
return
EAI_MFImage;
71
case
FIELDTYPE_SFMatrix3f:
return
EAI_SFMatrix3f;
72
case
FIELDTYPE_MFMatrix3f:
return
EAI_MFMatrix3f;
73
case
FIELDTYPE_SFMatrix4f:
return
EAI_SFMatrix4f;
74
case
FIELDTYPE_MFMatrix4f:
return
EAI_MFMatrix4f;
75
case
FIELDTYPE_SFMatrix3d:
return
EAI_SFMatrix3d;
76
case
FIELDTYPE_MFMatrix3d:
return
EAI_MFMatrix3d;
77
case
FIELDTYPE_SFMatrix4d:
return
EAI_SFMatrix4d;
78
case
FIELDTYPE_MFMatrix4d:
return
EAI_MFMatrix4d;
79
case
FIELDTYPE_FreeWRLPTR:
return
EAI_FreeWRLPTR;
80
case
FIELDTYPE_FreeWRLThread:
return
EAI_FreeWRLThread;
81
default
:
return
-1;
82
}
83
return
-1;
84
}
85
/* convert an EAI type to an internal type */
86
int
mapEAItypeToFieldType (
char
st) {
87
switch
(st) {
88
case
EAI_SFFloat:
return
FIELDTYPE_SFFloat;
89
case
EAI_MFFloat:
return
FIELDTYPE_MFFloat;
90
case
EAI_SFBool:
return
FIELDTYPE_SFBool;
91
case
EAI_MFBool:
return
FIELDTYPE_MFBool;
92
case
EAI_SFInt32:
return
FIELDTYPE_SFInt32;
93
case
EAI_MFInt32:
return
FIELDTYPE_MFInt32;
94
case
EAI_SFTime:
return
FIELDTYPE_SFTime;
95
case
EAI_MFTime:
return
FIELDTYPE_MFTime;
96
case
EAI_SFDouble:
return
FIELDTYPE_SFDouble;
97
case
EAI_MFDouble:
return
FIELDTYPE_MFDouble;
98
case
EAI_SFNode:
return
FIELDTYPE_SFNode;
99
case
EAI_MFNode:
return
FIELDTYPE_MFNode;
100
case
EAI_SFColor:
return
FIELDTYPE_SFColor;
101
case
EAI_MFColor:
return
FIELDTYPE_MFColor;
102
case
EAI_SFColorRGBA:
return
FIELDTYPE_SFColorRGBA;
103
case
EAI_MFColorRGBA:
return
FIELDTYPE_MFColorRGBA;
104
case
EAI_SFRotation:
return
FIELDTYPE_SFRotation;
105
case
EAI_MFRotation:
return
FIELDTYPE_MFRotation;
106
case
EAI_SFVec2f:
return
FIELDTYPE_SFVec2f;
107
case
EAI_MFVec2f:
return
FIELDTYPE_MFVec2f;
108
case
EAI_SFVec3f:
return
FIELDTYPE_SFVec3f;
109
case
EAI_MFVec3f:
return
FIELDTYPE_MFVec3f;
110
case
EAI_SFVec4f:
return
FIELDTYPE_SFVec4f;
111
case
EAI_MFVec4f:
return
FIELDTYPE_MFVec4f;
112
case
EAI_SFVec2d:
return
FIELDTYPE_SFVec2d;
113
case
EAI_MFVec2d:
return
FIELDTYPE_MFVec2d;
114
case
EAI_SFVec3d:
return
FIELDTYPE_SFVec3d;
115
case
EAI_MFVec3d:
return
FIELDTYPE_MFVec3d;
116
case
EAI_SFVec4d:
return
FIELDTYPE_SFVec4d;
117
case
EAI_MFVec4d:
return
FIELDTYPE_MFVec4d;
118
case
EAI_SFString:
return
FIELDTYPE_SFString;
119
case
EAI_MFString:
return
FIELDTYPE_MFString;
120
case
EAI_SFImage:
return
FIELDTYPE_SFImage;
121
case
EAI_MFImage:
return
FIELDTYPE_MFImage;
122
case
EAI_SFMatrix3f:
return
FIELDTYPE_SFMatrix3f;
123
case
EAI_MFMatrix3f:
return
FIELDTYPE_MFMatrix3f;
124
case
EAI_SFMatrix4f:
return
FIELDTYPE_SFMatrix4f;
125
case
EAI_MFMatrix4f:
return
FIELDTYPE_MFMatrix4f;
126
case
EAI_SFMatrix3d:
return
FIELDTYPE_SFMatrix3d;
127
case
EAI_MFMatrix3d:
return
FIELDTYPE_MFMatrix3d;
128
case
EAI_SFMatrix4d:
return
FIELDTYPE_SFMatrix4d;
129
case
EAI_MFMatrix4d:
return
FIELDTYPE_MFMatrix4d;
130
case
EAI_FreeWRLPTR:
return
FIELDTYPE_FreeWRLPTR;
131
case
EAI_FreeWRLThread:
return
FIELDTYPE_FreeWRLThread;
132
default
:
return
-1;
133
}
134
return
-1;
135
}
136
137
/* Table of Field Types */
138
const
char
*FIELDTYPES[] = {
139
"SFFloat"
,
140
"MFFloat"
,
141
"SFBool"
,
142
"MFBool"
,
143
"SFInt32"
,
144
"MFInt32"
,
145
"SFTime"
,
146
"MFTime"
,
147
"SFDouble"
,
148
"MFDouble"
,
149
"SFNode"
,
150
"MFNode"
,
151
"SFColor"
,
152
"MFColor"
,
153
"SFColorRGBA"
,
154
"MFColorRGBA"
,
155
"SFRotation"
,
156
"MFRotation"
,
157
"SFVec2f"
,
158
"MFVec2f"
,
159
"SFVec3f"
,
160
"MFVec3f"
,
161
"SFVec4f"
,
162
"MFVec4f"
,
163
"SFVec2d"
,
164
"MFVec2d"
,
165
"SFVec3d"
,
166
"MFVec3d"
,
167
"SFVec4d"
,
168
"MFVec4d"
,
169
"SFString"
,
170
"MFString"
,
171
"SFImage"
,
172
"MFImage"
,
173
"SFMatrix3f"
,
174
"MFMatrix3f"
,
175
"SFMatrix4f"
,
176
"MFMatrix4f"
,
177
"SFMatrix3d"
,
178
"MFMatrix3d"
,
179
"SFMatrix4d"
,
180
"MFMatrix4d"
,
181
"FreeWRLPTR"
,
182
"FreeWRLThread"
,
183
};
184
const
int
FIELDTYPES_COUNT = ARR_SIZE(FIELDTYPES);
185
src
libeai
GeneratedCode.c
Generated by
1.14.0