FreeWRL/FreeX3D  3.0.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_SFRotation: return EAI_SFRotation;
40  case FIELDTYPE_MFRotation: return EAI_MFRotation;
41  case FIELDTYPE_SFVec3f: return EAI_SFVec3f;
42  case FIELDTYPE_MFVec3f: return EAI_MFVec3f;
43  case FIELDTYPE_SFBool: return EAI_SFBool;
44  case FIELDTYPE_MFBool: return EAI_MFBool;
45  case FIELDTYPE_SFInt32: return EAI_SFInt32;
46  case FIELDTYPE_MFInt32: return EAI_MFInt32;
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_SFTime: return EAI_SFTime;
54  case FIELDTYPE_MFTime: return EAI_MFTime;
55  case FIELDTYPE_SFString: return EAI_SFString;
56  case FIELDTYPE_MFString: return EAI_MFString;
57  case FIELDTYPE_SFVec2f: return EAI_SFVec2f;
58  case FIELDTYPE_MFVec2f: return EAI_MFVec2f;
59  case FIELDTYPE_FreeWRLPTR: return EAI_FreeWRLPTR;
60  case FIELDTYPE_SFImage: return EAI_SFImage;
61  case FIELDTYPE_SFVec3d: return EAI_SFVec3d;
62  case FIELDTYPE_MFVec3d: return EAI_MFVec3d;
63  case FIELDTYPE_SFDouble: return EAI_SFDouble;
64  case FIELDTYPE_MFDouble: return EAI_MFDouble;
65  case FIELDTYPE_SFMatrix3f: return EAI_SFMatrix3f;
66  case FIELDTYPE_MFMatrix3f: return EAI_MFMatrix3f;
67  case FIELDTYPE_SFMatrix3d: return EAI_SFMatrix3d;
68  case FIELDTYPE_MFMatrix3d: return EAI_MFMatrix3d;
69  case FIELDTYPE_SFMatrix4f: return EAI_SFMatrix4f;
70  case FIELDTYPE_MFMatrix4f: return EAI_MFMatrix4f;
71  case FIELDTYPE_SFMatrix4d: return EAI_SFMatrix4d;
72  case FIELDTYPE_MFMatrix4d: return EAI_MFMatrix4d;
73  case FIELDTYPE_SFVec2d: return EAI_SFVec2d;
74  case FIELDTYPE_MFVec2d: return EAI_MFVec2d;
75  case FIELDTYPE_SFVec4f: return EAI_SFVec4f;
76  case FIELDTYPE_MFVec4f: return EAI_MFVec4f;
77  case FIELDTYPE_SFVec4d: return EAI_SFVec4d;
78  case FIELDTYPE_MFVec4d: return EAI_MFVec4d;
79  case FIELDTYPE_FreeWRLThread: return EAI_FreeWRLThread;
80  default: return -1;
81  }
82  return -1;
83 }
84 /* convert an EAI type to an internal type */
85 int mapEAItypeToFieldType (char st) {
86  switch (st) {
87  case EAI_SFFloat: return FIELDTYPE_SFFloat;
88  case EAI_MFFloat: return FIELDTYPE_MFFloat;
89  case EAI_SFRotation: return FIELDTYPE_SFRotation;
90  case EAI_MFRotation: return FIELDTYPE_MFRotation;
91  case EAI_SFVec3f: return FIELDTYPE_SFVec3f;
92  case EAI_MFVec3f: return FIELDTYPE_MFVec3f;
93  case EAI_SFBool: return FIELDTYPE_SFBool;
94  case EAI_MFBool: return FIELDTYPE_MFBool;
95  case EAI_SFInt32: return FIELDTYPE_SFInt32;
96  case EAI_MFInt32: return FIELDTYPE_MFInt32;
97  case EAI_SFNode: return FIELDTYPE_SFNode;
98  case EAI_MFNode: return FIELDTYPE_MFNode;
99  case EAI_SFColor: return FIELDTYPE_SFColor;
100  case EAI_MFColor: return FIELDTYPE_MFColor;
101  case EAI_SFColorRGBA: return FIELDTYPE_SFColorRGBA;
102  case EAI_MFColorRGBA: return FIELDTYPE_MFColorRGBA;
103  case EAI_SFTime: return FIELDTYPE_SFTime;
104  case EAI_MFTime: return FIELDTYPE_MFTime;
105  case EAI_SFString: return FIELDTYPE_SFString;
106  case EAI_MFString: return FIELDTYPE_MFString;
107  case EAI_SFVec2f: return FIELDTYPE_SFVec2f;
108  case EAI_MFVec2f: return FIELDTYPE_MFVec2f;
109  case EAI_FreeWRLPTR: return FIELDTYPE_FreeWRLPTR;
110  case EAI_SFImage: return FIELDTYPE_SFImage;
111  case EAI_SFVec3d: return FIELDTYPE_SFVec3d;
112  case EAI_MFVec3d: return FIELDTYPE_MFVec3d;
113  case EAI_SFDouble: return FIELDTYPE_SFDouble;
114  case EAI_MFDouble: return FIELDTYPE_MFDouble;
115  case EAI_SFMatrix3f: return FIELDTYPE_SFMatrix3f;
116  case EAI_MFMatrix3f: return FIELDTYPE_MFMatrix3f;
117  case EAI_SFMatrix3d: return FIELDTYPE_SFMatrix3d;
118  case EAI_MFMatrix3d: return FIELDTYPE_MFMatrix3d;
119  case EAI_SFMatrix4f: return FIELDTYPE_SFMatrix4f;
120  case EAI_MFMatrix4f: return FIELDTYPE_MFMatrix4f;
121  case EAI_SFMatrix4d: return FIELDTYPE_SFMatrix4d;
122  case EAI_MFMatrix4d: return FIELDTYPE_MFMatrix4d;
123  case EAI_SFVec2d: return FIELDTYPE_SFVec2d;
124  case EAI_MFVec2d: return FIELDTYPE_MFVec2d;
125  case EAI_SFVec4f: return FIELDTYPE_SFVec4f;
126  case EAI_MFVec4f: return FIELDTYPE_MFVec4f;
127  case EAI_SFVec4d: return FIELDTYPE_SFVec4d;
128  case EAI_MFVec4d: return FIELDTYPE_MFVec4d;
129  case EAI_FreeWRLThread: return FIELDTYPE_FreeWRLThread;
130  default: return -1;
131  }
132  return -1;
133 }
134 
135 /* Table of Field Types */
136  const char *FIELDTYPES[] = {
137  "SFFloat",
138  "MFFloat",
139  "SFRotation",
140  "MFRotation",
141  "SFVec3f",
142  "MFVec3f",
143  "SFBool",
144  "MFBool",
145  "SFInt32",
146  "MFInt32",
147  "SFNode",
148  "MFNode",
149  "SFColor",
150  "MFColor",
151  "SFColorRGBA",
152  "MFColorRGBA",
153  "SFTime",
154  "MFTime",
155  "SFString",
156  "MFString",
157  "SFVec2f",
158  "MFVec2f",
159  "FreeWRLPTR",
160  "SFImage",
161  "SFVec3d",
162  "MFVec3d",
163  "SFDouble",
164  "MFDouble",
165  "SFMatrix3f",
166  "MFMatrix3f",
167  "SFMatrix3d",
168  "MFMatrix3d",
169  "SFMatrix4f",
170  "MFMatrix4f",
171  "SFMatrix4d",
172  "MFMatrix4d",
173  "SFVec2d",
174  "MFVec2d",
175  "SFVec4f",
176  "MFVec4f",
177  "SFVec4d",
178  "MFVec4d",
179  "FreeWRLThread",
180 };
181 const int FIELDTYPES_COUNT = ARR_SIZE(FIELDTYPES);
182