Line data Source code
1 : /*
2 : * GPAC - Multimedia Framework C SDK
3 : *
4 : * Authors: Jean Le Feuvre
5 : * Copyright (c) Telecom ParisTech 2000-2012
6 : * All rights reserved
7 : *
8 : * This file is part of GPAC / X3D Scene Graph sub-project
9 : *
10 : * GPAC is free software; you can redistribute it and/or modify
11 : * it under the terms of the GNU Lesser General Public License as published by
12 : * the Free Software Foundation; either version 2, or (at your option)
13 : * any later version.
14 : *
15 : * GPAC is distributed in the hope that it will be useful,
16 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 : * GNU Lesser General Public License for more details.
19 : *
20 : * You should have received a copy of the GNU Lesser General Public
21 : * License along with this library; see the file COPYING. If not, write to
22 : * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23 : *
24 : */
25 :
26 :
27 : /*
28 : DO NOT MOFIFY - File generated on GMT Fri Jul 31 16:39:50 2009
29 :
30 : BY X3DGen for GPAC Version 0.5.0
31 : */
32 :
33 :
34 : #include <gpac/nodes_x3d.h>
35 :
36 : #include <gpac/internal/scenegraph_dev.h>
37 :
38 : /*for NDT tag definitions*/
39 : #include <gpac/nodes_mpeg4.h>
40 : #ifndef GPAC_DISABLE_X3D
41 :
42 :
43 : /*
44 : Anchor Node deletion
45 : */
46 :
47 1 : static void Anchor_Del(GF_Node *node)
48 : {
49 : X_Anchor *p = (X_Anchor *) node;
50 1 : gf_sg_sfstring_del(p->description);
51 1 : gf_sg_mfstring_del(p->parameter);
52 1 : gf_sg_mfurl_del(p->url);
53 1 : gf_node_unregister((GF_Node *) p->metadata, node);
54 1 : gf_sg_vrml_parent_destroy(node);
55 1 : gf_node_free((GF_Node *)p);
56 1 : }
57 :
58 :
59 : static u32 Anchor_get_field_count(GF_Node *node, u8 dummy)
60 : {
61 : return 7;
62 : }
63 :
64 14 : static GF_Err Anchor_get_field(GF_Node *node, GF_FieldInfo *info)
65 : {
66 14 : switch (info->fieldIndex) {
67 2 : case 0:
68 2 : info->name = "addChildren";
69 2 : info->eventType = GF_SG_EVENT_IN;
70 2 : info->on_event_in = ((X_Anchor *)node)->on_addChildren;
71 2 : info->fieldType = GF_SG_VRML_MFNODE;
72 2 : info->NDTtype = NDT_SF3DNode;
73 2 : info->far_ptr = & ((X_Anchor *)node)->addChildren;
74 2 : return GF_OK;
75 2 : case 1:
76 2 : info->name = "removeChildren";
77 2 : info->eventType = GF_SG_EVENT_IN;
78 2 : info->on_event_in = ((X_Anchor *)node)->on_removeChildren;
79 2 : info->fieldType = GF_SG_VRML_MFNODE;
80 2 : info->NDTtype = NDT_SF3DNode;
81 2 : info->far_ptr = & ((X_Anchor *)node)->removeChildren;
82 2 : return GF_OK;
83 2 : case 2:
84 2 : info->name = "children";
85 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
86 2 : info->fieldType = GF_SG_VRML_MFNODE;
87 2 : info->NDTtype = NDT_SF3DNode;
88 2 : info->far_ptr = & ((X_Anchor *)node)->children;
89 2 : return GF_OK;
90 2 : case 3:
91 2 : info->name = "description";
92 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
93 2 : info->fieldType = GF_SG_VRML_SFSTRING;
94 2 : info->far_ptr = & ((X_Anchor *) node)->description;
95 2 : return GF_OK;
96 2 : case 4:
97 2 : info->name = "parameter";
98 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
99 2 : info->fieldType = GF_SG_VRML_MFSTRING;
100 2 : info->far_ptr = & ((X_Anchor *) node)->parameter;
101 2 : return GF_OK;
102 2 : case 5:
103 2 : info->name = "url";
104 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
105 2 : info->fieldType = GF_SG_VRML_MFURL;
106 2 : info->far_ptr = & ((X_Anchor *) node)->url;
107 2 : return GF_OK;
108 2 : case 6:
109 2 : info->name = "metadata";
110 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
111 2 : info->fieldType = GF_SG_VRML_SFNODE;
112 2 : info->NDTtype = NDT_SFMetadataNode;
113 2 : info->far_ptr = & ((X_Anchor *)node)->metadata;
114 2 : return GF_OK;
115 : default:
116 : return GF_BAD_PARAM;
117 : }
118 : }
119 :
120 :
121 7 : static s32 Anchor_get_field_index_by_name(char *name)
122 : {
123 7 : if (!strcmp("addChildren", name)) return 0;
124 6 : if (!strcmp("removeChildren", name)) return 1;
125 5 : if (!strcmp("children", name)) return 2;
126 4 : if (!strcmp("description", name)) return 3;
127 3 : if (!strcmp("parameter", name)) return 4;
128 2 : if (!strcmp("url", name)) return 5;
129 1 : if (!strcmp("metadata", name)) return 6;
130 0 : return -1;
131 : }
132 :
133 :
134 1 : static GF_Node *Anchor_Create()
135 : {
136 : X_Anchor *p;
137 1 : GF_SAFEALLOC(p, X_Anchor);
138 1 : if(!p) return NULL;
139 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Anchor);
140 1 : gf_sg_vrml_parent_setup((GF_Node *) p);
141 :
142 : /*default field values*/
143 1 : return (GF_Node *)p;
144 : }
145 :
146 :
147 : /*
148 : Appearance Node deletion
149 : */
150 :
151 27 : static void Appearance_Del(GF_Node *node)
152 : {
153 : X_Appearance *p = (X_Appearance *) node;
154 27 : gf_node_unregister((GF_Node *) p->material, node);
155 27 : gf_node_unregister((GF_Node *) p->texture, node);
156 27 : gf_node_unregister((GF_Node *) p->textureTransform, node);
157 27 : gf_node_unregister((GF_Node *) p->fillProperties, node);
158 27 : gf_node_unregister((GF_Node *) p->lineProperties, node);
159 27 : gf_node_unregister((GF_Node *) p->metadata, node);
160 27 : gf_node_free((GF_Node *)p);
161 27 : }
162 :
163 :
164 : static u32 Appearance_get_field_count(GF_Node *node, u8 dummy)
165 : {
166 : return 6;
167 : }
168 :
169 39 : static GF_Err Appearance_get_field(GF_Node *node, GF_FieldInfo *info)
170 : {
171 39 : switch (info->fieldIndex) {
172 28 : case 0:
173 28 : info->name = "material";
174 28 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
175 28 : info->fieldType = GF_SG_VRML_SFNODE;
176 28 : info->NDTtype = NDT_SFMaterialNode;
177 28 : info->far_ptr = & ((X_Appearance *)node)->material;
178 28 : return GF_OK;
179 2 : case 1:
180 2 : info->name = "texture";
181 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
182 2 : info->fieldType = GF_SG_VRML_SFNODE;
183 2 : info->NDTtype = NDT_SFTextureNode;
184 2 : info->far_ptr = & ((X_Appearance *)node)->texture;
185 2 : return GF_OK;
186 2 : case 2:
187 2 : info->name = "textureTransform";
188 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
189 2 : info->fieldType = GF_SG_VRML_SFNODE;
190 2 : info->NDTtype = NDT_SFTextureTransformNode;
191 2 : info->far_ptr = & ((X_Appearance *)node)->textureTransform;
192 2 : return GF_OK;
193 3 : case 3:
194 3 : info->name = "fillProperties";
195 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
196 3 : info->fieldType = GF_SG_VRML_SFNODE;
197 3 : info->NDTtype = NDT_SFFillPropertiesNode;
198 3 : info->far_ptr = & ((X_Appearance *)node)->fillProperties;
199 3 : return GF_OK;
200 2 : case 4:
201 2 : info->name = "lineProperties";
202 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
203 2 : info->fieldType = GF_SG_VRML_SFNODE;
204 2 : info->NDTtype = NDT_SFX3DLinePropertiesNode;
205 2 : info->far_ptr = & ((X_Appearance *)node)->lineProperties;
206 2 : return GF_OK;
207 2 : case 5:
208 2 : info->name = "metadata";
209 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
210 2 : info->fieldType = GF_SG_VRML_SFNODE;
211 2 : info->NDTtype = NDT_SFMetadataNode;
212 2 : info->far_ptr = & ((X_Appearance *)node)->metadata;
213 2 : return GF_OK;
214 : default:
215 : return GF_BAD_PARAM;
216 : }
217 : }
218 :
219 :
220 33 : static s32 Appearance_get_field_index_by_name(char *name)
221 : {
222 33 : if (!strcmp("material", name)) return 0;
223 6 : if (!strcmp("texture", name)) return 1;
224 5 : if (!strcmp("textureTransform", name)) return 2;
225 4 : if (!strcmp("fillProperties", name)) return 3;
226 2 : if (!strcmp("lineProperties", name)) return 4;
227 1 : if (!strcmp("metadata", name)) return 5;
228 0 : return -1;
229 : }
230 :
231 :
232 27 : static GF_Node *Appearance_Create()
233 : {
234 : X_Appearance *p;
235 27 : GF_SAFEALLOC(p, X_Appearance);
236 27 : if(!p) return NULL;
237 27 : gf_node_setup((GF_Node *)p, TAG_X3D_Appearance);
238 :
239 : /*default field values*/
240 27 : return (GF_Node *)p;
241 : }
242 :
243 :
244 : /*
245 : Arc2D Node deletion
246 : */
247 :
248 : static void Arc2D_Del(GF_Node *node)
249 : {
250 : X_Arc2D *p = (X_Arc2D *) node;
251 2 : gf_node_unregister((GF_Node *) p->metadata, node);
252 2 : gf_node_free((GF_Node *)p);
253 : }
254 :
255 :
256 : static u32 Arc2D_get_field_count(GF_Node *node, u8 dummy)
257 : {
258 : return 4;
259 : }
260 :
261 9 : static GF_Err Arc2D_get_field(GF_Node *node, GF_FieldInfo *info)
262 : {
263 9 : switch (info->fieldIndex) {
264 2 : case 0:
265 2 : info->name = "endAngle";
266 2 : info->eventType = GF_SG_EVENT_FIELD;
267 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
268 2 : info->far_ptr = & ((X_Arc2D *) node)->endAngle;
269 2 : return GF_OK;
270 3 : case 1:
271 3 : info->name = "radius";
272 3 : info->eventType = GF_SG_EVENT_FIELD;
273 3 : info->fieldType = GF_SG_VRML_SFFLOAT;
274 3 : info->far_ptr = & ((X_Arc2D *) node)->radius;
275 3 : return GF_OK;
276 2 : case 2:
277 2 : info->name = "startAngle";
278 2 : info->eventType = GF_SG_EVENT_FIELD;
279 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
280 2 : info->far_ptr = & ((X_Arc2D *) node)->startAngle;
281 2 : return GF_OK;
282 2 : case 3:
283 2 : info->name = "metadata";
284 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
285 2 : info->fieldType = GF_SG_VRML_SFNODE;
286 2 : info->NDTtype = NDT_SFMetadataNode;
287 2 : info->far_ptr = & ((X_Arc2D *)node)->metadata;
288 2 : return GF_OK;
289 : default:
290 : return GF_BAD_PARAM;
291 : }
292 : }
293 :
294 :
295 5 : static s32 Arc2D_get_field_index_by_name(char *name)
296 : {
297 5 : if (!strcmp("endAngle", name)) return 0;
298 4 : if (!strcmp("radius", name)) return 1;
299 2 : if (!strcmp("startAngle", name)) return 2;
300 1 : if (!strcmp("metadata", name)) return 3;
301 0 : return -1;
302 : }
303 :
304 :
305 2 : static GF_Node *Arc2D_Create()
306 : {
307 : X_Arc2D *p;
308 2 : GF_SAFEALLOC(p, X_Arc2D);
309 2 : if(!p) return NULL;
310 2 : gf_node_setup((GF_Node *)p, TAG_X3D_Arc2D);
311 :
312 : /*default field values*/
313 2 : p->endAngle = FLT2FIX(1.5707963);
314 2 : p->radius = FLT2FIX(1);
315 2 : p->startAngle = FLT2FIX(0);
316 2 : return (GF_Node *)p;
317 : }
318 :
319 :
320 : /*
321 : ArcClose2D Node deletion
322 : */
323 :
324 2 : static void ArcClose2D_Del(GF_Node *node)
325 : {
326 : X_ArcClose2D *p = (X_ArcClose2D *) node;
327 2 : gf_sg_sfstring_del(p->closureType);
328 2 : gf_node_unregister((GF_Node *) p->metadata, node);
329 2 : gf_node_free((GF_Node *)p);
330 2 : }
331 :
332 :
333 : static u32 ArcClose2D_get_field_count(GF_Node *node, u8 dummy)
334 : {
335 : return 5;
336 : }
337 :
338 12 : static GF_Err ArcClose2D_get_field(GF_Node *node, GF_FieldInfo *info)
339 : {
340 12 : switch (info->fieldIndex) {
341 3 : case 0:
342 3 : info->name = "closureType";
343 3 : info->eventType = GF_SG_EVENT_FIELD;
344 3 : info->fieldType = GF_SG_VRML_SFSTRING;
345 3 : info->far_ptr = & ((X_ArcClose2D *) node)->closureType;
346 3 : return GF_OK;
347 2 : case 1:
348 2 : info->name = "endAngle";
349 2 : info->eventType = GF_SG_EVENT_FIELD;
350 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
351 2 : info->far_ptr = & ((X_ArcClose2D *) node)->endAngle;
352 2 : return GF_OK;
353 3 : case 2:
354 3 : info->name = "radius";
355 3 : info->eventType = GF_SG_EVENT_FIELD;
356 3 : info->fieldType = GF_SG_VRML_SFFLOAT;
357 3 : info->far_ptr = & ((X_ArcClose2D *) node)->radius;
358 3 : return GF_OK;
359 2 : case 3:
360 2 : info->name = "startAngle";
361 2 : info->eventType = GF_SG_EVENT_FIELD;
362 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
363 2 : info->far_ptr = & ((X_ArcClose2D *) node)->startAngle;
364 2 : return GF_OK;
365 2 : case 4:
366 2 : info->name = "metadata";
367 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
368 2 : info->fieldType = GF_SG_VRML_SFNODE;
369 2 : info->NDTtype = NDT_SFMetadataNode;
370 2 : info->far_ptr = & ((X_ArcClose2D *)node)->metadata;
371 2 : return GF_OK;
372 : default:
373 : return GF_BAD_PARAM;
374 : }
375 : }
376 :
377 :
378 7 : static s32 ArcClose2D_get_field_index_by_name(char *name)
379 : {
380 7 : if (!strcmp("closureType", name)) return 0;
381 5 : if (!strcmp("endAngle", name)) return 1;
382 4 : if (!strcmp("radius", name)) return 2;
383 2 : if (!strcmp("startAngle", name)) return 3;
384 1 : if (!strcmp("metadata", name)) return 4;
385 0 : return -1;
386 : }
387 :
388 :
389 2 : static GF_Node *ArcClose2D_Create()
390 : {
391 : X_ArcClose2D *p;
392 2 : GF_SAFEALLOC(p, X_ArcClose2D);
393 2 : if(!p) return NULL;
394 2 : gf_node_setup((GF_Node *)p, TAG_X3D_ArcClose2D);
395 :
396 : /*default field values*/
397 2 : p->closureType.buffer = (char*) gf_malloc(sizeof(char) * 4);
398 : strcpy(p->closureType.buffer, "PIE");
399 2 : p->endAngle = FLT2FIX(1.5707963);
400 2 : p->radius = FLT2FIX(1);
401 2 : p->startAngle = FLT2FIX(0);
402 2 : return (GF_Node *)p;
403 : }
404 :
405 :
406 : /*
407 : AudioClip Node deletion
408 : */
409 :
410 1 : static void AudioClip_Del(GF_Node *node)
411 : {
412 : X_AudioClip *p = (X_AudioClip *) node;
413 1 : gf_sg_sfstring_del(p->description);
414 1 : gf_sg_mfurl_del(p->url);
415 1 : gf_node_unregister((GF_Node *) p->metadata, node);
416 1 : gf_node_free((GF_Node *)p);
417 1 : }
418 :
419 :
420 : static u32 AudioClip_get_field_count(GF_Node *node, u8 dummy)
421 : {
422 : return 13;
423 : }
424 :
425 26 : static GF_Err AudioClip_get_field(GF_Node *node, GF_FieldInfo *info)
426 : {
427 26 : switch (info->fieldIndex) {
428 2 : case 0:
429 2 : info->name = "description";
430 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
431 2 : info->fieldType = GF_SG_VRML_SFSTRING;
432 2 : info->far_ptr = & ((X_AudioClip *) node)->description;
433 2 : return GF_OK;
434 2 : case 1:
435 2 : info->name = "loop";
436 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
437 2 : info->fieldType = GF_SG_VRML_SFBOOL;
438 2 : info->far_ptr = & ((X_AudioClip *) node)->loop;
439 2 : return GF_OK;
440 2 : case 2:
441 2 : info->name = "pitch";
442 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
443 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
444 2 : info->far_ptr = & ((X_AudioClip *) node)->pitch;
445 2 : return GF_OK;
446 2 : case 3:
447 2 : info->name = "startTime";
448 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
449 2 : info->fieldType = GF_SG_VRML_SFTIME;
450 2 : info->far_ptr = & ((X_AudioClip *) node)->startTime;
451 2 : return GF_OK;
452 2 : case 4:
453 2 : info->name = "stopTime";
454 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
455 2 : info->fieldType = GF_SG_VRML_SFTIME;
456 2 : info->far_ptr = & ((X_AudioClip *) node)->stopTime;
457 2 : return GF_OK;
458 2 : case 5:
459 2 : info->name = "url";
460 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
461 2 : info->fieldType = GF_SG_VRML_MFURL;
462 2 : info->far_ptr = & ((X_AudioClip *) node)->url;
463 2 : return GF_OK;
464 2 : case 6:
465 2 : info->name = "duration_changed";
466 2 : info->eventType = GF_SG_EVENT_OUT;
467 2 : info->fieldType = GF_SG_VRML_SFTIME;
468 2 : info->far_ptr = & ((X_AudioClip *) node)->duration_changed;
469 2 : return GF_OK;
470 2 : case 7:
471 2 : info->name = "isActive";
472 2 : info->eventType = GF_SG_EVENT_OUT;
473 2 : info->fieldType = GF_SG_VRML_SFBOOL;
474 2 : info->far_ptr = & ((X_AudioClip *) node)->isActive;
475 2 : return GF_OK;
476 2 : case 8:
477 2 : info->name = "metadata";
478 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
479 2 : info->fieldType = GF_SG_VRML_SFNODE;
480 2 : info->NDTtype = NDT_SFMetadataNode;
481 2 : info->far_ptr = & ((X_AudioClip *)node)->metadata;
482 2 : return GF_OK;
483 2 : case 9:
484 2 : info->name = "pauseTime";
485 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
486 2 : info->fieldType = GF_SG_VRML_SFTIME;
487 2 : info->far_ptr = & ((X_AudioClip *) node)->pauseTime;
488 2 : return GF_OK;
489 2 : case 10:
490 2 : info->name = "resumeTime";
491 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
492 2 : info->fieldType = GF_SG_VRML_SFTIME;
493 2 : info->far_ptr = & ((X_AudioClip *) node)->resumeTime;
494 2 : return GF_OK;
495 2 : case 11:
496 2 : info->name = "elapsedTime";
497 2 : info->eventType = GF_SG_EVENT_OUT;
498 2 : info->fieldType = GF_SG_VRML_SFTIME;
499 2 : info->far_ptr = & ((X_AudioClip *) node)->elapsedTime;
500 2 : return GF_OK;
501 2 : case 12:
502 2 : info->name = "isPaused";
503 2 : info->eventType = GF_SG_EVENT_OUT;
504 2 : info->fieldType = GF_SG_VRML_SFBOOL;
505 2 : info->far_ptr = & ((X_AudioClip *) node)->isPaused;
506 2 : return GF_OK;
507 : default:
508 : return GF_BAD_PARAM;
509 : }
510 : }
511 :
512 :
513 13 : static s32 AudioClip_get_field_index_by_name(char *name)
514 : {
515 13 : if (!strcmp("description", name)) return 0;
516 12 : if (!strcmp("loop", name)) return 1;
517 11 : if (!strcmp("pitch", name)) return 2;
518 10 : if (!strcmp("startTime", name)) return 3;
519 9 : if (!strcmp("stopTime", name)) return 4;
520 8 : if (!strcmp("url", name)) return 5;
521 7 : if (!strcmp("duration_changed", name)) return 6;
522 6 : if (!strcmp("isActive", name)) return 7;
523 5 : if (!strcmp("metadata", name)) return 8;
524 4 : if (!strcmp("pauseTime", name)) return 9;
525 3 : if (!strcmp("resumeTime", name)) return 10;
526 2 : if (!strcmp("elapsedTime", name)) return 11;
527 1 : if (!strcmp("isPaused", name)) return 12;
528 0 : return -1;
529 : }
530 :
531 :
532 1 : static GF_Node *AudioClip_Create()
533 : {
534 : X_AudioClip *p;
535 1 : GF_SAFEALLOC(p, X_AudioClip);
536 1 : if(!p) return NULL;
537 1 : gf_node_setup((GF_Node *)p, TAG_X3D_AudioClip);
538 :
539 : /*default field values*/
540 1 : p->pitch = FLT2FIX(1.0);
541 1 : p->startTime = 0;
542 1 : p->stopTime = 0;
543 1 : p->pauseTime = 0;
544 1 : p->resumeTime = 0;
545 1 : return (GF_Node *)p;
546 : }
547 :
548 :
549 : /*
550 : Background Node deletion
551 : */
552 :
553 1 : static void Background_Del(GF_Node *node)
554 : {
555 : X_Background *p = (X_Background *) node;
556 1 : gf_sg_mffloat_del(p->groundAngle);
557 1 : gf_sg_mfcolor_del(p->groundColor);
558 1 : gf_sg_mfurl_del(p->backUrl);
559 1 : gf_sg_mfurl_del(p->bottomUrl);
560 1 : gf_sg_mfurl_del(p->frontUrl);
561 1 : gf_sg_mfurl_del(p->leftUrl);
562 1 : gf_sg_mfurl_del(p->rightUrl);
563 1 : gf_sg_mfurl_del(p->topUrl);
564 1 : gf_sg_mffloat_del(p->skyAngle);
565 1 : gf_sg_mfcolor_del(p->skyColor);
566 1 : gf_node_unregister((GF_Node *) p->metadata, node);
567 1 : gf_node_free((GF_Node *)p);
568 1 : }
569 :
570 :
571 : static u32 Background_get_field_count(GF_Node *node, u8 dummy)
572 : {
573 : return 14;
574 : }
575 :
576 28 : static GF_Err Background_get_field(GF_Node *node, GF_FieldInfo *info)
577 : {
578 28 : switch (info->fieldIndex) {
579 2 : case 0:
580 2 : info->name = "set_bind";
581 2 : info->eventType = GF_SG_EVENT_IN;
582 2 : info->on_event_in = ((X_Background *)node)->on_set_bind;
583 2 : info->fieldType = GF_SG_VRML_SFBOOL;
584 2 : info->far_ptr = & ((X_Background *) node)->set_bind;
585 2 : return GF_OK;
586 2 : case 1:
587 2 : info->name = "groundAngle";
588 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
589 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
590 2 : info->far_ptr = & ((X_Background *) node)->groundAngle;
591 2 : return GF_OK;
592 2 : case 2:
593 2 : info->name = "groundColor";
594 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
595 2 : info->fieldType = GF_SG_VRML_MFCOLOR;
596 2 : info->far_ptr = & ((X_Background *) node)->groundColor;
597 2 : return GF_OK;
598 2 : case 3:
599 2 : info->name = "backUrl";
600 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
601 2 : info->fieldType = GF_SG_VRML_MFURL;
602 2 : info->far_ptr = & ((X_Background *) node)->backUrl;
603 2 : return GF_OK;
604 2 : case 4:
605 2 : info->name = "bottomUrl";
606 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
607 2 : info->fieldType = GF_SG_VRML_MFURL;
608 2 : info->far_ptr = & ((X_Background *) node)->bottomUrl;
609 2 : return GF_OK;
610 2 : case 5:
611 2 : info->name = "frontUrl";
612 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
613 2 : info->fieldType = GF_SG_VRML_MFURL;
614 2 : info->far_ptr = & ((X_Background *) node)->frontUrl;
615 2 : return GF_OK;
616 2 : case 6:
617 2 : info->name = "leftUrl";
618 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
619 2 : info->fieldType = GF_SG_VRML_MFURL;
620 2 : info->far_ptr = & ((X_Background *) node)->leftUrl;
621 2 : return GF_OK;
622 2 : case 7:
623 2 : info->name = "rightUrl";
624 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
625 2 : info->fieldType = GF_SG_VRML_MFURL;
626 2 : info->far_ptr = & ((X_Background *) node)->rightUrl;
627 2 : return GF_OK;
628 2 : case 8:
629 2 : info->name = "topUrl";
630 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
631 2 : info->fieldType = GF_SG_VRML_MFURL;
632 2 : info->far_ptr = & ((X_Background *) node)->topUrl;
633 2 : return GF_OK;
634 2 : case 9:
635 2 : info->name = "skyAngle";
636 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
637 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
638 2 : info->far_ptr = & ((X_Background *) node)->skyAngle;
639 2 : return GF_OK;
640 2 : case 10:
641 2 : info->name = "skyColor";
642 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
643 2 : info->fieldType = GF_SG_VRML_MFCOLOR;
644 2 : info->far_ptr = & ((X_Background *) node)->skyColor;
645 2 : return GF_OK;
646 2 : case 11:
647 2 : info->name = "isBound";
648 2 : info->eventType = GF_SG_EVENT_OUT;
649 2 : info->fieldType = GF_SG_VRML_SFBOOL;
650 2 : info->far_ptr = & ((X_Background *) node)->isBound;
651 2 : return GF_OK;
652 2 : case 12:
653 2 : info->name = "metadata";
654 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
655 2 : info->fieldType = GF_SG_VRML_SFNODE;
656 2 : info->NDTtype = NDT_SFMetadataNode;
657 2 : info->far_ptr = & ((X_Background *)node)->metadata;
658 2 : return GF_OK;
659 2 : case 13:
660 2 : info->name = "bindTime";
661 2 : info->eventType = GF_SG_EVENT_OUT;
662 2 : info->fieldType = GF_SG_VRML_SFTIME;
663 2 : info->far_ptr = & ((X_Background *) node)->bindTime;
664 2 : return GF_OK;
665 : default:
666 : return GF_BAD_PARAM;
667 : }
668 : }
669 :
670 :
671 14 : static s32 Background_get_field_index_by_name(char *name)
672 : {
673 14 : if (!strcmp("set_bind", name)) return 0;
674 13 : if (!strcmp("groundAngle", name)) return 1;
675 12 : if (!strcmp("groundColor", name)) return 2;
676 11 : if (!strcmp("backUrl", name)) return 3;
677 10 : if (!strcmp("bottomUrl", name)) return 4;
678 9 : if (!strcmp("frontUrl", name)) return 5;
679 8 : if (!strcmp("leftUrl", name)) return 6;
680 7 : if (!strcmp("rightUrl", name)) return 7;
681 6 : if (!strcmp("topUrl", name)) return 8;
682 5 : if (!strcmp("skyAngle", name)) return 9;
683 4 : if (!strcmp("skyColor", name)) return 10;
684 3 : if (!strcmp("isBound", name)) return 11;
685 2 : if (!strcmp("metadata", name)) return 12;
686 1 : if (!strcmp("bindTime", name)) return 13;
687 0 : return -1;
688 : }
689 :
690 :
691 1 : static GF_Node *Background_Create()
692 : {
693 : X_Background *p;
694 1 : GF_SAFEALLOC(p, X_Background);
695 1 : if(!p) return NULL;
696 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Background);
697 :
698 : /*default field values*/
699 1 : p->skyColor.vals = (SFColor*)gf_malloc(sizeof(SFColor)*1);
700 1 : p->skyColor.count = 1;
701 1 : p->skyColor.vals[0].red = FLT2FIX(0);
702 1 : p->skyColor.vals[0].green = FLT2FIX(0);
703 1 : p->skyColor.vals[0].blue = FLT2FIX(0);
704 1 : return (GF_Node *)p;
705 : }
706 :
707 :
708 : /*
709 : Billboard Node deletion
710 : */
711 :
712 1 : static void Billboard_Del(GF_Node *node)
713 : {
714 : X_Billboard *p = (X_Billboard *) node;
715 1 : gf_node_unregister((GF_Node *) p->metadata, node);
716 1 : gf_sg_vrml_parent_destroy(node);
717 1 : gf_node_free((GF_Node *)p);
718 1 : }
719 :
720 :
721 : static u32 Billboard_get_field_count(GF_Node *node, u8 dummy)
722 : {
723 : return 5;
724 : }
725 :
726 10 : static GF_Err Billboard_get_field(GF_Node *node, GF_FieldInfo *info)
727 : {
728 10 : switch (info->fieldIndex) {
729 2 : case 0:
730 2 : info->name = "addChildren";
731 2 : info->eventType = GF_SG_EVENT_IN;
732 2 : info->on_event_in = ((X_Billboard *)node)->on_addChildren;
733 2 : info->fieldType = GF_SG_VRML_MFNODE;
734 2 : info->NDTtype = NDT_SF3DNode;
735 2 : info->far_ptr = & ((X_Billboard *)node)->addChildren;
736 2 : return GF_OK;
737 2 : case 1:
738 2 : info->name = "removeChildren";
739 2 : info->eventType = GF_SG_EVENT_IN;
740 2 : info->on_event_in = ((X_Billboard *)node)->on_removeChildren;
741 2 : info->fieldType = GF_SG_VRML_MFNODE;
742 2 : info->NDTtype = NDT_SF3DNode;
743 2 : info->far_ptr = & ((X_Billboard *)node)->removeChildren;
744 2 : return GF_OK;
745 2 : case 2:
746 2 : info->name = "children";
747 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
748 2 : info->fieldType = GF_SG_VRML_MFNODE;
749 2 : info->NDTtype = NDT_SF3DNode;
750 2 : info->far_ptr = & ((X_Billboard *)node)->children;
751 2 : return GF_OK;
752 2 : case 3:
753 2 : info->name = "axisOfRotation";
754 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
755 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
756 2 : info->far_ptr = & ((X_Billboard *) node)->axisOfRotation;
757 2 : return GF_OK;
758 2 : case 4:
759 2 : info->name = "metadata";
760 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
761 2 : info->fieldType = GF_SG_VRML_SFNODE;
762 2 : info->NDTtype = NDT_SFMetadataNode;
763 2 : info->far_ptr = & ((X_Billboard *)node)->metadata;
764 2 : return GF_OK;
765 : default:
766 : return GF_BAD_PARAM;
767 : }
768 : }
769 :
770 :
771 5 : static s32 Billboard_get_field_index_by_name(char *name)
772 : {
773 5 : if (!strcmp("addChildren", name)) return 0;
774 4 : if (!strcmp("removeChildren", name)) return 1;
775 3 : if (!strcmp("children", name)) return 2;
776 2 : if (!strcmp("axisOfRotation", name)) return 3;
777 1 : if (!strcmp("metadata", name)) return 4;
778 0 : return -1;
779 : }
780 :
781 :
782 1 : static GF_Node *Billboard_Create()
783 : {
784 : X_Billboard *p;
785 1 : GF_SAFEALLOC(p, X_Billboard);
786 1 : if(!p) return NULL;
787 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Billboard);
788 1 : gf_sg_vrml_parent_setup((GF_Node *) p);
789 :
790 : /*default field values*/
791 1 : p->axisOfRotation.x = FLT2FIX(0);
792 1 : p->axisOfRotation.y = FLT2FIX(1);
793 1 : p->axisOfRotation.z = FLT2FIX(0);
794 1 : return (GF_Node *)p;
795 : }
796 :
797 :
798 : /*
799 : BooleanFilter Node deletion
800 : */
801 :
802 : static void BooleanFilter_Del(GF_Node *node)
803 : {
804 : X_BooleanFilter *p = (X_BooleanFilter *) node;
805 2 : gf_node_unregister((GF_Node *) p->metadata, node);
806 2 : gf_node_free((GF_Node *)p);
807 : }
808 :
809 :
810 : static u32 BooleanFilter_get_field_count(GF_Node *node, u8 dummy)
811 : {
812 : return 5;
813 : }
814 :
815 11 : static GF_Err BooleanFilter_get_field(GF_Node *node, GF_FieldInfo *info)
816 : {
817 11 : switch (info->fieldIndex) {
818 3 : case 0:
819 3 : info->name = "set_boolean";
820 3 : info->eventType = GF_SG_EVENT_IN;
821 3 : info->on_event_in = ((X_BooleanFilter *)node)->on_set_boolean;
822 3 : info->fieldType = GF_SG_VRML_SFBOOL;
823 3 : info->far_ptr = & ((X_BooleanFilter *) node)->set_boolean;
824 3 : return GF_OK;
825 2 : case 1:
826 2 : info->name = "inputFalse";
827 2 : info->eventType = GF_SG_EVENT_OUT;
828 2 : info->fieldType = GF_SG_VRML_SFBOOL;
829 2 : info->far_ptr = & ((X_BooleanFilter *) node)->inputFalse;
830 2 : return GF_OK;
831 2 : case 2:
832 2 : info->name = "inputNegate";
833 2 : info->eventType = GF_SG_EVENT_OUT;
834 2 : info->fieldType = GF_SG_VRML_SFBOOL;
835 2 : info->far_ptr = & ((X_BooleanFilter *) node)->inputNegate;
836 2 : return GF_OK;
837 2 : case 3:
838 2 : info->name = "inputTrue";
839 2 : info->eventType = GF_SG_EVENT_OUT;
840 2 : info->fieldType = GF_SG_VRML_SFBOOL;
841 2 : info->far_ptr = & ((X_BooleanFilter *) node)->inputTrue;
842 2 : return GF_OK;
843 2 : case 4:
844 2 : info->name = "metadata";
845 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
846 2 : info->fieldType = GF_SG_VRML_SFNODE;
847 2 : info->NDTtype = NDT_SFMetadataNode;
848 2 : info->far_ptr = & ((X_BooleanFilter *)node)->metadata;
849 2 : return GF_OK;
850 : default:
851 : return GF_BAD_PARAM;
852 : }
853 : }
854 :
855 :
856 6 : static s32 BooleanFilter_get_field_index_by_name(char *name)
857 : {
858 6 : if (!strcmp("set_boolean", name)) return 0;
859 4 : if (!strcmp("inputFalse", name)) return 1;
860 3 : if (!strcmp("inputNegate", name)) return 2;
861 2 : if (!strcmp("inputTrue", name)) return 3;
862 1 : if (!strcmp("metadata", name)) return 4;
863 0 : return -1;
864 : }
865 :
866 :
867 2 : static GF_Node *BooleanFilter_Create()
868 : {
869 : X_BooleanFilter *p;
870 2 : GF_SAFEALLOC(p, X_BooleanFilter);
871 2 : if(!p) return NULL;
872 2 : gf_node_setup((GF_Node *)p, TAG_X3D_BooleanFilter);
873 :
874 : /*default field values*/
875 2 : return (GF_Node *)p;
876 : }
877 :
878 :
879 : /*
880 : BooleanSequencer Node deletion
881 : */
882 :
883 2 : static void BooleanSequencer_Del(GF_Node *node)
884 : {
885 : X_BooleanSequencer *p = (X_BooleanSequencer *) node;
886 2 : gf_sg_mffloat_del(p->key);
887 2 : gf_sg_mfbool_del(p->keyValue);
888 2 : gf_node_unregister((GF_Node *) p->metadata, node);
889 2 : gf_node_free((GF_Node *)p);
890 2 : }
891 :
892 :
893 : static u32 BooleanSequencer_get_field_count(GF_Node *node, u8 dummy)
894 : {
895 : return 7;
896 : }
897 :
898 19 : static GF_Err BooleanSequencer_get_field(GF_Node *node, GF_FieldInfo *info)
899 : {
900 19 : switch (info->fieldIndex) {
901 3 : case 0:
902 3 : info->name = "next";
903 3 : info->eventType = GF_SG_EVENT_IN;
904 3 : info->on_event_in = ((X_BooleanSequencer *)node)->on_next;
905 3 : info->fieldType = GF_SG_VRML_SFBOOL;
906 3 : info->far_ptr = & ((X_BooleanSequencer *) node)->next;
907 3 : return GF_OK;
908 3 : case 1:
909 3 : info->name = "previous";
910 3 : info->eventType = GF_SG_EVENT_IN;
911 3 : info->on_event_in = ((X_BooleanSequencer *)node)->on_previous;
912 3 : info->fieldType = GF_SG_VRML_SFBOOL;
913 3 : info->far_ptr = & ((X_BooleanSequencer *) node)->previous;
914 3 : return GF_OK;
915 3 : case 2:
916 3 : info->name = "set_fraction";
917 3 : info->eventType = GF_SG_EVENT_IN;
918 3 : info->on_event_in = ((X_BooleanSequencer *)node)->on_set_fraction;
919 3 : info->fieldType = GF_SG_VRML_SFFLOAT;
920 3 : info->far_ptr = & ((X_BooleanSequencer *) node)->set_fraction;
921 3 : return GF_OK;
922 3 : case 3:
923 3 : info->name = "key";
924 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
925 3 : info->fieldType = GF_SG_VRML_MFFLOAT;
926 3 : info->far_ptr = & ((X_BooleanSequencer *) node)->key;
927 3 : return GF_OK;
928 3 : case 4:
929 3 : info->name = "keyValue";
930 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
931 3 : info->fieldType = GF_SG_VRML_MFBOOL;
932 3 : info->far_ptr = & ((X_BooleanSequencer *) node)->keyValue;
933 3 : return GF_OK;
934 2 : case 5:
935 2 : info->name = "value_changed";
936 2 : info->eventType = GF_SG_EVENT_OUT;
937 2 : info->fieldType = GF_SG_VRML_SFBOOL;
938 2 : info->far_ptr = & ((X_BooleanSequencer *) node)->value_changed;
939 2 : return GF_OK;
940 2 : case 6:
941 2 : info->name = "metadata";
942 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
943 2 : info->fieldType = GF_SG_VRML_SFNODE;
944 2 : info->NDTtype = NDT_SFMetadataNode;
945 2 : info->far_ptr = & ((X_BooleanSequencer *)node)->metadata;
946 2 : return GF_OK;
947 : default:
948 : return GF_BAD_PARAM;
949 : }
950 : }
951 :
952 :
953 12 : static s32 BooleanSequencer_get_field_index_by_name(char *name)
954 : {
955 12 : if (!strcmp("next", name)) return 0;
956 10 : if (!strcmp("previous", name)) return 1;
957 8 : if (!strcmp("set_fraction", name)) return 2;
958 6 : if (!strcmp("key", name)) return 3;
959 4 : if (!strcmp("keyValue", name)) return 4;
960 2 : if (!strcmp("value_changed", name)) return 5;
961 1 : if (!strcmp("metadata", name)) return 6;
962 0 : return -1;
963 : }
964 :
965 :
966 2 : static GF_Node *BooleanSequencer_Create()
967 : {
968 : X_BooleanSequencer *p;
969 2 : GF_SAFEALLOC(p, X_BooleanSequencer);
970 2 : if(!p) return NULL;
971 2 : gf_node_setup((GF_Node *)p, TAG_X3D_BooleanSequencer);
972 :
973 : /*default field values*/
974 2 : return (GF_Node *)p;
975 : }
976 :
977 :
978 : /*
979 : BooleanToggle Node deletion
980 : */
981 :
982 : static void BooleanToggle_Del(GF_Node *node)
983 : {
984 : X_BooleanToggle *p = (X_BooleanToggle *) node;
985 2 : gf_node_unregister((GF_Node *) p->metadata, node);
986 2 : gf_node_free((GF_Node *)p);
987 : }
988 :
989 :
990 : static u32 BooleanToggle_get_field_count(GF_Node *node, u8 dummy)
991 : {
992 : return 3;
993 : }
994 :
995 : static GF_Err BooleanToggle_get_field(GF_Node *node, GF_FieldInfo *info)
996 : {
997 7 : switch (info->fieldIndex) {
998 3 : case 0:
999 3 : info->name = "set_boolean";
1000 3 : info->eventType = GF_SG_EVENT_IN;
1001 3 : info->on_event_in = ((X_BooleanToggle *)node)->on_set_boolean;
1002 3 : info->fieldType = GF_SG_VRML_SFBOOL;
1003 3 : info->far_ptr = & ((X_BooleanToggle *) node)->set_boolean;
1004 : return GF_OK;
1005 2 : case 1:
1006 2 : info->name = "toggle";
1007 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1008 2 : info->fieldType = GF_SG_VRML_SFBOOL;
1009 2 : info->far_ptr = & ((X_BooleanToggle *) node)->toggle;
1010 : return GF_OK;
1011 2 : case 2:
1012 2 : info->name = "metadata";
1013 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1014 2 : info->fieldType = GF_SG_VRML_SFNODE;
1015 2 : info->NDTtype = NDT_SFMetadataNode;
1016 2 : info->far_ptr = & ((X_BooleanToggle *)node)->metadata;
1017 : return GF_OK;
1018 : default:
1019 : return GF_BAD_PARAM;
1020 : }
1021 : }
1022 :
1023 :
1024 4 : static s32 BooleanToggle_get_field_index_by_name(char *name)
1025 : {
1026 4 : if (!strcmp("set_boolean", name)) return 0;
1027 2 : if (!strcmp("toggle", name)) return 1;
1028 1 : if (!strcmp("metadata", name)) return 2;
1029 0 : return -1;
1030 : }
1031 :
1032 :
1033 2 : static GF_Node *BooleanToggle_Create()
1034 : {
1035 : X_BooleanToggle *p;
1036 2 : GF_SAFEALLOC(p, X_BooleanToggle);
1037 2 : if(!p) return NULL;
1038 2 : gf_node_setup((GF_Node *)p, TAG_X3D_BooleanToggle);
1039 :
1040 : /*default field values*/
1041 2 : return (GF_Node *)p;
1042 : }
1043 :
1044 :
1045 : /*
1046 : BooleanTrigger Node deletion
1047 : */
1048 :
1049 : static void BooleanTrigger_Del(GF_Node *node)
1050 : {
1051 : X_BooleanTrigger *p = (X_BooleanTrigger *) node;
1052 2 : gf_node_unregister((GF_Node *) p->metadata, node);
1053 2 : gf_node_free((GF_Node *)p);
1054 : }
1055 :
1056 :
1057 : static u32 BooleanTrigger_get_field_count(GF_Node *node, u8 dummy)
1058 : {
1059 : return 3;
1060 : }
1061 :
1062 : static GF_Err BooleanTrigger_get_field(GF_Node *node, GF_FieldInfo *info)
1063 : {
1064 7 : switch (info->fieldIndex) {
1065 3 : case 0:
1066 3 : info->name = "set_triggerTime";
1067 3 : info->eventType = GF_SG_EVENT_IN;
1068 3 : info->on_event_in = ((X_BooleanTrigger *)node)->on_set_triggerTime;
1069 3 : info->fieldType = GF_SG_VRML_SFTIME;
1070 3 : info->far_ptr = & ((X_BooleanTrigger *) node)->set_triggerTime;
1071 : return GF_OK;
1072 2 : case 1:
1073 2 : info->name = "triggerTrue";
1074 2 : info->eventType = GF_SG_EVENT_OUT;
1075 2 : info->fieldType = GF_SG_VRML_SFBOOL;
1076 2 : info->far_ptr = & ((X_BooleanTrigger *) node)->triggerTrue;
1077 : return GF_OK;
1078 2 : case 2:
1079 2 : info->name = "metadata";
1080 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1081 2 : info->fieldType = GF_SG_VRML_SFNODE;
1082 2 : info->NDTtype = NDT_SFMetadataNode;
1083 2 : info->far_ptr = & ((X_BooleanTrigger *)node)->metadata;
1084 : return GF_OK;
1085 : default:
1086 : return GF_BAD_PARAM;
1087 : }
1088 : }
1089 :
1090 :
1091 4 : static s32 BooleanTrigger_get_field_index_by_name(char *name)
1092 : {
1093 4 : if (!strcmp("set_triggerTime", name)) return 0;
1094 2 : if (!strcmp("triggerTrue", name)) return 1;
1095 1 : if (!strcmp("metadata", name)) return 2;
1096 0 : return -1;
1097 : }
1098 :
1099 :
1100 2 : static GF_Node *BooleanTrigger_Create()
1101 : {
1102 : X_BooleanTrigger *p;
1103 2 : GF_SAFEALLOC(p, X_BooleanTrigger);
1104 2 : if(!p) return NULL;
1105 2 : gf_node_setup((GF_Node *)p, TAG_X3D_BooleanTrigger);
1106 :
1107 : /*default field values*/
1108 2 : return (GF_Node *)p;
1109 : }
1110 :
1111 :
1112 : /*
1113 : Box Node deletion
1114 : */
1115 :
1116 : static void Box_Del(GF_Node *node)
1117 : {
1118 : X_Box *p = (X_Box *) node;
1119 2 : gf_node_unregister((GF_Node *) p->metadata, node);
1120 2 : gf_node_free((GF_Node *)p);
1121 : }
1122 :
1123 :
1124 : static u32 Box_get_field_count(GF_Node *node, u8 dummy)
1125 : {
1126 : return 2;
1127 : }
1128 :
1129 : static GF_Err Box_get_field(GF_Node *node, GF_FieldInfo *info)
1130 : {
1131 5 : switch (info->fieldIndex) {
1132 3 : case 0:
1133 3 : info->name = "size";
1134 3 : info->eventType = GF_SG_EVENT_FIELD;
1135 3 : info->fieldType = GF_SG_VRML_SFVEC3F;
1136 3 : info->far_ptr = & ((X_Box *) node)->size;
1137 : return GF_OK;
1138 2 : case 1:
1139 2 : info->name = "metadata";
1140 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1141 2 : info->fieldType = GF_SG_VRML_SFNODE;
1142 2 : info->NDTtype = NDT_SFMetadataNode;
1143 2 : info->far_ptr = & ((X_Box *)node)->metadata;
1144 : return GF_OK;
1145 : default:
1146 : return GF_BAD_PARAM;
1147 : }
1148 : }
1149 :
1150 :
1151 3 : static s32 Box_get_field_index_by_name(char *name)
1152 : {
1153 3 : if (!strcmp("size", name)) return 0;
1154 1 : if (!strcmp("metadata", name)) return 1;
1155 0 : return -1;
1156 : }
1157 :
1158 :
1159 2 : static GF_Node *Box_Create()
1160 : {
1161 : X_Box *p;
1162 2 : GF_SAFEALLOC(p, X_Box);
1163 2 : if(!p) return NULL;
1164 2 : gf_node_setup((GF_Node *)p, TAG_X3D_Box);
1165 :
1166 : /*default field values*/
1167 2 : p->size.x = FLT2FIX(2);
1168 2 : p->size.y = FLT2FIX(2);
1169 2 : p->size.z = FLT2FIX(2);
1170 2 : return (GF_Node *)p;
1171 : }
1172 :
1173 :
1174 : /*
1175 : Circle2D Node deletion
1176 : */
1177 :
1178 : static void Circle2D_Del(GF_Node *node)
1179 : {
1180 : X_Circle2D *p = (X_Circle2D *) node;
1181 1 : gf_node_unregister((GF_Node *) p->metadata, node);
1182 1 : gf_node_free((GF_Node *)p);
1183 : }
1184 :
1185 :
1186 : static u32 Circle2D_get_field_count(GF_Node *node, u8 dummy)
1187 : {
1188 : return 2;
1189 : }
1190 :
1191 : static GF_Err Circle2D_get_field(GF_Node *node, GF_FieldInfo *info)
1192 : {
1193 4 : switch (info->fieldIndex) {
1194 2 : case 0:
1195 2 : info->name = "radius";
1196 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1197 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
1198 2 : info->far_ptr = & ((X_Circle2D *) node)->radius;
1199 : return GF_OK;
1200 2 : case 1:
1201 2 : info->name = "metadata";
1202 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1203 2 : info->fieldType = GF_SG_VRML_SFNODE;
1204 2 : info->NDTtype = NDT_SFMetadataNode;
1205 2 : info->far_ptr = & ((X_Circle2D *)node)->metadata;
1206 : return GF_OK;
1207 : default:
1208 : return GF_BAD_PARAM;
1209 : }
1210 : }
1211 :
1212 :
1213 2 : static s32 Circle2D_get_field_index_by_name(char *name)
1214 : {
1215 2 : if (!strcmp("radius", name)) return 0;
1216 1 : if (!strcmp("metadata", name)) return 1;
1217 0 : return -1;
1218 : }
1219 :
1220 :
1221 1 : static GF_Node *Circle2D_Create()
1222 : {
1223 : X_Circle2D *p;
1224 1 : GF_SAFEALLOC(p, X_Circle2D);
1225 1 : if(!p) return NULL;
1226 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Circle2D);
1227 :
1228 : /*default field values*/
1229 1 : p->radius = FLT2FIX(1);
1230 1 : return (GF_Node *)p;
1231 : }
1232 :
1233 :
1234 : /*
1235 : Collision Node deletion
1236 : */
1237 :
1238 1 : static void Collision_Del(GF_Node *node)
1239 : {
1240 : X_Collision *p = (X_Collision *) node;
1241 1 : gf_node_unregister((GF_Node *) p->proxy, node);
1242 1 : gf_node_unregister((GF_Node *) p->metadata, node);
1243 1 : gf_sg_vrml_parent_destroy(node);
1244 1 : gf_node_free((GF_Node *)p);
1245 1 : }
1246 :
1247 :
1248 : static u32 Collision_get_field_count(GF_Node *node, u8 dummy)
1249 : {
1250 : return 8;
1251 : }
1252 :
1253 16 : static GF_Err Collision_get_field(GF_Node *node, GF_FieldInfo *info)
1254 : {
1255 16 : switch (info->fieldIndex) {
1256 2 : case 0:
1257 2 : info->name = "addChildren";
1258 2 : info->eventType = GF_SG_EVENT_IN;
1259 2 : info->on_event_in = ((X_Collision *)node)->on_addChildren;
1260 2 : info->fieldType = GF_SG_VRML_MFNODE;
1261 2 : info->NDTtype = NDT_SF3DNode;
1262 2 : info->far_ptr = & ((X_Collision *)node)->addChildren;
1263 2 : return GF_OK;
1264 2 : case 1:
1265 2 : info->name = "removeChildren";
1266 2 : info->eventType = GF_SG_EVENT_IN;
1267 2 : info->on_event_in = ((X_Collision *)node)->on_removeChildren;
1268 2 : info->fieldType = GF_SG_VRML_MFNODE;
1269 2 : info->NDTtype = NDT_SF3DNode;
1270 2 : info->far_ptr = & ((X_Collision *)node)->removeChildren;
1271 2 : return GF_OK;
1272 2 : case 2:
1273 2 : info->name = "children";
1274 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1275 2 : info->fieldType = GF_SG_VRML_MFNODE;
1276 2 : info->NDTtype = NDT_SF3DNode;
1277 2 : info->far_ptr = & ((X_Collision *)node)->children;
1278 2 : return GF_OK;
1279 2 : case 3:
1280 2 : info->name = "enabled";
1281 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1282 2 : info->fieldType = GF_SG_VRML_SFBOOL;
1283 2 : info->far_ptr = & ((X_Collision *) node)->enabled;
1284 2 : return GF_OK;
1285 2 : case 4:
1286 2 : info->name = "proxy";
1287 2 : info->eventType = GF_SG_EVENT_FIELD;
1288 2 : info->fieldType = GF_SG_VRML_SFNODE;
1289 2 : info->NDTtype = NDT_SF3DNode;
1290 2 : info->far_ptr = & ((X_Collision *)node)->proxy;
1291 2 : return GF_OK;
1292 2 : case 5:
1293 2 : info->name = "collideTime";
1294 2 : info->eventType = GF_SG_EVENT_OUT;
1295 2 : info->fieldType = GF_SG_VRML_SFTIME;
1296 2 : info->far_ptr = & ((X_Collision *) node)->collideTime;
1297 2 : return GF_OK;
1298 2 : case 6:
1299 2 : info->name = "isActive";
1300 2 : info->eventType = GF_SG_EVENT_OUT;
1301 2 : info->fieldType = GF_SG_VRML_SFBOOL;
1302 2 : info->far_ptr = & ((X_Collision *) node)->isActive;
1303 2 : return GF_OK;
1304 2 : case 7:
1305 2 : info->name = "metadata";
1306 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1307 2 : info->fieldType = GF_SG_VRML_SFNODE;
1308 2 : info->NDTtype = NDT_SFMetadataNode;
1309 2 : info->far_ptr = & ((X_Collision *)node)->metadata;
1310 2 : return GF_OK;
1311 : default:
1312 : return GF_BAD_PARAM;
1313 : }
1314 : }
1315 :
1316 :
1317 8 : static s32 Collision_get_field_index_by_name(char *name)
1318 : {
1319 8 : if (!strcmp("addChildren", name)) return 0;
1320 7 : if (!strcmp("removeChildren", name)) return 1;
1321 6 : if (!strcmp("children", name)) return 2;
1322 5 : if (!strcmp("enabled", name)) return 3;
1323 4 : if (!strcmp("proxy", name)) return 4;
1324 3 : if (!strcmp("collideTime", name)) return 5;
1325 2 : if (!strcmp("isActive", name)) return 6;
1326 1 : if (!strcmp("metadata", name)) return 7;
1327 0 : return -1;
1328 : }
1329 :
1330 :
1331 1 : static GF_Node *Collision_Create()
1332 : {
1333 : X_Collision *p;
1334 1 : GF_SAFEALLOC(p, X_Collision);
1335 1 : if(!p) return NULL;
1336 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Collision);
1337 1 : gf_sg_vrml_parent_setup((GF_Node *) p);
1338 :
1339 : /*default field values*/
1340 1 : p->enabled = 1;
1341 1 : return (GF_Node *)p;
1342 : }
1343 :
1344 :
1345 : /*
1346 : Color Node deletion
1347 : */
1348 :
1349 8 : static void Color_Del(GF_Node *node)
1350 : {
1351 : X_Color *p = (X_Color *) node;
1352 8 : gf_sg_mfcolor_del(p->color);
1353 8 : gf_node_unregister((GF_Node *) p->metadata, node);
1354 8 : gf_node_free((GF_Node *)p);
1355 8 : }
1356 :
1357 :
1358 : static u32 Color_get_field_count(GF_Node *node, u8 dummy)
1359 : {
1360 : return 2;
1361 : }
1362 :
1363 : static GF_Err Color_get_field(GF_Node *node, GF_FieldInfo *info)
1364 : {
1365 11 : switch (info->fieldIndex) {
1366 9 : case 0:
1367 9 : info->name = "color";
1368 9 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1369 9 : info->fieldType = GF_SG_VRML_MFCOLOR;
1370 9 : info->far_ptr = & ((X_Color *) node)->color;
1371 : return GF_OK;
1372 2 : case 1:
1373 2 : info->name = "metadata";
1374 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1375 2 : info->fieldType = GF_SG_VRML_SFNODE;
1376 2 : info->NDTtype = NDT_SFMetadataNode;
1377 2 : info->far_ptr = & ((X_Color *)node)->metadata;
1378 : return GF_OK;
1379 : default:
1380 : return GF_BAD_PARAM;
1381 : }
1382 : }
1383 :
1384 :
1385 9 : static s32 Color_get_field_index_by_name(char *name)
1386 : {
1387 9 : if (!strcmp("color", name)) return 0;
1388 1 : if (!strcmp("metadata", name)) return 1;
1389 0 : return -1;
1390 : }
1391 :
1392 :
1393 8 : static GF_Node *Color_Create()
1394 : {
1395 : X_Color *p;
1396 8 : GF_SAFEALLOC(p, X_Color);
1397 8 : if(!p) return NULL;
1398 8 : gf_node_setup((GF_Node *)p, TAG_X3D_Color);
1399 :
1400 : /*default field values*/
1401 8 : return (GF_Node *)p;
1402 : }
1403 :
1404 :
1405 : /*
1406 : ColorInterpolator Node deletion
1407 : */
1408 :
1409 1 : static void ColorInterpolator_Del(GF_Node *node)
1410 : {
1411 : X_ColorInterpolator *p = (X_ColorInterpolator *) node;
1412 1 : gf_sg_mffloat_del(p->key);
1413 1 : gf_sg_mfcolor_del(p->keyValue);
1414 1 : gf_node_unregister((GF_Node *) p->metadata, node);
1415 1 : gf_node_free((GF_Node *)p);
1416 1 : }
1417 :
1418 :
1419 : static u32 ColorInterpolator_get_field_count(GF_Node *node, u8 dummy)
1420 : {
1421 : return 5;
1422 : }
1423 :
1424 10 : static GF_Err ColorInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
1425 : {
1426 10 : switch (info->fieldIndex) {
1427 2 : case 0:
1428 2 : info->name = "set_fraction";
1429 2 : info->eventType = GF_SG_EVENT_IN;
1430 2 : info->on_event_in = ((X_ColorInterpolator *)node)->on_set_fraction;
1431 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
1432 2 : info->far_ptr = & ((X_ColorInterpolator *) node)->set_fraction;
1433 2 : return GF_OK;
1434 2 : case 1:
1435 2 : info->name = "key";
1436 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1437 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
1438 2 : info->far_ptr = & ((X_ColorInterpolator *) node)->key;
1439 2 : return GF_OK;
1440 2 : case 2:
1441 2 : info->name = "keyValue";
1442 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1443 2 : info->fieldType = GF_SG_VRML_MFCOLOR;
1444 2 : info->far_ptr = & ((X_ColorInterpolator *) node)->keyValue;
1445 2 : return GF_OK;
1446 2 : case 3:
1447 2 : info->name = "value_changed";
1448 2 : info->eventType = GF_SG_EVENT_OUT;
1449 2 : info->fieldType = GF_SG_VRML_SFCOLOR;
1450 2 : info->far_ptr = & ((X_ColorInterpolator *) node)->value_changed;
1451 2 : return GF_OK;
1452 2 : case 4:
1453 2 : info->name = "metadata";
1454 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1455 2 : info->fieldType = GF_SG_VRML_SFNODE;
1456 2 : info->NDTtype = NDT_SFMetadataNode;
1457 2 : info->far_ptr = & ((X_ColorInterpolator *)node)->metadata;
1458 2 : return GF_OK;
1459 : default:
1460 : return GF_BAD_PARAM;
1461 : }
1462 : }
1463 :
1464 :
1465 5 : static s32 ColorInterpolator_get_field_index_by_name(char *name)
1466 : {
1467 5 : if (!strcmp("set_fraction", name)) return 0;
1468 4 : if (!strcmp("key", name)) return 1;
1469 3 : if (!strcmp("keyValue", name)) return 2;
1470 2 : if (!strcmp("value_changed", name)) return 3;
1471 1 : if (!strcmp("metadata", name)) return 4;
1472 0 : return -1;
1473 : }
1474 :
1475 :
1476 1 : static GF_Node *ColorInterpolator_Create()
1477 : {
1478 : X_ColorInterpolator *p;
1479 1 : GF_SAFEALLOC(p, X_ColorInterpolator);
1480 1 : if(!p) return NULL;
1481 1 : gf_node_setup((GF_Node *)p, TAG_X3D_ColorInterpolator);
1482 :
1483 : /*default field values*/
1484 1 : return (GF_Node *)p;
1485 : }
1486 :
1487 :
1488 : /*
1489 : ColorRGBA Node deletion
1490 : */
1491 :
1492 2 : static void ColorRGBA_Del(GF_Node *node)
1493 : {
1494 : X_ColorRGBA *p = (X_ColorRGBA *) node;
1495 2 : gf_sg_mfcolorrgba_del(p->color);
1496 2 : gf_node_unregister((GF_Node *) p->metadata, node);
1497 2 : gf_node_free((GF_Node *)p);
1498 2 : }
1499 :
1500 :
1501 : static u32 ColorRGBA_get_field_count(GF_Node *node, u8 dummy)
1502 : {
1503 : return 2;
1504 : }
1505 :
1506 : static GF_Err ColorRGBA_get_field(GF_Node *node, GF_FieldInfo *info)
1507 : {
1508 5 : switch (info->fieldIndex) {
1509 3 : case 0:
1510 3 : info->name = "color";
1511 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1512 3 : info->fieldType = GF_SG_VRML_MFCOLORRGBA;
1513 3 : info->far_ptr = & ((X_ColorRGBA *) node)->color;
1514 : return GF_OK;
1515 2 : case 1:
1516 2 : info->name = "metadata";
1517 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1518 2 : info->fieldType = GF_SG_VRML_SFNODE;
1519 2 : info->NDTtype = NDT_SFMetadataNode;
1520 2 : info->far_ptr = & ((X_ColorRGBA *)node)->metadata;
1521 : return GF_OK;
1522 : default:
1523 : return GF_BAD_PARAM;
1524 : }
1525 : }
1526 :
1527 :
1528 3 : static s32 ColorRGBA_get_field_index_by_name(char *name)
1529 : {
1530 3 : if (!strcmp("color", name)) return 0;
1531 1 : if (!strcmp("metadata", name)) return 1;
1532 0 : return -1;
1533 : }
1534 :
1535 :
1536 2 : static GF_Node *ColorRGBA_Create()
1537 : {
1538 : X_ColorRGBA *p;
1539 2 : GF_SAFEALLOC(p, X_ColorRGBA);
1540 2 : if(!p) return NULL;
1541 2 : gf_node_setup((GF_Node *)p, TAG_X3D_ColorRGBA);
1542 :
1543 : /*default field values*/
1544 2 : return (GF_Node *)p;
1545 : }
1546 :
1547 :
1548 : /*
1549 : Cone Node deletion
1550 : */
1551 :
1552 : static void Cone_Del(GF_Node *node)
1553 : {
1554 : X_Cone *p = (X_Cone *) node;
1555 1 : gf_node_unregister((GF_Node *) p->metadata, node);
1556 1 : gf_node_free((GF_Node *)p);
1557 : }
1558 :
1559 :
1560 : static u32 Cone_get_field_count(GF_Node *node, u8 dummy)
1561 : {
1562 : return 5;
1563 : }
1564 :
1565 10 : static GF_Err Cone_get_field(GF_Node *node, GF_FieldInfo *info)
1566 : {
1567 10 : switch (info->fieldIndex) {
1568 2 : case 0:
1569 2 : info->name = "bottomRadius";
1570 2 : info->eventType = GF_SG_EVENT_FIELD;
1571 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
1572 2 : info->far_ptr = & ((X_Cone *) node)->bottomRadius;
1573 2 : return GF_OK;
1574 2 : case 1:
1575 2 : info->name = "height";
1576 2 : info->eventType = GF_SG_EVENT_FIELD;
1577 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
1578 2 : info->far_ptr = & ((X_Cone *) node)->height;
1579 2 : return GF_OK;
1580 2 : case 2:
1581 2 : info->name = "side";
1582 2 : info->eventType = GF_SG_EVENT_FIELD;
1583 2 : info->fieldType = GF_SG_VRML_SFBOOL;
1584 2 : info->far_ptr = & ((X_Cone *) node)->side;
1585 2 : return GF_OK;
1586 2 : case 3:
1587 2 : info->name = "bottom";
1588 2 : info->eventType = GF_SG_EVENT_FIELD;
1589 2 : info->fieldType = GF_SG_VRML_SFBOOL;
1590 2 : info->far_ptr = & ((X_Cone *) node)->bottom;
1591 2 : return GF_OK;
1592 2 : case 4:
1593 2 : info->name = "metadata";
1594 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1595 2 : info->fieldType = GF_SG_VRML_SFNODE;
1596 2 : info->NDTtype = NDT_SFMetadataNode;
1597 2 : info->far_ptr = & ((X_Cone *)node)->metadata;
1598 2 : return GF_OK;
1599 : default:
1600 : return GF_BAD_PARAM;
1601 : }
1602 : }
1603 :
1604 :
1605 5 : static s32 Cone_get_field_index_by_name(char *name)
1606 : {
1607 5 : if (!strcmp("bottomRadius", name)) return 0;
1608 4 : if (!strcmp("height", name)) return 1;
1609 3 : if (!strcmp("side", name)) return 2;
1610 2 : if (!strcmp("bottom", name)) return 3;
1611 1 : if (!strcmp("metadata", name)) return 4;
1612 0 : return -1;
1613 : }
1614 :
1615 :
1616 1 : static GF_Node *Cone_Create()
1617 : {
1618 : X_Cone *p;
1619 1 : GF_SAFEALLOC(p, X_Cone);
1620 1 : if(!p) return NULL;
1621 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Cone);
1622 :
1623 : /*default field values*/
1624 1 : p->bottomRadius = FLT2FIX(1);
1625 1 : p->height = FLT2FIX(2);
1626 1 : p->side = 1;
1627 1 : p->bottom = 1;
1628 1 : return (GF_Node *)p;
1629 : }
1630 :
1631 :
1632 : /*
1633 : Contour2D Node deletion
1634 : */
1635 :
1636 1 : static void Contour2D_Del(GF_Node *node)
1637 : {
1638 : X_Contour2D *p = (X_Contour2D *) node;
1639 1 : gf_node_unregister((GF_Node *) p->metadata, node);
1640 1 : gf_sg_vrml_parent_destroy(node);
1641 1 : gf_node_free((GF_Node *)p);
1642 1 : }
1643 :
1644 :
1645 : static u32 Contour2D_get_field_count(GF_Node *node, u8 dummy)
1646 : {
1647 : return 4;
1648 : }
1649 :
1650 8 : static GF_Err Contour2D_get_field(GF_Node *node, GF_FieldInfo *info)
1651 : {
1652 8 : switch (info->fieldIndex) {
1653 2 : case 0:
1654 2 : info->name = "addChildren";
1655 2 : info->eventType = GF_SG_EVENT_IN;
1656 2 : info->on_event_in = ((X_Contour2D *)node)->on_addChildren;
1657 2 : info->fieldType = GF_SG_VRML_MFNODE;
1658 2 : info->NDTtype = NDT_SFNurbsControlCurveNode;
1659 2 : info->far_ptr = & ((X_Contour2D *)node)->addChildren;
1660 2 : return GF_OK;
1661 2 : case 1:
1662 2 : info->name = "removeChildren";
1663 2 : info->eventType = GF_SG_EVENT_IN;
1664 2 : info->on_event_in = ((X_Contour2D *)node)->on_removeChildren;
1665 2 : info->fieldType = GF_SG_VRML_MFNODE;
1666 2 : info->NDTtype = NDT_SFNurbsControlCurveNode;
1667 2 : info->far_ptr = & ((X_Contour2D *)node)->removeChildren;
1668 2 : return GF_OK;
1669 2 : case 2:
1670 2 : info->name = "children";
1671 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1672 2 : info->fieldType = GF_SG_VRML_MFNODE;
1673 2 : info->NDTtype = NDT_SFNurbsControlCurveNode;
1674 2 : info->far_ptr = & ((X_Contour2D *)node)->children;
1675 2 : return GF_OK;
1676 2 : case 3:
1677 2 : info->name = "metadata";
1678 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1679 2 : info->fieldType = GF_SG_VRML_SFNODE;
1680 2 : info->NDTtype = NDT_SFMetadataNode;
1681 2 : info->far_ptr = & ((X_Contour2D *)node)->metadata;
1682 2 : return GF_OK;
1683 : default:
1684 : return GF_BAD_PARAM;
1685 : }
1686 : }
1687 :
1688 :
1689 4 : static s32 Contour2D_get_field_index_by_name(char *name)
1690 : {
1691 4 : if (!strcmp("addChildren", name)) return 0;
1692 3 : if (!strcmp("removeChildren", name)) return 1;
1693 2 : if (!strcmp("children", name)) return 2;
1694 1 : if (!strcmp("metadata", name)) return 3;
1695 0 : return -1;
1696 : }
1697 :
1698 :
1699 1 : static GF_Node *Contour2D_Create()
1700 : {
1701 : X_Contour2D *p;
1702 1 : GF_SAFEALLOC(p, X_Contour2D);
1703 1 : if(!p) return NULL;
1704 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Contour2D);
1705 1 : gf_sg_vrml_parent_setup((GF_Node *) p);
1706 :
1707 : /*default field values*/
1708 1 : return (GF_Node *)p;
1709 : }
1710 :
1711 :
1712 : /*
1713 : ContourPolyline2D Node deletion
1714 : */
1715 :
1716 1 : static void ContourPolyline2D_Del(GF_Node *node)
1717 : {
1718 : X_ContourPolyline2D *p = (X_ContourPolyline2D *) node;
1719 1 : gf_sg_mfvec2f_del(p->point);
1720 1 : gf_node_unregister((GF_Node *) p->metadata, node);
1721 1 : gf_node_free((GF_Node *)p);
1722 1 : }
1723 :
1724 :
1725 : static u32 ContourPolyline2D_get_field_count(GF_Node *node, u8 dummy)
1726 : {
1727 : return 2;
1728 : }
1729 :
1730 : static GF_Err ContourPolyline2D_get_field(GF_Node *node, GF_FieldInfo *info)
1731 : {
1732 4 : switch (info->fieldIndex) {
1733 2 : case 0:
1734 2 : info->name = "point";
1735 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1736 2 : info->fieldType = GF_SG_VRML_MFVEC2F;
1737 2 : info->far_ptr = & ((X_ContourPolyline2D *) node)->point;
1738 : return GF_OK;
1739 2 : case 1:
1740 2 : info->name = "metadata";
1741 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1742 2 : info->fieldType = GF_SG_VRML_SFNODE;
1743 2 : info->NDTtype = NDT_SFMetadataNode;
1744 2 : info->far_ptr = & ((X_ContourPolyline2D *)node)->metadata;
1745 : return GF_OK;
1746 : default:
1747 : return GF_BAD_PARAM;
1748 : }
1749 : }
1750 :
1751 :
1752 2 : static s32 ContourPolyline2D_get_field_index_by_name(char *name)
1753 : {
1754 2 : if (!strcmp("point", name)) return 0;
1755 1 : if (!strcmp("metadata", name)) return 1;
1756 0 : return -1;
1757 : }
1758 :
1759 :
1760 1 : static GF_Node *ContourPolyline2D_Create()
1761 : {
1762 : X_ContourPolyline2D *p;
1763 1 : GF_SAFEALLOC(p, X_ContourPolyline2D);
1764 1 : if(!p) return NULL;
1765 1 : gf_node_setup((GF_Node *)p, TAG_X3D_ContourPolyline2D);
1766 :
1767 : /*default field values*/
1768 1 : return (GF_Node *)p;
1769 : }
1770 :
1771 :
1772 : /*
1773 : Coordinate Node deletion
1774 : */
1775 :
1776 19 : static void Coordinate_Del(GF_Node *node)
1777 : {
1778 : X_Coordinate *p = (X_Coordinate *) node;
1779 19 : gf_sg_mfvec3f_del(p->point);
1780 19 : gf_node_unregister((GF_Node *) p->metadata, node);
1781 19 : gf_node_free((GF_Node *)p);
1782 19 : }
1783 :
1784 :
1785 : static u32 Coordinate_get_field_count(GF_Node *node, u8 dummy)
1786 : {
1787 : return 2;
1788 : }
1789 :
1790 : static GF_Err Coordinate_get_field(GF_Node *node, GF_FieldInfo *info)
1791 : {
1792 22 : switch (info->fieldIndex) {
1793 20 : case 0:
1794 20 : info->name = "point";
1795 20 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1796 20 : info->fieldType = GF_SG_VRML_MFVEC3F;
1797 20 : info->far_ptr = & ((X_Coordinate *) node)->point;
1798 : return GF_OK;
1799 2 : case 1:
1800 2 : info->name = "metadata";
1801 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1802 2 : info->fieldType = GF_SG_VRML_SFNODE;
1803 2 : info->NDTtype = NDT_SFMetadataNode;
1804 2 : info->far_ptr = & ((X_Coordinate *)node)->metadata;
1805 : return GF_OK;
1806 : default:
1807 : return GF_BAD_PARAM;
1808 : }
1809 : }
1810 :
1811 :
1812 20 : static s32 Coordinate_get_field_index_by_name(char *name)
1813 : {
1814 20 : if (!strcmp("point", name)) return 0;
1815 1 : if (!strcmp("metadata", name)) return 1;
1816 0 : return -1;
1817 : }
1818 :
1819 :
1820 19 : static GF_Node *Coordinate_Create()
1821 : {
1822 : X_Coordinate *p;
1823 19 : GF_SAFEALLOC(p, X_Coordinate);
1824 19 : if(!p) return NULL;
1825 19 : gf_node_setup((GF_Node *)p, TAG_X3D_Coordinate);
1826 :
1827 : /*default field values*/
1828 19 : return (GF_Node *)p;
1829 : }
1830 :
1831 :
1832 : /*
1833 : CoordinateDouble Node deletion
1834 : */
1835 :
1836 1 : static void CoordinateDouble_Del(GF_Node *node)
1837 : {
1838 : X_CoordinateDouble *p = (X_CoordinateDouble *) node;
1839 1 : gf_sg_mfvec3d_del(p->point);
1840 1 : gf_node_unregister((GF_Node *) p->metadata, node);
1841 1 : gf_node_free((GF_Node *)p);
1842 1 : }
1843 :
1844 :
1845 : static u32 CoordinateDouble_get_field_count(GF_Node *node, u8 dummy)
1846 : {
1847 : return 2;
1848 : }
1849 :
1850 : static GF_Err CoordinateDouble_get_field(GF_Node *node, GF_FieldInfo *info)
1851 : {
1852 4 : switch (info->fieldIndex) {
1853 2 : case 0:
1854 2 : info->name = "point";
1855 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1856 2 : info->fieldType = GF_SG_VRML_MFVEC3D;
1857 2 : info->far_ptr = & ((X_CoordinateDouble *) node)->point;
1858 : return GF_OK;
1859 2 : case 1:
1860 2 : info->name = "metadata";
1861 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1862 2 : info->fieldType = GF_SG_VRML_SFNODE;
1863 2 : info->NDTtype = NDT_SFMetadataNode;
1864 2 : info->far_ptr = & ((X_CoordinateDouble *)node)->metadata;
1865 : return GF_OK;
1866 : default:
1867 : return GF_BAD_PARAM;
1868 : }
1869 : }
1870 :
1871 :
1872 2 : static s32 CoordinateDouble_get_field_index_by_name(char *name)
1873 : {
1874 2 : if (!strcmp("point", name)) return 0;
1875 1 : if (!strcmp("metadata", name)) return 1;
1876 0 : return -1;
1877 : }
1878 :
1879 :
1880 1 : static GF_Node *CoordinateDouble_Create()
1881 : {
1882 : X_CoordinateDouble *p;
1883 1 : GF_SAFEALLOC(p, X_CoordinateDouble);
1884 1 : if(!p) return NULL;
1885 1 : gf_node_setup((GF_Node *)p, TAG_X3D_CoordinateDouble);
1886 :
1887 : /*default field values*/
1888 1 : return (GF_Node *)p;
1889 : }
1890 :
1891 :
1892 : /*
1893 : Coordinate2D Node deletion
1894 : */
1895 :
1896 1 : static void Coordinate2D_Del(GF_Node *node)
1897 : {
1898 : X_Coordinate2D *p = (X_Coordinate2D *) node;
1899 1 : gf_sg_mfvec2f_del(p->point);
1900 1 : gf_node_unregister((GF_Node *) p->metadata, node);
1901 1 : gf_node_free((GF_Node *)p);
1902 1 : }
1903 :
1904 :
1905 : static u32 Coordinate2D_get_field_count(GF_Node *node, u8 dummy)
1906 : {
1907 : return 2;
1908 : }
1909 :
1910 : static GF_Err Coordinate2D_get_field(GF_Node *node, GF_FieldInfo *info)
1911 : {
1912 4 : switch (info->fieldIndex) {
1913 2 : case 0:
1914 2 : info->name = "point";
1915 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1916 2 : info->fieldType = GF_SG_VRML_MFVEC2F;
1917 2 : info->far_ptr = & ((X_Coordinate2D *) node)->point;
1918 : return GF_OK;
1919 2 : case 1:
1920 2 : info->name = "metadata";
1921 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1922 2 : info->fieldType = GF_SG_VRML_SFNODE;
1923 2 : info->NDTtype = NDT_SFMetadataNode;
1924 2 : info->far_ptr = & ((X_Coordinate2D *)node)->metadata;
1925 : return GF_OK;
1926 : default:
1927 : return GF_BAD_PARAM;
1928 : }
1929 : }
1930 :
1931 :
1932 2 : static s32 Coordinate2D_get_field_index_by_name(char *name)
1933 : {
1934 2 : if (!strcmp("point", name)) return 0;
1935 1 : if (!strcmp("metadata", name)) return 1;
1936 0 : return -1;
1937 : }
1938 :
1939 :
1940 1 : static GF_Node *Coordinate2D_Create()
1941 : {
1942 : X_Coordinate2D *p;
1943 1 : GF_SAFEALLOC(p, X_Coordinate2D);
1944 1 : if(!p) return NULL;
1945 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Coordinate2D);
1946 :
1947 : /*default field values*/
1948 1 : return (GF_Node *)p;
1949 : }
1950 :
1951 :
1952 : /*
1953 : CoordinateInterpolator Node deletion
1954 : */
1955 :
1956 1 : static void CoordinateInterpolator_Del(GF_Node *node)
1957 : {
1958 : X_CoordinateInterpolator *p = (X_CoordinateInterpolator *) node;
1959 1 : gf_sg_mffloat_del(p->key);
1960 1 : gf_sg_mfvec3f_del(p->keyValue);
1961 1 : gf_sg_mfvec3f_del(p->value_changed);
1962 1 : gf_node_unregister((GF_Node *) p->metadata, node);
1963 1 : gf_node_free((GF_Node *)p);
1964 1 : }
1965 :
1966 :
1967 : static u32 CoordinateInterpolator_get_field_count(GF_Node *node, u8 dummy)
1968 : {
1969 : return 5;
1970 : }
1971 :
1972 10 : static GF_Err CoordinateInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
1973 : {
1974 10 : switch (info->fieldIndex) {
1975 2 : case 0:
1976 2 : info->name = "set_fraction";
1977 2 : info->eventType = GF_SG_EVENT_IN;
1978 2 : info->on_event_in = ((X_CoordinateInterpolator *)node)->on_set_fraction;
1979 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
1980 2 : info->far_ptr = & ((X_CoordinateInterpolator *) node)->set_fraction;
1981 2 : return GF_OK;
1982 2 : case 1:
1983 2 : info->name = "key";
1984 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1985 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
1986 2 : info->far_ptr = & ((X_CoordinateInterpolator *) node)->key;
1987 2 : return GF_OK;
1988 2 : case 2:
1989 2 : info->name = "keyValue";
1990 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1991 2 : info->fieldType = GF_SG_VRML_MFVEC3F;
1992 2 : info->far_ptr = & ((X_CoordinateInterpolator *) node)->keyValue;
1993 2 : return GF_OK;
1994 2 : case 3:
1995 2 : info->name = "value_changed";
1996 2 : info->eventType = GF_SG_EVENT_OUT;
1997 2 : info->fieldType = GF_SG_VRML_MFVEC3F;
1998 2 : info->far_ptr = & ((X_CoordinateInterpolator *) node)->value_changed;
1999 2 : return GF_OK;
2000 2 : case 4:
2001 2 : info->name = "metadata";
2002 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2003 2 : info->fieldType = GF_SG_VRML_SFNODE;
2004 2 : info->NDTtype = NDT_SFMetadataNode;
2005 2 : info->far_ptr = & ((X_CoordinateInterpolator *)node)->metadata;
2006 2 : return GF_OK;
2007 : default:
2008 : return GF_BAD_PARAM;
2009 : }
2010 : }
2011 :
2012 :
2013 5 : static s32 CoordinateInterpolator_get_field_index_by_name(char *name)
2014 : {
2015 5 : if (!strcmp("set_fraction", name)) return 0;
2016 4 : if (!strcmp("key", name)) return 1;
2017 3 : if (!strcmp("keyValue", name)) return 2;
2018 2 : if (!strcmp("value_changed", name)) return 3;
2019 1 : if (!strcmp("metadata", name)) return 4;
2020 0 : return -1;
2021 : }
2022 :
2023 :
2024 1 : static GF_Node *CoordinateInterpolator_Create()
2025 : {
2026 : X_CoordinateInterpolator *p;
2027 1 : GF_SAFEALLOC(p, X_CoordinateInterpolator);
2028 1 : if(!p) return NULL;
2029 1 : gf_node_setup((GF_Node *)p, TAG_X3D_CoordinateInterpolator);
2030 :
2031 : /*default field values*/
2032 1 : return (GF_Node *)p;
2033 : }
2034 :
2035 :
2036 : /*
2037 : CoordinateInterpolator2D Node deletion
2038 : */
2039 :
2040 1 : static void CoordinateInterpolator2D_Del(GF_Node *node)
2041 : {
2042 : X_CoordinateInterpolator2D *p = (X_CoordinateInterpolator2D *) node;
2043 1 : gf_sg_mffloat_del(p->key);
2044 1 : gf_sg_mfvec2f_del(p->keyValue);
2045 1 : gf_sg_mfvec2f_del(p->value_changed);
2046 1 : gf_node_unregister((GF_Node *) p->metadata, node);
2047 1 : gf_node_free((GF_Node *)p);
2048 1 : }
2049 :
2050 :
2051 : static u32 CoordinateInterpolator2D_get_field_count(GF_Node *node, u8 dummy)
2052 : {
2053 : return 5;
2054 : }
2055 :
2056 10 : static GF_Err CoordinateInterpolator2D_get_field(GF_Node *node, GF_FieldInfo *info)
2057 : {
2058 10 : switch (info->fieldIndex) {
2059 2 : case 0:
2060 2 : info->name = "set_fraction";
2061 2 : info->eventType = GF_SG_EVENT_IN;
2062 2 : info->on_event_in = ((X_CoordinateInterpolator2D *)node)->on_set_fraction;
2063 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2064 2 : info->far_ptr = & ((X_CoordinateInterpolator2D *) node)->set_fraction;
2065 2 : return GF_OK;
2066 2 : case 1:
2067 2 : info->name = "key";
2068 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2069 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
2070 2 : info->far_ptr = & ((X_CoordinateInterpolator2D *) node)->key;
2071 2 : return GF_OK;
2072 2 : case 2:
2073 2 : info->name = "keyValue";
2074 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2075 2 : info->fieldType = GF_SG_VRML_MFVEC2F;
2076 2 : info->far_ptr = & ((X_CoordinateInterpolator2D *) node)->keyValue;
2077 2 : return GF_OK;
2078 2 : case 3:
2079 2 : info->name = "value_changed";
2080 2 : info->eventType = GF_SG_EVENT_OUT;
2081 2 : info->fieldType = GF_SG_VRML_MFVEC2F;
2082 2 : info->far_ptr = & ((X_CoordinateInterpolator2D *) node)->value_changed;
2083 2 : return GF_OK;
2084 2 : case 4:
2085 2 : info->name = "metadata";
2086 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2087 2 : info->fieldType = GF_SG_VRML_SFNODE;
2088 2 : info->NDTtype = NDT_SFMetadataNode;
2089 2 : info->far_ptr = & ((X_CoordinateInterpolator2D *)node)->metadata;
2090 2 : return GF_OK;
2091 : default:
2092 : return GF_BAD_PARAM;
2093 : }
2094 : }
2095 :
2096 :
2097 5 : static s32 CoordinateInterpolator2D_get_field_index_by_name(char *name)
2098 : {
2099 5 : if (!strcmp("set_fraction", name)) return 0;
2100 4 : if (!strcmp("key", name)) return 1;
2101 3 : if (!strcmp("keyValue", name)) return 2;
2102 2 : if (!strcmp("value_changed", name)) return 3;
2103 1 : if (!strcmp("metadata", name)) return 4;
2104 0 : return -1;
2105 : }
2106 :
2107 :
2108 1 : static GF_Node *CoordinateInterpolator2D_Create()
2109 : {
2110 : X_CoordinateInterpolator2D *p;
2111 1 : GF_SAFEALLOC(p, X_CoordinateInterpolator2D);
2112 1 : if(!p) return NULL;
2113 1 : gf_node_setup((GF_Node *)p, TAG_X3D_CoordinateInterpolator2D);
2114 :
2115 : /*default field values*/
2116 1 : return (GF_Node *)p;
2117 : }
2118 :
2119 :
2120 : /*
2121 : Cylinder Node deletion
2122 : */
2123 :
2124 : static void Cylinder_Del(GF_Node *node)
2125 : {
2126 : X_Cylinder *p = (X_Cylinder *) node;
2127 1 : gf_node_unregister((GF_Node *) p->metadata, node);
2128 1 : gf_node_free((GF_Node *)p);
2129 : }
2130 :
2131 :
2132 : static u32 Cylinder_get_field_count(GF_Node *node, u8 dummy)
2133 : {
2134 : return 6;
2135 : }
2136 :
2137 12 : static GF_Err Cylinder_get_field(GF_Node *node, GF_FieldInfo *info)
2138 : {
2139 12 : switch (info->fieldIndex) {
2140 2 : case 0:
2141 2 : info->name = "bottom";
2142 2 : info->eventType = GF_SG_EVENT_FIELD;
2143 2 : info->fieldType = GF_SG_VRML_SFBOOL;
2144 2 : info->far_ptr = & ((X_Cylinder *) node)->bottom;
2145 2 : return GF_OK;
2146 2 : case 1:
2147 2 : info->name = "height";
2148 2 : info->eventType = GF_SG_EVENT_FIELD;
2149 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2150 2 : info->far_ptr = & ((X_Cylinder *) node)->height;
2151 2 : return GF_OK;
2152 2 : case 2:
2153 2 : info->name = "radius";
2154 2 : info->eventType = GF_SG_EVENT_FIELD;
2155 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2156 2 : info->far_ptr = & ((X_Cylinder *) node)->radius;
2157 2 : return GF_OK;
2158 2 : case 3:
2159 2 : info->name = "side";
2160 2 : info->eventType = GF_SG_EVENT_FIELD;
2161 2 : info->fieldType = GF_SG_VRML_SFBOOL;
2162 2 : info->far_ptr = & ((X_Cylinder *) node)->side;
2163 2 : return GF_OK;
2164 2 : case 4:
2165 2 : info->name = "top";
2166 2 : info->eventType = GF_SG_EVENT_FIELD;
2167 2 : info->fieldType = GF_SG_VRML_SFBOOL;
2168 2 : info->far_ptr = & ((X_Cylinder *) node)->top;
2169 2 : return GF_OK;
2170 2 : case 5:
2171 2 : info->name = "metadata";
2172 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2173 2 : info->fieldType = GF_SG_VRML_SFNODE;
2174 2 : info->NDTtype = NDT_SFMetadataNode;
2175 2 : info->far_ptr = & ((X_Cylinder *)node)->metadata;
2176 2 : return GF_OK;
2177 : default:
2178 : return GF_BAD_PARAM;
2179 : }
2180 : }
2181 :
2182 :
2183 6 : static s32 Cylinder_get_field_index_by_name(char *name)
2184 : {
2185 6 : if (!strcmp("bottom", name)) return 0;
2186 5 : if (!strcmp("height", name)) return 1;
2187 4 : if (!strcmp("radius", name)) return 2;
2188 3 : if (!strcmp("side", name)) return 3;
2189 2 : if (!strcmp("top", name)) return 4;
2190 1 : if (!strcmp("metadata", name)) return 5;
2191 0 : return -1;
2192 : }
2193 :
2194 :
2195 1 : static GF_Node *Cylinder_Create()
2196 : {
2197 : X_Cylinder *p;
2198 1 : GF_SAFEALLOC(p, X_Cylinder);
2199 1 : if(!p) return NULL;
2200 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Cylinder);
2201 :
2202 : /*default field values*/
2203 1 : p->bottom = 1;
2204 1 : p->height = FLT2FIX(2);
2205 1 : p->radius = FLT2FIX(1);
2206 1 : p->side = 1;
2207 1 : p->top = 1;
2208 1 : return (GF_Node *)p;
2209 : }
2210 :
2211 :
2212 : /*
2213 : CylinderSensor Node deletion
2214 : */
2215 :
2216 1 : static void CylinderSensor_Del(GF_Node *node)
2217 : {
2218 : X_CylinderSensor *p = (X_CylinderSensor *) node;
2219 1 : gf_node_unregister((GF_Node *) p->metadata, node);
2220 1 : gf_sg_sfstring_del(p->description);
2221 1 : gf_node_free((GF_Node *)p);
2222 1 : }
2223 :
2224 :
2225 : static u32 CylinderSensor_get_field_count(GF_Node *node, u8 dummy)
2226 : {
2227 : return 12;
2228 : }
2229 :
2230 24 : static GF_Err CylinderSensor_get_field(GF_Node *node, GF_FieldInfo *info)
2231 : {
2232 24 : switch (info->fieldIndex) {
2233 2 : case 0:
2234 2 : info->name = "autoOffset";
2235 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2236 2 : info->fieldType = GF_SG_VRML_SFBOOL;
2237 2 : info->far_ptr = & ((X_CylinderSensor *) node)->autoOffset;
2238 2 : return GF_OK;
2239 2 : case 1:
2240 2 : info->name = "diskAngle";
2241 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2242 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2243 2 : info->far_ptr = & ((X_CylinderSensor *) node)->diskAngle;
2244 2 : return GF_OK;
2245 2 : case 2:
2246 2 : info->name = "enabled";
2247 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2248 2 : info->fieldType = GF_SG_VRML_SFBOOL;
2249 2 : info->far_ptr = & ((X_CylinderSensor *) node)->enabled;
2250 2 : return GF_OK;
2251 2 : case 3:
2252 2 : info->name = "maxAngle";
2253 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2254 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2255 2 : info->far_ptr = & ((X_CylinderSensor *) node)->maxAngle;
2256 2 : return GF_OK;
2257 2 : case 4:
2258 2 : info->name = "minAngle";
2259 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2260 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2261 2 : info->far_ptr = & ((X_CylinderSensor *) node)->minAngle;
2262 2 : return GF_OK;
2263 2 : case 5:
2264 2 : info->name = "offset";
2265 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2266 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2267 2 : info->far_ptr = & ((X_CylinderSensor *) node)->offset;
2268 2 : return GF_OK;
2269 2 : case 6:
2270 2 : info->name = "isActive";
2271 2 : info->eventType = GF_SG_EVENT_OUT;
2272 2 : info->fieldType = GF_SG_VRML_SFBOOL;
2273 2 : info->far_ptr = & ((X_CylinderSensor *) node)->isActive;
2274 2 : return GF_OK;
2275 2 : case 7:
2276 2 : info->name = "rotation_changed";
2277 2 : info->eventType = GF_SG_EVENT_OUT;
2278 2 : info->fieldType = GF_SG_VRML_SFROTATION;
2279 2 : info->far_ptr = & ((X_CylinderSensor *) node)->rotation_changed;
2280 2 : return GF_OK;
2281 2 : case 8:
2282 2 : info->name = "trackPoint_changed";
2283 2 : info->eventType = GF_SG_EVENT_OUT;
2284 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
2285 2 : info->far_ptr = & ((X_CylinderSensor *) node)->trackPoint_changed;
2286 2 : return GF_OK;
2287 2 : case 9:
2288 2 : info->name = "metadata";
2289 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2290 2 : info->fieldType = GF_SG_VRML_SFNODE;
2291 2 : info->NDTtype = NDT_SFMetadataNode;
2292 2 : info->far_ptr = & ((X_CylinderSensor *)node)->metadata;
2293 2 : return GF_OK;
2294 2 : case 10:
2295 2 : info->name = "description";
2296 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2297 2 : info->fieldType = GF_SG_VRML_SFSTRING;
2298 2 : info->far_ptr = & ((X_CylinderSensor *) node)->description;
2299 2 : return GF_OK;
2300 2 : case 11:
2301 2 : info->name = "isOver";
2302 2 : info->eventType = GF_SG_EVENT_OUT;
2303 2 : info->fieldType = GF_SG_VRML_SFBOOL;
2304 2 : info->far_ptr = & ((X_CylinderSensor *) node)->isOver;
2305 2 : return GF_OK;
2306 : default:
2307 : return GF_BAD_PARAM;
2308 : }
2309 : }
2310 :
2311 :
2312 12 : static s32 CylinderSensor_get_field_index_by_name(char *name)
2313 : {
2314 12 : if (!strcmp("autoOffset", name)) return 0;
2315 11 : if (!strcmp("diskAngle", name)) return 1;
2316 10 : if (!strcmp("enabled", name)) return 2;
2317 9 : if (!strcmp("maxAngle", name)) return 3;
2318 8 : if (!strcmp("minAngle", name)) return 4;
2319 7 : if (!strcmp("offset", name)) return 5;
2320 6 : if (!strcmp("isActive", name)) return 6;
2321 5 : if (!strcmp("rotation_changed", name)) return 7;
2322 4 : if (!strcmp("trackPoint_changed", name)) return 8;
2323 3 : if (!strcmp("metadata", name)) return 9;
2324 2 : if (!strcmp("description", name)) return 10;
2325 1 : if (!strcmp("isOver", name)) return 11;
2326 0 : return -1;
2327 : }
2328 :
2329 :
2330 1 : static GF_Node *CylinderSensor_Create()
2331 : {
2332 : X_CylinderSensor *p;
2333 1 : GF_SAFEALLOC(p, X_CylinderSensor);
2334 1 : if(!p) return NULL;
2335 1 : gf_node_setup((GF_Node *)p, TAG_X3D_CylinderSensor);
2336 :
2337 : /*default field values*/
2338 1 : p->autoOffset = 1;
2339 1 : p->diskAngle = FLT2FIX(0.2617);
2340 1 : p->enabled = 1;
2341 1 : p->maxAngle = FLT2FIX(-1);
2342 1 : p->minAngle = FLT2FIX(0);
2343 1 : p->offset = FLT2FIX(0);
2344 1 : return (GF_Node *)p;
2345 : }
2346 :
2347 :
2348 : /*
2349 : DirectionalLight Node deletion
2350 : */
2351 :
2352 : static void DirectionalLight_Del(GF_Node *node)
2353 : {
2354 : X_DirectionalLight *p = (X_DirectionalLight *) node;
2355 1 : gf_node_unregister((GF_Node *) p->metadata, node);
2356 1 : gf_node_free((GF_Node *)p);
2357 : }
2358 :
2359 :
2360 : static u32 DirectionalLight_get_field_count(GF_Node *node, u8 dummy)
2361 : {
2362 : return 6;
2363 : }
2364 :
2365 12 : static GF_Err DirectionalLight_get_field(GF_Node *node, GF_FieldInfo *info)
2366 : {
2367 12 : switch (info->fieldIndex) {
2368 2 : case 0:
2369 2 : info->name = "ambientIntensity";
2370 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2371 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2372 2 : info->far_ptr = & ((X_DirectionalLight *) node)->ambientIntensity;
2373 2 : return GF_OK;
2374 2 : case 1:
2375 2 : info->name = "color";
2376 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2377 2 : info->fieldType = GF_SG_VRML_SFCOLOR;
2378 2 : info->far_ptr = & ((X_DirectionalLight *) node)->color;
2379 2 : return GF_OK;
2380 2 : case 2:
2381 2 : info->name = "direction";
2382 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2383 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
2384 2 : info->far_ptr = & ((X_DirectionalLight *) node)->direction;
2385 2 : return GF_OK;
2386 2 : case 3:
2387 2 : info->name = "intensity";
2388 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2389 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2390 2 : info->far_ptr = & ((X_DirectionalLight *) node)->intensity;
2391 2 : return GF_OK;
2392 2 : case 4:
2393 2 : info->name = "on";
2394 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2395 2 : info->fieldType = GF_SG_VRML_SFBOOL;
2396 2 : info->far_ptr = & ((X_DirectionalLight *) node)->on;
2397 2 : return GF_OK;
2398 2 : case 5:
2399 2 : info->name = "metadata";
2400 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2401 2 : info->fieldType = GF_SG_VRML_SFNODE;
2402 2 : info->NDTtype = NDT_SFMetadataNode;
2403 2 : info->far_ptr = & ((X_DirectionalLight *)node)->metadata;
2404 2 : return GF_OK;
2405 : default:
2406 : return GF_BAD_PARAM;
2407 : }
2408 : }
2409 :
2410 :
2411 6 : static s32 DirectionalLight_get_field_index_by_name(char *name)
2412 : {
2413 6 : if (!strcmp("ambientIntensity", name)) return 0;
2414 5 : if (!strcmp("color", name)) return 1;
2415 4 : if (!strcmp("direction", name)) return 2;
2416 3 : if (!strcmp("intensity", name)) return 3;
2417 2 : if (!strcmp("on", name)) return 4;
2418 1 : if (!strcmp("metadata", name)) return 5;
2419 0 : return -1;
2420 : }
2421 :
2422 :
2423 1 : static GF_Node *DirectionalLight_Create()
2424 : {
2425 : X_DirectionalLight *p;
2426 1 : GF_SAFEALLOC(p, X_DirectionalLight);
2427 1 : if(!p) return NULL;
2428 1 : gf_node_setup((GF_Node *)p, TAG_X3D_DirectionalLight);
2429 :
2430 : /*default field values*/
2431 1 : p->ambientIntensity = FLT2FIX(0);
2432 1 : p->color.red = FLT2FIX(1);
2433 1 : p->color.green = FLT2FIX(1);
2434 1 : p->color.blue = FLT2FIX(1);
2435 1 : p->direction.x = FLT2FIX(0);
2436 1 : p->direction.y = FLT2FIX(0);
2437 1 : p->direction.z = FLT2FIX(-1);
2438 1 : p->intensity = FLT2FIX(1);
2439 1 : p->on = 1;
2440 1 : return (GF_Node *)p;
2441 : }
2442 :
2443 :
2444 : /*
2445 : Disk2D Node deletion
2446 : */
2447 :
2448 : static void Disk2D_Del(GF_Node *node)
2449 : {
2450 : X_Disk2D *p = (X_Disk2D *) node;
2451 2 : gf_node_unregister((GF_Node *) p->metadata, node);
2452 2 : gf_node_free((GF_Node *)p);
2453 : }
2454 :
2455 :
2456 : static u32 Disk2D_get_field_count(GF_Node *node, u8 dummy)
2457 : {
2458 : return 3;
2459 : }
2460 :
2461 : static GF_Err Disk2D_get_field(GF_Node *node, GF_FieldInfo *info)
2462 : {
2463 8 : switch (info->fieldIndex) {
2464 3 : case 0:
2465 3 : info->name = "innerRadius";
2466 3 : info->eventType = GF_SG_EVENT_FIELD;
2467 3 : info->fieldType = GF_SG_VRML_SFFLOAT;
2468 3 : info->far_ptr = & ((X_Disk2D *) node)->innerRadius;
2469 : return GF_OK;
2470 3 : case 1:
2471 3 : info->name = "outerRadius";
2472 3 : info->eventType = GF_SG_EVENT_FIELD;
2473 3 : info->fieldType = GF_SG_VRML_SFFLOAT;
2474 3 : info->far_ptr = & ((X_Disk2D *) node)->outerRadius;
2475 : return GF_OK;
2476 2 : case 2:
2477 2 : info->name = "metadata";
2478 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2479 2 : info->fieldType = GF_SG_VRML_SFNODE;
2480 2 : info->NDTtype = NDT_SFMetadataNode;
2481 2 : info->far_ptr = & ((X_Disk2D *)node)->metadata;
2482 : return GF_OK;
2483 : default:
2484 : return GF_BAD_PARAM;
2485 : }
2486 : }
2487 :
2488 :
2489 5 : static s32 Disk2D_get_field_index_by_name(char *name)
2490 : {
2491 5 : if (!strcmp("innerRadius", name)) return 0;
2492 3 : if (!strcmp("outerRadius", name)) return 1;
2493 1 : if (!strcmp("metadata", name)) return 2;
2494 0 : return -1;
2495 : }
2496 :
2497 :
2498 2 : static GF_Node *Disk2D_Create()
2499 : {
2500 : X_Disk2D *p;
2501 2 : GF_SAFEALLOC(p, X_Disk2D);
2502 2 : if(!p) return NULL;
2503 2 : gf_node_setup((GF_Node *)p, TAG_X3D_Disk2D);
2504 :
2505 : /*default field values*/
2506 2 : p->innerRadius = FLT2FIX(0);
2507 2 : p->outerRadius = FLT2FIX(1);
2508 2 : return (GF_Node *)p;
2509 : }
2510 :
2511 :
2512 : /*
2513 : ElevationGrid Node deletion
2514 : */
2515 :
2516 2 : static void ElevationGrid_Del(GF_Node *node)
2517 : {
2518 : X_ElevationGrid *p = (X_ElevationGrid *) node;
2519 2 : gf_sg_mffloat_del(p->set_height);
2520 2 : gf_node_unregister((GF_Node *) p->color, node);
2521 2 : gf_node_unregister((GF_Node *) p->normal, node);
2522 2 : gf_node_unregister((GF_Node *) p->texCoord, node);
2523 2 : gf_sg_mffloat_del(p->height);
2524 2 : gf_node_unregister((GF_Node *) p->metadata, node);
2525 2 : gf_node_free((GF_Node *)p);
2526 2 : }
2527 :
2528 :
2529 : static u32 ElevationGrid_get_field_count(GF_Node *node, u8 dummy)
2530 : {
2531 : return 15;
2532 : }
2533 :
2534 45 : static GF_Err ElevationGrid_get_field(GF_Node *node, GF_FieldInfo *info)
2535 : {
2536 45 : switch (info->fieldIndex) {
2537 3 : case 0:
2538 3 : info->name = "set_height";
2539 3 : info->eventType = GF_SG_EVENT_IN;
2540 3 : info->on_event_in = ((X_ElevationGrid *)node)->on_set_height;
2541 3 : info->fieldType = GF_SG_VRML_MFFLOAT;
2542 3 : info->far_ptr = & ((X_ElevationGrid *) node)->set_height;
2543 3 : return GF_OK;
2544 3 : case 1:
2545 3 : info->name = "color";
2546 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2547 3 : info->fieldType = GF_SG_VRML_SFNODE;
2548 3 : info->NDTtype = NDT_SFColorNode;
2549 3 : info->far_ptr = & ((X_ElevationGrid *)node)->color;
2550 3 : return GF_OK;
2551 3 : case 2:
2552 3 : info->name = "normal";
2553 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2554 3 : info->fieldType = GF_SG_VRML_SFNODE;
2555 3 : info->NDTtype = NDT_SFNormalNode;
2556 3 : info->far_ptr = & ((X_ElevationGrid *)node)->normal;
2557 3 : return GF_OK;
2558 3 : case 3:
2559 3 : info->name = "texCoord";
2560 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2561 3 : info->fieldType = GF_SG_VRML_SFNODE;
2562 3 : info->NDTtype = NDT_SFTextureCoordinateNode;
2563 3 : info->far_ptr = & ((X_ElevationGrid *)node)->texCoord;
2564 3 : return GF_OK;
2565 3 : case 4:
2566 3 : info->name = "height";
2567 3 : info->eventType = GF_SG_EVENT_FIELD;
2568 3 : info->fieldType = GF_SG_VRML_MFFLOAT;
2569 3 : info->far_ptr = & ((X_ElevationGrid *) node)->height;
2570 3 : return GF_OK;
2571 3 : case 5:
2572 3 : info->name = "ccw";
2573 3 : info->eventType = GF_SG_EVENT_FIELD;
2574 3 : info->fieldType = GF_SG_VRML_SFBOOL;
2575 3 : info->far_ptr = & ((X_ElevationGrid *) node)->ccw;
2576 3 : return GF_OK;
2577 3 : case 6:
2578 3 : info->name = "colorPerVertex";
2579 3 : info->eventType = GF_SG_EVENT_FIELD;
2580 3 : info->fieldType = GF_SG_VRML_SFBOOL;
2581 3 : info->far_ptr = & ((X_ElevationGrid *) node)->colorPerVertex;
2582 3 : return GF_OK;
2583 3 : case 7:
2584 3 : info->name = "creaseAngle";
2585 3 : info->eventType = GF_SG_EVENT_FIELD;
2586 3 : info->fieldType = GF_SG_VRML_SFFLOAT;
2587 3 : info->far_ptr = & ((X_ElevationGrid *) node)->creaseAngle;
2588 3 : return GF_OK;
2589 3 : case 8:
2590 3 : info->name = "normalPerVertex";
2591 3 : info->eventType = GF_SG_EVENT_FIELD;
2592 3 : info->fieldType = GF_SG_VRML_SFBOOL;
2593 3 : info->far_ptr = & ((X_ElevationGrid *) node)->normalPerVertex;
2594 3 : return GF_OK;
2595 3 : case 9:
2596 3 : info->name = "solid";
2597 3 : info->eventType = GF_SG_EVENT_FIELD;
2598 3 : info->fieldType = GF_SG_VRML_SFBOOL;
2599 3 : info->far_ptr = & ((X_ElevationGrid *) node)->solid;
2600 3 : return GF_OK;
2601 3 : case 10:
2602 3 : info->name = "xDimension";
2603 3 : info->eventType = GF_SG_EVENT_FIELD;
2604 3 : info->fieldType = GF_SG_VRML_SFINT32;
2605 3 : info->far_ptr = & ((X_ElevationGrid *) node)->xDimension;
2606 3 : return GF_OK;
2607 3 : case 11:
2608 3 : info->name = "xSpacing";
2609 3 : info->eventType = GF_SG_EVENT_FIELD;
2610 3 : info->fieldType = GF_SG_VRML_SFFLOAT;
2611 3 : info->far_ptr = & ((X_ElevationGrid *) node)->xSpacing;
2612 3 : return GF_OK;
2613 3 : case 12:
2614 3 : info->name = "zDimension";
2615 3 : info->eventType = GF_SG_EVENT_FIELD;
2616 3 : info->fieldType = GF_SG_VRML_SFINT32;
2617 3 : info->far_ptr = & ((X_ElevationGrid *) node)->zDimension;
2618 3 : return GF_OK;
2619 3 : case 13:
2620 3 : info->name = "zSpacing";
2621 3 : info->eventType = GF_SG_EVENT_FIELD;
2622 3 : info->fieldType = GF_SG_VRML_SFFLOAT;
2623 3 : info->far_ptr = & ((X_ElevationGrid *) node)->zSpacing;
2624 3 : return GF_OK;
2625 3 : case 14:
2626 3 : info->name = "metadata";
2627 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2628 3 : info->fieldType = GF_SG_VRML_SFNODE;
2629 3 : info->NDTtype = NDT_SFMetadataNode;
2630 3 : info->far_ptr = & ((X_ElevationGrid *)node)->metadata;
2631 3 : return GF_OK;
2632 : default:
2633 : return GF_BAD_PARAM;
2634 : }
2635 : }
2636 :
2637 :
2638 15 : static s32 ElevationGrid_get_field_index_by_name(char *name)
2639 : {
2640 15 : if (!strcmp("set_height", name)) return 0;
2641 14 : if (!strcmp("color", name)) return 1;
2642 13 : if (!strcmp("normal", name)) return 2;
2643 12 : if (!strcmp("texCoord", name)) return 3;
2644 11 : if (!strcmp("height", name)) return 4;
2645 10 : if (!strcmp("ccw", name)) return 5;
2646 9 : if (!strcmp("colorPerVertex", name)) return 6;
2647 8 : if (!strcmp("creaseAngle", name)) return 7;
2648 7 : if (!strcmp("normalPerVertex", name)) return 8;
2649 6 : if (!strcmp("solid", name)) return 9;
2650 5 : if (!strcmp("xDimension", name)) return 10;
2651 4 : if (!strcmp("xSpacing", name)) return 11;
2652 3 : if (!strcmp("zDimension", name)) return 12;
2653 2 : if (!strcmp("zSpacing", name)) return 13;
2654 1 : if (!strcmp("metadata", name)) return 14;
2655 0 : return -1;
2656 : }
2657 :
2658 :
2659 2 : static GF_Node *ElevationGrid_Create()
2660 : {
2661 : X_ElevationGrid *p;
2662 2 : GF_SAFEALLOC(p, X_ElevationGrid);
2663 2 : if(!p) return NULL;
2664 2 : gf_node_setup((GF_Node *)p, TAG_X3D_ElevationGrid);
2665 :
2666 : /*default field values*/
2667 2 : p->ccw = 1;
2668 2 : p->colorPerVertex = 1;
2669 2 : p->creaseAngle = FLT2FIX(0.0);
2670 2 : p->normalPerVertex = 1;
2671 2 : p->solid = 1;
2672 2 : p->xDimension = 0;
2673 2 : p->xSpacing = FLT2FIX(1.0);
2674 2 : p->zDimension = 0;
2675 2 : p->zSpacing = FLT2FIX(1.0);
2676 2 : return (GF_Node *)p;
2677 : }
2678 :
2679 :
2680 : /*
2681 : EspduTransform Node deletion
2682 : */
2683 :
2684 1 : static void EspduTransform_Del(GF_Node *node)
2685 : {
2686 : X_EspduTransform *p = (X_EspduTransform *) node;
2687 1 : gf_sg_sfstring_del(p->address);
2688 1 : gf_sg_mfint32_del(p->articulationParameterDesignatorArray);
2689 1 : gf_sg_mfint32_del(p->articulationParameterChangeIndicatorArray);
2690 1 : gf_sg_mfint32_del(p->articulationParameterIdPartAttachedToArray);
2691 1 : gf_sg_mfint32_del(p->articulationParameterTypeArray);
2692 1 : gf_sg_mffloat_del(p->articulationParameterArray);
2693 1 : gf_sg_sfstring_del(p->marking);
2694 1 : gf_sg_sfstring_del(p->multicastRelayHost);
2695 1 : gf_sg_sfstring_del(p->networkMode);
2696 1 : gf_node_unregister((GF_Node *) p->metadata, node);
2697 1 : gf_sg_vrml_parent_destroy(node);
2698 1 : gf_node_free((GF_Node *)p);
2699 1 : }
2700 :
2701 :
2702 : static u32 EspduTransform_get_field_count(GF_Node *node, u8 dummy)
2703 : {
2704 : return 86;
2705 : }
2706 :
2707 172 : static GF_Err EspduTransform_get_field(GF_Node *node, GF_FieldInfo *info)
2708 : {
2709 172 : switch (info->fieldIndex) {
2710 2 : case 0:
2711 2 : info->name = "addChildren";
2712 2 : info->eventType = GF_SG_EVENT_IN;
2713 2 : info->on_event_in = ((X_EspduTransform *)node)->on_addChildren;
2714 2 : info->fieldType = GF_SG_VRML_MFNODE;
2715 2 : info->NDTtype = NDT_SF3DNode;
2716 2 : info->far_ptr = & ((X_EspduTransform *)node)->addChildren;
2717 2 : return GF_OK;
2718 2 : case 1:
2719 2 : info->name = "removeChildren";
2720 2 : info->eventType = GF_SG_EVENT_IN;
2721 2 : info->on_event_in = ((X_EspduTransform *)node)->on_removeChildren;
2722 2 : info->fieldType = GF_SG_VRML_MFNODE;
2723 2 : info->NDTtype = NDT_SF3DNode;
2724 2 : info->far_ptr = & ((X_EspduTransform *)node)->removeChildren;
2725 2 : return GF_OK;
2726 2 : case 2:
2727 2 : info->name = "set_articulationParameterValue0";
2728 2 : info->eventType = GF_SG_EVENT_IN;
2729 2 : info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue0;
2730 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2731 2 : info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue0;
2732 2 : return GF_OK;
2733 2 : case 3:
2734 2 : info->name = "set_articulationParameterValue1";
2735 2 : info->eventType = GF_SG_EVENT_IN;
2736 2 : info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue1;
2737 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2738 2 : info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue1;
2739 2 : return GF_OK;
2740 2 : case 4:
2741 2 : info->name = "set_articulationParameterValue2";
2742 2 : info->eventType = GF_SG_EVENT_IN;
2743 2 : info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue2;
2744 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2745 2 : info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue2;
2746 2 : return GF_OK;
2747 2 : case 5:
2748 2 : info->name = "set_articulationParameterValue3";
2749 2 : info->eventType = GF_SG_EVENT_IN;
2750 2 : info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue3;
2751 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2752 2 : info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue3;
2753 2 : return GF_OK;
2754 2 : case 6:
2755 2 : info->name = "set_articulationParameterValue4";
2756 2 : info->eventType = GF_SG_EVENT_IN;
2757 2 : info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue4;
2758 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2759 2 : info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue4;
2760 2 : return GF_OK;
2761 2 : case 7:
2762 2 : info->name = "set_articulationParameterValue5";
2763 2 : info->eventType = GF_SG_EVENT_IN;
2764 2 : info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue5;
2765 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2766 2 : info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue5;
2767 2 : return GF_OK;
2768 2 : case 8:
2769 2 : info->name = "set_articulationParameterValue6";
2770 2 : info->eventType = GF_SG_EVENT_IN;
2771 2 : info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue6;
2772 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2773 2 : info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue6;
2774 2 : return GF_OK;
2775 2 : case 9:
2776 2 : info->name = "set_articulationParameterValue7";
2777 2 : info->eventType = GF_SG_EVENT_IN;
2778 2 : info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue7;
2779 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2780 2 : info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue7;
2781 2 : return GF_OK;
2782 2 : case 10:
2783 2 : info->name = "address";
2784 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2785 2 : info->fieldType = GF_SG_VRML_SFSTRING;
2786 2 : info->far_ptr = & ((X_EspduTransform *) node)->address;
2787 2 : return GF_OK;
2788 2 : case 11:
2789 2 : info->name = "applicationID";
2790 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2791 2 : info->fieldType = GF_SG_VRML_SFINT32;
2792 2 : info->far_ptr = & ((X_EspduTransform *) node)->applicationID;
2793 2 : return GF_OK;
2794 2 : case 12:
2795 2 : info->name = "articulationParameterCount";
2796 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2797 2 : info->fieldType = GF_SG_VRML_SFINT32;
2798 2 : info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterCount;
2799 2 : return GF_OK;
2800 2 : case 13:
2801 2 : info->name = "articulationParameterDesignatorArray";
2802 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2803 2 : info->fieldType = GF_SG_VRML_MFINT32;
2804 2 : info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterDesignatorArray;
2805 2 : return GF_OK;
2806 2 : case 14:
2807 2 : info->name = "articulationParameterChangeIndicatorArray";
2808 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2809 2 : info->fieldType = GF_SG_VRML_MFINT32;
2810 2 : info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterChangeIndicatorArray;
2811 2 : return GF_OK;
2812 2 : case 15:
2813 2 : info->name = "articulationParameterIdPartAttachedToArray";
2814 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2815 2 : info->fieldType = GF_SG_VRML_MFINT32;
2816 2 : info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterIdPartAttachedToArray;
2817 2 : return GF_OK;
2818 2 : case 16:
2819 2 : info->name = "articulationParameterTypeArray";
2820 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2821 2 : info->fieldType = GF_SG_VRML_MFINT32;
2822 2 : info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterTypeArray;
2823 2 : return GF_OK;
2824 2 : case 17:
2825 2 : info->name = "articulationParameterArray";
2826 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2827 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
2828 2 : info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterArray;
2829 2 : return GF_OK;
2830 2 : case 18:
2831 2 : info->name = "center";
2832 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2833 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
2834 2 : info->far_ptr = & ((X_EspduTransform *) node)->center;
2835 2 : return GF_OK;
2836 2 : case 19:
2837 2 : info->name = "children";
2838 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2839 2 : info->fieldType = GF_SG_VRML_MFNODE;
2840 2 : info->NDTtype = NDT_SF3DNode;
2841 2 : info->far_ptr = & ((X_EspduTransform *)node)->children;
2842 2 : return GF_OK;
2843 2 : case 20:
2844 2 : info->name = "collisionType";
2845 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2846 2 : info->fieldType = GF_SG_VRML_SFINT32;
2847 2 : info->far_ptr = & ((X_EspduTransform *) node)->collisionType;
2848 2 : return GF_OK;
2849 2 : case 21:
2850 2 : info->name = "deadReckoning";
2851 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2852 2 : info->fieldType = GF_SG_VRML_SFINT32;
2853 2 : info->far_ptr = & ((X_EspduTransform *) node)->deadReckoning;
2854 2 : return GF_OK;
2855 2 : case 22:
2856 2 : info->name = "detonationLocation";
2857 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2858 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
2859 2 : info->far_ptr = & ((X_EspduTransform *) node)->detonationLocation;
2860 2 : return GF_OK;
2861 2 : case 23:
2862 2 : info->name = "detonationRelativeLocation";
2863 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2864 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
2865 2 : info->far_ptr = & ((X_EspduTransform *) node)->detonationRelativeLocation;
2866 2 : return GF_OK;
2867 2 : case 24:
2868 2 : info->name = "detonationResult";
2869 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2870 2 : info->fieldType = GF_SG_VRML_SFINT32;
2871 2 : info->far_ptr = & ((X_EspduTransform *) node)->detonationResult;
2872 2 : return GF_OK;
2873 2 : case 25:
2874 2 : info->name = "entityCategory";
2875 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2876 2 : info->fieldType = GF_SG_VRML_SFINT32;
2877 2 : info->far_ptr = & ((X_EspduTransform *) node)->entityCategory;
2878 2 : return GF_OK;
2879 2 : case 26:
2880 2 : info->name = "entityCountry";
2881 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2882 2 : info->fieldType = GF_SG_VRML_SFINT32;
2883 2 : info->far_ptr = & ((X_EspduTransform *) node)->entityCountry;
2884 2 : return GF_OK;
2885 2 : case 27:
2886 2 : info->name = "entityDomain";
2887 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2888 2 : info->fieldType = GF_SG_VRML_SFINT32;
2889 2 : info->far_ptr = & ((X_EspduTransform *) node)->entityDomain;
2890 2 : return GF_OK;
2891 2 : case 28:
2892 2 : info->name = "entityExtra";
2893 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2894 2 : info->fieldType = GF_SG_VRML_SFINT32;
2895 2 : info->far_ptr = & ((X_EspduTransform *) node)->entityExtra;
2896 2 : return GF_OK;
2897 2 : case 29:
2898 2 : info->name = "entityID";
2899 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2900 2 : info->fieldType = GF_SG_VRML_SFINT32;
2901 2 : info->far_ptr = & ((X_EspduTransform *) node)->entityID;
2902 2 : return GF_OK;
2903 2 : case 30:
2904 2 : info->name = "entityKind";
2905 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2906 2 : info->fieldType = GF_SG_VRML_SFINT32;
2907 2 : info->far_ptr = & ((X_EspduTransform *) node)->entityKind;
2908 2 : return GF_OK;
2909 2 : case 31:
2910 2 : info->name = "entitySpecific";
2911 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2912 2 : info->fieldType = GF_SG_VRML_SFINT32;
2913 2 : info->far_ptr = & ((X_EspduTransform *) node)->entitySpecific;
2914 2 : return GF_OK;
2915 2 : case 32:
2916 2 : info->name = "entitySubCategory";
2917 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2918 2 : info->fieldType = GF_SG_VRML_SFINT32;
2919 2 : info->far_ptr = & ((X_EspduTransform *) node)->entitySubCategory;
2920 2 : return GF_OK;
2921 2 : case 33:
2922 2 : info->name = "eventApplicationID";
2923 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2924 2 : info->fieldType = GF_SG_VRML_SFINT32;
2925 2 : info->far_ptr = & ((X_EspduTransform *) node)->eventApplicationID;
2926 2 : return GF_OK;
2927 2 : case 34:
2928 2 : info->name = "eventEntityID";
2929 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2930 2 : info->fieldType = GF_SG_VRML_SFINT32;
2931 2 : info->far_ptr = & ((X_EspduTransform *) node)->eventEntityID;
2932 2 : return GF_OK;
2933 2 : case 35:
2934 2 : info->name = "eventNumber";
2935 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2936 2 : info->fieldType = GF_SG_VRML_SFINT32;
2937 2 : info->far_ptr = & ((X_EspduTransform *) node)->eventNumber;
2938 2 : return GF_OK;
2939 2 : case 36:
2940 2 : info->name = "eventSiteID";
2941 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2942 2 : info->fieldType = GF_SG_VRML_SFINT32;
2943 2 : info->far_ptr = & ((X_EspduTransform *) node)->eventSiteID;
2944 2 : return GF_OK;
2945 2 : case 37:
2946 2 : info->name = "fired1";
2947 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2948 2 : info->fieldType = GF_SG_VRML_SFBOOL;
2949 2 : info->far_ptr = & ((X_EspduTransform *) node)->fired1;
2950 2 : return GF_OK;
2951 2 : case 38:
2952 2 : info->name = "fired2";
2953 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2954 2 : info->fieldType = GF_SG_VRML_SFBOOL;
2955 2 : info->far_ptr = & ((X_EspduTransform *) node)->fired2;
2956 2 : return GF_OK;
2957 2 : case 39:
2958 2 : info->name = "fireMissionIndex";
2959 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2960 2 : info->fieldType = GF_SG_VRML_SFINT32;
2961 2 : info->far_ptr = & ((X_EspduTransform *) node)->fireMissionIndex;
2962 2 : return GF_OK;
2963 2 : case 40:
2964 2 : info->name = "firingRange";
2965 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2966 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
2967 2 : info->far_ptr = & ((X_EspduTransform *) node)->firingRange;
2968 2 : return GF_OK;
2969 2 : case 41:
2970 2 : info->name = "firingRate";
2971 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2972 2 : info->fieldType = GF_SG_VRML_SFINT32;
2973 2 : info->far_ptr = & ((X_EspduTransform *) node)->firingRate;
2974 2 : return GF_OK;
2975 2 : case 42:
2976 2 : info->name = "forceID";
2977 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2978 2 : info->fieldType = GF_SG_VRML_SFINT32;
2979 2 : info->far_ptr = & ((X_EspduTransform *) node)->forceID;
2980 2 : return GF_OK;
2981 2 : case 43:
2982 2 : info->name = "fuse";
2983 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2984 2 : info->fieldType = GF_SG_VRML_SFINT32;
2985 2 : info->far_ptr = & ((X_EspduTransform *) node)->fuse;
2986 2 : return GF_OK;
2987 2 : case 44:
2988 2 : info->name = "linearVelocity";
2989 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2990 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
2991 2 : info->far_ptr = & ((X_EspduTransform *) node)->linearVelocity;
2992 2 : return GF_OK;
2993 2 : case 45:
2994 2 : info->name = "linearAcceleration";
2995 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2996 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
2997 2 : info->far_ptr = & ((X_EspduTransform *) node)->linearAcceleration;
2998 2 : return GF_OK;
2999 2 : case 46:
3000 2 : info->name = "marking";
3001 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3002 2 : info->fieldType = GF_SG_VRML_SFSTRING;
3003 2 : info->far_ptr = & ((X_EspduTransform *) node)->marking;
3004 2 : return GF_OK;
3005 2 : case 47:
3006 2 : info->name = "multicastRelayHost";
3007 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3008 2 : info->fieldType = GF_SG_VRML_SFSTRING;
3009 2 : info->far_ptr = & ((X_EspduTransform *) node)->multicastRelayHost;
3010 2 : return GF_OK;
3011 2 : case 48:
3012 2 : info->name = "multicastRelayPort";
3013 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3014 2 : info->fieldType = GF_SG_VRML_SFINT32;
3015 2 : info->far_ptr = & ((X_EspduTransform *) node)->multicastRelayPort;
3016 2 : return GF_OK;
3017 2 : case 49:
3018 2 : info->name = "munitionApplicationID";
3019 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3020 2 : info->fieldType = GF_SG_VRML_SFINT32;
3021 2 : info->far_ptr = & ((X_EspduTransform *) node)->munitionApplicationID;
3022 2 : return GF_OK;
3023 2 : case 50:
3024 2 : info->name = "munitionEndPoint";
3025 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3026 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
3027 2 : info->far_ptr = & ((X_EspduTransform *) node)->munitionEndPoint;
3028 2 : return GF_OK;
3029 2 : case 51:
3030 2 : info->name = "munitionEntityID";
3031 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3032 2 : info->fieldType = GF_SG_VRML_SFINT32;
3033 2 : info->far_ptr = & ((X_EspduTransform *) node)->munitionEntityID;
3034 2 : return GF_OK;
3035 2 : case 52:
3036 2 : info->name = "munitionQuantity";
3037 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3038 2 : info->fieldType = GF_SG_VRML_SFINT32;
3039 2 : info->far_ptr = & ((X_EspduTransform *) node)->munitionQuantity;
3040 2 : return GF_OK;
3041 2 : case 53:
3042 2 : info->name = "munitionSiteID";
3043 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3044 2 : info->fieldType = GF_SG_VRML_SFINT32;
3045 2 : info->far_ptr = & ((X_EspduTransform *) node)->munitionSiteID;
3046 2 : return GF_OK;
3047 2 : case 54:
3048 2 : info->name = "munitionStartPoint";
3049 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3050 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
3051 2 : info->far_ptr = & ((X_EspduTransform *) node)->munitionStartPoint;
3052 2 : return GF_OK;
3053 2 : case 55:
3054 2 : info->name = "networkMode";
3055 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3056 2 : info->fieldType = GF_SG_VRML_SFSTRING;
3057 2 : info->far_ptr = & ((X_EspduTransform *) node)->networkMode;
3058 2 : return GF_OK;
3059 2 : case 56:
3060 2 : info->name = "port";
3061 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3062 2 : info->fieldType = GF_SG_VRML_SFINT32;
3063 2 : info->far_ptr = & ((X_EspduTransform *) node)->port;
3064 2 : return GF_OK;
3065 2 : case 57:
3066 2 : info->name = "readInterval";
3067 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3068 2 : info->fieldType = GF_SG_VRML_SFTIME;
3069 2 : info->far_ptr = & ((X_EspduTransform *) node)->readInterval;
3070 2 : return GF_OK;
3071 2 : case 58:
3072 2 : info->name = "rotation";
3073 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3074 2 : info->fieldType = GF_SG_VRML_SFROTATION;
3075 2 : info->far_ptr = & ((X_EspduTransform *) node)->rotation;
3076 2 : return GF_OK;
3077 2 : case 59:
3078 2 : info->name = "scale";
3079 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3080 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
3081 2 : info->far_ptr = & ((X_EspduTransform *) node)->scale;
3082 2 : return GF_OK;
3083 2 : case 60:
3084 2 : info->name = "scaleOrientation";
3085 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3086 2 : info->fieldType = GF_SG_VRML_SFROTATION;
3087 2 : info->far_ptr = & ((X_EspduTransform *) node)->scaleOrientation;
3088 2 : return GF_OK;
3089 2 : case 61:
3090 2 : info->name = "siteID";
3091 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3092 2 : info->fieldType = GF_SG_VRML_SFINT32;
3093 2 : info->far_ptr = & ((X_EspduTransform *) node)->siteID;
3094 2 : return GF_OK;
3095 2 : case 62:
3096 2 : info->name = "translation";
3097 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3098 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
3099 2 : info->far_ptr = & ((X_EspduTransform *) node)->translation;
3100 2 : return GF_OK;
3101 2 : case 63:
3102 2 : info->name = "warhead";
3103 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3104 2 : info->fieldType = GF_SG_VRML_SFINT32;
3105 2 : info->far_ptr = & ((X_EspduTransform *) node)->warhead;
3106 2 : return GF_OK;
3107 2 : case 64:
3108 2 : info->name = "writeInterval";
3109 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3110 2 : info->fieldType = GF_SG_VRML_SFTIME;
3111 2 : info->far_ptr = & ((X_EspduTransform *) node)->writeInterval;
3112 2 : return GF_OK;
3113 2 : case 65:
3114 2 : info->name = "rtpHeaderExpected";
3115 2 : info->eventType = GF_SG_EVENT_FIELD;
3116 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3117 2 : info->far_ptr = & ((X_EspduTransform *) node)->rtpHeaderExpected;
3118 2 : return GF_OK;
3119 2 : case 66:
3120 2 : info->name = "articulationParameterValue0_changed";
3121 2 : info->eventType = GF_SG_EVENT_OUT;
3122 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
3123 2 : info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue0_changed;
3124 2 : return GF_OK;
3125 2 : case 67:
3126 2 : info->name = "articulationParameterValue1_changed";
3127 2 : info->eventType = GF_SG_EVENT_OUT;
3128 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
3129 2 : info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue1_changed;
3130 2 : return GF_OK;
3131 2 : case 68:
3132 2 : info->name = "articulationParameterValue2_changed";
3133 2 : info->eventType = GF_SG_EVENT_OUT;
3134 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
3135 2 : info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue2_changed;
3136 2 : return GF_OK;
3137 2 : case 69:
3138 2 : info->name = "articulationParameterValue3_changed";
3139 2 : info->eventType = GF_SG_EVENT_OUT;
3140 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
3141 2 : info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue3_changed;
3142 2 : return GF_OK;
3143 2 : case 70:
3144 2 : info->name = "articulationParameterValue4_changed";
3145 2 : info->eventType = GF_SG_EVENT_OUT;
3146 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
3147 2 : info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue4_changed;
3148 2 : return GF_OK;
3149 2 : case 71:
3150 2 : info->name = "articulationParameterValue5_changed";
3151 2 : info->eventType = GF_SG_EVENT_OUT;
3152 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
3153 2 : info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue5_changed;
3154 2 : return GF_OK;
3155 2 : case 72:
3156 2 : info->name = "articulationParameterValue6_changed";
3157 2 : info->eventType = GF_SG_EVENT_OUT;
3158 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
3159 2 : info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue6_changed;
3160 2 : return GF_OK;
3161 2 : case 73:
3162 2 : info->name = "articulationParameterValue7_changed";
3163 2 : info->eventType = GF_SG_EVENT_OUT;
3164 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
3165 2 : info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue7_changed;
3166 2 : return GF_OK;
3167 2 : case 74:
3168 2 : info->name = "collideTime";
3169 2 : info->eventType = GF_SG_EVENT_OUT;
3170 2 : info->fieldType = GF_SG_VRML_SFTIME;
3171 2 : info->far_ptr = & ((X_EspduTransform *) node)->collideTime;
3172 2 : return GF_OK;
3173 2 : case 75:
3174 2 : info->name = "detonateTime";
3175 2 : info->eventType = GF_SG_EVENT_OUT;
3176 2 : info->fieldType = GF_SG_VRML_SFTIME;
3177 2 : info->far_ptr = & ((X_EspduTransform *) node)->detonateTime;
3178 2 : return GF_OK;
3179 2 : case 76:
3180 2 : info->name = "firedTime";
3181 2 : info->eventType = GF_SG_EVENT_OUT;
3182 2 : info->fieldType = GF_SG_VRML_SFTIME;
3183 2 : info->far_ptr = & ((X_EspduTransform *) node)->firedTime;
3184 2 : return GF_OK;
3185 2 : case 77:
3186 2 : info->name = "isActive";
3187 2 : info->eventType = GF_SG_EVENT_OUT;
3188 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3189 2 : info->far_ptr = & ((X_EspduTransform *) node)->isActive;
3190 2 : return GF_OK;
3191 2 : case 78:
3192 2 : info->name = "isCollided";
3193 2 : info->eventType = GF_SG_EVENT_OUT;
3194 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3195 2 : info->far_ptr = & ((X_EspduTransform *) node)->isCollided;
3196 2 : return GF_OK;
3197 2 : case 79:
3198 2 : info->name = "isDetonated";
3199 2 : info->eventType = GF_SG_EVENT_OUT;
3200 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3201 2 : info->far_ptr = & ((X_EspduTransform *) node)->isDetonated;
3202 2 : return GF_OK;
3203 2 : case 80:
3204 2 : info->name = "isNetworkReader";
3205 2 : info->eventType = GF_SG_EVENT_OUT;
3206 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3207 2 : info->far_ptr = & ((X_EspduTransform *) node)->isNetworkReader;
3208 2 : return GF_OK;
3209 2 : case 81:
3210 2 : info->name = "isNetworkWriter";
3211 2 : info->eventType = GF_SG_EVENT_OUT;
3212 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3213 2 : info->far_ptr = & ((X_EspduTransform *) node)->isNetworkWriter;
3214 2 : return GF_OK;
3215 2 : case 82:
3216 2 : info->name = "isRtpHeaderHeard";
3217 2 : info->eventType = GF_SG_EVENT_OUT;
3218 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3219 2 : info->far_ptr = & ((X_EspduTransform *) node)->isRtpHeaderHeard;
3220 2 : return GF_OK;
3221 2 : case 83:
3222 2 : info->name = "isStandAlone";
3223 2 : info->eventType = GF_SG_EVENT_OUT;
3224 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3225 2 : info->far_ptr = & ((X_EspduTransform *) node)->isStandAlone;
3226 2 : return GF_OK;
3227 2 : case 84:
3228 2 : info->name = "timestamp";
3229 2 : info->eventType = GF_SG_EVENT_OUT;
3230 2 : info->fieldType = GF_SG_VRML_SFTIME;
3231 2 : info->far_ptr = & ((X_EspduTransform *) node)->timestamp;
3232 2 : return GF_OK;
3233 2 : case 85:
3234 2 : info->name = "metadata";
3235 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3236 2 : info->fieldType = GF_SG_VRML_SFNODE;
3237 2 : info->NDTtype = NDT_SFMetadataNode;
3238 2 : info->far_ptr = & ((X_EspduTransform *)node)->metadata;
3239 2 : return GF_OK;
3240 : default:
3241 : return GF_BAD_PARAM;
3242 : }
3243 : }
3244 :
3245 :
3246 86 : static s32 EspduTransform_get_field_index_by_name(char *name)
3247 : {
3248 86 : if (!strcmp("addChildren", name)) return 0;
3249 85 : if (!strcmp("removeChildren", name)) return 1;
3250 84 : if (!strcmp("set_articulationParameterValue0", name)) return 2;
3251 83 : if (!strcmp("set_articulationParameterValue1", name)) return 3;
3252 82 : if (!strcmp("set_articulationParameterValue2", name)) return 4;
3253 81 : if (!strcmp("set_articulationParameterValue3", name)) return 5;
3254 80 : if (!strcmp("set_articulationParameterValue4", name)) return 6;
3255 79 : if (!strcmp("set_articulationParameterValue5", name)) return 7;
3256 78 : if (!strcmp("set_articulationParameterValue6", name)) return 8;
3257 77 : if (!strcmp("set_articulationParameterValue7", name)) return 9;
3258 76 : if (!strcmp("address", name)) return 10;
3259 75 : if (!strcmp("applicationID", name)) return 11;
3260 74 : if (!strcmp("articulationParameterCount", name)) return 12;
3261 73 : if (!strcmp("articulationParameterDesignatorArray", name)) return 13;
3262 72 : if (!strcmp("articulationParameterChangeIndicatorArray", name)) return 14;
3263 71 : if (!strcmp("articulationParameterIdPartAttachedToArray", name)) return 15;
3264 70 : if (!strcmp("articulationParameterTypeArray", name)) return 16;
3265 69 : if (!strcmp("articulationParameterArray", name)) return 17;
3266 68 : if (!strcmp("center", name)) return 18;
3267 67 : if (!strcmp("children", name)) return 19;
3268 66 : if (!strcmp("collisionType", name)) return 20;
3269 65 : if (!strcmp("deadReckoning", name)) return 21;
3270 64 : if (!strcmp("detonationLocation", name)) return 22;
3271 63 : if (!strcmp("detonationRelativeLocation", name)) return 23;
3272 62 : if (!strcmp("detonationResult", name)) return 24;
3273 61 : if (!strcmp("entityCategory", name)) return 25;
3274 60 : if (!strcmp("entityCountry", name)) return 26;
3275 59 : if (!strcmp("entityDomain", name)) return 27;
3276 58 : if (!strcmp("entityExtra", name)) return 28;
3277 57 : if (!strcmp("entityID", name)) return 29;
3278 56 : if (!strcmp("entityKind", name)) return 30;
3279 55 : if (!strcmp("entitySpecific", name)) return 31;
3280 54 : if (!strcmp("entitySubCategory", name)) return 32;
3281 53 : if (!strcmp("eventApplicationID", name)) return 33;
3282 52 : if (!strcmp("eventEntityID", name)) return 34;
3283 51 : if (!strcmp("eventNumber", name)) return 35;
3284 50 : if (!strcmp("eventSiteID", name)) return 36;
3285 49 : if (!strcmp("fired1", name)) return 37;
3286 48 : if (!strcmp("fired2", name)) return 38;
3287 47 : if (!strcmp("fireMissionIndex", name)) return 39;
3288 46 : if (!strcmp("firingRange", name)) return 40;
3289 45 : if (!strcmp("firingRate", name)) return 41;
3290 44 : if (!strcmp("forceID", name)) return 42;
3291 43 : if (!strcmp("fuse", name)) return 43;
3292 42 : if (!strcmp("linearVelocity", name)) return 44;
3293 41 : if (!strcmp("linearAcceleration", name)) return 45;
3294 40 : if (!strcmp("marking", name)) return 46;
3295 39 : if (!strcmp("multicastRelayHost", name)) return 47;
3296 38 : if (!strcmp("multicastRelayPort", name)) return 48;
3297 37 : if (!strcmp("munitionApplicationID", name)) return 49;
3298 36 : if (!strcmp("munitionEndPoint", name)) return 50;
3299 35 : if (!strcmp("munitionEntityID", name)) return 51;
3300 34 : if (!strcmp("munitionQuantity", name)) return 52;
3301 33 : if (!strcmp("munitionSiteID", name)) return 53;
3302 32 : if (!strcmp("munitionStartPoint", name)) return 54;
3303 31 : if (!strcmp("networkMode", name)) return 55;
3304 30 : if (!strcmp("port", name)) return 56;
3305 29 : if (!strcmp("readInterval", name)) return 57;
3306 28 : if (!strcmp("rotation", name)) return 58;
3307 27 : if (!strcmp("scale", name)) return 59;
3308 26 : if (!strcmp("scaleOrientation", name)) return 60;
3309 25 : if (!strcmp("siteID", name)) return 61;
3310 24 : if (!strcmp("translation", name)) return 62;
3311 23 : if (!strcmp("warhead", name)) return 63;
3312 22 : if (!strcmp("writeInterval", name)) return 64;
3313 21 : if (!strcmp("rtpHeaderExpected", name)) return 65;
3314 20 : if (!strcmp("articulationParameterValue0_changed", name)) return 66;
3315 19 : if (!strcmp("articulationParameterValue1_changed", name)) return 67;
3316 18 : if (!strcmp("articulationParameterValue2_changed", name)) return 68;
3317 17 : if (!strcmp("articulationParameterValue3_changed", name)) return 69;
3318 16 : if (!strcmp("articulationParameterValue4_changed", name)) return 70;
3319 15 : if (!strcmp("articulationParameterValue5_changed", name)) return 71;
3320 14 : if (!strcmp("articulationParameterValue6_changed", name)) return 72;
3321 13 : if (!strcmp("articulationParameterValue7_changed", name)) return 73;
3322 12 : if (!strcmp("collideTime", name)) return 74;
3323 11 : if (!strcmp("detonateTime", name)) return 75;
3324 10 : if (!strcmp("firedTime", name)) return 76;
3325 9 : if (!strcmp("isActive", name)) return 77;
3326 8 : if (!strcmp("isCollided", name)) return 78;
3327 7 : if (!strcmp("isDetonated", name)) return 79;
3328 6 : if (!strcmp("isNetworkReader", name)) return 80;
3329 5 : if (!strcmp("isNetworkWriter", name)) return 81;
3330 4 : if (!strcmp("isRtpHeaderHeard", name)) return 82;
3331 3 : if (!strcmp("isStandAlone", name)) return 83;
3332 2 : if (!strcmp("timestamp", name)) return 84;
3333 1 : if (!strcmp("metadata", name)) return 85;
3334 0 : return -1;
3335 : }
3336 :
3337 :
3338 1 : static GF_Node *EspduTransform_Create()
3339 : {
3340 : X_EspduTransform *p;
3341 1 : GF_SAFEALLOC(p, X_EspduTransform);
3342 1 : if(!p) return NULL;
3343 1 : gf_node_setup((GF_Node *)p, TAG_X3D_EspduTransform);
3344 1 : gf_sg_vrml_parent_setup((GF_Node *) p);
3345 :
3346 : /*default field values*/
3347 1 : p->address.buffer = (char*) gf_malloc(sizeof(char) * 10);
3348 : strcpy(p->address.buffer, "localhost");
3349 1 : p->applicationID = 1;
3350 1 : p->articulationParameterCount = 0;
3351 1 : p->center.x = FLT2FIX(0);
3352 1 : p->center.y = FLT2FIX(0);
3353 1 : p->center.z = FLT2FIX(0);
3354 1 : p->collisionType = 0;
3355 1 : p->deadReckoning = 0;
3356 1 : p->detonationLocation.x = FLT2FIX(0);
3357 1 : p->detonationLocation.y = FLT2FIX(0);
3358 1 : p->detonationLocation.z = FLT2FIX(0);
3359 1 : p->detonationRelativeLocation.x = FLT2FIX(0);
3360 1 : p->detonationRelativeLocation.y = FLT2FIX(0);
3361 1 : p->detonationRelativeLocation.z = FLT2FIX(0);
3362 1 : p->detonationResult = 0;
3363 1 : p->entityCategory = 0;
3364 1 : p->entityCountry = 0;
3365 1 : p->entityDomain = 0;
3366 1 : p->entityExtra = 0;
3367 1 : p->entityID = 0;
3368 1 : p->entityKind = 0;
3369 1 : p->entitySpecific = 0;
3370 1 : p->entitySubCategory = 0;
3371 1 : p->eventApplicationID = 1;
3372 1 : p->eventEntityID = 0;
3373 1 : p->eventNumber = 0;
3374 1 : p->eventSiteID = 0;
3375 1 : p->fireMissionIndex = 0;
3376 1 : p->firingRange = FLT2FIX(0.0);
3377 1 : p->firingRate = 0;
3378 1 : p->forceID = 0;
3379 1 : p->fuse = 0;
3380 1 : p->linearVelocity.x = FLT2FIX(0);
3381 1 : p->linearVelocity.y = FLT2FIX(0);
3382 1 : p->linearVelocity.z = FLT2FIX(0);
3383 1 : p->linearAcceleration.x = FLT2FIX(0);
3384 1 : p->linearAcceleration.y = FLT2FIX(0);
3385 1 : p->linearAcceleration.z = FLT2FIX(0);
3386 1 : p->multicastRelayPort = 0;
3387 1 : p->munitionApplicationID = 1;
3388 1 : p->munitionEndPoint.x = FLT2FIX(0);
3389 1 : p->munitionEndPoint.y = FLT2FIX(0);
3390 1 : p->munitionEndPoint.z = FLT2FIX(0);
3391 1 : p->munitionEntityID = 0;
3392 1 : p->munitionQuantity = 0;
3393 1 : p->munitionSiteID = 0;
3394 1 : p->munitionStartPoint.x = FLT2FIX(0);
3395 1 : p->munitionStartPoint.y = FLT2FIX(0);
3396 1 : p->munitionStartPoint.z = FLT2FIX(0);
3397 1 : p->networkMode.buffer = (char*) gf_malloc(sizeof(char) * 11);
3398 : strcpy(p->networkMode.buffer, "standAlone");
3399 1 : p->port = 0;
3400 1 : p->readInterval = 0.1;
3401 1 : p->rotation.x = FLT2FIX(0);
3402 1 : p->rotation.y = FLT2FIX(0);
3403 1 : p->rotation.z = FLT2FIX(1);
3404 1 : p->rotation.q = FLT2FIX(0);
3405 1 : p->scale.x = FLT2FIX(1);
3406 1 : p->scale.y = FLT2FIX(1);
3407 1 : p->scale.z = FLT2FIX(1);
3408 1 : p->scaleOrientation.x = FLT2FIX(0);
3409 1 : p->scaleOrientation.y = FLT2FIX(0);
3410 1 : p->scaleOrientation.z = FLT2FIX(1);
3411 1 : p->scaleOrientation.q = FLT2FIX(0);
3412 1 : p->siteID = 0;
3413 1 : p->translation.x = FLT2FIX(0);
3414 1 : p->translation.y = FLT2FIX(0);
3415 1 : p->translation.z = FLT2FIX(0);
3416 1 : p->warhead = 0;
3417 1 : p->writeInterval = 1.0;
3418 1 : return (GF_Node *)p;
3419 : }
3420 :
3421 :
3422 : /*
3423 : Extrusion Node deletion
3424 : */
3425 :
3426 1 : static void Extrusion_Del(GF_Node *node)
3427 : {
3428 : X_Extrusion *p = (X_Extrusion *) node;
3429 1 : gf_sg_mfvec2f_del(p->set_crossSection);
3430 1 : gf_sg_mfrotation_del(p->set_orientation);
3431 1 : gf_sg_mfvec2f_del(p->set_scale);
3432 1 : gf_sg_mfvec3f_del(p->set_spine);
3433 1 : gf_sg_mfvec2f_del(p->crossSection);
3434 1 : gf_sg_mfrotation_del(p->orientation);
3435 1 : gf_sg_mfvec2f_del(p->scale);
3436 1 : gf_sg_mfvec3f_del(p->spine);
3437 1 : gf_node_unregister((GF_Node *) p->metadata, node);
3438 1 : gf_node_free((GF_Node *)p);
3439 1 : }
3440 :
3441 :
3442 : static u32 Extrusion_get_field_count(GF_Node *node, u8 dummy)
3443 : {
3444 : return 15;
3445 : }
3446 :
3447 30 : static GF_Err Extrusion_get_field(GF_Node *node, GF_FieldInfo *info)
3448 : {
3449 30 : switch (info->fieldIndex) {
3450 2 : case 0:
3451 2 : info->name = "set_crossSection";
3452 2 : info->eventType = GF_SG_EVENT_IN;
3453 2 : info->on_event_in = ((X_Extrusion *)node)->on_set_crossSection;
3454 2 : info->fieldType = GF_SG_VRML_MFVEC2F;
3455 2 : info->far_ptr = & ((X_Extrusion *) node)->set_crossSection;
3456 2 : return GF_OK;
3457 2 : case 1:
3458 2 : info->name = "set_orientation";
3459 2 : info->eventType = GF_SG_EVENT_IN;
3460 2 : info->on_event_in = ((X_Extrusion *)node)->on_set_orientation;
3461 2 : info->fieldType = GF_SG_VRML_MFROTATION;
3462 2 : info->far_ptr = & ((X_Extrusion *) node)->set_orientation;
3463 2 : return GF_OK;
3464 2 : case 2:
3465 2 : info->name = "set_scale";
3466 2 : info->eventType = GF_SG_EVENT_IN;
3467 2 : info->on_event_in = ((X_Extrusion *)node)->on_set_scale;
3468 2 : info->fieldType = GF_SG_VRML_MFVEC2F;
3469 2 : info->far_ptr = & ((X_Extrusion *) node)->set_scale;
3470 2 : return GF_OK;
3471 2 : case 3:
3472 2 : info->name = "set_spine";
3473 2 : info->eventType = GF_SG_EVENT_IN;
3474 2 : info->on_event_in = ((X_Extrusion *)node)->on_set_spine;
3475 2 : info->fieldType = GF_SG_VRML_MFVEC3F;
3476 2 : info->far_ptr = & ((X_Extrusion *) node)->set_spine;
3477 2 : return GF_OK;
3478 2 : case 4:
3479 2 : info->name = "beginCap";
3480 2 : info->eventType = GF_SG_EVENT_FIELD;
3481 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3482 2 : info->far_ptr = & ((X_Extrusion *) node)->beginCap;
3483 2 : return GF_OK;
3484 2 : case 5:
3485 2 : info->name = "ccw";
3486 2 : info->eventType = GF_SG_EVENT_FIELD;
3487 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3488 2 : info->far_ptr = & ((X_Extrusion *) node)->ccw;
3489 2 : return GF_OK;
3490 2 : case 6:
3491 2 : info->name = "convex";
3492 2 : info->eventType = GF_SG_EVENT_FIELD;
3493 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3494 2 : info->far_ptr = & ((X_Extrusion *) node)->convex;
3495 2 : return GF_OK;
3496 2 : case 7:
3497 2 : info->name = "creaseAngle";
3498 2 : info->eventType = GF_SG_EVENT_FIELD;
3499 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
3500 2 : info->far_ptr = & ((X_Extrusion *) node)->creaseAngle;
3501 2 : return GF_OK;
3502 2 : case 8:
3503 2 : info->name = "crossSection";
3504 2 : info->eventType = GF_SG_EVENT_FIELD;
3505 2 : info->fieldType = GF_SG_VRML_MFVEC2F;
3506 2 : info->far_ptr = & ((X_Extrusion *) node)->crossSection;
3507 2 : return GF_OK;
3508 2 : case 9:
3509 2 : info->name = "endCap";
3510 2 : info->eventType = GF_SG_EVENT_FIELD;
3511 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3512 2 : info->far_ptr = & ((X_Extrusion *) node)->endCap;
3513 2 : return GF_OK;
3514 2 : case 10:
3515 2 : info->name = "orientation";
3516 2 : info->eventType = GF_SG_EVENT_FIELD;
3517 2 : info->fieldType = GF_SG_VRML_MFROTATION;
3518 2 : info->far_ptr = & ((X_Extrusion *) node)->orientation;
3519 2 : return GF_OK;
3520 2 : case 11:
3521 2 : info->name = "scale";
3522 2 : info->eventType = GF_SG_EVENT_FIELD;
3523 2 : info->fieldType = GF_SG_VRML_MFVEC2F;
3524 2 : info->far_ptr = & ((X_Extrusion *) node)->scale;
3525 2 : return GF_OK;
3526 2 : case 12:
3527 2 : info->name = "solid";
3528 2 : info->eventType = GF_SG_EVENT_FIELD;
3529 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3530 2 : info->far_ptr = & ((X_Extrusion *) node)->solid;
3531 2 : return GF_OK;
3532 2 : case 13:
3533 2 : info->name = "spine";
3534 2 : info->eventType = GF_SG_EVENT_FIELD;
3535 2 : info->fieldType = GF_SG_VRML_MFVEC3F;
3536 2 : info->far_ptr = & ((X_Extrusion *) node)->spine;
3537 2 : return GF_OK;
3538 2 : case 14:
3539 2 : info->name = "metadata";
3540 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3541 2 : info->fieldType = GF_SG_VRML_SFNODE;
3542 2 : info->NDTtype = NDT_SFMetadataNode;
3543 2 : info->far_ptr = & ((X_Extrusion *)node)->metadata;
3544 2 : return GF_OK;
3545 : default:
3546 : return GF_BAD_PARAM;
3547 : }
3548 : }
3549 :
3550 :
3551 15 : static s32 Extrusion_get_field_index_by_name(char *name)
3552 : {
3553 15 : if (!strcmp("set_crossSection", name)) return 0;
3554 14 : if (!strcmp("set_orientation", name)) return 1;
3555 13 : if (!strcmp("set_scale", name)) return 2;
3556 12 : if (!strcmp("set_spine", name)) return 3;
3557 11 : if (!strcmp("beginCap", name)) return 4;
3558 10 : if (!strcmp("ccw", name)) return 5;
3559 9 : if (!strcmp("convex", name)) return 6;
3560 8 : if (!strcmp("creaseAngle", name)) return 7;
3561 7 : if (!strcmp("crossSection", name)) return 8;
3562 6 : if (!strcmp("endCap", name)) return 9;
3563 5 : if (!strcmp("orientation", name)) return 10;
3564 4 : if (!strcmp("scale", name)) return 11;
3565 3 : if (!strcmp("solid", name)) return 12;
3566 2 : if (!strcmp("spine", name)) return 13;
3567 1 : if (!strcmp("metadata", name)) return 14;
3568 0 : return -1;
3569 : }
3570 :
3571 :
3572 1 : static GF_Node *Extrusion_Create()
3573 : {
3574 : X_Extrusion *p;
3575 1 : GF_SAFEALLOC(p, X_Extrusion);
3576 1 : if(!p) return NULL;
3577 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Extrusion);
3578 :
3579 : /*default field values*/
3580 1 : p->beginCap = 1;
3581 1 : p->ccw = 1;
3582 1 : p->convex = 1;
3583 1 : p->creaseAngle = FLT2FIX(0.0);
3584 1 : p->crossSection.vals = (SFVec2f*) gf_malloc(sizeof(SFVec2f)*5);
3585 1 : p->crossSection.count = 5;
3586 1 : p->crossSection.vals[0].x = FLT2FIX(1);
3587 1 : p->crossSection.vals[0].y = FLT2FIX(1);
3588 1 : p->crossSection.vals[1].x = FLT2FIX(1);
3589 1 : p->crossSection.vals[1].y = FLT2FIX(-1);
3590 1 : p->crossSection.vals[2].x = FLT2FIX(-1);
3591 1 : p->crossSection.vals[2].y = FLT2FIX(-1);
3592 1 : p->crossSection.vals[3].x = FLT2FIX(-1);
3593 1 : p->crossSection.vals[3].y = FLT2FIX(1);
3594 1 : p->crossSection.vals[4].x = FLT2FIX(1);
3595 1 : p->crossSection.vals[4].y = FLT2FIX(1);
3596 1 : p->endCap = 1;
3597 1 : p->orientation.vals = (GF_Vec4*)gf_malloc(sizeof(GF_Vec4)*1);
3598 1 : p->orientation.count = 1;
3599 1 : p->orientation.vals[0].x = FLT2FIX(0);
3600 1 : p->orientation.vals[0].y = FLT2FIX(0);
3601 1 : p->orientation.vals[0].z = FLT2FIX(1);
3602 1 : p->orientation.vals[0].q = FLT2FIX(0);
3603 1 : p->scale.vals = (SFVec2f*) gf_malloc(sizeof(SFVec2f)*1);
3604 1 : p->scale.count = 1;
3605 1 : p->scale.vals[0].x = FLT2FIX(1);
3606 1 : p->scale.vals[0].y = FLT2FIX(1);
3607 1 : p->solid = 1;
3608 1 : p->spine.vals = (SFVec3f*)gf_malloc(sizeof(SFVec3f)*2);
3609 1 : p->spine.count = 2;
3610 1 : p->spine.vals[0].x = FLT2FIX(0);
3611 1 : p->spine.vals[0].y = FLT2FIX(0);
3612 1 : p->spine.vals[0].z = FLT2FIX(0);
3613 1 : p->spine.vals[1].x = FLT2FIX(0);
3614 1 : p->spine.vals[1].y = FLT2FIX(1);
3615 1 : p->spine.vals[1].z = FLT2FIX(0);
3616 1 : return (GF_Node *)p;
3617 : }
3618 :
3619 :
3620 : /*
3621 : FillProperties Node deletion
3622 : */
3623 :
3624 : static void FillProperties_Del(GF_Node *node)
3625 : {
3626 : X_FillProperties *p = (X_FillProperties *) node;
3627 2 : gf_node_free((GF_Node *)p);
3628 : }
3629 :
3630 :
3631 : static u32 FillProperties_get_field_count(GF_Node *node, u8 dummy)
3632 : {
3633 : return 4;
3634 : }
3635 :
3636 11 : static GF_Err FillProperties_get_field(GF_Node *node, GF_FieldInfo *info)
3637 : {
3638 11 : switch (info->fieldIndex) {
3639 3 : case 0:
3640 3 : info->name = "filled";
3641 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3642 3 : info->fieldType = GF_SG_VRML_SFBOOL;
3643 3 : info->far_ptr = & ((X_FillProperties *) node)->filled;
3644 3 : return GF_OK;
3645 3 : case 1:
3646 3 : info->name = "hatchColor";
3647 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3648 3 : info->fieldType = GF_SG_VRML_SFCOLOR;
3649 3 : info->far_ptr = & ((X_FillProperties *) node)->hatchColor;
3650 3 : return GF_OK;
3651 2 : case 2:
3652 2 : info->name = "hatched";
3653 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3654 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3655 2 : info->far_ptr = & ((X_FillProperties *) node)->hatched;
3656 2 : return GF_OK;
3657 3 : case 3:
3658 3 : info->name = "hatchStyle";
3659 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3660 3 : info->fieldType = GF_SG_VRML_SFINT32;
3661 3 : info->far_ptr = & ((X_FillProperties *) node)->hatchStyle;
3662 3 : return GF_OK;
3663 : default:
3664 : return GF_BAD_PARAM;
3665 : }
3666 : }
3667 :
3668 :
3669 7 : static s32 FillProperties_get_field_index_by_name(char *name)
3670 : {
3671 7 : if (!strcmp("filled", name)) return 0;
3672 5 : if (!strcmp("hatchColor", name)) return 1;
3673 3 : if (!strcmp("hatched", name)) return 2;
3674 2 : if (!strcmp("hatchStyle", name)) return 3;
3675 0 : return -1;
3676 : }
3677 :
3678 :
3679 2 : static GF_Node *FillProperties_Create()
3680 : {
3681 : X_FillProperties *p;
3682 2 : GF_SAFEALLOC(p, X_FillProperties);
3683 2 : if(!p) return NULL;
3684 2 : gf_node_setup((GF_Node *)p, TAG_X3D_FillProperties);
3685 :
3686 : /*default field values*/
3687 2 : p->filled = 1;
3688 2 : p->hatchColor.red = FLT2FIX(1);
3689 2 : p->hatchColor.green = FLT2FIX(1);
3690 2 : p->hatchColor.blue = FLT2FIX(1);
3691 2 : p->hatched = 1;
3692 2 : p->hatchStyle = 1;
3693 2 : return (GF_Node *)p;
3694 : }
3695 :
3696 :
3697 : /*
3698 : Fog Node deletion
3699 : */
3700 :
3701 1 : static void Fog_Del(GF_Node *node)
3702 : {
3703 : X_Fog *p = (X_Fog *) node;
3704 1 : gf_sg_sfstring_del(p->fogType);
3705 1 : gf_node_unregister((GF_Node *) p->metadata, node);
3706 1 : gf_node_free((GF_Node *)p);
3707 1 : }
3708 :
3709 :
3710 : static u32 Fog_get_field_count(GF_Node *node, u8 dummy)
3711 : {
3712 : return 7;
3713 : }
3714 :
3715 14 : static GF_Err Fog_get_field(GF_Node *node, GF_FieldInfo *info)
3716 : {
3717 14 : switch (info->fieldIndex) {
3718 2 : case 0:
3719 2 : info->name = "color";
3720 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3721 2 : info->fieldType = GF_SG_VRML_SFCOLOR;
3722 2 : info->far_ptr = & ((X_Fog *) node)->color;
3723 2 : return GF_OK;
3724 2 : case 1:
3725 2 : info->name = "fogType";
3726 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3727 2 : info->fieldType = GF_SG_VRML_SFSTRING;
3728 2 : info->far_ptr = & ((X_Fog *) node)->fogType;
3729 2 : return GF_OK;
3730 2 : case 2:
3731 2 : info->name = "visibilityRange";
3732 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3733 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
3734 2 : info->far_ptr = & ((X_Fog *) node)->visibilityRange;
3735 2 : return GF_OK;
3736 2 : case 3:
3737 2 : info->name = "set_bind";
3738 2 : info->eventType = GF_SG_EVENT_IN;
3739 2 : info->on_event_in = ((X_Fog *)node)->on_set_bind;
3740 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3741 2 : info->far_ptr = & ((X_Fog *) node)->set_bind;
3742 2 : return GF_OK;
3743 2 : case 4:
3744 2 : info->name = "isBound";
3745 2 : info->eventType = GF_SG_EVENT_OUT;
3746 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3747 2 : info->far_ptr = & ((X_Fog *) node)->isBound;
3748 2 : return GF_OK;
3749 2 : case 5:
3750 2 : info->name = "metadata";
3751 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3752 2 : info->fieldType = GF_SG_VRML_SFNODE;
3753 2 : info->NDTtype = NDT_SFMetadataNode;
3754 2 : info->far_ptr = & ((X_Fog *)node)->metadata;
3755 2 : return GF_OK;
3756 2 : case 6:
3757 2 : info->name = "bindTime";
3758 2 : info->eventType = GF_SG_EVENT_OUT;
3759 2 : info->fieldType = GF_SG_VRML_SFTIME;
3760 2 : info->far_ptr = & ((X_Fog *) node)->bindTime;
3761 2 : return GF_OK;
3762 : default:
3763 : return GF_BAD_PARAM;
3764 : }
3765 : }
3766 :
3767 :
3768 7 : static s32 Fog_get_field_index_by_name(char *name)
3769 : {
3770 7 : if (!strcmp("color", name)) return 0;
3771 6 : if (!strcmp("fogType", name)) return 1;
3772 5 : if (!strcmp("visibilityRange", name)) return 2;
3773 4 : if (!strcmp("set_bind", name)) return 3;
3774 3 : if (!strcmp("isBound", name)) return 4;
3775 2 : if (!strcmp("metadata", name)) return 5;
3776 1 : if (!strcmp("bindTime", name)) return 6;
3777 0 : return -1;
3778 : }
3779 :
3780 :
3781 1 : static GF_Node *Fog_Create()
3782 : {
3783 : X_Fog *p;
3784 1 : GF_SAFEALLOC(p, X_Fog);
3785 1 : if(!p) return NULL;
3786 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Fog);
3787 :
3788 : /*default field values*/
3789 1 : p->color.red = FLT2FIX(1);
3790 1 : p->color.green = FLT2FIX(1);
3791 1 : p->color.blue = FLT2FIX(1);
3792 1 : p->fogType.buffer = (char*) gf_malloc(sizeof(char) * 7);
3793 : strcpy(p->fogType.buffer, "LINEAR");
3794 1 : p->visibilityRange = FLT2FIX(0);
3795 1 : return (GF_Node *)p;
3796 : }
3797 :
3798 :
3799 : /*
3800 : FontStyle Node deletion
3801 : */
3802 :
3803 3 : static void FontStyle_Del(GF_Node *node)
3804 : {
3805 : X_FontStyle *p = (X_FontStyle *) node;
3806 3 : gf_sg_mfstring_del(p->family);
3807 3 : gf_sg_mfstring_del(p->justify);
3808 3 : gf_sg_sfstring_del(p->language);
3809 3 : gf_sg_sfstring_del(p->style);
3810 3 : gf_node_unregister((GF_Node *) p->metadata, node);
3811 3 : gf_node_free((GF_Node *)p);
3812 3 : }
3813 :
3814 :
3815 : static u32 FontStyle_get_field_count(GF_Node *node, u8 dummy)
3816 : {
3817 : return 10;
3818 : }
3819 :
3820 23 : static GF_Err FontStyle_get_field(GF_Node *node, GF_FieldInfo *info)
3821 : {
3822 23 : switch (info->fieldIndex) {
3823 2 : case 0:
3824 2 : info->name = "family";
3825 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3826 2 : info->fieldType = GF_SG_VRML_MFSTRING;
3827 2 : info->far_ptr = & ((X_FontStyle *) node)->family;
3828 2 : return GF_OK;
3829 2 : case 1:
3830 2 : info->name = "horizontal";
3831 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3832 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3833 2 : info->far_ptr = & ((X_FontStyle *) node)->horizontal;
3834 2 : return GF_OK;
3835 4 : case 2:
3836 4 : info->name = "justify";
3837 4 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3838 4 : info->fieldType = GF_SG_VRML_MFSTRING;
3839 4 : info->far_ptr = & ((X_FontStyle *) node)->justify;
3840 4 : return GF_OK;
3841 2 : case 3:
3842 2 : info->name = "language";
3843 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3844 2 : info->fieldType = GF_SG_VRML_SFSTRING;
3845 2 : info->far_ptr = & ((X_FontStyle *) node)->language;
3846 2 : return GF_OK;
3847 2 : case 4:
3848 2 : info->name = "leftToRight";
3849 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3850 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3851 2 : info->far_ptr = & ((X_FontStyle *) node)->leftToRight;
3852 2 : return GF_OK;
3853 3 : case 5:
3854 3 : info->name = "size";
3855 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3856 3 : info->fieldType = GF_SG_VRML_SFFLOAT;
3857 3 : info->far_ptr = & ((X_FontStyle *) node)->size;
3858 3 : return GF_OK;
3859 2 : case 6:
3860 2 : info->name = "spacing";
3861 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3862 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
3863 2 : info->far_ptr = & ((X_FontStyle *) node)->spacing;
3864 2 : return GF_OK;
3865 2 : case 7:
3866 2 : info->name = "style";
3867 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3868 2 : info->fieldType = GF_SG_VRML_SFSTRING;
3869 2 : info->far_ptr = & ((X_FontStyle *) node)->style;
3870 2 : return GF_OK;
3871 2 : case 8:
3872 2 : info->name = "topToBottom";
3873 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3874 2 : info->fieldType = GF_SG_VRML_SFBOOL;
3875 2 : info->far_ptr = & ((X_FontStyle *) node)->topToBottom;
3876 2 : return GF_OK;
3877 2 : case 9:
3878 2 : info->name = "metadata";
3879 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3880 2 : info->fieldType = GF_SG_VRML_SFNODE;
3881 2 : info->NDTtype = NDT_SFMetadataNode;
3882 2 : info->far_ptr = & ((X_FontStyle *)node)->metadata;
3883 2 : return GF_OK;
3884 : default:
3885 : return GF_BAD_PARAM;
3886 : }
3887 : }
3888 :
3889 :
3890 13 : static s32 FontStyle_get_field_index_by_name(char *name)
3891 : {
3892 13 : if (!strcmp("family", name)) return 0;
3893 12 : if (!strcmp("horizontal", name)) return 1;
3894 11 : if (!strcmp("justify", name)) return 2;
3895 8 : if (!strcmp("language", name)) return 3;
3896 7 : if (!strcmp("leftToRight", name)) return 4;
3897 6 : if (!strcmp("size", name)) return 5;
3898 4 : if (!strcmp("spacing", name)) return 6;
3899 3 : if (!strcmp("style", name)) return 7;
3900 2 : if (!strcmp("topToBottom", name)) return 8;
3901 1 : if (!strcmp("metadata", name)) return 9;
3902 0 : return -1;
3903 : }
3904 :
3905 :
3906 3 : static GF_Node *FontStyle_Create()
3907 : {
3908 : X_FontStyle *p;
3909 3 : GF_SAFEALLOC(p, X_FontStyle);
3910 3 : if(!p) return NULL;
3911 3 : gf_node_setup((GF_Node *)p, TAG_X3D_FontStyle);
3912 :
3913 : /*default field values*/
3914 3 : p->family.vals = (char**)gf_malloc(sizeof(SFString)*1);
3915 3 : p->family.count = 1;
3916 3 : p->family.vals[0] = (char*)gf_malloc(sizeof(char) * 6);
3917 3 : strcpy(p->family.vals[0], "SERIF");
3918 3 : p->horizontal = 1;
3919 3 : p->justify.vals = (char**)gf_malloc(sizeof(SFString)*1);
3920 3 : p->justify.count = 1;
3921 3 : p->justify.vals[0] = (char*)gf_malloc(sizeof(char) * 6);
3922 3 : strcpy(p->justify.vals[0], "BEGIN");
3923 3 : p->leftToRight = 1;
3924 3 : p->size = FLT2FIX(1.0);
3925 3 : p->spacing = FLT2FIX(1.0);
3926 3 : p->style.buffer = (char*) gf_malloc(sizeof(char) * 6);
3927 : strcpy(p->style.buffer, "PLAIN");
3928 3 : p->topToBottom = 1;
3929 3 : return (GF_Node *)p;
3930 : }
3931 :
3932 :
3933 : /*
3934 : GeoCoordinate Node deletion
3935 : */
3936 :
3937 1 : static void GeoCoordinate_Del(GF_Node *node)
3938 : {
3939 : X_GeoCoordinate *p = (X_GeoCoordinate *) node;
3940 1 : gf_sg_mfvec3d_del(p->point);
3941 1 : gf_node_unregister((GF_Node *) p->geoOrigin, node);
3942 1 : gf_sg_mfstring_del(p->geoSystem);
3943 1 : gf_node_unregister((GF_Node *) p->metadata, node);
3944 1 : gf_node_free((GF_Node *)p);
3945 1 : }
3946 :
3947 :
3948 : static u32 GeoCoordinate_get_field_count(GF_Node *node, u8 dummy)
3949 : {
3950 : return 4;
3951 : }
3952 :
3953 8 : static GF_Err GeoCoordinate_get_field(GF_Node *node, GF_FieldInfo *info)
3954 : {
3955 8 : switch (info->fieldIndex) {
3956 2 : case 0:
3957 2 : info->name = "point";
3958 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3959 2 : info->fieldType = GF_SG_VRML_MFVEC3D;
3960 2 : info->far_ptr = & ((X_GeoCoordinate *) node)->point;
3961 2 : return GF_OK;
3962 2 : case 1:
3963 2 : info->name = "geoOrigin";
3964 2 : info->eventType = GF_SG_EVENT_FIELD;
3965 2 : info->fieldType = GF_SG_VRML_SFNODE;
3966 2 : info->NDTtype = NDT_SFGeoOriginNode;
3967 2 : info->far_ptr = & ((X_GeoCoordinate *)node)->geoOrigin;
3968 2 : return GF_OK;
3969 2 : case 2:
3970 2 : info->name = "geoSystem";
3971 2 : info->eventType = GF_SG_EVENT_FIELD;
3972 2 : info->fieldType = GF_SG_VRML_MFSTRING;
3973 2 : info->far_ptr = & ((X_GeoCoordinate *) node)->geoSystem;
3974 2 : return GF_OK;
3975 2 : case 3:
3976 2 : info->name = "metadata";
3977 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3978 2 : info->fieldType = GF_SG_VRML_SFNODE;
3979 2 : info->NDTtype = NDT_SFMetadataNode;
3980 2 : info->far_ptr = & ((X_GeoCoordinate *)node)->metadata;
3981 2 : return GF_OK;
3982 : default:
3983 : return GF_BAD_PARAM;
3984 : }
3985 : }
3986 :
3987 :
3988 4 : static s32 GeoCoordinate_get_field_index_by_name(char *name)
3989 : {
3990 4 : if (!strcmp("point", name)) return 0;
3991 3 : if (!strcmp("geoOrigin", name)) return 1;
3992 2 : if (!strcmp("geoSystem", name)) return 2;
3993 1 : if (!strcmp("metadata", name)) return 3;
3994 0 : return -1;
3995 : }
3996 :
3997 :
3998 1 : static GF_Node *GeoCoordinate_Create()
3999 : {
4000 : X_GeoCoordinate *p;
4001 1 : GF_SAFEALLOC(p, X_GeoCoordinate);
4002 1 : if(!p) return NULL;
4003 1 : gf_node_setup((GF_Node *)p, TAG_X3D_GeoCoordinate);
4004 :
4005 : /*default field values*/
4006 1 : p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
4007 1 : p->geoSystem.count = 2;
4008 1 : p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
4009 1 : strcpy(p->geoSystem.vals[0], "GD");
4010 1 : p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
4011 1 : strcpy(p->geoSystem.vals[1], "WE");
4012 1 : return (GF_Node *)p;
4013 : }
4014 :
4015 :
4016 : /*
4017 : GeoElevationGrid Node deletion
4018 : */
4019 :
4020 1 : static void GeoElevationGrid_Del(GF_Node *node)
4021 : {
4022 : X_GeoElevationGrid *p = (X_GeoElevationGrid *) node;
4023 1 : gf_sg_mfdouble_del(p->set_height);
4024 1 : gf_node_unregister((GF_Node *) p->color, node);
4025 1 : gf_node_unregister((GF_Node *) p->normal, node);
4026 1 : gf_node_unregister((GF_Node *) p->texCoord, node);
4027 1 : gf_sg_sfstring_del(p->geoGridOrigin);
4028 1 : gf_node_unregister((GF_Node *) p->geoOrigin, node);
4029 1 : gf_sg_mfstring_del(p->geoSystem);
4030 1 : gf_sg_mfdouble_del(p->height);
4031 1 : gf_node_unregister((GF_Node *) p->metadata, node);
4032 1 : gf_node_free((GF_Node *)p);
4033 1 : }
4034 :
4035 :
4036 : static u32 GeoElevationGrid_get_field_count(GF_Node *node, u8 dummy)
4037 : {
4038 : return 19;
4039 : }
4040 :
4041 38 : static GF_Err GeoElevationGrid_get_field(GF_Node *node, GF_FieldInfo *info)
4042 : {
4043 38 : switch (info->fieldIndex) {
4044 2 : case 0:
4045 2 : info->name = "set_height";
4046 2 : info->eventType = GF_SG_EVENT_IN;
4047 2 : info->on_event_in = ((X_GeoElevationGrid *)node)->on_set_height;
4048 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
4049 2 : info->far_ptr = & ((X_GeoElevationGrid *) node)->set_height;
4050 2 : return GF_OK;
4051 2 : case 1:
4052 2 : info->name = "color";
4053 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4054 2 : info->fieldType = GF_SG_VRML_SFNODE;
4055 2 : info->NDTtype = NDT_SFColorNode;
4056 2 : info->far_ptr = & ((X_GeoElevationGrid *)node)->color;
4057 2 : return GF_OK;
4058 2 : case 2:
4059 2 : info->name = "normal";
4060 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4061 2 : info->fieldType = GF_SG_VRML_SFNODE;
4062 2 : info->NDTtype = NDT_SFNormalNode;
4063 2 : info->far_ptr = & ((X_GeoElevationGrid *)node)->normal;
4064 2 : return GF_OK;
4065 2 : case 3:
4066 2 : info->name = "texCoord";
4067 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4068 2 : info->fieldType = GF_SG_VRML_SFNODE;
4069 2 : info->NDTtype = NDT_SFTextureCoordinateNode;
4070 2 : info->far_ptr = & ((X_GeoElevationGrid *)node)->texCoord;
4071 2 : return GF_OK;
4072 2 : case 4:
4073 2 : info->name = "yScale";
4074 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4075 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
4076 2 : info->far_ptr = & ((X_GeoElevationGrid *) node)->yScale;
4077 2 : return GF_OK;
4078 2 : case 5:
4079 2 : info->name = "ccw";
4080 2 : info->eventType = GF_SG_EVENT_FIELD;
4081 2 : info->fieldType = GF_SG_VRML_SFBOOL;
4082 2 : info->far_ptr = & ((X_GeoElevationGrid *) node)->ccw;
4083 2 : return GF_OK;
4084 2 : case 6:
4085 2 : info->name = "colorPerVertex";
4086 2 : info->eventType = GF_SG_EVENT_FIELD;
4087 2 : info->fieldType = GF_SG_VRML_SFBOOL;
4088 2 : info->far_ptr = & ((X_GeoElevationGrid *) node)->colorPerVertex;
4089 2 : return GF_OK;
4090 2 : case 7:
4091 2 : info->name = "creaseAngle";
4092 2 : info->eventType = GF_SG_EVENT_FIELD;
4093 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
4094 2 : info->far_ptr = & ((X_GeoElevationGrid *) node)->creaseAngle;
4095 2 : return GF_OK;
4096 2 : case 8:
4097 2 : info->name = "geoGridOrigin";
4098 2 : info->eventType = GF_SG_EVENT_FIELD;
4099 2 : info->fieldType = GF_SG_VRML_SFSTRING;
4100 2 : info->far_ptr = & ((X_GeoElevationGrid *) node)->geoGridOrigin;
4101 2 : return GF_OK;
4102 2 : case 9:
4103 2 : info->name = "geoOrigin";
4104 2 : info->eventType = GF_SG_EVENT_FIELD;
4105 2 : info->fieldType = GF_SG_VRML_SFNODE;
4106 2 : info->NDTtype = NDT_SFGeoOriginNode;
4107 2 : info->far_ptr = & ((X_GeoElevationGrid *)node)->geoOrigin;
4108 2 : return GF_OK;
4109 2 : case 10:
4110 2 : info->name = "geoSystem";
4111 2 : info->eventType = GF_SG_EVENT_FIELD;
4112 2 : info->fieldType = GF_SG_VRML_MFSTRING;
4113 2 : info->far_ptr = & ((X_GeoElevationGrid *) node)->geoSystem;
4114 2 : return GF_OK;
4115 2 : case 11:
4116 2 : info->name = "height";
4117 2 : info->eventType = GF_SG_EVENT_FIELD;
4118 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
4119 2 : info->far_ptr = & ((X_GeoElevationGrid *) node)->height;
4120 2 : return GF_OK;
4121 2 : case 12:
4122 2 : info->name = "normalPerVertex";
4123 2 : info->eventType = GF_SG_EVENT_FIELD;
4124 2 : info->fieldType = GF_SG_VRML_SFBOOL;
4125 2 : info->far_ptr = & ((X_GeoElevationGrid *) node)->normalPerVertex;
4126 2 : return GF_OK;
4127 2 : case 13:
4128 2 : info->name = "solid";
4129 2 : info->eventType = GF_SG_EVENT_FIELD;
4130 2 : info->fieldType = GF_SG_VRML_SFBOOL;
4131 2 : info->far_ptr = & ((X_GeoElevationGrid *) node)->solid;
4132 2 : return GF_OK;
4133 2 : case 14:
4134 2 : info->name = "xDimension";
4135 2 : info->eventType = GF_SG_EVENT_FIELD;
4136 2 : info->fieldType = GF_SG_VRML_SFINT32;
4137 2 : info->far_ptr = & ((X_GeoElevationGrid *) node)->xDimension;
4138 2 : return GF_OK;
4139 2 : case 15:
4140 2 : info->name = "xSpacing";
4141 2 : info->eventType = GF_SG_EVENT_FIELD;
4142 2 : info->fieldType = GF_SG_VRML_SFDOUBLE;
4143 2 : info->far_ptr = & ((X_GeoElevationGrid *) node)->xSpacing;
4144 2 : return GF_OK;
4145 2 : case 16:
4146 2 : info->name = "zDimension";
4147 2 : info->eventType = GF_SG_EVENT_FIELD;
4148 2 : info->fieldType = GF_SG_VRML_SFINT32;
4149 2 : info->far_ptr = & ((X_GeoElevationGrid *) node)->zDimension;
4150 2 : return GF_OK;
4151 2 : case 17:
4152 2 : info->name = "zSpacing";
4153 2 : info->eventType = GF_SG_EVENT_FIELD;
4154 2 : info->fieldType = GF_SG_VRML_SFDOUBLE;
4155 2 : info->far_ptr = & ((X_GeoElevationGrid *) node)->zSpacing;
4156 2 : return GF_OK;
4157 2 : case 18:
4158 2 : info->name = "metadata";
4159 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4160 2 : info->fieldType = GF_SG_VRML_SFNODE;
4161 2 : info->NDTtype = NDT_SFMetadataNode;
4162 2 : info->far_ptr = & ((X_GeoElevationGrid *)node)->metadata;
4163 2 : return GF_OK;
4164 : default:
4165 : return GF_BAD_PARAM;
4166 : }
4167 : }
4168 :
4169 :
4170 19 : static s32 GeoElevationGrid_get_field_index_by_name(char *name)
4171 : {
4172 19 : if (!strcmp("set_height", name)) return 0;
4173 18 : if (!strcmp("color", name)) return 1;
4174 17 : if (!strcmp("normal", name)) return 2;
4175 16 : if (!strcmp("texCoord", name)) return 3;
4176 15 : if (!strcmp("yScale", name)) return 4;
4177 14 : if (!strcmp("ccw", name)) return 5;
4178 13 : if (!strcmp("colorPerVertex", name)) return 6;
4179 12 : if (!strcmp("creaseAngle", name)) return 7;
4180 11 : if (!strcmp("geoGridOrigin", name)) return 8;
4181 10 : if (!strcmp("geoOrigin", name)) return 9;
4182 9 : if (!strcmp("geoSystem", name)) return 10;
4183 8 : if (!strcmp("height", name)) return 11;
4184 7 : if (!strcmp("normalPerVertex", name)) return 12;
4185 6 : if (!strcmp("solid", name)) return 13;
4186 5 : if (!strcmp("xDimension", name)) return 14;
4187 4 : if (!strcmp("xSpacing", name)) return 15;
4188 3 : if (!strcmp("zDimension", name)) return 16;
4189 2 : if (!strcmp("zSpacing", name)) return 17;
4190 1 : if (!strcmp("metadata", name)) return 18;
4191 0 : return -1;
4192 : }
4193 :
4194 :
4195 1 : static GF_Node *GeoElevationGrid_Create()
4196 : {
4197 : X_GeoElevationGrid *p;
4198 1 : GF_SAFEALLOC(p, X_GeoElevationGrid);
4199 1 : if(!p) return NULL;
4200 1 : gf_node_setup((GF_Node *)p, TAG_X3D_GeoElevationGrid);
4201 :
4202 : /*default field values*/
4203 1 : p->yScale = FLT2FIX(1.0);
4204 1 : p->ccw = 1;
4205 1 : p->colorPerVertex = 1;
4206 1 : p->creaseAngle = FLT2FIX(0.0);
4207 1 : p->geoGridOrigin.buffer = (char*) gf_malloc(sizeof(char) * 6);
4208 : strcpy(p->geoGridOrigin.buffer, "0 0 0");
4209 1 : p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
4210 1 : p->geoSystem.count = 2;
4211 1 : p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
4212 1 : strcpy(p->geoSystem.vals[0], "GD");
4213 1 : p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
4214 1 : strcpy(p->geoSystem.vals[1], "WE");
4215 1 : p->normalPerVertex = 1;
4216 1 : p->solid = 1;
4217 1 : p->xDimension = 0;
4218 1 : p->xSpacing = (SFDouble) 1.0;
4219 1 : p->zDimension = 0;
4220 1 : p->zSpacing = (SFDouble) 1.0;
4221 1 : return (GF_Node *)p;
4222 : }
4223 :
4224 :
4225 : /*
4226 : GeoLocation Node deletion
4227 : */
4228 :
4229 1 : static void GeoLocation_Del(GF_Node *node)
4230 : {
4231 : X_GeoLocation *p = (X_GeoLocation *) node;
4232 1 : gf_node_unregister((GF_Node *) p->geoOrigin, node);
4233 1 : gf_sg_mfstring_del(p->geoSystem);
4234 1 : gf_node_unregister((GF_Node *) p->metadata, node);
4235 1 : gf_sg_vrml_parent_destroy(node);
4236 1 : gf_node_free((GF_Node *)p);
4237 1 : }
4238 :
4239 :
4240 : static u32 GeoLocation_get_field_count(GF_Node *node, u8 dummy)
4241 : {
4242 : return 7;
4243 : }
4244 :
4245 14 : static GF_Err GeoLocation_get_field(GF_Node *node, GF_FieldInfo *info)
4246 : {
4247 14 : switch (info->fieldIndex) {
4248 2 : case 0:
4249 2 : info->name = "addChildren";
4250 2 : info->eventType = GF_SG_EVENT_IN;
4251 2 : info->on_event_in = ((X_GeoLocation *)node)->on_addChildren;
4252 2 : info->fieldType = GF_SG_VRML_MFNODE;
4253 2 : info->NDTtype = NDT_SF3DNode;
4254 2 : info->far_ptr = & ((X_GeoLocation *)node)->addChildren;
4255 2 : return GF_OK;
4256 2 : case 1:
4257 2 : info->name = "removeChildren";
4258 2 : info->eventType = GF_SG_EVENT_IN;
4259 2 : info->on_event_in = ((X_GeoLocation *)node)->on_removeChildren;
4260 2 : info->fieldType = GF_SG_VRML_MFNODE;
4261 2 : info->NDTtype = NDT_SF3DNode;
4262 2 : info->far_ptr = & ((X_GeoLocation *)node)->removeChildren;
4263 2 : return GF_OK;
4264 2 : case 2:
4265 2 : info->name = "children";
4266 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4267 2 : info->fieldType = GF_SG_VRML_MFNODE;
4268 2 : info->NDTtype = NDT_SF3DNode;
4269 2 : info->far_ptr = & ((X_GeoLocation *)node)->children;
4270 2 : return GF_OK;
4271 2 : case 3:
4272 2 : info->name = "geoCoords";
4273 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4274 2 : info->fieldType = GF_SG_VRML_SFVEC3D;
4275 2 : info->far_ptr = & ((X_GeoLocation *) node)->geoCoords;
4276 2 : return GF_OK;
4277 2 : case 4:
4278 2 : info->name = "geoOrigin";
4279 2 : info->eventType = GF_SG_EVENT_FIELD;
4280 2 : info->fieldType = GF_SG_VRML_SFNODE;
4281 2 : info->NDTtype = NDT_SFGeoOriginNode;
4282 2 : info->far_ptr = & ((X_GeoLocation *)node)->geoOrigin;
4283 2 : return GF_OK;
4284 2 : case 5:
4285 2 : info->name = "geoSystem";
4286 2 : info->eventType = GF_SG_EVENT_FIELD;
4287 2 : info->fieldType = GF_SG_VRML_MFSTRING;
4288 2 : info->far_ptr = & ((X_GeoLocation *) node)->geoSystem;
4289 2 : return GF_OK;
4290 2 : case 6:
4291 2 : info->name = "metadata";
4292 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4293 2 : info->fieldType = GF_SG_VRML_SFNODE;
4294 2 : info->NDTtype = NDT_SFMetadataNode;
4295 2 : info->far_ptr = & ((X_GeoLocation *)node)->metadata;
4296 2 : return GF_OK;
4297 : default:
4298 : return GF_BAD_PARAM;
4299 : }
4300 : }
4301 :
4302 :
4303 7 : static s32 GeoLocation_get_field_index_by_name(char *name)
4304 : {
4305 7 : if (!strcmp("addChildren", name)) return 0;
4306 6 : if (!strcmp("removeChildren", name)) return 1;
4307 5 : if (!strcmp("children", name)) return 2;
4308 4 : if (!strcmp("geoCoords", name)) return 3;
4309 3 : if (!strcmp("geoOrigin", name)) return 4;
4310 2 : if (!strcmp("geoSystem", name)) return 5;
4311 1 : if (!strcmp("metadata", name)) return 6;
4312 0 : return -1;
4313 : }
4314 :
4315 :
4316 1 : static GF_Node *GeoLocation_Create()
4317 : {
4318 : X_GeoLocation *p;
4319 1 : GF_SAFEALLOC(p, X_GeoLocation);
4320 1 : if(!p) return NULL;
4321 1 : gf_node_setup((GF_Node *)p, TAG_X3D_GeoLocation);
4322 1 : gf_sg_vrml_parent_setup((GF_Node *) p);
4323 :
4324 : /*default field values*/
4325 1 : p->geoCoords.x = (SFDouble) 0;
4326 1 : p->geoCoords.y = (SFDouble) 0;
4327 1 : p->geoCoords.z = (SFDouble) 0;
4328 1 : p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
4329 1 : p->geoSystem.count = 2;
4330 1 : p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
4331 1 : strcpy(p->geoSystem.vals[0], "GD");
4332 1 : p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
4333 1 : strcpy(p->geoSystem.vals[1], "WE");
4334 1 : return (GF_Node *)p;
4335 : }
4336 :
4337 :
4338 : /*
4339 : GeoLOD Node deletion
4340 : */
4341 :
4342 1 : static void GeoLOD_Del(GF_Node *node)
4343 : {
4344 : X_GeoLOD *p = (X_GeoLOD *) node;
4345 1 : gf_sg_mfurl_del(p->child1Url);
4346 1 : gf_sg_mfurl_del(p->child2Url);
4347 1 : gf_sg_mfurl_del(p->child3Url);
4348 1 : gf_sg_mfurl_del(p->child4Url);
4349 1 : gf_node_unregister((GF_Node *) p->geoOrigin, node);
4350 1 : gf_sg_mfstring_del(p->geoSystem);
4351 1 : gf_sg_mfurl_del(p->rootUrl);
4352 1 : gf_node_unregister_children(node, p->rootNode);
4353 1 : gf_node_unregister_children(node, p->children);
4354 1 : gf_node_unregister((GF_Node *) p->metadata, node);
4355 1 : gf_node_free((GF_Node *)p);
4356 1 : }
4357 :
4358 :
4359 : static u32 GeoLOD_get_field_count(GF_Node *node, u8 dummy)
4360 : {
4361 : return 12;
4362 : }
4363 :
4364 24 : static GF_Err GeoLOD_get_field(GF_Node *node, GF_FieldInfo *info)
4365 : {
4366 24 : switch (info->fieldIndex) {
4367 2 : case 0:
4368 2 : info->name = "center";
4369 2 : info->eventType = GF_SG_EVENT_FIELD;
4370 2 : info->fieldType = GF_SG_VRML_SFVEC3D;
4371 2 : info->far_ptr = & ((X_GeoLOD *) node)->center;
4372 2 : return GF_OK;
4373 2 : case 1:
4374 2 : info->name = "child1Url";
4375 2 : info->eventType = GF_SG_EVENT_FIELD;
4376 2 : info->fieldType = GF_SG_VRML_MFURL;
4377 2 : info->far_ptr = & ((X_GeoLOD *) node)->child1Url;
4378 2 : return GF_OK;
4379 2 : case 2:
4380 2 : info->name = "child2Url";
4381 2 : info->eventType = GF_SG_EVENT_FIELD;
4382 2 : info->fieldType = GF_SG_VRML_MFURL;
4383 2 : info->far_ptr = & ((X_GeoLOD *) node)->child2Url;
4384 2 : return GF_OK;
4385 2 : case 3:
4386 2 : info->name = "child3Url";
4387 2 : info->eventType = GF_SG_EVENT_FIELD;
4388 2 : info->fieldType = GF_SG_VRML_MFURL;
4389 2 : info->far_ptr = & ((X_GeoLOD *) node)->child3Url;
4390 2 : return GF_OK;
4391 2 : case 4:
4392 2 : info->name = "child4Url";
4393 2 : info->eventType = GF_SG_EVENT_FIELD;
4394 2 : info->fieldType = GF_SG_VRML_MFURL;
4395 2 : info->far_ptr = & ((X_GeoLOD *) node)->child4Url;
4396 2 : return GF_OK;
4397 2 : case 5:
4398 2 : info->name = "geoOrigin";
4399 2 : info->eventType = GF_SG_EVENT_FIELD;
4400 2 : info->fieldType = GF_SG_VRML_SFNODE;
4401 2 : info->NDTtype = NDT_SFGeoOriginNode;
4402 2 : info->far_ptr = & ((X_GeoLOD *)node)->geoOrigin;
4403 2 : return GF_OK;
4404 2 : case 6:
4405 2 : info->name = "geoSystem";
4406 2 : info->eventType = GF_SG_EVENT_FIELD;
4407 2 : info->fieldType = GF_SG_VRML_MFSTRING;
4408 2 : info->far_ptr = & ((X_GeoLOD *) node)->geoSystem;
4409 2 : return GF_OK;
4410 2 : case 7:
4411 2 : info->name = "range";
4412 2 : info->eventType = GF_SG_EVENT_FIELD;
4413 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
4414 2 : info->far_ptr = & ((X_GeoLOD *) node)->range;
4415 2 : return GF_OK;
4416 2 : case 8:
4417 2 : info->name = "rootUrl";
4418 2 : info->eventType = GF_SG_EVENT_FIELD;
4419 2 : info->fieldType = GF_SG_VRML_MFURL;
4420 2 : info->far_ptr = & ((X_GeoLOD *) node)->rootUrl;
4421 2 : return GF_OK;
4422 2 : case 9:
4423 2 : info->name = "rootNode";
4424 2 : info->eventType = GF_SG_EVENT_FIELD;
4425 2 : info->fieldType = GF_SG_VRML_MFNODE;
4426 2 : info->NDTtype = NDT_SF3DNode;
4427 2 : info->far_ptr = & ((X_GeoLOD *)node)->rootNode;
4428 2 : return GF_OK;
4429 2 : case 10:
4430 2 : info->name = "children";
4431 2 : info->eventType = GF_SG_EVENT_OUT;
4432 2 : info->fieldType = GF_SG_VRML_MFNODE;
4433 2 : info->NDTtype = NDT_SF3DNode;
4434 2 : info->far_ptr = & ((X_GeoLOD *)node)->children;
4435 2 : return GF_OK;
4436 2 : case 11:
4437 2 : info->name = "metadata";
4438 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4439 2 : info->fieldType = GF_SG_VRML_SFNODE;
4440 2 : info->NDTtype = NDT_SFMetadataNode;
4441 2 : info->far_ptr = & ((X_GeoLOD *)node)->metadata;
4442 2 : return GF_OK;
4443 : default:
4444 : return GF_BAD_PARAM;
4445 : }
4446 : }
4447 :
4448 :
4449 12 : static s32 GeoLOD_get_field_index_by_name(char *name)
4450 : {
4451 12 : if (!strcmp("center", name)) return 0;
4452 11 : if (!strcmp("child1Url", name)) return 1;
4453 10 : if (!strcmp("child2Url", name)) return 2;
4454 9 : if (!strcmp("child3Url", name)) return 3;
4455 8 : if (!strcmp("child4Url", name)) return 4;
4456 7 : if (!strcmp("geoOrigin", name)) return 5;
4457 6 : if (!strcmp("geoSystem", name)) return 6;
4458 5 : if (!strcmp("range", name)) return 7;
4459 4 : if (!strcmp("rootUrl", name)) return 8;
4460 3 : if (!strcmp("rootNode", name)) return 9;
4461 2 : if (!strcmp("children", name)) return 10;
4462 1 : if (!strcmp("metadata", name)) return 11;
4463 0 : return -1;
4464 : }
4465 :
4466 :
4467 1 : static GF_Node *GeoLOD_Create()
4468 : {
4469 : X_GeoLOD *p;
4470 1 : GF_SAFEALLOC(p, X_GeoLOD);
4471 1 : if(!p) return NULL;
4472 1 : gf_node_setup((GF_Node *)p, TAG_X3D_GeoLOD);
4473 :
4474 : /*default field values*/
4475 1 : p->center.x = (SFDouble) 0;
4476 1 : p->center.y = (SFDouble) 0;
4477 1 : p->center.z = (SFDouble) 0;
4478 1 : p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
4479 1 : p->geoSystem.count = 2;
4480 1 : p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
4481 1 : strcpy(p->geoSystem.vals[0], "GD");
4482 1 : p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
4483 1 : strcpy(p->geoSystem.vals[1], "WE");
4484 1 : p->range = FLT2FIX(10);
4485 1 : return (GF_Node *)p;
4486 : }
4487 :
4488 :
4489 : /*
4490 : GeoMetadata Node deletion
4491 : */
4492 :
4493 1 : static void GeoMetadata_Del(GF_Node *node)
4494 : {
4495 : X_GeoMetadata *p = (X_GeoMetadata *) node;
4496 1 : gf_node_unregister_children(node, p->data);
4497 1 : gf_sg_mfstring_del(p->summary);
4498 1 : gf_sg_mfurl_del(p->url);
4499 1 : gf_node_unregister((GF_Node *) p->metadata, node);
4500 1 : gf_node_free((GF_Node *)p);
4501 1 : }
4502 :
4503 :
4504 : static u32 GeoMetadata_get_field_count(GF_Node *node, u8 dummy)
4505 : {
4506 : return 4;
4507 : }
4508 :
4509 8 : static GF_Err GeoMetadata_get_field(GF_Node *node, GF_FieldInfo *info)
4510 : {
4511 8 : switch (info->fieldIndex) {
4512 2 : case 0:
4513 2 : info->name = "data";
4514 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4515 2 : info->fieldType = GF_SG_VRML_MFNODE;
4516 2 : info->NDTtype = NDT_SF3DNode;
4517 2 : info->far_ptr = & ((X_GeoMetadata *)node)->data;
4518 2 : return GF_OK;
4519 2 : case 1:
4520 2 : info->name = "summary";
4521 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4522 2 : info->fieldType = GF_SG_VRML_MFSTRING;
4523 2 : info->far_ptr = & ((X_GeoMetadata *) node)->summary;
4524 2 : return GF_OK;
4525 2 : case 2:
4526 2 : info->name = "url";
4527 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4528 2 : info->fieldType = GF_SG_VRML_MFURL;
4529 2 : info->far_ptr = & ((X_GeoMetadata *) node)->url;
4530 2 : return GF_OK;
4531 2 : case 3:
4532 2 : info->name = "metadata";
4533 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4534 2 : info->fieldType = GF_SG_VRML_SFNODE;
4535 2 : info->NDTtype = NDT_SFMetadataNode;
4536 2 : info->far_ptr = & ((X_GeoMetadata *)node)->metadata;
4537 2 : return GF_OK;
4538 : default:
4539 : return GF_BAD_PARAM;
4540 : }
4541 : }
4542 :
4543 :
4544 4 : static s32 GeoMetadata_get_field_index_by_name(char *name)
4545 : {
4546 4 : if (!strcmp("data", name)) return 0;
4547 3 : if (!strcmp("summary", name)) return 1;
4548 2 : if (!strcmp("url", name)) return 2;
4549 1 : if (!strcmp("metadata", name)) return 3;
4550 0 : return -1;
4551 : }
4552 :
4553 :
4554 1 : static GF_Node *GeoMetadata_Create()
4555 : {
4556 : X_GeoMetadata *p;
4557 1 : GF_SAFEALLOC(p, X_GeoMetadata);
4558 1 : if(!p) return NULL;
4559 1 : gf_node_setup((GF_Node *)p, TAG_X3D_GeoMetadata);
4560 :
4561 : /*default field values*/
4562 1 : return (GF_Node *)p;
4563 : }
4564 :
4565 :
4566 : /*
4567 : GeoOrigin Node deletion
4568 : */
4569 :
4570 1 : static void GeoOrigin_Del(GF_Node *node)
4571 : {
4572 : X_GeoOrigin *p = (X_GeoOrigin *) node;
4573 1 : gf_sg_mfstring_del(p->geoSystem);
4574 1 : gf_node_unregister((GF_Node *) p->metadata, node);
4575 1 : gf_node_free((GF_Node *)p);
4576 1 : }
4577 :
4578 :
4579 : static u32 GeoOrigin_get_field_count(GF_Node *node, u8 dummy)
4580 : {
4581 : return 4;
4582 : }
4583 :
4584 8 : static GF_Err GeoOrigin_get_field(GF_Node *node, GF_FieldInfo *info)
4585 : {
4586 8 : switch (info->fieldIndex) {
4587 2 : case 0:
4588 2 : info->name = "geoCoords";
4589 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4590 2 : info->fieldType = GF_SG_VRML_SFVEC3D;
4591 2 : info->far_ptr = & ((X_GeoOrigin *) node)->geoCoords;
4592 2 : return GF_OK;
4593 2 : case 1:
4594 2 : info->name = "geoSystem";
4595 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4596 2 : info->fieldType = GF_SG_VRML_MFSTRING;
4597 2 : info->far_ptr = & ((X_GeoOrigin *) node)->geoSystem;
4598 2 : return GF_OK;
4599 2 : case 2:
4600 2 : info->name = "rotateYUp";
4601 2 : info->eventType = GF_SG_EVENT_FIELD;
4602 2 : info->fieldType = GF_SG_VRML_SFBOOL;
4603 2 : info->far_ptr = & ((X_GeoOrigin *) node)->rotateYUp;
4604 2 : return GF_OK;
4605 2 : case 3:
4606 2 : info->name = "metadata";
4607 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4608 2 : info->fieldType = GF_SG_VRML_SFNODE;
4609 2 : info->NDTtype = NDT_SFMetadataNode;
4610 2 : info->far_ptr = & ((X_GeoOrigin *)node)->metadata;
4611 2 : return GF_OK;
4612 : default:
4613 : return GF_BAD_PARAM;
4614 : }
4615 : }
4616 :
4617 :
4618 4 : static s32 GeoOrigin_get_field_index_by_name(char *name)
4619 : {
4620 4 : if (!strcmp("geoCoords", name)) return 0;
4621 3 : if (!strcmp("geoSystem", name)) return 1;
4622 2 : if (!strcmp("rotateYUp", name)) return 2;
4623 1 : if (!strcmp("metadata", name)) return 3;
4624 0 : return -1;
4625 : }
4626 :
4627 :
4628 1 : static GF_Node *GeoOrigin_Create()
4629 : {
4630 : X_GeoOrigin *p;
4631 1 : GF_SAFEALLOC(p, X_GeoOrigin);
4632 1 : if(!p) return NULL;
4633 1 : gf_node_setup((GF_Node *)p, TAG_X3D_GeoOrigin);
4634 :
4635 : /*default field values*/
4636 1 : p->geoCoords.x = (SFDouble) 0;
4637 1 : p->geoCoords.y = (SFDouble) 0;
4638 1 : p->geoCoords.z = (SFDouble) 0;
4639 1 : p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
4640 1 : p->geoSystem.count = 2;
4641 1 : p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
4642 1 : strcpy(p->geoSystem.vals[0], "GD");
4643 1 : p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
4644 1 : strcpy(p->geoSystem.vals[1], "WE");
4645 1 : return (GF_Node *)p;
4646 : }
4647 :
4648 :
4649 : /*
4650 : GeoPositionInterpolator Node deletion
4651 : */
4652 :
4653 1 : static void GeoPositionInterpolator_Del(GF_Node *node)
4654 : {
4655 : X_GeoPositionInterpolator *p = (X_GeoPositionInterpolator *) node;
4656 1 : gf_sg_mffloat_del(p->key);
4657 1 : gf_sg_mfvec3d_del(p->keyValue);
4658 1 : gf_node_unregister((GF_Node *) p->geoOrigin, node);
4659 1 : gf_sg_mfstring_del(p->geoSystem);
4660 1 : gf_node_unregister((GF_Node *) p->metadata, node);
4661 1 : gf_node_free((GF_Node *)p);
4662 1 : }
4663 :
4664 :
4665 : static u32 GeoPositionInterpolator_get_field_count(GF_Node *node, u8 dummy)
4666 : {
4667 : return 8;
4668 : }
4669 :
4670 16 : static GF_Err GeoPositionInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
4671 : {
4672 16 : switch (info->fieldIndex) {
4673 2 : case 0:
4674 2 : info->name = "set_fraction";
4675 2 : info->eventType = GF_SG_EVENT_IN;
4676 2 : info->on_event_in = ((X_GeoPositionInterpolator *)node)->on_set_fraction;
4677 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
4678 2 : info->far_ptr = & ((X_GeoPositionInterpolator *) node)->set_fraction;
4679 2 : return GF_OK;
4680 2 : case 1:
4681 2 : info->name = "key";
4682 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4683 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
4684 2 : info->far_ptr = & ((X_GeoPositionInterpolator *) node)->key;
4685 2 : return GF_OK;
4686 2 : case 2:
4687 2 : info->name = "keyValue";
4688 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4689 2 : info->fieldType = GF_SG_VRML_MFVEC3D;
4690 2 : info->far_ptr = & ((X_GeoPositionInterpolator *) node)->keyValue;
4691 2 : return GF_OK;
4692 2 : case 3:
4693 2 : info->name = "geoOrigin";
4694 2 : info->eventType = GF_SG_EVENT_FIELD;
4695 2 : info->fieldType = GF_SG_VRML_SFNODE;
4696 2 : info->NDTtype = NDT_SFGeoOriginNode;
4697 2 : info->far_ptr = & ((X_GeoPositionInterpolator *)node)->geoOrigin;
4698 2 : return GF_OK;
4699 2 : case 4:
4700 2 : info->name = "geoSystem";
4701 2 : info->eventType = GF_SG_EVENT_FIELD;
4702 2 : info->fieldType = GF_SG_VRML_MFSTRING;
4703 2 : info->far_ptr = & ((X_GeoPositionInterpolator *) node)->geoSystem;
4704 2 : return GF_OK;
4705 2 : case 5:
4706 2 : info->name = "geovalue_changed";
4707 2 : info->eventType = GF_SG_EVENT_OUT;
4708 2 : info->fieldType = GF_SG_VRML_SFVEC3D;
4709 2 : info->far_ptr = & ((X_GeoPositionInterpolator *) node)->geovalue_changed;
4710 2 : return GF_OK;
4711 2 : case 6:
4712 2 : info->name = "value_changed";
4713 2 : info->eventType = GF_SG_EVENT_OUT;
4714 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
4715 2 : info->far_ptr = & ((X_GeoPositionInterpolator *) node)->value_changed;
4716 2 : return GF_OK;
4717 2 : case 7:
4718 2 : info->name = "metadata";
4719 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4720 2 : info->fieldType = GF_SG_VRML_SFNODE;
4721 2 : info->NDTtype = NDT_SFMetadataNode;
4722 2 : info->far_ptr = & ((X_GeoPositionInterpolator *)node)->metadata;
4723 2 : return GF_OK;
4724 : default:
4725 : return GF_BAD_PARAM;
4726 : }
4727 : }
4728 :
4729 :
4730 8 : static s32 GeoPositionInterpolator_get_field_index_by_name(char *name)
4731 : {
4732 8 : if (!strcmp("set_fraction", name)) return 0;
4733 7 : if (!strcmp("key", name)) return 1;
4734 6 : if (!strcmp("keyValue", name)) return 2;
4735 5 : if (!strcmp("geoOrigin", name)) return 3;
4736 4 : if (!strcmp("geoSystem", name)) return 4;
4737 3 : if (!strcmp("geovalue_changed", name)) return 5;
4738 2 : if (!strcmp("value_changed", name)) return 6;
4739 1 : if (!strcmp("metadata", name)) return 7;
4740 0 : return -1;
4741 : }
4742 :
4743 :
4744 1 : static GF_Node *GeoPositionInterpolator_Create()
4745 : {
4746 : X_GeoPositionInterpolator *p;
4747 1 : GF_SAFEALLOC(p, X_GeoPositionInterpolator);
4748 1 : if(!p) return NULL;
4749 1 : gf_node_setup((GF_Node *)p, TAG_X3D_GeoPositionInterpolator);
4750 :
4751 : /*default field values*/
4752 1 : p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
4753 1 : p->geoSystem.count = 2;
4754 1 : p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
4755 1 : strcpy(p->geoSystem.vals[0], "GD");
4756 1 : p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
4757 1 : strcpy(p->geoSystem.vals[1], "WE");
4758 1 : return (GF_Node *)p;
4759 : }
4760 :
4761 :
4762 : /*
4763 : GeoTouchSensor Node deletion
4764 : */
4765 :
4766 1 : static void GeoTouchSensor_Del(GF_Node *node)
4767 : {
4768 : X_GeoTouchSensor *p = (X_GeoTouchSensor *) node;
4769 1 : gf_node_unregister((GF_Node *) p->geoOrigin, node);
4770 1 : gf_sg_mfstring_del(p->geoSystem);
4771 1 : gf_node_unregister((GF_Node *) p->metadata, node);
4772 1 : gf_node_free((GF_Node *)p);
4773 1 : }
4774 :
4775 :
4776 : static u32 GeoTouchSensor_get_field_count(GF_Node *node, u8 dummy)
4777 : {
4778 : return 11;
4779 : }
4780 :
4781 22 : static GF_Err GeoTouchSensor_get_field(GF_Node *node, GF_FieldInfo *info)
4782 : {
4783 22 : switch (info->fieldIndex) {
4784 2 : case 0:
4785 2 : info->name = "enabled";
4786 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4787 2 : info->fieldType = GF_SG_VRML_SFBOOL;
4788 2 : info->far_ptr = & ((X_GeoTouchSensor *) node)->enabled;
4789 2 : return GF_OK;
4790 2 : case 1:
4791 2 : info->name = "geoOrigin";
4792 2 : info->eventType = GF_SG_EVENT_FIELD;
4793 2 : info->fieldType = GF_SG_VRML_SFNODE;
4794 2 : info->NDTtype = NDT_SFGeoOriginNode;
4795 2 : info->far_ptr = & ((X_GeoTouchSensor *)node)->geoOrigin;
4796 2 : return GF_OK;
4797 2 : case 2:
4798 2 : info->name = "geoSystem";
4799 2 : info->eventType = GF_SG_EVENT_FIELD;
4800 2 : info->fieldType = GF_SG_VRML_MFSTRING;
4801 2 : info->far_ptr = & ((X_GeoTouchSensor *) node)->geoSystem;
4802 2 : return GF_OK;
4803 2 : case 3:
4804 2 : info->name = "hitNormal_changed";
4805 2 : info->eventType = GF_SG_EVENT_OUT;
4806 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
4807 2 : info->far_ptr = & ((X_GeoTouchSensor *) node)->hitNormal_changed;
4808 2 : return GF_OK;
4809 2 : case 4:
4810 2 : info->name = "hitPoint_changed";
4811 2 : info->eventType = GF_SG_EVENT_OUT;
4812 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
4813 2 : info->far_ptr = & ((X_GeoTouchSensor *) node)->hitPoint_changed;
4814 2 : return GF_OK;
4815 2 : case 5:
4816 2 : info->name = "hitTexCoord_changed";
4817 2 : info->eventType = GF_SG_EVENT_OUT;
4818 2 : info->fieldType = GF_SG_VRML_SFVEC2F;
4819 2 : info->far_ptr = & ((X_GeoTouchSensor *) node)->hitTexCoord_changed;
4820 2 : return GF_OK;
4821 2 : case 6:
4822 2 : info->name = "hitGeoCoord_changed";
4823 2 : info->eventType = GF_SG_EVENT_OUT;
4824 2 : info->fieldType = GF_SG_VRML_SFVEC3D;
4825 2 : info->far_ptr = & ((X_GeoTouchSensor *) node)->hitGeoCoord_changed;
4826 2 : return GF_OK;
4827 2 : case 7:
4828 2 : info->name = "isActive";
4829 2 : info->eventType = GF_SG_EVENT_OUT;
4830 2 : info->fieldType = GF_SG_VRML_SFBOOL;
4831 2 : info->far_ptr = & ((X_GeoTouchSensor *) node)->isActive;
4832 2 : return GF_OK;
4833 2 : case 8:
4834 2 : info->name = "isOver";
4835 2 : info->eventType = GF_SG_EVENT_OUT;
4836 2 : info->fieldType = GF_SG_VRML_SFBOOL;
4837 2 : info->far_ptr = & ((X_GeoTouchSensor *) node)->isOver;
4838 2 : return GF_OK;
4839 2 : case 9:
4840 2 : info->name = "touchTime";
4841 2 : info->eventType = GF_SG_EVENT_OUT;
4842 2 : info->fieldType = GF_SG_VRML_SFTIME;
4843 2 : info->far_ptr = & ((X_GeoTouchSensor *) node)->touchTime;
4844 2 : return GF_OK;
4845 2 : case 10:
4846 2 : info->name = "metadata";
4847 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4848 2 : info->fieldType = GF_SG_VRML_SFNODE;
4849 2 : info->NDTtype = NDT_SFMetadataNode;
4850 2 : info->far_ptr = & ((X_GeoTouchSensor *)node)->metadata;
4851 2 : return GF_OK;
4852 : default:
4853 : return GF_BAD_PARAM;
4854 : }
4855 : }
4856 :
4857 :
4858 11 : static s32 GeoTouchSensor_get_field_index_by_name(char *name)
4859 : {
4860 11 : if (!strcmp("enabled", name)) return 0;
4861 10 : if (!strcmp("geoOrigin", name)) return 1;
4862 9 : if (!strcmp("geoSystem", name)) return 2;
4863 8 : if (!strcmp("hitNormal_changed", name)) return 3;
4864 7 : if (!strcmp("hitPoint_changed", name)) return 4;
4865 6 : if (!strcmp("hitTexCoord_changed", name)) return 5;
4866 5 : if (!strcmp("hitGeoCoord_changed", name)) return 6;
4867 4 : if (!strcmp("isActive", name)) return 7;
4868 3 : if (!strcmp("isOver", name)) return 8;
4869 2 : if (!strcmp("touchTime", name)) return 9;
4870 1 : if (!strcmp("metadata", name)) return 10;
4871 0 : return -1;
4872 : }
4873 :
4874 :
4875 1 : static GF_Node *GeoTouchSensor_Create()
4876 : {
4877 : X_GeoTouchSensor *p;
4878 1 : GF_SAFEALLOC(p, X_GeoTouchSensor);
4879 1 : if(!p) return NULL;
4880 1 : gf_node_setup((GF_Node *)p, TAG_X3D_GeoTouchSensor);
4881 :
4882 : /*default field values*/
4883 1 : p->enabled = 1;
4884 1 : p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
4885 1 : p->geoSystem.count = 2;
4886 1 : p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
4887 1 : strcpy(p->geoSystem.vals[0], "GD");
4888 1 : p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
4889 1 : strcpy(p->geoSystem.vals[1], "WE");
4890 1 : return (GF_Node *)p;
4891 : }
4892 :
4893 :
4894 : /*
4895 : GeoViewpoint Node deletion
4896 : */
4897 :
4898 1 : static void GeoViewpoint_Del(GF_Node *node)
4899 : {
4900 : X_GeoViewpoint *p = (X_GeoViewpoint *) node;
4901 1 : gf_sg_sfstring_del(p->set_orientation);
4902 1 : gf_sg_sfstring_del(p->set_position);
4903 1 : gf_sg_sfstring_del(p->description);
4904 1 : gf_sg_mfstring_del(p->navType);
4905 1 : gf_node_unregister((GF_Node *) p->geoOrigin, node);
4906 1 : gf_sg_mfstring_del(p->geoSystem);
4907 1 : gf_node_unregister((GF_Node *) p->metadata, node);
4908 1 : gf_node_free((GF_Node *)p);
4909 1 : }
4910 :
4911 :
4912 : static u32 GeoViewpoint_get_field_count(GF_Node *node, u8 dummy)
4913 : {
4914 : return 16;
4915 : }
4916 :
4917 32 : static GF_Err GeoViewpoint_get_field(GF_Node *node, GF_FieldInfo *info)
4918 : {
4919 32 : switch (info->fieldIndex) {
4920 2 : case 0:
4921 2 : info->name = "set_bind";
4922 2 : info->eventType = GF_SG_EVENT_IN;
4923 2 : info->on_event_in = ((X_GeoViewpoint *)node)->on_set_bind;
4924 2 : info->fieldType = GF_SG_VRML_SFBOOL;
4925 2 : info->far_ptr = & ((X_GeoViewpoint *) node)->set_bind;
4926 2 : return GF_OK;
4927 2 : case 1:
4928 2 : info->name = "set_orientation";
4929 2 : info->eventType = GF_SG_EVENT_IN;
4930 2 : info->on_event_in = ((X_GeoViewpoint *)node)->on_set_orientation;
4931 2 : info->fieldType = GF_SG_VRML_SFSTRING;
4932 2 : info->far_ptr = & ((X_GeoViewpoint *) node)->set_orientation;
4933 2 : return GF_OK;
4934 2 : case 2:
4935 2 : info->name = "set_position";
4936 2 : info->eventType = GF_SG_EVENT_IN;
4937 2 : info->on_event_in = ((X_GeoViewpoint *)node)->on_set_position;
4938 2 : info->fieldType = GF_SG_VRML_SFSTRING;
4939 2 : info->far_ptr = & ((X_GeoViewpoint *) node)->set_position;
4940 2 : return GF_OK;
4941 2 : case 3:
4942 2 : info->name = "description";
4943 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4944 2 : info->fieldType = GF_SG_VRML_SFSTRING;
4945 2 : info->far_ptr = & ((X_GeoViewpoint *) node)->description;
4946 2 : return GF_OK;
4947 2 : case 4:
4948 2 : info->name = "fieldOfView";
4949 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4950 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
4951 2 : info->far_ptr = & ((X_GeoViewpoint *) node)->fieldOfView;
4952 2 : return GF_OK;
4953 2 : case 5:
4954 2 : info->name = "headlight";
4955 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4956 2 : info->fieldType = GF_SG_VRML_SFBOOL;
4957 2 : info->far_ptr = & ((X_GeoViewpoint *) node)->headlight;
4958 2 : return GF_OK;
4959 2 : case 6:
4960 2 : info->name = "jump";
4961 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4962 2 : info->fieldType = GF_SG_VRML_SFBOOL;
4963 2 : info->far_ptr = & ((X_GeoViewpoint *) node)->jump;
4964 2 : return GF_OK;
4965 2 : case 7:
4966 2 : info->name = "navType";
4967 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4968 2 : info->fieldType = GF_SG_VRML_MFSTRING;
4969 2 : info->far_ptr = & ((X_GeoViewpoint *) node)->navType;
4970 2 : return GF_OK;
4971 2 : case 8:
4972 2 : info->name = "bindTime";
4973 2 : info->eventType = GF_SG_EVENT_OUT;
4974 2 : info->fieldType = GF_SG_VRML_SFTIME;
4975 2 : info->far_ptr = & ((X_GeoViewpoint *) node)->bindTime;
4976 2 : return GF_OK;
4977 2 : case 9:
4978 2 : info->name = "isBound";
4979 2 : info->eventType = GF_SG_EVENT_OUT;
4980 2 : info->fieldType = GF_SG_VRML_SFBOOL;
4981 2 : info->far_ptr = & ((X_GeoViewpoint *) node)->isBound;
4982 2 : return GF_OK;
4983 2 : case 10:
4984 2 : info->name = "geoOrigin";
4985 2 : info->eventType = GF_SG_EVENT_FIELD;
4986 2 : info->fieldType = GF_SG_VRML_SFNODE;
4987 2 : info->NDTtype = NDT_SFGeoOriginNode;
4988 2 : info->far_ptr = & ((X_GeoViewpoint *)node)->geoOrigin;
4989 2 : return GF_OK;
4990 2 : case 11:
4991 2 : info->name = "geoSystem";
4992 2 : info->eventType = GF_SG_EVENT_FIELD;
4993 2 : info->fieldType = GF_SG_VRML_MFSTRING;
4994 2 : info->far_ptr = & ((X_GeoViewpoint *) node)->geoSystem;
4995 2 : return GF_OK;
4996 2 : case 12:
4997 2 : info->name = "orientation";
4998 2 : info->eventType = GF_SG_EVENT_FIELD;
4999 2 : info->fieldType = GF_SG_VRML_SFROTATION;
5000 2 : info->far_ptr = & ((X_GeoViewpoint *) node)->orientation;
5001 2 : return GF_OK;
5002 2 : case 13:
5003 2 : info->name = "position";
5004 2 : info->eventType = GF_SG_EVENT_FIELD;
5005 2 : info->fieldType = GF_SG_VRML_SFVEC3D;
5006 2 : info->far_ptr = & ((X_GeoViewpoint *) node)->position;
5007 2 : return GF_OK;
5008 2 : case 14:
5009 2 : info->name = "speedFactor";
5010 2 : info->eventType = GF_SG_EVENT_FIELD;
5011 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
5012 2 : info->far_ptr = & ((X_GeoViewpoint *) node)->speedFactor;
5013 2 : return GF_OK;
5014 2 : case 15:
5015 2 : info->name = "metadata";
5016 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5017 2 : info->fieldType = GF_SG_VRML_SFNODE;
5018 2 : info->NDTtype = NDT_SFMetadataNode;
5019 2 : info->far_ptr = & ((X_GeoViewpoint *)node)->metadata;
5020 2 : return GF_OK;
5021 : default:
5022 : return GF_BAD_PARAM;
5023 : }
5024 : }
5025 :
5026 :
5027 16 : static s32 GeoViewpoint_get_field_index_by_name(char *name)
5028 : {
5029 16 : if (!strcmp("set_bind", name)) return 0;
5030 15 : if (!strcmp("set_orientation", name)) return 1;
5031 14 : if (!strcmp("set_position", name)) return 2;
5032 13 : if (!strcmp("description", name)) return 3;
5033 12 : if (!strcmp("fieldOfView", name)) return 4;
5034 11 : if (!strcmp("headlight", name)) return 5;
5035 10 : if (!strcmp("jump", name)) return 6;
5036 9 : if (!strcmp("navType", name)) return 7;
5037 8 : if (!strcmp("bindTime", name)) return 8;
5038 7 : if (!strcmp("isBound", name)) return 9;
5039 6 : if (!strcmp("geoOrigin", name)) return 10;
5040 5 : if (!strcmp("geoSystem", name)) return 11;
5041 4 : if (!strcmp("orientation", name)) return 12;
5042 3 : if (!strcmp("position", name)) return 13;
5043 2 : if (!strcmp("speedFactor", name)) return 14;
5044 1 : if (!strcmp("metadata", name)) return 15;
5045 0 : return -1;
5046 : }
5047 :
5048 :
5049 1 : static GF_Node *GeoViewpoint_Create()
5050 : {
5051 : X_GeoViewpoint *p;
5052 1 : GF_SAFEALLOC(p, X_GeoViewpoint);
5053 1 : if(!p) return NULL;
5054 1 : gf_node_setup((GF_Node *)p, TAG_X3D_GeoViewpoint);
5055 :
5056 : /*default field values*/
5057 1 : p->fieldOfView = FLT2FIX(0.785398);
5058 1 : p->headlight = 1;
5059 1 : p->jump = 1;
5060 1 : p->navType.vals = (char**)gf_malloc(sizeof(SFString)*2);
5061 1 : p->navType.count = 2;
5062 1 : p->navType.vals[0] = (char*)gf_malloc(sizeof(char) * 8);
5063 1 : strcpy(p->navType.vals[0], "EXAMINE");
5064 1 : p->navType.vals[1] = (char*)gf_malloc(sizeof(char) * 4);
5065 1 : strcpy(p->navType.vals[1], "ANY");
5066 1 : p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
5067 1 : p->geoSystem.count = 2;
5068 1 : p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
5069 1 : strcpy(p->geoSystem.vals[0], "GD");
5070 1 : p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
5071 1 : strcpy(p->geoSystem.vals[1], "WE");
5072 1 : p->orientation.x = FLT2FIX(0);
5073 1 : p->orientation.y = FLT2FIX(0);
5074 1 : p->orientation.z = FLT2FIX(1);
5075 1 : p->orientation.q = FLT2FIX(0);
5076 1 : p->position.x = (SFDouble) 0;
5077 1 : p->position.y = (SFDouble) 0;
5078 1 : p->position.z = (SFDouble) 100000;
5079 1 : p->speedFactor = FLT2FIX(1.0);
5080 1 : return (GF_Node *)p;
5081 : }
5082 :
5083 :
5084 : /*
5085 : Group Node deletion
5086 : */
5087 :
5088 49 : static void Group_Del(GF_Node *node)
5089 : {
5090 : X_Group *p = (X_Group *) node;
5091 49 : gf_node_unregister((GF_Node *) p->metadata, node);
5092 49 : gf_sg_vrml_parent_destroy(node);
5093 49 : gf_node_free((GF_Node *)p);
5094 49 : }
5095 :
5096 :
5097 : static u32 Group_get_field_count(GF_Node *node, u8 dummy)
5098 : {
5099 : return 4;
5100 : }
5101 :
5102 31 : static GF_Err Group_get_field(GF_Node *node, GF_FieldInfo *info)
5103 : {
5104 31 : switch (info->fieldIndex) {
5105 3 : case 0:
5106 3 : info->name = "addChildren";
5107 3 : info->eventType = GF_SG_EVENT_IN;
5108 3 : info->on_event_in = ((X_Group *)node)->on_addChildren;
5109 3 : info->fieldType = GF_SG_VRML_MFNODE;
5110 3 : info->NDTtype = NDT_SF3DNode;
5111 3 : info->far_ptr = & ((X_Group *)node)->addChildren;
5112 3 : return GF_OK;
5113 3 : case 1:
5114 3 : info->name = "removeChildren";
5115 3 : info->eventType = GF_SG_EVENT_IN;
5116 3 : info->on_event_in = ((X_Group *)node)->on_removeChildren;
5117 3 : info->fieldType = GF_SG_VRML_MFNODE;
5118 3 : info->NDTtype = NDT_SF3DNode;
5119 3 : info->far_ptr = & ((X_Group *)node)->removeChildren;
5120 3 : return GF_OK;
5121 23 : case 2:
5122 23 : info->name = "children";
5123 23 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5124 23 : info->fieldType = GF_SG_VRML_MFNODE;
5125 23 : info->NDTtype = NDT_SF3DNode;
5126 23 : info->far_ptr = & ((X_Group *)node)->children;
5127 23 : return GF_OK;
5128 2 : case 3:
5129 2 : info->name = "metadata";
5130 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5131 2 : info->fieldType = GF_SG_VRML_SFNODE;
5132 2 : info->NDTtype = NDT_SFMetadataNode;
5133 2 : info->far_ptr = & ((X_Group *)node)->metadata;
5134 2 : return GF_OK;
5135 : default:
5136 : return GF_BAD_PARAM;
5137 : }
5138 : }
5139 :
5140 :
5141 24 : static s32 Group_get_field_index_by_name(char *name)
5142 : {
5143 24 : if (!strcmp("addChildren", name)) return 0;
5144 23 : if (!strcmp("removeChildren", name)) return 1;
5145 22 : if (!strcmp("children", name)) return 2;
5146 1 : if (!strcmp("metadata", name)) return 3;
5147 0 : return -1;
5148 : }
5149 :
5150 :
5151 49 : static GF_Node *Group_Create()
5152 : {
5153 : X_Group *p;
5154 49 : GF_SAFEALLOC(p, X_Group);
5155 49 : if(!p) return NULL;
5156 49 : gf_node_setup((GF_Node *)p, TAG_X3D_Group);
5157 49 : gf_sg_vrml_parent_setup((GF_Node *) p);
5158 :
5159 : /*default field values*/
5160 49 : return (GF_Node *)p;
5161 : }
5162 :
5163 :
5164 : /*
5165 : HAnimDisplacer Node deletion
5166 : */
5167 :
5168 1 : static void HAnimDisplacer_Del(GF_Node *node)
5169 : {
5170 : X_HAnimDisplacer *p = (X_HAnimDisplacer *) node;
5171 1 : gf_sg_mfint32_del(p->coordIndex);
5172 1 : gf_sg_mfvec3f_del(p->displacements);
5173 1 : gf_sg_sfstring_del(p->name);
5174 1 : gf_node_unregister((GF_Node *) p->metadata, node);
5175 1 : gf_node_free((GF_Node *)p);
5176 1 : }
5177 :
5178 :
5179 : static u32 HAnimDisplacer_get_field_count(GF_Node *node, u8 dummy)
5180 : {
5181 : return 5;
5182 : }
5183 :
5184 10 : static GF_Err HAnimDisplacer_get_field(GF_Node *node, GF_FieldInfo *info)
5185 : {
5186 10 : switch (info->fieldIndex) {
5187 2 : case 0:
5188 2 : info->name = "coordIndex";
5189 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5190 2 : info->fieldType = GF_SG_VRML_MFINT32;
5191 2 : info->far_ptr = & ((X_HAnimDisplacer *) node)->coordIndex;
5192 2 : return GF_OK;
5193 2 : case 1:
5194 2 : info->name = "displacements";
5195 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5196 2 : info->fieldType = GF_SG_VRML_MFVEC3F;
5197 2 : info->far_ptr = & ((X_HAnimDisplacer *) node)->displacements;
5198 2 : return GF_OK;
5199 2 : case 2:
5200 2 : info->name = "name";
5201 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5202 2 : info->fieldType = GF_SG_VRML_SFSTRING;
5203 2 : info->far_ptr = & ((X_HAnimDisplacer *) node)->name;
5204 2 : return GF_OK;
5205 2 : case 3:
5206 2 : info->name = "weight";
5207 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5208 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
5209 2 : info->far_ptr = & ((X_HAnimDisplacer *) node)->weight;
5210 2 : return GF_OK;
5211 2 : case 4:
5212 2 : info->name = "metadata";
5213 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5214 2 : info->fieldType = GF_SG_VRML_SFNODE;
5215 2 : info->NDTtype = NDT_SFMetadataNode;
5216 2 : info->far_ptr = & ((X_HAnimDisplacer *)node)->metadata;
5217 2 : return GF_OK;
5218 : default:
5219 : return GF_BAD_PARAM;
5220 : }
5221 : }
5222 :
5223 :
5224 5 : static s32 HAnimDisplacer_get_field_index_by_name(char *name)
5225 : {
5226 5 : if (!strcmp("coordIndex", name)) return 0;
5227 4 : if (!strcmp("displacements", name)) return 1;
5228 3 : if (!strcmp("name", name)) return 2;
5229 2 : if (!strcmp("weight", name)) return 3;
5230 1 : if (!strcmp("metadata", name)) return 4;
5231 0 : return -1;
5232 : }
5233 :
5234 :
5235 1 : static GF_Node *HAnimDisplacer_Create()
5236 : {
5237 : X_HAnimDisplacer *p;
5238 1 : GF_SAFEALLOC(p, X_HAnimDisplacer);
5239 1 : if(!p) return NULL;
5240 1 : gf_node_setup((GF_Node *)p, TAG_X3D_HAnimDisplacer);
5241 :
5242 : /*default field values*/
5243 1 : p->weight = FLT2FIX(0.0);
5244 1 : return (GF_Node *)p;
5245 : }
5246 :
5247 :
5248 : /*
5249 : HAnimHumanoid Node deletion
5250 : */
5251 :
5252 1 : static void HAnimHumanoid_Del(GF_Node *node)
5253 : {
5254 : X_HAnimHumanoid *p = (X_HAnimHumanoid *) node;
5255 1 : gf_sg_mfstring_del(p->info);
5256 1 : gf_node_unregister_children(node, p->joints);
5257 1 : gf_sg_sfstring_del(p->name);
5258 1 : gf_node_unregister_children(node, p->segments);
5259 1 : gf_node_unregister_children(node, p->sites);
5260 1 : gf_node_unregister_children(node, p->skeleton);
5261 1 : gf_node_unregister_children(node, p->skin);
5262 1 : gf_node_unregister((GF_Node *) p->skinCoord, node);
5263 1 : gf_node_unregister((GF_Node *) p->skinNormal, node);
5264 1 : gf_sg_sfstring_del(p->version);
5265 1 : gf_node_unregister_children(node, p->viewpoints);
5266 1 : gf_node_unregister((GF_Node *) p->metadata, node);
5267 1 : gf_node_free((GF_Node *)p);
5268 1 : }
5269 :
5270 :
5271 : static u32 HAnimHumanoid_get_field_count(GF_Node *node, u8 dummy)
5272 : {
5273 : return 17;
5274 : }
5275 :
5276 34 : static GF_Err HAnimHumanoid_get_field(GF_Node *node, GF_FieldInfo *info)
5277 : {
5278 34 : switch (info->fieldIndex) {
5279 2 : case 0:
5280 2 : info->name = "center";
5281 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5282 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
5283 2 : info->far_ptr = & ((X_HAnimHumanoid *) node)->center;
5284 2 : return GF_OK;
5285 2 : case 1:
5286 2 : info->name = "info";
5287 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5288 2 : info->fieldType = GF_SG_VRML_MFSTRING;
5289 2 : info->far_ptr = & ((X_HAnimHumanoid *) node)->info;
5290 2 : return GF_OK;
5291 2 : case 2:
5292 2 : info->name = "joints";
5293 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5294 2 : info->fieldType = GF_SG_VRML_MFNODE;
5295 2 : info->NDTtype = NDT_SFHAnimNode;
5296 2 : info->far_ptr = & ((X_HAnimHumanoid *)node)->joints;
5297 2 : return GF_OK;
5298 2 : case 3:
5299 2 : info->name = "name";
5300 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5301 2 : info->fieldType = GF_SG_VRML_SFSTRING;
5302 2 : info->far_ptr = & ((X_HAnimHumanoid *) node)->name;
5303 2 : return GF_OK;
5304 2 : case 4:
5305 2 : info->name = "rotation";
5306 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5307 2 : info->fieldType = GF_SG_VRML_SFROTATION;
5308 2 : info->far_ptr = & ((X_HAnimHumanoid *) node)->rotation;
5309 2 : return GF_OK;
5310 2 : case 5:
5311 2 : info->name = "scale";
5312 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5313 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
5314 2 : info->far_ptr = & ((X_HAnimHumanoid *) node)->scale;
5315 2 : return GF_OK;
5316 2 : case 6:
5317 2 : info->name = "scaleOrientation";
5318 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5319 2 : info->fieldType = GF_SG_VRML_SFROTATION;
5320 2 : info->far_ptr = & ((X_HAnimHumanoid *) node)->scaleOrientation;
5321 2 : return GF_OK;
5322 2 : case 7:
5323 2 : info->name = "segments";
5324 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5325 2 : info->fieldType = GF_SG_VRML_MFNODE;
5326 2 : info->NDTtype = NDT_SFHAnimNode;
5327 2 : info->far_ptr = & ((X_HAnimHumanoid *)node)->segments;
5328 2 : return GF_OK;
5329 2 : case 8:
5330 2 : info->name = "sites";
5331 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5332 2 : info->fieldType = GF_SG_VRML_MFNODE;
5333 2 : info->NDTtype = NDT_SFHAnimNode;
5334 2 : info->far_ptr = & ((X_HAnimHumanoid *)node)->sites;
5335 2 : return GF_OK;
5336 2 : case 9:
5337 2 : info->name = "skeleton";
5338 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5339 2 : info->fieldType = GF_SG_VRML_MFNODE;
5340 2 : info->NDTtype = NDT_SFHAnimNode;
5341 2 : info->far_ptr = & ((X_HAnimHumanoid *)node)->skeleton;
5342 2 : return GF_OK;
5343 2 : case 10:
5344 2 : info->name = "skin";
5345 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5346 2 : info->fieldType = GF_SG_VRML_MFNODE;
5347 2 : info->NDTtype = NDT_SF3DNode;
5348 2 : info->far_ptr = & ((X_HAnimHumanoid *)node)->skin;
5349 2 : return GF_OK;
5350 2 : case 11:
5351 2 : info->name = "skinCoord";
5352 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5353 2 : info->fieldType = GF_SG_VRML_SFNODE;
5354 2 : info->NDTtype = NDT_SFCoordinateNode;
5355 2 : info->far_ptr = & ((X_HAnimHumanoid *)node)->skinCoord;
5356 2 : return GF_OK;
5357 2 : case 12:
5358 2 : info->name = "skinNormal";
5359 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5360 2 : info->fieldType = GF_SG_VRML_SFNODE;
5361 2 : info->NDTtype = NDT_SFNormalNode;
5362 2 : info->far_ptr = & ((X_HAnimHumanoid *)node)->skinNormal;
5363 2 : return GF_OK;
5364 2 : case 13:
5365 2 : info->name = "translation";
5366 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5367 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
5368 2 : info->far_ptr = & ((X_HAnimHumanoid *) node)->translation;
5369 2 : return GF_OK;
5370 2 : case 14:
5371 2 : info->name = "version";
5372 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5373 2 : info->fieldType = GF_SG_VRML_SFSTRING;
5374 2 : info->far_ptr = & ((X_HAnimHumanoid *) node)->version;
5375 2 : return GF_OK;
5376 2 : case 15:
5377 2 : info->name = "viewpoints";
5378 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5379 2 : info->fieldType = GF_SG_VRML_MFNODE;
5380 2 : info->NDTtype = NDT_SFViewpointNode;
5381 2 : info->far_ptr = & ((X_HAnimHumanoid *)node)->viewpoints;
5382 2 : return GF_OK;
5383 2 : case 16:
5384 2 : info->name = "metadata";
5385 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5386 2 : info->fieldType = GF_SG_VRML_SFNODE;
5387 2 : info->NDTtype = NDT_SFMetadataNode;
5388 2 : info->far_ptr = & ((X_HAnimHumanoid *)node)->metadata;
5389 2 : return GF_OK;
5390 : default:
5391 : return GF_BAD_PARAM;
5392 : }
5393 : }
5394 :
5395 :
5396 17 : static s32 HAnimHumanoid_get_field_index_by_name(char *name)
5397 : {
5398 17 : if (!strcmp("center", name)) return 0;
5399 16 : if (!strcmp("info", name)) return 1;
5400 15 : if (!strcmp("joints", name)) return 2;
5401 14 : if (!strcmp("name", name)) return 3;
5402 13 : if (!strcmp("rotation", name)) return 4;
5403 12 : if (!strcmp("scale", name)) return 5;
5404 11 : if (!strcmp("scaleOrientation", name)) return 6;
5405 10 : if (!strcmp("segments", name)) return 7;
5406 9 : if (!strcmp("sites", name)) return 8;
5407 8 : if (!strcmp("skeleton", name)) return 9;
5408 7 : if (!strcmp("skin", name)) return 10;
5409 6 : if (!strcmp("skinCoord", name)) return 11;
5410 5 : if (!strcmp("skinNormal", name)) return 12;
5411 4 : if (!strcmp("translation", name)) return 13;
5412 3 : if (!strcmp("version", name)) return 14;
5413 2 : if (!strcmp("viewpoints", name)) return 15;
5414 1 : if (!strcmp("metadata", name)) return 16;
5415 0 : return -1;
5416 : }
5417 :
5418 :
5419 1 : static GF_Node *HAnimHumanoid_Create()
5420 : {
5421 : X_HAnimHumanoid *p;
5422 1 : GF_SAFEALLOC(p, X_HAnimHumanoid);
5423 1 : if(!p) return NULL;
5424 1 : gf_node_setup((GF_Node *)p, TAG_X3D_HAnimHumanoid);
5425 :
5426 : /*default field values*/
5427 1 : p->center.x = FLT2FIX(0);
5428 1 : p->center.y = FLT2FIX(0);
5429 1 : p->center.z = FLT2FIX(0);
5430 1 : p->rotation.x = FLT2FIX(0);
5431 1 : p->rotation.y = FLT2FIX(0);
5432 1 : p->rotation.z = FLT2FIX(1);
5433 1 : p->rotation.q = FLT2FIX(0);
5434 1 : p->scale.x = FLT2FIX(1);
5435 1 : p->scale.y = FLT2FIX(1);
5436 1 : p->scale.z = FLT2FIX(1);
5437 1 : p->scaleOrientation.x = FLT2FIX(0);
5438 1 : p->scaleOrientation.y = FLT2FIX(0);
5439 1 : p->scaleOrientation.z = FLT2FIX(1);
5440 1 : p->scaleOrientation.q = FLT2FIX(0);
5441 1 : p->translation.x = FLT2FIX(0);
5442 1 : p->translation.y = FLT2FIX(0);
5443 1 : p->translation.z = FLT2FIX(0);
5444 1 : return (GF_Node *)p;
5445 : }
5446 :
5447 :
5448 : /*
5449 : HAnimJoint Node deletion
5450 : */
5451 :
5452 1 : static void HAnimJoint_Del(GF_Node *node)
5453 : {
5454 : X_HAnimJoint *p = (X_HAnimJoint *) node;
5455 1 : gf_node_unregister_children(node, p->displacers);
5456 1 : gf_sg_mffloat_del(p->llimit);
5457 1 : gf_sg_sfstring_del(p->name);
5458 1 : gf_sg_mfint32_del(p->skinCoordIndex);
5459 1 : gf_sg_mffloat_del(p->skinCoordWeight);
5460 1 : gf_sg_mffloat_del(p->stiffness);
5461 1 : gf_sg_mffloat_del(p->ulimit);
5462 1 : gf_node_unregister((GF_Node *) p->metadata, node);
5463 1 : gf_sg_vrml_parent_destroy(node);
5464 1 : gf_node_free((GF_Node *)p);
5465 1 : }
5466 :
5467 :
5468 : static u32 HAnimJoint_get_field_count(GF_Node *node, u8 dummy)
5469 : {
5470 : return 17;
5471 : }
5472 :
5473 34 : static GF_Err HAnimJoint_get_field(GF_Node *node, GF_FieldInfo *info)
5474 : {
5475 34 : switch (info->fieldIndex) {
5476 2 : case 0:
5477 2 : info->name = "addChildren";
5478 2 : info->eventType = GF_SG_EVENT_IN;
5479 2 : info->on_event_in = ((X_HAnimJoint *)node)->on_addChildren;
5480 2 : info->fieldType = GF_SG_VRML_MFNODE;
5481 2 : info->NDTtype = NDT_SFHAnimNode;
5482 2 : info->far_ptr = & ((X_HAnimJoint *)node)->addChildren;
5483 2 : return GF_OK;
5484 2 : case 1:
5485 2 : info->name = "removeChildren";
5486 2 : info->eventType = GF_SG_EVENT_IN;
5487 2 : info->on_event_in = ((X_HAnimJoint *)node)->on_removeChildren;
5488 2 : info->fieldType = GF_SG_VRML_MFNODE;
5489 2 : info->NDTtype = NDT_SFHAnimNode;
5490 2 : info->far_ptr = & ((X_HAnimJoint *)node)->removeChildren;
5491 2 : return GF_OK;
5492 2 : case 2:
5493 2 : info->name = "children";
5494 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5495 2 : info->fieldType = GF_SG_VRML_MFNODE;
5496 2 : info->NDTtype = NDT_SFHAnimNode;
5497 2 : info->far_ptr = & ((X_HAnimJoint *)node)->children;
5498 2 : return GF_OK;
5499 2 : case 3:
5500 2 : info->name = "center";
5501 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5502 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
5503 2 : info->far_ptr = & ((X_HAnimJoint *) node)->center;
5504 2 : return GF_OK;
5505 2 : case 4:
5506 2 : info->name = "displacers";
5507 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5508 2 : info->fieldType = GF_SG_VRML_MFNODE;
5509 2 : info->NDTtype = NDT_SFHAnimDisplacerNode;
5510 2 : info->far_ptr = & ((X_HAnimJoint *)node)->displacers;
5511 2 : return GF_OK;
5512 2 : case 5:
5513 2 : info->name = "limitOrientation";
5514 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5515 2 : info->fieldType = GF_SG_VRML_SFROTATION;
5516 2 : info->far_ptr = & ((X_HAnimJoint *) node)->limitOrientation;
5517 2 : return GF_OK;
5518 2 : case 6:
5519 2 : info->name = "llimit";
5520 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5521 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
5522 2 : info->far_ptr = & ((X_HAnimJoint *) node)->llimit;
5523 2 : return GF_OK;
5524 2 : case 7:
5525 2 : info->name = "name";
5526 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5527 2 : info->fieldType = GF_SG_VRML_SFSTRING;
5528 2 : info->far_ptr = & ((X_HAnimJoint *) node)->name;
5529 2 : return GF_OK;
5530 2 : case 8:
5531 2 : info->name = "rotation";
5532 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5533 2 : info->fieldType = GF_SG_VRML_SFROTATION;
5534 2 : info->far_ptr = & ((X_HAnimJoint *) node)->rotation;
5535 2 : return GF_OK;
5536 2 : case 9:
5537 2 : info->name = "scale";
5538 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5539 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
5540 2 : info->far_ptr = & ((X_HAnimJoint *) node)->scale;
5541 2 : return GF_OK;
5542 2 : case 10:
5543 2 : info->name = "scaleOrientation";
5544 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5545 2 : info->fieldType = GF_SG_VRML_SFROTATION;
5546 2 : info->far_ptr = & ((X_HAnimJoint *) node)->scaleOrientation;
5547 2 : return GF_OK;
5548 2 : case 11:
5549 2 : info->name = "skinCoordIndex";
5550 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5551 2 : info->fieldType = GF_SG_VRML_MFINT32;
5552 2 : info->far_ptr = & ((X_HAnimJoint *) node)->skinCoordIndex;
5553 2 : return GF_OK;
5554 2 : case 12:
5555 2 : info->name = "skinCoordWeight";
5556 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5557 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
5558 2 : info->far_ptr = & ((X_HAnimJoint *) node)->skinCoordWeight;
5559 2 : return GF_OK;
5560 2 : case 13:
5561 2 : info->name = "stiffness";
5562 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5563 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
5564 2 : info->far_ptr = & ((X_HAnimJoint *) node)->stiffness;
5565 2 : return GF_OK;
5566 2 : case 14:
5567 2 : info->name = "translation";
5568 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5569 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
5570 2 : info->far_ptr = & ((X_HAnimJoint *) node)->translation;
5571 2 : return GF_OK;
5572 2 : case 15:
5573 2 : info->name = "ulimit";
5574 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5575 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
5576 2 : info->far_ptr = & ((X_HAnimJoint *) node)->ulimit;
5577 2 : return GF_OK;
5578 2 : case 16:
5579 2 : info->name = "metadata";
5580 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5581 2 : info->fieldType = GF_SG_VRML_SFNODE;
5582 2 : info->NDTtype = NDT_SFMetadataNode;
5583 2 : info->far_ptr = & ((X_HAnimJoint *)node)->metadata;
5584 2 : return GF_OK;
5585 : default:
5586 : return GF_BAD_PARAM;
5587 : }
5588 : }
5589 :
5590 :
5591 17 : static s32 HAnimJoint_get_field_index_by_name(char *name)
5592 : {
5593 17 : if (!strcmp("addChildren", name)) return 0;
5594 16 : if (!strcmp("removeChildren", name)) return 1;
5595 15 : if (!strcmp("children", name)) return 2;
5596 14 : if (!strcmp("center", name)) return 3;
5597 13 : if (!strcmp("displacers", name)) return 4;
5598 12 : if (!strcmp("limitOrientation", name)) return 5;
5599 11 : if (!strcmp("llimit", name)) return 6;
5600 10 : if (!strcmp("name", name)) return 7;
5601 9 : if (!strcmp("rotation", name)) return 8;
5602 8 : if (!strcmp("scale", name)) return 9;
5603 7 : if (!strcmp("scaleOrientation", name)) return 10;
5604 6 : if (!strcmp("skinCoordIndex", name)) return 11;
5605 5 : if (!strcmp("skinCoordWeight", name)) return 12;
5606 4 : if (!strcmp("stiffness", name)) return 13;
5607 3 : if (!strcmp("translation", name)) return 14;
5608 2 : if (!strcmp("ulimit", name)) return 15;
5609 1 : if (!strcmp("metadata", name)) return 16;
5610 0 : return -1;
5611 : }
5612 :
5613 :
5614 1 : static GF_Node *HAnimJoint_Create()
5615 : {
5616 : X_HAnimJoint *p;
5617 1 : GF_SAFEALLOC(p, X_HAnimJoint);
5618 1 : if(!p) return NULL;
5619 1 : gf_node_setup((GF_Node *)p, TAG_X3D_HAnimJoint);
5620 1 : gf_sg_vrml_parent_setup((GF_Node *) p);
5621 :
5622 : /*default field values*/
5623 1 : p->center.x = FLT2FIX(0);
5624 1 : p->center.y = FLT2FIX(0);
5625 1 : p->center.z = FLT2FIX(0);
5626 1 : p->limitOrientation.x = FLT2FIX(0);
5627 1 : p->limitOrientation.y = FLT2FIX(0);
5628 1 : p->limitOrientation.z = FLT2FIX(1);
5629 1 : p->limitOrientation.q = FLT2FIX(0);
5630 1 : p->rotation.x = FLT2FIX(0);
5631 1 : p->rotation.y = FLT2FIX(0);
5632 1 : p->rotation.z = FLT2FIX(1);
5633 1 : p->rotation.q = FLT2FIX(0);
5634 1 : p->scale.x = FLT2FIX(1);
5635 1 : p->scale.y = FLT2FIX(1);
5636 1 : p->scale.z = FLT2FIX(1);
5637 1 : p->scaleOrientation.x = FLT2FIX(0);
5638 1 : p->scaleOrientation.y = FLT2FIX(0);
5639 1 : p->scaleOrientation.z = FLT2FIX(1);
5640 1 : p->scaleOrientation.q = FLT2FIX(0);
5641 1 : p->stiffness.vals = (SFFloat *)gf_malloc(sizeof(SFFloat)*3);
5642 1 : p->stiffness.count = 3;
5643 1 : p->stiffness.vals[0] = FLT2FIX(0);
5644 1 : p->stiffness.vals[1] = FLT2FIX(0);
5645 1 : p->stiffness.vals[2] = FLT2FIX(0);
5646 1 : p->translation.x = FLT2FIX(0);
5647 1 : p->translation.y = FLT2FIX(0);
5648 1 : p->translation.z = FLT2FIX(0);
5649 1 : return (GF_Node *)p;
5650 : }
5651 :
5652 :
5653 : /*
5654 : HAnimSegment Node deletion
5655 : */
5656 :
5657 1 : static void HAnimSegment_Del(GF_Node *node)
5658 : {
5659 : X_HAnimSegment *p = (X_HAnimSegment *) node;
5660 1 : gf_node_unregister((GF_Node *) p->coord, node);
5661 1 : gf_node_unregister_children(node, p->displacers);
5662 1 : gf_sg_mffloat_del(p->momentsOfInertia);
5663 1 : gf_sg_sfstring_del(p->name);
5664 1 : gf_node_unregister((GF_Node *) p->metadata, node);
5665 1 : gf_sg_vrml_parent_destroy(node);
5666 1 : gf_node_free((GF_Node *)p);
5667 1 : }
5668 :
5669 :
5670 : static u32 HAnimSegment_get_field_count(GF_Node *node, u8 dummy)
5671 : {
5672 : return 10;
5673 : }
5674 :
5675 20 : static GF_Err HAnimSegment_get_field(GF_Node *node, GF_FieldInfo *info)
5676 : {
5677 20 : switch (info->fieldIndex) {
5678 2 : case 0:
5679 2 : info->name = "addChildren";
5680 2 : info->eventType = GF_SG_EVENT_IN;
5681 2 : info->on_event_in = ((X_HAnimSegment *)node)->on_addChildren;
5682 2 : info->fieldType = GF_SG_VRML_MFNODE;
5683 2 : info->NDTtype = NDT_SF3DNode;
5684 2 : info->far_ptr = & ((X_HAnimSegment *)node)->addChildren;
5685 2 : return GF_OK;
5686 2 : case 1:
5687 2 : info->name = "removeChildren";
5688 2 : info->eventType = GF_SG_EVENT_IN;
5689 2 : info->on_event_in = ((X_HAnimSegment *)node)->on_removeChildren;
5690 2 : info->fieldType = GF_SG_VRML_MFNODE;
5691 2 : info->NDTtype = NDT_SF3DNode;
5692 2 : info->far_ptr = & ((X_HAnimSegment *)node)->removeChildren;
5693 2 : return GF_OK;
5694 2 : case 2:
5695 2 : info->name = "children";
5696 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5697 2 : info->fieldType = GF_SG_VRML_MFNODE;
5698 2 : info->NDTtype = NDT_SF3DNode;
5699 2 : info->far_ptr = & ((X_HAnimSegment *)node)->children;
5700 2 : return GF_OK;
5701 2 : case 3:
5702 2 : info->name = "centerOfMass";
5703 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5704 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
5705 2 : info->far_ptr = & ((X_HAnimSegment *) node)->centerOfMass;
5706 2 : return GF_OK;
5707 2 : case 4:
5708 2 : info->name = "coord";
5709 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5710 2 : info->fieldType = GF_SG_VRML_SFNODE;
5711 2 : info->NDTtype = NDT_SFCoordinateNode;
5712 2 : info->far_ptr = & ((X_HAnimSegment *)node)->coord;
5713 2 : return GF_OK;
5714 2 : case 5:
5715 2 : info->name = "displacers";
5716 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5717 2 : info->fieldType = GF_SG_VRML_MFNODE;
5718 2 : info->NDTtype = NDT_SFHAnimDisplacerNode;
5719 2 : info->far_ptr = & ((X_HAnimSegment *)node)->displacers;
5720 2 : return GF_OK;
5721 2 : case 6:
5722 2 : info->name = "mass";
5723 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5724 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
5725 2 : info->far_ptr = & ((X_HAnimSegment *) node)->mass;
5726 2 : return GF_OK;
5727 2 : case 7:
5728 2 : info->name = "momentsOfInertia";
5729 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5730 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
5731 2 : info->far_ptr = & ((X_HAnimSegment *) node)->momentsOfInertia;
5732 2 : return GF_OK;
5733 2 : case 8:
5734 2 : info->name = "name";
5735 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5736 2 : info->fieldType = GF_SG_VRML_SFSTRING;
5737 2 : info->far_ptr = & ((X_HAnimSegment *) node)->name;
5738 2 : return GF_OK;
5739 2 : case 9:
5740 2 : info->name = "metadata";
5741 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5742 2 : info->fieldType = GF_SG_VRML_SFNODE;
5743 2 : info->NDTtype = NDT_SFMetadataNode;
5744 2 : info->far_ptr = & ((X_HAnimSegment *)node)->metadata;
5745 2 : return GF_OK;
5746 : default:
5747 : return GF_BAD_PARAM;
5748 : }
5749 : }
5750 :
5751 :
5752 10 : static s32 HAnimSegment_get_field_index_by_name(char *name)
5753 : {
5754 10 : if (!strcmp("addChildren", name)) return 0;
5755 9 : if (!strcmp("removeChildren", name)) return 1;
5756 8 : if (!strcmp("children", name)) return 2;
5757 7 : if (!strcmp("centerOfMass", name)) return 3;
5758 6 : if (!strcmp("coord", name)) return 4;
5759 5 : if (!strcmp("displacers", name)) return 5;
5760 4 : if (!strcmp("mass", name)) return 6;
5761 3 : if (!strcmp("momentsOfInertia", name)) return 7;
5762 2 : if (!strcmp("name", name)) return 8;
5763 1 : if (!strcmp("metadata", name)) return 9;
5764 0 : return -1;
5765 : }
5766 :
5767 :
5768 1 : static GF_Node *HAnimSegment_Create()
5769 : {
5770 : X_HAnimSegment *p;
5771 1 : GF_SAFEALLOC(p, X_HAnimSegment);
5772 1 : if(!p) return NULL;
5773 1 : gf_node_setup((GF_Node *)p, TAG_X3D_HAnimSegment);
5774 1 : gf_sg_vrml_parent_setup((GF_Node *) p);
5775 :
5776 : /*default field values*/
5777 1 : p->centerOfMass.x = FLT2FIX(0);
5778 1 : p->centerOfMass.y = FLT2FIX(0);
5779 1 : p->centerOfMass.z = FLT2FIX(0);
5780 1 : p->mass = FLT2FIX(0);
5781 1 : p->momentsOfInertia.vals = (SFFloat *)gf_malloc(sizeof(SFFloat)*9);
5782 1 : p->momentsOfInertia.count = 9;
5783 1 : p->momentsOfInertia.vals[0] = FLT2FIX(0);
5784 1 : p->momentsOfInertia.vals[1] = FLT2FIX(0);
5785 1 : p->momentsOfInertia.vals[2] = FLT2FIX(0);
5786 1 : p->momentsOfInertia.vals[3] = FLT2FIX(0);
5787 1 : p->momentsOfInertia.vals[4] = FLT2FIX(0);
5788 1 : p->momentsOfInertia.vals[5] = FLT2FIX(0);
5789 1 : p->momentsOfInertia.vals[6] = FLT2FIX(0);
5790 1 : p->momentsOfInertia.vals[7] = FLT2FIX(0);
5791 1 : p->momentsOfInertia.vals[8] = FLT2FIX(0);
5792 1 : return (GF_Node *)p;
5793 : }
5794 :
5795 :
5796 : /*
5797 : HAnimSite Node deletion
5798 : */
5799 :
5800 1 : static void HAnimSite_Del(GF_Node *node)
5801 : {
5802 : X_HAnimSite *p = (X_HAnimSite *) node;
5803 1 : gf_sg_sfstring_del(p->name);
5804 1 : gf_node_unregister((GF_Node *) p->metadata, node);
5805 1 : gf_sg_vrml_parent_destroy(node);
5806 1 : gf_node_free((GF_Node *)p);
5807 1 : }
5808 :
5809 :
5810 : static u32 HAnimSite_get_field_count(GF_Node *node, u8 dummy)
5811 : {
5812 : return 10;
5813 : }
5814 :
5815 20 : static GF_Err HAnimSite_get_field(GF_Node *node, GF_FieldInfo *info)
5816 : {
5817 20 : switch (info->fieldIndex) {
5818 2 : case 0:
5819 2 : info->name = "addChildren";
5820 2 : info->eventType = GF_SG_EVENT_IN;
5821 2 : info->on_event_in = ((X_HAnimSite *)node)->on_addChildren;
5822 2 : info->fieldType = GF_SG_VRML_MFNODE;
5823 2 : info->NDTtype = NDT_SF3DNode;
5824 2 : info->far_ptr = & ((X_HAnimSite *)node)->addChildren;
5825 2 : return GF_OK;
5826 2 : case 1:
5827 2 : info->name = "removeChildren";
5828 2 : info->eventType = GF_SG_EVENT_IN;
5829 2 : info->on_event_in = ((X_HAnimSite *)node)->on_removeChildren;
5830 2 : info->fieldType = GF_SG_VRML_MFNODE;
5831 2 : info->NDTtype = NDT_SF3DNode;
5832 2 : info->far_ptr = & ((X_HAnimSite *)node)->removeChildren;
5833 2 : return GF_OK;
5834 2 : case 2:
5835 2 : info->name = "children";
5836 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5837 2 : info->fieldType = GF_SG_VRML_MFNODE;
5838 2 : info->NDTtype = NDT_SF3DNode;
5839 2 : info->far_ptr = & ((X_HAnimSite *)node)->children;
5840 2 : return GF_OK;
5841 2 : case 3:
5842 2 : info->name = "center";
5843 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5844 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
5845 2 : info->far_ptr = & ((X_HAnimSite *) node)->center;
5846 2 : return GF_OK;
5847 2 : case 4:
5848 2 : info->name = "name";
5849 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5850 2 : info->fieldType = GF_SG_VRML_SFSTRING;
5851 2 : info->far_ptr = & ((X_HAnimSite *) node)->name;
5852 2 : return GF_OK;
5853 2 : case 5:
5854 2 : info->name = "rotation";
5855 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5856 2 : info->fieldType = GF_SG_VRML_SFROTATION;
5857 2 : info->far_ptr = & ((X_HAnimSite *) node)->rotation;
5858 2 : return GF_OK;
5859 2 : case 6:
5860 2 : info->name = "scale";
5861 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5862 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
5863 2 : info->far_ptr = & ((X_HAnimSite *) node)->scale;
5864 2 : return GF_OK;
5865 2 : case 7:
5866 2 : info->name = "scaleOrientation";
5867 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5868 2 : info->fieldType = GF_SG_VRML_SFROTATION;
5869 2 : info->far_ptr = & ((X_HAnimSite *) node)->scaleOrientation;
5870 2 : return GF_OK;
5871 2 : case 8:
5872 2 : info->name = "translation";
5873 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5874 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
5875 2 : info->far_ptr = & ((X_HAnimSite *) node)->translation;
5876 2 : return GF_OK;
5877 2 : case 9:
5878 2 : info->name = "metadata";
5879 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5880 2 : info->fieldType = GF_SG_VRML_SFNODE;
5881 2 : info->NDTtype = NDT_SFMetadataNode;
5882 2 : info->far_ptr = & ((X_HAnimSite *)node)->metadata;
5883 2 : return GF_OK;
5884 : default:
5885 : return GF_BAD_PARAM;
5886 : }
5887 : }
5888 :
5889 :
5890 10 : static s32 HAnimSite_get_field_index_by_name(char *name)
5891 : {
5892 10 : if (!strcmp("addChildren", name)) return 0;
5893 9 : if (!strcmp("removeChildren", name)) return 1;
5894 8 : if (!strcmp("children", name)) return 2;
5895 7 : if (!strcmp("center", name)) return 3;
5896 6 : if (!strcmp("name", name)) return 4;
5897 5 : if (!strcmp("rotation", name)) return 5;
5898 4 : if (!strcmp("scale", name)) return 6;
5899 3 : if (!strcmp("scaleOrientation", name)) return 7;
5900 2 : if (!strcmp("translation", name)) return 8;
5901 1 : if (!strcmp("metadata", name)) return 9;
5902 0 : return -1;
5903 : }
5904 :
5905 :
5906 1 : static GF_Node *HAnimSite_Create()
5907 : {
5908 : X_HAnimSite *p;
5909 1 : GF_SAFEALLOC(p, X_HAnimSite);
5910 1 : if(!p) return NULL;
5911 1 : gf_node_setup((GF_Node *)p, TAG_X3D_HAnimSite);
5912 1 : gf_sg_vrml_parent_setup((GF_Node *) p);
5913 :
5914 : /*default field values*/
5915 1 : p->center.x = FLT2FIX(0);
5916 1 : p->center.y = FLT2FIX(0);
5917 1 : p->center.z = FLT2FIX(0);
5918 1 : p->rotation.x = FLT2FIX(0);
5919 1 : p->rotation.y = FLT2FIX(0);
5920 1 : p->rotation.z = FLT2FIX(1);
5921 1 : p->rotation.q = FLT2FIX(0);
5922 1 : p->scale.x = FLT2FIX(1);
5923 1 : p->scale.y = FLT2FIX(1);
5924 1 : p->scale.z = FLT2FIX(1);
5925 1 : p->scaleOrientation.x = FLT2FIX(0);
5926 1 : p->scaleOrientation.y = FLT2FIX(0);
5927 1 : p->scaleOrientation.z = FLT2FIX(1);
5928 1 : p->scaleOrientation.q = FLT2FIX(0);
5929 1 : p->translation.x = FLT2FIX(0);
5930 1 : p->translation.y = FLT2FIX(0);
5931 1 : p->translation.z = FLT2FIX(0);
5932 1 : return (GF_Node *)p;
5933 : }
5934 :
5935 :
5936 : /*
5937 : ImageTexture Node deletion
5938 : */
5939 :
5940 1 : static void ImageTexture_Del(GF_Node *node)
5941 : {
5942 : X_ImageTexture *p = (X_ImageTexture *) node;
5943 1 : gf_sg_mfurl_del(p->url);
5944 1 : gf_node_unregister((GF_Node *) p->metadata, node);
5945 1 : gf_node_free((GF_Node *)p);
5946 1 : }
5947 :
5948 :
5949 : static u32 ImageTexture_get_field_count(GF_Node *node, u8 dummy)
5950 : {
5951 : return 4;
5952 : }
5953 :
5954 8 : static GF_Err ImageTexture_get_field(GF_Node *node, GF_FieldInfo *info)
5955 : {
5956 8 : switch (info->fieldIndex) {
5957 2 : case 0:
5958 2 : info->name = "url";
5959 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5960 2 : info->fieldType = GF_SG_VRML_MFURL;
5961 2 : info->far_ptr = & ((X_ImageTexture *) node)->url;
5962 2 : return GF_OK;
5963 2 : case 1:
5964 2 : info->name = "repeatS";
5965 2 : info->eventType = GF_SG_EVENT_FIELD;
5966 2 : info->fieldType = GF_SG_VRML_SFBOOL;
5967 2 : info->far_ptr = & ((X_ImageTexture *) node)->repeatS;
5968 2 : return GF_OK;
5969 2 : case 2:
5970 2 : info->name = "repeatT";
5971 2 : info->eventType = GF_SG_EVENT_FIELD;
5972 2 : info->fieldType = GF_SG_VRML_SFBOOL;
5973 2 : info->far_ptr = & ((X_ImageTexture *) node)->repeatT;
5974 2 : return GF_OK;
5975 2 : case 3:
5976 2 : info->name = "metadata";
5977 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5978 2 : info->fieldType = GF_SG_VRML_SFNODE;
5979 2 : info->NDTtype = NDT_SFMetadataNode;
5980 2 : info->far_ptr = & ((X_ImageTexture *)node)->metadata;
5981 2 : return GF_OK;
5982 : default:
5983 : return GF_BAD_PARAM;
5984 : }
5985 : }
5986 :
5987 :
5988 4 : static s32 ImageTexture_get_field_index_by_name(char *name)
5989 : {
5990 4 : if (!strcmp("url", name)) return 0;
5991 3 : if (!strcmp("repeatS", name)) return 1;
5992 2 : if (!strcmp("repeatT", name)) return 2;
5993 1 : if (!strcmp("metadata", name)) return 3;
5994 0 : return -1;
5995 : }
5996 :
5997 :
5998 1 : static GF_Node *ImageTexture_Create()
5999 : {
6000 : X_ImageTexture *p;
6001 1 : GF_SAFEALLOC(p, X_ImageTexture);
6002 1 : if(!p) return NULL;
6003 1 : gf_node_setup((GF_Node *)p, TAG_X3D_ImageTexture);
6004 :
6005 : /*default field values*/
6006 1 : p->repeatS = 1;
6007 1 : p->repeatT = 1;
6008 1 : return (GF_Node *)p;
6009 : }
6010 :
6011 :
6012 : /*
6013 : IndexedFaceSet Node deletion
6014 : */
6015 :
6016 13 : static void IndexedFaceSet_Del(GF_Node *node)
6017 : {
6018 : X_IndexedFaceSet *p = (X_IndexedFaceSet *) node;
6019 13 : gf_sg_mfint32_del(p->set_colorIndex);
6020 13 : gf_sg_mfint32_del(p->set_coordIndex);
6021 13 : gf_sg_mfint32_del(p->set_normalIndex);
6022 13 : gf_sg_mfint32_del(p->set_texCoordIndex);
6023 13 : gf_node_unregister((GF_Node *) p->color, node);
6024 13 : gf_node_unregister((GF_Node *) p->coord, node);
6025 13 : gf_node_unregister((GF_Node *) p->normal, node);
6026 13 : gf_node_unregister((GF_Node *) p->texCoord, node);
6027 13 : gf_sg_mfint32_del(p->colorIndex);
6028 13 : gf_sg_mfint32_del(p->coordIndex);
6029 13 : gf_sg_mfint32_del(p->normalIndex);
6030 13 : gf_sg_mfint32_del(p->texCoordIndex);
6031 13 : gf_node_unregister((GF_Node *) p->metadata, node);
6032 13 : gf_node_free((GF_Node *)p);
6033 13 : }
6034 :
6035 :
6036 : static u32 IndexedFaceSet_get_field_count(GF_Node *node, u8 dummy)
6037 : {
6038 : return 19;
6039 : }
6040 :
6041 96 : static GF_Err IndexedFaceSet_get_field(GF_Node *node, GF_FieldInfo *info)
6042 : {
6043 96 : switch (info->fieldIndex) {
6044 2 : case 0:
6045 2 : info->name = "set_colorIndex";
6046 2 : info->eventType = GF_SG_EVENT_IN;
6047 2 : info->on_event_in = ((X_IndexedFaceSet *)node)->on_set_colorIndex;
6048 2 : info->fieldType = GF_SG_VRML_MFINT32;
6049 2 : info->far_ptr = & ((X_IndexedFaceSet *) node)->set_colorIndex;
6050 2 : return GF_OK;
6051 2 : case 1:
6052 2 : info->name = "set_coordIndex";
6053 2 : info->eventType = GF_SG_EVENT_IN;
6054 2 : info->on_event_in = ((X_IndexedFaceSet *)node)->on_set_coordIndex;
6055 2 : info->fieldType = GF_SG_VRML_MFINT32;
6056 2 : info->far_ptr = & ((X_IndexedFaceSet *) node)->set_coordIndex;
6057 2 : return GF_OK;
6058 2 : case 2:
6059 2 : info->name = "set_normalIndex";
6060 2 : info->eventType = GF_SG_EVENT_IN;
6061 2 : info->on_event_in = ((X_IndexedFaceSet *)node)->on_set_normalIndex;
6062 2 : info->fieldType = GF_SG_VRML_MFINT32;
6063 2 : info->far_ptr = & ((X_IndexedFaceSet *) node)->set_normalIndex;
6064 2 : return GF_OK;
6065 2 : case 3:
6066 2 : info->name = "set_texCoordIndex";
6067 2 : info->eventType = GF_SG_EVENT_IN;
6068 2 : info->on_event_in = ((X_IndexedFaceSet *)node)->on_set_texCoordIndex;
6069 2 : info->fieldType = GF_SG_VRML_MFINT32;
6070 2 : info->far_ptr = & ((X_IndexedFaceSet *) node)->set_texCoordIndex;
6071 2 : return GF_OK;
6072 4 : case 4:
6073 4 : info->name = "color";
6074 4 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6075 4 : info->fieldType = GF_SG_VRML_SFNODE;
6076 4 : info->NDTtype = NDT_SFColorNode;
6077 4 : info->far_ptr = & ((X_IndexedFaceSet *)node)->color;
6078 4 : return GF_OK;
6079 14 : case 5:
6080 14 : info->name = "coord";
6081 14 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6082 14 : info->fieldType = GF_SG_VRML_SFNODE;
6083 14 : info->NDTtype = NDT_SFCoordinateNode;
6084 14 : info->far_ptr = & ((X_IndexedFaceSet *)node)->coord;
6085 14 : return GF_OK;
6086 2 : case 6:
6087 2 : info->name = "normal";
6088 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6089 2 : info->fieldType = GF_SG_VRML_SFNODE;
6090 2 : info->NDTtype = NDT_SFNormalNode;
6091 2 : info->far_ptr = & ((X_IndexedFaceSet *)node)->normal;
6092 2 : return GF_OK;
6093 2 : case 7:
6094 2 : info->name = "texCoord";
6095 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6096 2 : info->fieldType = GF_SG_VRML_SFNODE;
6097 2 : info->NDTtype = NDT_SFTextureCoordinateNode;
6098 2 : info->far_ptr = & ((X_IndexedFaceSet *)node)->texCoord;
6099 2 : return GF_OK;
6100 12 : case 8:
6101 12 : info->name = "ccw";
6102 12 : info->eventType = GF_SG_EVENT_FIELD;
6103 12 : info->fieldType = GF_SG_VRML_SFBOOL;
6104 12 : info->far_ptr = & ((X_IndexedFaceSet *) node)->ccw;
6105 12 : return GF_OK;
6106 3 : case 9:
6107 3 : info->name = "colorIndex";
6108 3 : info->eventType = GF_SG_EVENT_FIELD;
6109 3 : info->fieldType = GF_SG_VRML_MFINT32;
6110 3 : info->far_ptr = & ((X_IndexedFaceSet *) node)->colorIndex;
6111 3 : return GF_OK;
6112 3 : case 10:
6113 3 : info->name = "colorPerVertex";
6114 3 : info->eventType = GF_SG_EVENT_FIELD;
6115 3 : info->fieldType = GF_SG_VRML_SFBOOL;
6116 3 : info->far_ptr = & ((X_IndexedFaceSet *) node)->colorPerVertex;
6117 3 : return GF_OK;
6118 2 : case 11:
6119 2 : info->name = "convex";
6120 2 : info->eventType = GF_SG_EVENT_FIELD;
6121 2 : info->fieldType = GF_SG_VRML_SFBOOL;
6122 2 : info->far_ptr = & ((X_IndexedFaceSet *) node)->convex;
6123 2 : return GF_OK;
6124 14 : case 12:
6125 14 : info->name = "coordIndex";
6126 14 : info->eventType = GF_SG_EVENT_FIELD;
6127 14 : info->fieldType = GF_SG_VRML_MFINT32;
6128 14 : info->far_ptr = & ((X_IndexedFaceSet *) node)->coordIndex;
6129 14 : return GF_OK;
6130 12 : case 13:
6131 12 : info->name = "creaseAngle";
6132 12 : info->eventType = GF_SG_EVENT_FIELD;
6133 12 : info->fieldType = GF_SG_VRML_SFFLOAT;
6134 12 : info->far_ptr = & ((X_IndexedFaceSet *) node)->creaseAngle;
6135 12 : return GF_OK;
6136 2 : case 14:
6137 2 : info->name = "normalIndex";
6138 2 : info->eventType = GF_SG_EVENT_FIELD;
6139 2 : info->fieldType = GF_SG_VRML_MFINT32;
6140 2 : info->far_ptr = & ((X_IndexedFaceSet *) node)->normalIndex;
6141 2 : return GF_OK;
6142 2 : case 15:
6143 2 : info->name = "normalPerVertex";
6144 2 : info->eventType = GF_SG_EVENT_FIELD;
6145 2 : info->fieldType = GF_SG_VRML_SFBOOL;
6146 2 : info->far_ptr = & ((X_IndexedFaceSet *) node)->normalPerVertex;
6147 2 : return GF_OK;
6148 12 : case 16:
6149 12 : info->name = "solid";
6150 12 : info->eventType = GF_SG_EVENT_FIELD;
6151 12 : info->fieldType = GF_SG_VRML_SFBOOL;
6152 12 : info->far_ptr = & ((X_IndexedFaceSet *) node)->solid;
6153 12 : return GF_OK;
6154 2 : case 17:
6155 2 : info->name = "texCoordIndex";
6156 2 : info->eventType = GF_SG_EVENT_FIELD;
6157 2 : info->fieldType = GF_SG_VRML_MFINT32;
6158 2 : info->far_ptr = & ((X_IndexedFaceSet *) node)->texCoordIndex;
6159 2 : return GF_OK;
6160 2 : case 18:
6161 2 : info->name = "metadata";
6162 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6163 2 : info->fieldType = GF_SG_VRML_SFNODE;
6164 2 : info->NDTtype = NDT_SFMetadataNode;
6165 2 : info->far_ptr = & ((X_IndexedFaceSet *)node)->metadata;
6166 2 : return GF_OK;
6167 : default:
6168 : return GF_BAD_PARAM;
6169 : }
6170 : }
6171 :
6172 :
6173 77 : static s32 IndexedFaceSet_get_field_index_by_name(char *name)
6174 : {
6175 77 : if (!strcmp("set_colorIndex", name)) return 0;
6176 76 : if (!strcmp("set_coordIndex", name)) return 1;
6177 75 : if (!strcmp("set_normalIndex", name)) return 2;
6178 74 : if (!strcmp("set_texCoordIndex", name)) return 3;
6179 73 : if (!strcmp("color", name)) return 4;
6180 70 : if (!strcmp("coord", name)) return 5;
6181 57 : if (!strcmp("normal", name)) return 6;
6182 56 : if (!strcmp("texCoord", name)) return 7;
6183 55 : if (!strcmp("ccw", name)) return 8;
6184 44 : if (!strcmp("colorIndex", name)) return 9;
6185 42 : if (!strcmp("colorPerVertex", name)) return 10;
6186 40 : if (!strcmp("convex", name)) return 11;
6187 39 : if (!strcmp("coordIndex", name)) return 12;
6188 26 : if (!strcmp("creaseAngle", name)) return 13;
6189 15 : if (!strcmp("normalIndex", name)) return 14;
6190 14 : if (!strcmp("normalPerVertex", name)) return 15;
6191 13 : if (!strcmp("solid", name)) return 16;
6192 2 : if (!strcmp("texCoordIndex", name)) return 17;
6193 1 : if (!strcmp("metadata", name)) return 18;
6194 0 : return -1;
6195 : }
6196 :
6197 :
6198 13 : static GF_Node *IndexedFaceSet_Create()
6199 : {
6200 : X_IndexedFaceSet *p;
6201 13 : GF_SAFEALLOC(p, X_IndexedFaceSet);
6202 13 : if(!p) return NULL;
6203 13 : gf_node_setup((GF_Node *)p, TAG_X3D_IndexedFaceSet);
6204 :
6205 : /*default field values*/
6206 13 : p->ccw = 1;
6207 13 : p->colorPerVertex = 1;
6208 13 : p->convex = 1;
6209 13 : p->creaseAngle = FLT2FIX(0.0);
6210 13 : p->normalPerVertex = 1;
6211 13 : p->solid = 1;
6212 13 : return (GF_Node *)p;
6213 : }
6214 :
6215 :
6216 : /*
6217 : IndexedLineSet Node deletion
6218 : */
6219 :
6220 1 : static void IndexedLineSet_Del(GF_Node *node)
6221 : {
6222 : X_IndexedLineSet *p = (X_IndexedLineSet *) node;
6223 1 : gf_sg_mfint32_del(p->set_colorIndex);
6224 1 : gf_sg_mfint32_del(p->set_coordIndex);
6225 1 : gf_node_unregister((GF_Node *) p->color, node);
6226 1 : gf_node_unregister((GF_Node *) p->coord, node);
6227 1 : gf_sg_mfint32_del(p->colorIndex);
6228 1 : gf_sg_mfint32_del(p->coordIndex);
6229 1 : gf_node_unregister((GF_Node *) p->metadata, node);
6230 1 : gf_node_free((GF_Node *)p);
6231 1 : }
6232 :
6233 :
6234 : static u32 IndexedLineSet_get_field_count(GF_Node *node, u8 dummy)
6235 : {
6236 : return 8;
6237 : }
6238 :
6239 16 : static GF_Err IndexedLineSet_get_field(GF_Node *node, GF_FieldInfo *info)
6240 : {
6241 16 : switch (info->fieldIndex) {
6242 2 : case 0:
6243 2 : info->name = "set_colorIndex";
6244 2 : info->eventType = GF_SG_EVENT_IN;
6245 2 : info->on_event_in = ((X_IndexedLineSet *)node)->on_set_colorIndex;
6246 2 : info->fieldType = GF_SG_VRML_MFINT32;
6247 2 : info->far_ptr = & ((X_IndexedLineSet *) node)->set_colorIndex;
6248 2 : return GF_OK;
6249 2 : case 1:
6250 2 : info->name = "set_coordIndex";
6251 2 : info->eventType = GF_SG_EVENT_IN;
6252 2 : info->on_event_in = ((X_IndexedLineSet *)node)->on_set_coordIndex;
6253 2 : info->fieldType = GF_SG_VRML_MFINT32;
6254 2 : info->far_ptr = & ((X_IndexedLineSet *) node)->set_coordIndex;
6255 2 : return GF_OK;
6256 2 : case 2:
6257 2 : info->name = "color";
6258 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6259 2 : info->fieldType = GF_SG_VRML_SFNODE;
6260 2 : info->NDTtype = NDT_SFColorNode;
6261 2 : info->far_ptr = & ((X_IndexedLineSet *)node)->color;
6262 2 : return GF_OK;
6263 2 : case 3:
6264 2 : info->name = "coord";
6265 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6266 2 : info->fieldType = GF_SG_VRML_SFNODE;
6267 2 : info->NDTtype = NDT_SFCoordinateNode;
6268 2 : info->far_ptr = & ((X_IndexedLineSet *)node)->coord;
6269 2 : return GF_OK;
6270 2 : case 4:
6271 2 : info->name = "colorIndex";
6272 2 : info->eventType = GF_SG_EVENT_FIELD;
6273 2 : info->fieldType = GF_SG_VRML_MFINT32;
6274 2 : info->far_ptr = & ((X_IndexedLineSet *) node)->colorIndex;
6275 2 : return GF_OK;
6276 2 : case 5:
6277 2 : info->name = "colorPerVertex";
6278 2 : info->eventType = GF_SG_EVENT_FIELD;
6279 2 : info->fieldType = GF_SG_VRML_SFBOOL;
6280 2 : info->far_ptr = & ((X_IndexedLineSet *) node)->colorPerVertex;
6281 2 : return GF_OK;
6282 2 : case 6:
6283 2 : info->name = "coordIndex";
6284 2 : info->eventType = GF_SG_EVENT_FIELD;
6285 2 : info->fieldType = GF_SG_VRML_MFINT32;
6286 2 : info->far_ptr = & ((X_IndexedLineSet *) node)->coordIndex;
6287 2 : return GF_OK;
6288 2 : case 7:
6289 2 : info->name = "metadata";
6290 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6291 2 : info->fieldType = GF_SG_VRML_SFNODE;
6292 2 : info->NDTtype = NDT_SFMetadataNode;
6293 2 : info->far_ptr = & ((X_IndexedLineSet *)node)->metadata;
6294 2 : return GF_OK;
6295 : default:
6296 : return GF_BAD_PARAM;
6297 : }
6298 : }
6299 :
6300 :
6301 8 : static s32 IndexedLineSet_get_field_index_by_name(char *name)
6302 : {
6303 8 : if (!strcmp("set_colorIndex", name)) return 0;
6304 7 : if (!strcmp("set_coordIndex", name)) return 1;
6305 6 : if (!strcmp("color", name)) return 2;
6306 5 : if (!strcmp("coord", name)) return 3;
6307 4 : if (!strcmp("colorIndex", name)) return 4;
6308 3 : if (!strcmp("colorPerVertex", name)) return 5;
6309 2 : if (!strcmp("coordIndex", name)) return 6;
6310 1 : if (!strcmp("metadata", name)) return 7;
6311 0 : return -1;
6312 : }
6313 :
6314 :
6315 1 : static GF_Node *IndexedLineSet_Create()
6316 : {
6317 : X_IndexedLineSet *p;
6318 1 : GF_SAFEALLOC(p, X_IndexedLineSet);
6319 1 : if(!p) return NULL;
6320 1 : gf_node_setup((GF_Node *)p, TAG_X3D_IndexedLineSet);
6321 :
6322 : /*default field values*/
6323 1 : p->colorPerVertex = 1;
6324 1 : return (GF_Node *)p;
6325 : }
6326 :
6327 :
6328 : /*
6329 : IndexedTriangleFanSet Node deletion
6330 : */
6331 :
6332 2 : static void IndexedTriangleFanSet_Del(GF_Node *node)
6333 : {
6334 : X_IndexedTriangleFanSet *p = (X_IndexedTriangleFanSet *) node;
6335 2 : gf_sg_mfint32_del(p->set_index);
6336 2 : gf_node_unregister((GF_Node *) p->color, node);
6337 2 : gf_node_unregister((GF_Node *) p->coord, node);
6338 2 : gf_node_unregister((GF_Node *) p->normal, node);
6339 2 : gf_node_unregister((GF_Node *) p->texCoord, node);
6340 2 : gf_sg_mfint32_del(p->index);
6341 2 : gf_node_unregister((GF_Node *) p->metadata, node);
6342 2 : gf_node_free((GF_Node *)p);
6343 2 : }
6344 :
6345 :
6346 : static u32 IndexedTriangleFanSet_get_field_count(GF_Node *node, u8 dummy)
6347 : {
6348 : return 11;
6349 : }
6350 :
6351 27 : static GF_Err IndexedTriangleFanSet_get_field(GF_Node *node, GF_FieldInfo *info)
6352 : {
6353 27 : switch (info->fieldIndex) {
6354 2 : case 0:
6355 2 : info->name = "set_index";
6356 2 : info->eventType = GF_SG_EVENT_IN;
6357 2 : info->on_event_in = ((X_IndexedTriangleFanSet *)node)->on_set_index;
6358 2 : info->fieldType = GF_SG_VRML_MFINT32;
6359 2 : info->far_ptr = & ((X_IndexedTriangleFanSet *) node)->set_index;
6360 2 : return GF_OK;
6361 3 : case 1:
6362 3 : info->name = "color";
6363 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6364 3 : info->fieldType = GF_SG_VRML_SFNODE;
6365 3 : info->NDTtype = NDT_SFColorNode;
6366 3 : info->far_ptr = & ((X_IndexedTriangleFanSet *)node)->color;
6367 3 : return GF_OK;
6368 3 : case 2:
6369 3 : info->name = "coord";
6370 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6371 3 : info->fieldType = GF_SG_VRML_SFNODE;
6372 3 : info->NDTtype = NDT_SFCoordinateNode;
6373 3 : info->far_ptr = & ((X_IndexedTriangleFanSet *)node)->coord;
6374 3 : return GF_OK;
6375 2 : case 3:
6376 2 : info->name = "normal";
6377 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6378 2 : info->fieldType = GF_SG_VRML_SFNODE;
6379 2 : info->NDTtype = NDT_SFNormalNode;
6380 2 : info->far_ptr = & ((X_IndexedTriangleFanSet *)node)->normal;
6381 2 : return GF_OK;
6382 2 : case 4:
6383 2 : info->name = "texCoord";
6384 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6385 2 : info->fieldType = GF_SG_VRML_SFNODE;
6386 2 : info->NDTtype = NDT_SFTextureCoordinateNode;
6387 2 : info->far_ptr = & ((X_IndexedTriangleFanSet *)node)->texCoord;
6388 2 : return GF_OK;
6389 3 : case 5:
6390 3 : info->name = "ccw";
6391 3 : info->eventType = GF_SG_EVENT_FIELD;
6392 3 : info->fieldType = GF_SG_VRML_SFBOOL;
6393 3 : info->far_ptr = & ((X_IndexedTriangleFanSet *) node)->ccw;
6394 3 : return GF_OK;
6395 2 : case 6:
6396 2 : info->name = "colorPerVertex";
6397 2 : info->eventType = GF_SG_EVENT_FIELD;
6398 2 : info->fieldType = GF_SG_VRML_SFBOOL;
6399 2 : info->far_ptr = & ((X_IndexedTriangleFanSet *) node)->colorPerVertex;
6400 2 : return GF_OK;
6401 2 : case 7:
6402 2 : info->name = "normalPerVertex";
6403 2 : info->eventType = GF_SG_EVENT_FIELD;
6404 2 : info->fieldType = GF_SG_VRML_SFBOOL;
6405 2 : info->far_ptr = & ((X_IndexedTriangleFanSet *) node)->normalPerVertex;
6406 2 : return GF_OK;
6407 3 : case 8:
6408 3 : info->name = "solid";
6409 3 : info->eventType = GF_SG_EVENT_FIELD;
6410 3 : info->fieldType = GF_SG_VRML_SFBOOL;
6411 3 : info->far_ptr = & ((X_IndexedTriangleFanSet *) node)->solid;
6412 3 : return GF_OK;
6413 3 : case 9:
6414 3 : info->name = "index";
6415 3 : info->eventType = GF_SG_EVENT_FIELD;
6416 3 : info->fieldType = GF_SG_VRML_MFINT32;
6417 3 : info->far_ptr = & ((X_IndexedTriangleFanSet *) node)->index;
6418 3 : return GF_OK;
6419 2 : case 10:
6420 2 : info->name = "metadata";
6421 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6422 2 : info->fieldType = GF_SG_VRML_SFNODE;
6423 2 : info->NDTtype = NDT_SFMetadataNode;
6424 2 : info->far_ptr = & ((X_IndexedTriangleFanSet *)node)->metadata;
6425 2 : return GF_OK;
6426 : default:
6427 : return GF_BAD_PARAM;
6428 : }
6429 : }
6430 :
6431 :
6432 16 : static s32 IndexedTriangleFanSet_get_field_index_by_name(char *name)
6433 : {
6434 16 : if (!strcmp("set_index", name)) return 0;
6435 15 : if (!strcmp("color", name)) return 1;
6436 13 : if (!strcmp("coord", name)) return 2;
6437 11 : if (!strcmp("normal", name)) return 3;
6438 10 : if (!strcmp("texCoord", name)) return 4;
6439 9 : if (!strcmp("ccw", name)) return 5;
6440 7 : if (!strcmp("colorPerVertex", name)) return 6;
6441 6 : if (!strcmp("normalPerVertex", name)) return 7;
6442 5 : if (!strcmp("solid", name)) return 8;
6443 3 : if (!strcmp("index", name)) return 9;
6444 1 : if (!strcmp("metadata", name)) return 10;
6445 0 : return -1;
6446 : }
6447 :
6448 :
6449 2 : static GF_Node *IndexedTriangleFanSet_Create()
6450 : {
6451 : X_IndexedTriangleFanSet *p;
6452 2 : GF_SAFEALLOC(p, X_IndexedTriangleFanSet);
6453 2 : if(!p) return NULL;
6454 2 : gf_node_setup((GF_Node *)p, TAG_X3D_IndexedTriangleFanSet);
6455 :
6456 : /*default field values*/
6457 2 : p->ccw = 1;
6458 2 : p->colorPerVertex = 1;
6459 2 : p->normalPerVertex = 1;
6460 2 : p->solid = 1;
6461 2 : return (GF_Node *)p;
6462 : }
6463 :
6464 :
6465 : /*
6466 : IndexedTriangleSet Node deletion
6467 : */
6468 :
6469 2 : static void IndexedTriangleSet_Del(GF_Node *node)
6470 : {
6471 : X_IndexedTriangleSet *p = (X_IndexedTriangleSet *) node;
6472 2 : gf_sg_mfint32_del(p->set_index);
6473 2 : gf_node_unregister((GF_Node *) p->color, node);
6474 2 : gf_node_unregister((GF_Node *) p->coord, node);
6475 2 : gf_node_unregister((GF_Node *) p->normal, node);
6476 2 : gf_node_unregister((GF_Node *) p->texCoord, node);
6477 2 : gf_sg_mfint32_del(p->index);
6478 2 : gf_node_unregister((GF_Node *) p->metadata, node);
6479 2 : gf_node_free((GF_Node *)p);
6480 2 : }
6481 :
6482 :
6483 : static u32 IndexedTriangleSet_get_field_count(GF_Node *node, u8 dummy)
6484 : {
6485 : return 11;
6486 : }
6487 :
6488 26 : static GF_Err IndexedTriangleSet_get_field(GF_Node *node, GF_FieldInfo *info)
6489 : {
6490 26 : switch (info->fieldIndex) {
6491 2 : case 0:
6492 2 : info->name = "set_index";
6493 2 : info->eventType = GF_SG_EVENT_IN;
6494 2 : info->on_event_in = ((X_IndexedTriangleSet *)node)->on_set_index;
6495 2 : info->fieldType = GF_SG_VRML_MFINT32;
6496 2 : info->far_ptr = & ((X_IndexedTriangleSet *) node)->set_index;
6497 2 : return GF_OK;
6498 3 : case 1:
6499 3 : info->name = "color";
6500 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6501 3 : info->fieldType = GF_SG_VRML_SFNODE;
6502 3 : info->NDTtype = NDT_SFColorNode;
6503 3 : info->far_ptr = & ((X_IndexedTriangleSet *)node)->color;
6504 3 : return GF_OK;
6505 3 : case 2:
6506 3 : info->name = "coord";
6507 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6508 3 : info->fieldType = GF_SG_VRML_SFNODE;
6509 3 : info->NDTtype = NDT_SFCoordinateNode;
6510 3 : info->far_ptr = & ((X_IndexedTriangleSet *)node)->coord;
6511 3 : return GF_OK;
6512 2 : case 3:
6513 2 : info->name = "normal";
6514 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6515 2 : info->fieldType = GF_SG_VRML_SFNODE;
6516 2 : info->NDTtype = NDT_SFNormalNode;
6517 2 : info->far_ptr = & ((X_IndexedTriangleSet *)node)->normal;
6518 2 : return GF_OK;
6519 2 : case 4:
6520 2 : info->name = "texCoord";
6521 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6522 2 : info->fieldType = GF_SG_VRML_SFNODE;
6523 2 : info->NDTtype = NDT_SFTextureCoordinateNode;
6524 2 : info->far_ptr = & ((X_IndexedTriangleSet *)node)->texCoord;
6525 2 : return GF_OK;
6526 2 : case 5:
6527 2 : info->name = "ccw";
6528 2 : info->eventType = GF_SG_EVENT_FIELD;
6529 2 : info->fieldType = GF_SG_VRML_SFBOOL;
6530 2 : info->far_ptr = & ((X_IndexedTriangleSet *) node)->ccw;
6531 2 : return GF_OK;
6532 2 : case 6:
6533 2 : info->name = "colorPerVertex";
6534 2 : info->eventType = GF_SG_EVENT_FIELD;
6535 2 : info->fieldType = GF_SG_VRML_SFBOOL;
6536 2 : info->far_ptr = & ((X_IndexedTriangleSet *) node)->colorPerVertex;
6537 2 : return GF_OK;
6538 2 : case 7:
6539 2 : info->name = "normalPerVertex";
6540 2 : info->eventType = GF_SG_EVENT_FIELD;
6541 2 : info->fieldType = GF_SG_VRML_SFBOOL;
6542 2 : info->far_ptr = & ((X_IndexedTriangleSet *) node)->normalPerVertex;
6543 2 : return GF_OK;
6544 3 : case 8:
6545 3 : info->name = "solid";
6546 3 : info->eventType = GF_SG_EVENT_FIELD;
6547 3 : info->fieldType = GF_SG_VRML_SFBOOL;
6548 3 : info->far_ptr = & ((X_IndexedTriangleSet *) node)->solid;
6549 3 : return GF_OK;
6550 3 : case 9:
6551 3 : info->name = "index";
6552 3 : info->eventType = GF_SG_EVENT_FIELD;
6553 3 : info->fieldType = GF_SG_VRML_MFINT32;
6554 3 : info->far_ptr = & ((X_IndexedTriangleSet *) node)->index;
6555 3 : return GF_OK;
6556 2 : case 10:
6557 2 : info->name = "metadata";
6558 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6559 2 : info->fieldType = GF_SG_VRML_SFNODE;
6560 2 : info->NDTtype = NDT_SFMetadataNode;
6561 2 : info->far_ptr = & ((X_IndexedTriangleSet *)node)->metadata;
6562 2 : return GF_OK;
6563 : default:
6564 : return GF_BAD_PARAM;
6565 : }
6566 : }
6567 :
6568 :
6569 15 : static s32 IndexedTriangleSet_get_field_index_by_name(char *name)
6570 : {
6571 15 : if (!strcmp("set_index", name)) return 0;
6572 14 : if (!strcmp("color", name)) return 1;
6573 12 : if (!strcmp("coord", name)) return 2;
6574 10 : if (!strcmp("normal", name)) return 3;
6575 9 : if (!strcmp("texCoord", name)) return 4;
6576 8 : if (!strcmp("ccw", name)) return 5;
6577 7 : if (!strcmp("colorPerVertex", name)) return 6;
6578 6 : if (!strcmp("normalPerVertex", name)) return 7;
6579 5 : if (!strcmp("solid", name)) return 8;
6580 3 : if (!strcmp("index", name)) return 9;
6581 1 : if (!strcmp("metadata", name)) return 10;
6582 0 : return -1;
6583 : }
6584 :
6585 :
6586 2 : static GF_Node *IndexedTriangleSet_Create()
6587 : {
6588 : X_IndexedTriangleSet *p;
6589 2 : GF_SAFEALLOC(p, X_IndexedTriangleSet);
6590 2 : if(!p) return NULL;
6591 2 : gf_node_setup((GF_Node *)p, TAG_X3D_IndexedTriangleSet);
6592 :
6593 : /*default field values*/
6594 2 : p->ccw = 1;
6595 2 : p->colorPerVertex = 1;
6596 2 : p->normalPerVertex = 1;
6597 2 : p->solid = 1;
6598 2 : return (GF_Node *)p;
6599 : }
6600 :
6601 :
6602 : /*
6603 : IndexedTriangleStripSet Node deletion
6604 : */
6605 :
6606 2 : static void IndexedTriangleStripSet_Del(GF_Node *node)
6607 : {
6608 : X_IndexedTriangleStripSet *p = (X_IndexedTriangleStripSet *) node;
6609 2 : gf_sg_mfint32_del(p->set_index);
6610 2 : gf_node_unregister((GF_Node *) p->color, node);
6611 2 : gf_node_unregister((GF_Node *) p->coord, node);
6612 2 : gf_node_unregister((GF_Node *) p->normal, node);
6613 2 : gf_node_unregister((GF_Node *) p->texCoord, node);
6614 2 : gf_sg_mfint32_del(p->index);
6615 2 : gf_node_unregister((GF_Node *) p->metadata, node);
6616 2 : gf_node_free((GF_Node *)p);
6617 2 : }
6618 :
6619 :
6620 : static u32 IndexedTriangleStripSet_get_field_count(GF_Node *node, u8 dummy)
6621 : {
6622 : return 11;
6623 : }
6624 :
6625 28 : static GF_Err IndexedTriangleStripSet_get_field(GF_Node *node, GF_FieldInfo *info)
6626 : {
6627 28 : switch (info->fieldIndex) {
6628 2 : case 0:
6629 2 : info->name = "set_index";
6630 2 : info->eventType = GF_SG_EVENT_IN;
6631 2 : info->on_event_in = ((X_IndexedTriangleStripSet *)node)->on_set_index;
6632 2 : info->fieldType = GF_SG_VRML_MFINT32;
6633 2 : info->far_ptr = & ((X_IndexedTriangleStripSet *) node)->set_index;
6634 2 : return GF_OK;
6635 3 : case 1:
6636 3 : info->name = "color";
6637 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6638 3 : info->fieldType = GF_SG_VRML_SFNODE;
6639 3 : info->NDTtype = NDT_SFColorNode;
6640 3 : info->far_ptr = & ((X_IndexedTriangleStripSet *)node)->color;
6641 3 : return GF_OK;
6642 3 : case 2:
6643 3 : info->name = "coord";
6644 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6645 3 : info->fieldType = GF_SG_VRML_SFNODE;
6646 3 : info->NDTtype = NDT_SFCoordinateNode;
6647 3 : info->far_ptr = & ((X_IndexedTriangleStripSet *)node)->coord;
6648 3 : return GF_OK;
6649 2 : case 3:
6650 2 : info->name = "creaseAngle";
6651 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6652 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
6653 2 : info->far_ptr = & ((X_IndexedTriangleStripSet *) node)->creaseAngle;
6654 2 : return GF_OK;
6655 2 : case 4:
6656 2 : info->name = "normal";
6657 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6658 2 : info->fieldType = GF_SG_VRML_SFNODE;
6659 2 : info->NDTtype = NDT_SFNormalNode;
6660 2 : info->far_ptr = & ((X_IndexedTriangleStripSet *)node)->normal;
6661 2 : return GF_OK;
6662 3 : case 5:
6663 3 : info->name = "texCoord";
6664 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6665 3 : info->fieldType = GF_SG_VRML_SFNODE;
6666 3 : info->NDTtype = NDT_SFTextureCoordinateNode;
6667 3 : info->far_ptr = & ((X_IndexedTriangleStripSet *)node)->texCoord;
6668 3 : return GF_OK;
6669 3 : case 6:
6670 3 : info->name = "ccw";
6671 3 : info->eventType = GF_SG_EVENT_FIELD;
6672 3 : info->fieldType = GF_SG_VRML_SFBOOL;
6673 3 : info->far_ptr = & ((X_IndexedTriangleStripSet *) node)->ccw;
6674 3 : return GF_OK;
6675 2 : case 7:
6676 2 : info->name = "normalPerVertex";
6677 2 : info->eventType = GF_SG_EVENT_FIELD;
6678 2 : info->fieldType = GF_SG_VRML_SFBOOL;
6679 2 : info->far_ptr = & ((X_IndexedTriangleStripSet *) node)->normalPerVertex;
6680 2 : return GF_OK;
6681 3 : case 8:
6682 3 : info->name = "solid";
6683 3 : info->eventType = GF_SG_EVENT_FIELD;
6684 3 : info->fieldType = GF_SG_VRML_SFBOOL;
6685 3 : info->far_ptr = & ((X_IndexedTriangleStripSet *) node)->solid;
6686 3 : return GF_OK;
6687 3 : case 9:
6688 3 : info->name = "index";
6689 3 : info->eventType = GF_SG_EVENT_FIELD;
6690 3 : info->fieldType = GF_SG_VRML_MFINT32;
6691 3 : info->far_ptr = & ((X_IndexedTriangleStripSet *) node)->index;
6692 3 : return GF_OK;
6693 2 : case 10:
6694 2 : info->name = "metadata";
6695 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6696 2 : info->fieldType = GF_SG_VRML_SFNODE;
6697 2 : info->NDTtype = NDT_SFMetadataNode;
6698 2 : info->far_ptr = & ((X_IndexedTriangleStripSet *)node)->metadata;
6699 2 : return GF_OK;
6700 : default:
6701 : return GF_BAD_PARAM;
6702 : }
6703 : }
6704 :
6705 :
6706 17 : static s32 IndexedTriangleStripSet_get_field_index_by_name(char *name)
6707 : {
6708 17 : if (!strcmp("set_index", name)) return 0;
6709 16 : if (!strcmp("color", name)) return 1;
6710 14 : if (!strcmp("coord", name)) return 2;
6711 12 : if (!strcmp("creaseAngle", name)) return 3;
6712 11 : if (!strcmp("normal", name)) return 4;
6713 10 : if (!strcmp("texCoord", name)) return 5;
6714 8 : if (!strcmp("ccw", name)) return 6;
6715 6 : if (!strcmp("normalPerVertex", name)) return 7;
6716 5 : if (!strcmp("solid", name)) return 8;
6717 3 : if (!strcmp("index", name)) return 9;
6718 1 : if (!strcmp("metadata", name)) return 10;
6719 0 : return -1;
6720 : }
6721 :
6722 :
6723 2 : static GF_Node *IndexedTriangleStripSet_Create()
6724 : {
6725 : X_IndexedTriangleStripSet *p;
6726 2 : GF_SAFEALLOC(p, X_IndexedTriangleStripSet);
6727 2 : if(!p) return NULL;
6728 2 : gf_node_setup((GF_Node *)p, TAG_X3D_IndexedTriangleStripSet);
6729 :
6730 : /*default field values*/
6731 2 : p->creaseAngle = FLT2FIX(0);
6732 2 : p->ccw = 1;
6733 2 : p->normalPerVertex = 1;
6734 2 : p->solid = 1;
6735 2 : return (GF_Node *)p;
6736 : }
6737 :
6738 :
6739 : /*
6740 : Inline Node deletion
6741 : */
6742 :
6743 1 : static void Inline_Del(GF_Node *node)
6744 : {
6745 : X_Inline *p = (X_Inline *) node;
6746 1 : gf_sg_mfurl_del(p->url);
6747 1 : gf_node_unregister((GF_Node *) p->metadata, node);
6748 1 : gf_node_free((GF_Node *)p);
6749 1 : }
6750 :
6751 :
6752 : static u32 Inline_get_field_count(GF_Node *node, u8 dummy)
6753 : {
6754 : return 3;
6755 : }
6756 :
6757 : static GF_Err Inline_get_field(GF_Node *node, GF_FieldInfo *info)
6758 : {
6759 6 : switch (info->fieldIndex) {
6760 2 : case 0:
6761 2 : info->name = "url";
6762 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6763 2 : info->fieldType = GF_SG_VRML_MFURL;
6764 2 : info->far_ptr = & ((X_Inline *) node)->url;
6765 : return GF_OK;
6766 2 : case 1:
6767 2 : info->name = "metadata";
6768 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6769 2 : info->fieldType = GF_SG_VRML_SFNODE;
6770 2 : info->NDTtype = NDT_SFMetadataNode;
6771 2 : info->far_ptr = & ((X_Inline *)node)->metadata;
6772 : return GF_OK;
6773 2 : case 2:
6774 2 : info->name = "load";
6775 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6776 2 : info->fieldType = GF_SG_VRML_SFBOOL;
6777 2 : info->far_ptr = & ((X_Inline *) node)->load;
6778 : return GF_OK;
6779 : default:
6780 : return GF_BAD_PARAM;
6781 : }
6782 : }
6783 :
6784 :
6785 3 : static s32 Inline_get_field_index_by_name(char *name)
6786 : {
6787 3 : if (!strcmp("url", name)) return 0;
6788 2 : if (!strcmp("metadata", name)) return 1;
6789 1 : if (!strcmp("load", name)) return 2;
6790 0 : return -1;
6791 : }
6792 :
6793 :
6794 1 : static GF_Node *Inline_Create()
6795 : {
6796 : X_Inline *p;
6797 1 : GF_SAFEALLOC(p, X_Inline);
6798 1 : if(!p) return NULL;
6799 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Inline);
6800 :
6801 : /*default field values*/
6802 1 : p->load = 1;
6803 1 : return (GF_Node *)p;
6804 : }
6805 :
6806 :
6807 : /*
6808 : IntegerSequencer Node deletion
6809 : */
6810 :
6811 2 : static void IntegerSequencer_Del(GF_Node *node)
6812 : {
6813 : X_IntegerSequencer *p = (X_IntegerSequencer *) node;
6814 2 : gf_sg_mffloat_del(p->key);
6815 2 : gf_sg_mfint32_del(p->keyValue);
6816 2 : gf_node_unregister((GF_Node *) p->metadata, node);
6817 2 : gf_node_free((GF_Node *)p);
6818 2 : }
6819 :
6820 :
6821 : static u32 IntegerSequencer_get_field_count(GF_Node *node, u8 dummy)
6822 : {
6823 : return 7;
6824 : }
6825 :
6826 19 : static GF_Err IntegerSequencer_get_field(GF_Node *node, GF_FieldInfo *info)
6827 : {
6828 19 : switch (info->fieldIndex) {
6829 3 : case 0:
6830 3 : info->name = "next";
6831 3 : info->eventType = GF_SG_EVENT_IN;
6832 3 : info->on_event_in = ((X_IntegerSequencer *)node)->on_next;
6833 3 : info->fieldType = GF_SG_VRML_SFBOOL;
6834 3 : info->far_ptr = & ((X_IntegerSequencer *) node)->next;
6835 3 : return GF_OK;
6836 3 : case 1:
6837 3 : info->name = "previous";
6838 3 : info->eventType = GF_SG_EVENT_IN;
6839 3 : info->on_event_in = ((X_IntegerSequencer *)node)->on_previous;
6840 3 : info->fieldType = GF_SG_VRML_SFBOOL;
6841 3 : info->far_ptr = & ((X_IntegerSequencer *) node)->previous;
6842 3 : return GF_OK;
6843 3 : case 2:
6844 3 : info->name = "set_fraction";
6845 3 : info->eventType = GF_SG_EVENT_IN;
6846 3 : info->on_event_in = ((X_IntegerSequencer *)node)->on_set_fraction;
6847 3 : info->fieldType = GF_SG_VRML_SFFLOAT;
6848 3 : info->far_ptr = & ((X_IntegerSequencer *) node)->set_fraction;
6849 3 : return GF_OK;
6850 3 : case 3:
6851 3 : info->name = "key";
6852 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6853 3 : info->fieldType = GF_SG_VRML_MFFLOAT;
6854 3 : info->far_ptr = & ((X_IntegerSequencer *) node)->key;
6855 3 : return GF_OK;
6856 3 : case 4:
6857 3 : info->name = "keyValue";
6858 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6859 3 : info->fieldType = GF_SG_VRML_MFINT32;
6860 3 : info->far_ptr = & ((X_IntegerSequencer *) node)->keyValue;
6861 3 : return GF_OK;
6862 2 : case 5:
6863 2 : info->name = "value_changed";
6864 2 : info->eventType = GF_SG_EVENT_OUT;
6865 2 : info->fieldType = GF_SG_VRML_SFINT32;
6866 2 : info->far_ptr = & ((X_IntegerSequencer *) node)->value_changed;
6867 2 : return GF_OK;
6868 2 : case 6:
6869 2 : info->name = "metadata";
6870 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6871 2 : info->fieldType = GF_SG_VRML_SFNODE;
6872 2 : info->NDTtype = NDT_SFMetadataNode;
6873 2 : info->far_ptr = & ((X_IntegerSequencer *)node)->metadata;
6874 2 : return GF_OK;
6875 : default:
6876 : return GF_BAD_PARAM;
6877 : }
6878 : }
6879 :
6880 :
6881 12 : static s32 IntegerSequencer_get_field_index_by_name(char *name)
6882 : {
6883 12 : if (!strcmp("next", name)) return 0;
6884 10 : if (!strcmp("previous", name)) return 1;
6885 8 : if (!strcmp("set_fraction", name)) return 2;
6886 6 : if (!strcmp("key", name)) return 3;
6887 4 : if (!strcmp("keyValue", name)) return 4;
6888 2 : if (!strcmp("value_changed", name)) return 5;
6889 1 : if (!strcmp("metadata", name)) return 6;
6890 0 : return -1;
6891 : }
6892 :
6893 :
6894 2 : static GF_Node *IntegerSequencer_Create()
6895 : {
6896 : X_IntegerSequencer *p;
6897 2 : GF_SAFEALLOC(p, X_IntegerSequencer);
6898 2 : if(!p) return NULL;
6899 2 : gf_node_setup((GF_Node *)p, TAG_X3D_IntegerSequencer);
6900 :
6901 : /*default field values*/
6902 2 : return (GF_Node *)p;
6903 : }
6904 :
6905 :
6906 : /*
6907 : IntegerTrigger Node deletion
6908 : */
6909 :
6910 : static void IntegerTrigger_Del(GF_Node *node)
6911 : {
6912 : X_IntegerTrigger *p = (X_IntegerTrigger *) node;
6913 2 : gf_node_unregister((GF_Node *) p->metadata, node);
6914 2 : gf_node_free((GF_Node *)p);
6915 : }
6916 :
6917 :
6918 : static u32 IntegerTrigger_get_field_count(GF_Node *node, u8 dummy)
6919 : {
6920 : return 4;
6921 : }
6922 :
6923 10 : static GF_Err IntegerTrigger_get_field(GF_Node *node, GF_FieldInfo *info)
6924 : {
6925 10 : switch (info->fieldIndex) {
6926 3 : case 0:
6927 3 : info->name = "set_boolean";
6928 3 : info->eventType = GF_SG_EVENT_IN;
6929 3 : info->on_event_in = ((X_IntegerTrigger *)node)->on_set_boolean;
6930 3 : info->fieldType = GF_SG_VRML_SFBOOL;
6931 3 : info->far_ptr = & ((X_IntegerTrigger *) node)->set_boolean;
6932 3 : return GF_OK;
6933 3 : case 1:
6934 3 : info->name = "integerKey";
6935 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6936 3 : info->fieldType = GF_SG_VRML_SFINT32;
6937 3 : info->far_ptr = & ((X_IntegerTrigger *) node)->integerKey;
6938 3 : return GF_OK;
6939 2 : case 2:
6940 2 : info->name = "triggerValue";
6941 2 : info->eventType = GF_SG_EVENT_OUT;
6942 2 : info->fieldType = GF_SG_VRML_SFINT32;
6943 2 : info->far_ptr = & ((X_IntegerTrigger *) node)->triggerValue;
6944 2 : return GF_OK;
6945 2 : case 3:
6946 2 : info->name = "metadata";
6947 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6948 2 : info->fieldType = GF_SG_VRML_SFNODE;
6949 2 : info->NDTtype = NDT_SFMetadataNode;
6950 2 : info->far_ptr = & ((X_IntegerTrigger *)node)->metadata;
6951 2 : return GF_OK;
6952 : default:
6953 : return GF_BAD_PARAM;
6954 : }
6955 : }
6956 :
6957 :
6958 6 : static s32 IntegerTrigger_get_field_index_by_name(char *name)
6959 : {
6960 6 : if (!strcmp("set_boolean", name)) return 0;
6961 4 : if (!strcmp("integerKey", name)) return 1;
6962 2 : if (!strcmp("triggerValue", name)) return 2;
6963 1 : if (!strcmp("metadata", name)) return 3;
6964 0 : return -1;
6965 : }
6966 :
6967 :
6968 2 : static GF_Node *IntegerTrigger_Create()
6969 : {
6970 : X_IntegerTrigger *p;
6971 2 : GF_SAFEALLOC(p, X_IntegerTrigger);
6972 2 : if(!p) return NULL;
6973 2 : gf_node_setup((GF_Node *)p, TAG_X3D_IntegerTrigger);
6974 :
6975 : /*default field values*/
6976 2 : p->integerKey = -1;
6977 2 : return (GF_Node *)p;
6978 : }
6979 :
6980 :
6981 : /*
6982 : KeySensor Node deletion
6983 : */
6984 :
6985 2 : static void KeySensor_Del(GF_Node *node)
6986 : {
6987 : X_KeySensor *p = (X_KeySensor *) node;
6988 2 : gf_sg_sfstring_del(p->keyPress);
6989 2 : gf_sg_sfstring_del(p->keyRelease);
6990 2 : gf_node_unregister((GF_Node *) p->metadata, node);
6991 2 : gf_node_free((GF_Node *)p);
6992 2 : }
6993 :
6994 :
6995 : static u32 KeySensor_get_field_count(GF_Node *node, u8 dummy)
6996 : {
6997 : return 10;
6998 : }
6999 :
7000 27 : static GF_Err KeySensor_get_field(GF_Node *node, GF_FieldInfo *info)
7001 : {
7002 27 : switch (info->fieldIndex) {
7003 2 : case 0:
7004 2 : info->name = "enabled";
7005 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7006 2 : info->fieldType = GF_SG_VRML_SFBOOL;
7007 2 : info->far_ptr = & ((X_KeySensor *) node)->enabled;
7008 2 : return GF_OK;
7009 3 : case 1:
7010 3 : info->name = "actionKeyPress";
7011 3 : info->eventType = GF_SG_EVENT_OUT;
7012 3 : info->fieldType = GF_SG_VRML_SFINT32;
7013 3 : info->far_ptr = & ((X_KeySensor *) node)->actionKeyPress;
7014 3 : return GF_OK;
7015 3 : case 2:
7016 3 : info->name = "actionKeyRelease";
7017 3 : info->eventType = GF_SG_EVENT_OUT;
7018 3 : info->fieldType = GF_SG_VRML_SFINT32;
7019 3 : info->far_ptr = & ((X_KeySensor *) node)->actionKeyRelease;
7020 3 : return GF_OK;
7021 3 : case 3:
7022 3 : info->name = "altKey";
7023 3 : info->eventType = GF_SG_EVENT_OUT;
7024 3 : info->fieldType = GF_SG_VRML_SFBOOL;
7025 3 : info->far_ptr = & ((X_KeySensor *) node)->altKey;
7026 3 : return GF_OK;
7027 3 : case 4:
7028 3 : info->name = "controlKey";
7029 3 : info->eventType = GF_SG_EVENT_OUT;
7030 3 : info->fieldType = GF_SG_VRML_SFBOOL;
7031 3 : info->far_ptr = & ((X_KeySensor *) node)->controlKey;
7032 3 : return GF_OK;
7033 2 : case 5:
7034 2 : info->name = "isActive";
7035 2 : info->eventType = GF_SG_EVENT_OUT;
7036 2 : info->fieldType = GF_SG_VRML_SFBOOL;
7037 2 : info->far_ptr = & ((X_KeySensor *) node)->isActive;
7038 2 : return GF_OK;
7039 3 : case 6:
7040 3 : info->name = "keyPress";
7041 3 : info->eventType = GF_SG_EVENT_OUT;
7042 3 : info->fieldType = GF_SG_VRML_SFSTRING;
7043 3 : info->far_ptr = & ((X_KeySensor *) node)->keyPress;
7044 3 : return GF_OK;
7045 3 : case 7:
7046 3 : info->name = "keyRelease";
7047 3 : info->eventType = GF_SG_EVENT_OUT;
7048 3 : info->fieldType = GF_SG_VRML_SFSTRING;
7049 3 : info->far_ptr = & ((X_KeySensor *) node)->keyRelease;
7050 3 : return GF_OK;
7051 3 : case 8:
7052 3 : info->name = "shiftKey";
7053 3 : info->eventType = GF_SG_EVENT_OUT;
7054 3 : info->fieldType = GF_SG_VRML_SFBOOL;
7055 3 : info->far_ptr = & ((X_KeySensor *) node)->shiftKey;
7056 3 : return GF_OK;
7057 2 : case 9:
7058 2 : info->name = "metadata";
7059 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7060 2 : info->fieldType = GF_SG_VRML_SFNODE;
7061 2 : info->NDTtype = NDT_SFMetadataNode;
7062 2 : info->far_ptr = & ((X_KeySensor *)node)->metadata;
7063 2 : return GF_OK;
7064 : default:
7065 : return GF_BAD_PARAM;
7066 : }
7067 : }
7068 :
7069 :
7070 17 : static s32 KeySensor_get_field_index_by_name(char *name)
7071 : {
7072 17 : if (!strcmp("enabled", name)) return 0;
7073 16 : if (!strcmp("actionKeyPress", name)) return 1;
7074 14 : if (!strcmp("actionKeyRelease", name)) return 2;
7075 12 : if (!strcmp("altKey", name)) return 3;
7076 10 : if (!strcmp("controlKey", name)) return 4;
7077 8 : if (!strcmp("isActive", name)) return 5;
7078 7 : if (!strcmp("keyPress", name)) return 6;
7079 5 : if (!strcmp("keyRelease", name)) return 7;
7080 3 : if (!strcmp("shiftKey", name)) return 8;
7081 1 : if (!strcmp("metadata", name)) return 9;
7082 0 : return -1;
7083 : }
7084 :
7085 :
7086 2 : static GF_Node *KeySensor_Create()
7087 : {
7088 : X_KeySensor *p;
7089 2 : GF_SAFEALLOC(p, X_KeySensor);
7090 2 : if(!p) return NULL;
7091 2 : gf_node_setup((GF_Node *)p, TAG_X3D_KeySensor);
7092 :
7093 : /*default field values*/
7094 2 : p->enabled = 1;
7095 2 : return (GF_Node *)p;
7096 : }
7097 :
7098 :
7099 : /*
7100 : LineProperties Node deletion
7101 : */
7102 :
7103 : static void LineProperties_Del(GF_Node *node)
7104 : {
7105 : X_LineProperties *p = (X_LineProperties *) node;
7106 1 : gf_node_unregister((GF_Node *) p->metadata, node);
7107 1 : gf_node_free((GF_Node *)p);
7108 : }
7109 :
7110 :
7111 : static u32 LineProperties_get_field_count(GF_Node *node, u8 dummy)
7112 : {
7113 : return 4;
7114 : }
7115 :
7116 8 : static GF_Err LineProperties_get_field(GF_Node *node, GF_FieldInfo *info)
7117 : {
7118 8 : switch (info->fieldIndex) {
7119 2 : case 0:
7120 2 : info->name = "applied";
7121 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7122 2 : info->fieldType = GF_SG_VRML_SFBOOL;
7123 2 : info->far_ptr = & ((X_LineProperties *) node)->applied;
7124 2 : return GF_OK;
7125 2 : case 1:
7126 2 : info->name = "linetype";
7127 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7128 2 : info->fieldType = GF_SG_VRML_SFINT32;
7129 2 : info->far_ptr = & ((X_LineProperties *) node)->linetype;
7130 2 : return GF_OK;
7131 2 : case 2:
7132 2 : info->name = "linewidthScaleFactor";
7133 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7134 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
7135 2 : info->far_ptr = & ((X_LineProperties *) node)->linewidthScaleFactor;
7136 2 : return GF_OK;
7137 2 : case 3:
7138 2 : info->name = "metadata";
7139 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7140 2 : info->fieldType = GF_SG_VRML_SFNODE;
7141 2 : info->NDTtype = NDT_SFMetadataNode;
7142 2 : info->far_ptr = & ((X_LineProperties *)node)->metadata;
7143 2 : return GF_OK;
7144 : default:
7145 : return GF_BAD_PARAM;
7146 : }
7147 : }
7148 :
7149 :
7150 4 : static s32 LineProperties_get_field_index_by_name(char *name)
7151 : {
7152 4 : if (!strcmp("applied", name)) return 0;
7153 3 : if (!strcmp("linetype", name)) return 1;
7154 2 : if (!strcmp("linewidthScaleFactor", name)) return 2;
7155 1 : if (!strcmp("metadata", name)) return 3;
7156 0 : return -1;
7157 : }
7158 :
7159 :
7160 1 : static GF_Node *LineProperties_Create()
7161 : {
7162 : X_LineProperties *p;
7163 1 : GF_SAFEALLOC(p, X_LineProperties);
7164 1 : if(!p) return NULL;
7165 1 : gf_node_setup((GF_Node *)p, TAG_X3D_LineProperties);
7166 :
7167 : /*default field values*/
7168 1 : p->applied = 1;
7169 1 : p->linetype = 1;
7170 1 : p->linewidthScaleFactor = FLT2FIX(0);
7171 1 : return (GF_Node *)p;
7172 : }
7173 :
7174 :
7175 : /*
7176 : LineSet Node deletion
7177 : */
7178 :
7179 2 : static void LineSet_Del(GF_Node *node)
7180 : {
7181 : X_LineSet *p = (X_LineSet *) node;
7182 2 : gf_node_unregister((GF_Node *) p->color, node);
7183 2 : gf_node_unregister((GF_Node *) p->coord, node);
7184 2 : gf_sg_mfint32_del(p->vertexCount);
7185 2 : gf_node_unregister((GF_Node *) p->metadata, node);
7186 2 : gf_node_free((GF_Node *)p);
7187 2 : }
7188 :
7189 :
7190 : static u32 LineSet_get_field_count(GF_Node *node, u8 dummy)
7191 : {
7192 : return 4;
7193 : }
7194 :
7195 11 : static GF_Err LineSet_get_field(GF_Node *node, GF_FieldInfo *info)
7196 : {
7197 11 : switch (info->fieldIndex) {
7198 3 : case 0:
7199 3 : info->name = "color";
7200 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7201 3 : info->fieldType = GF_SG_VRML_SFNODE;
7202 3 : info->NDTtype = NDT_SFColorNode;
7203 3 : info->far_ptr = & ((X_LineSet *)node)->color;
7204 3 : return GF_OK;
7205 3 : case 1:
7206 3 : info->name = "coord";
7207 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7208 3 : info->fieldType = GF_SG_VRML_SFNODE;
7209 3 : info->NDTtype = NDT_SFCoordinateNode;
7210 3 : info->far_ptr = & ((X_LineSet *)node)->coord;
7211 3 : return GF_OK;
7212 3 : case 2:
7213 3 : info->name = "vertexCount";
7214 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7215 3 : info->fieldType = GF_SG_VRML_MFINT32;
7216 3 : info->far_ptr = & ((X_LineSet *) node)->vertexCount;
7217 3 : return GF_OK;
7218 2 : case 3:
7219 2 : info->name = "metadata";
7220 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7221 2 : info->fieldType = GF_SG_VRML_SFNODE;
7222 2 : info->NDTtype = NDT_SFMetadataNode;
7223 2 : info->far_ptr = & ((X_LineSet *)node)->metadata;
7224 2 : return GF_OK;
7225 : default:
7226 : return GF_BAD_PARAM;
7227 : }
7228 : }
7229 :
7230 :
7231 7 : static s32 LineSet_get_field_index_by_name(char *name)
7232 : {
7233 7 : if (!strcmp("color", name)) return 0;
7234 5 : if (!strcmp("coord", name)) return 1;
7235 3 : if (!strcmp("vertexCount", name)) return 2;
7236 1 : if (!strcmp("metadata", name)) return 3;
7237 0 : return -1;
7238 : }
7239 :
7240 :
7241 2 : static GF_Node *LineSet_Create()
7242 : {
7243 : X_LineSet *p;
7244 2 : GF_SAFEALLOC(p, X_LineSet);
7245 2 : if(!p) return NULL;
7246 2 : gf_node_setup((GF_Node *)p, TAG_X3D_LineSet);
7247 :
7248 : /*default field values*/
7249 2 : return (GF_Node *)p;
7250 : }
7251 :
7252 :
7253 : /*
7254 : LoadSensor Node deletion
7255 : */
7256 :
7257 1 : static void LoadSensor_Del(GF_Node *node)
7258 : {
7259 : X_LoadSensor *p = (X_LoadSensor *) node;
7260 1 : gf_node_unregister_children(node, p->watchList);
7261 1 : gf_node_unregister((GF_Node *) p->metadata, node);
7262 1 : gf_node_free((GF_Node *)p);
7263 1 : }
7264 :
7265 :
7266 : static u32 LoadSensor_get_field_count(GF_Node *node, u8 dummy)
7267 : {
7268 : return 8;
7269 : }
7270 :
7271 16 : static GF_Err LoadSensor_get_field(GF_Node *node, GF_FieldInfo *info)
7272 : {
7273 16 : switch (info->fieldIndex) {
7274 2 : case 0:
7275 2 : info->name = "enabled";
7276 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7277 2 : info->fieldType = GF_SG_VRML_SFBOOL;
7278 2 : info->far_ptr = & ((X_LoadSensor *) node)->enabled;
7279 2 : return GF_OK;
7280 2 : case 1:
7281 2 : info->name = "timeOut";
7282 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7283 2 : info->fieldType = GF_SG_VRML_SFTIME;
7284 2 : info->far_ptr = & ((X_LoadSensor *) node)->timeOut;
7285 2 : return GF_OK;
7286 2 : case 2:
7287 2 : info->name = "watchList";
7288 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7289 2 : info->fieldType = GF_SG_VRML_MFNODE;
7290 2 : info->NDTtype = NDT_SFStreamingNode;
7291 2 : info->far_ptr = & ((X_LoadSensor *)node)->watchList;
7292 2 : return GF_OK;
7293 2 : case 3:
7294 2 : info->name = "isActive";
7295 2 : info->eventType = GF_SG_EVENT_OUT;
7296 2 : info->fieldType = GF_SG_VRML_SFBOOL;
7297 2 : info->far_ptr = & ((X_LoadSensor *) node)->isActive;
7298 2 : return GF_OK;
7299 2 : case 4:
7300 2 : info->name = "isLoaded";
7301 2 : info->eventType = GF_SG_EVENT_OUT;
7302 2 : info->fieldType = GF_SG_VRML_SFBOOL;
7303 2 : info->far_ptr = & ((X_LoadSensor *) node)->isLoaded;
7304 2 : return GF_OK;
7305 2 : case 5:
7306 2 : info->name = "loadTime";
7307 2 : info->eventType = GF_SG_EVENT_OUT;
7308 2 : info->fieldType = GF_SG_VRML_SFTIME;
7309 2 : info->far_ptr = & ((X_LoadSensor *) node)->loadTime;
7310 2 : return GF_OK;
7311 2 : case 6:
7312 2 : info->name = "progress";
7313 2 : info->eventType = GF_SG_EVENT_OUT;
7314 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
7315 2 : info->far_ptr = & ((X_LoadSensor *) node)->progress;
7316 2 : return GF_OK;
7317 2 : case 7:
7318 2 : info->name = "metadata";
7319 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7320 2 : info->fieldType = GF_SG_VRML_SFNODE;
7321 2 : info->NDTtype = NDT_SFMetadataNode;
7322 2 : info->far_ptr = & ((X_LoadSensor *)node)->metadata;
7323 2 : return GF_OK;
7324 : default:
7325 : return GF_BAD_PARAM;
7326 : }
7327 : }
7328 :
7329 :
7330 8 : static s32 LoadSensor_get_field_index_by_name(char *name)
7331 : {
7332 8 : if (!strcmp("enabled", name)) return 0;
7333 7 : if (!strcmp("timeOut", name)) return 1;
7334 6 : if (!strcmp("watchList", name)) return 2;
7335 5 : if (!strcmp("isActive", name)) return 3;
7336 4 : if (!strcmp("isLoaded", name)) return 4;
7337 3 : if (!strcmp("loadTime", name)) return 5;
7338 2 : if (!strcmp("progress", name)) return 6;
7339 1 : if (!strcmp("metadata", name)) return 7;
7340 0 : return -1;
7341 : }
7342 :
7343 :
7344 1 : static GF_Node *LoadSensor_Create()
7345 : {
7346 : X_LoadSensor *p;
7347 1 : GF_SAFEALLOC(p, X_LoadSensor);
7348 1 : if(!p) return NULL;
7349 1 : gf_node_setup((GF_Node *)p, TAG_X3D_LoadSensor);
7350 :
7351 : /*default field values*/
7352 1 : p->enabled = 1;
7353 1 : p->timeOut = 0;
7354 1 : return (GF_Node *)p;
7355 : }
7356 :
7357 :
7358 : /*
7359 : LOD Node deletion
7360 : */
7361 :
7362 1 : static void LOD_Del(GF_Node *node)
7363 : {
7364 : X_LOD *p = (X_LOD *) node;
7365 1 : gf_sg_mffloat_del(p->range);
7366 1 : gf_node_unregister((GF_Node *) p->metadata, node);
7367 1 : gf_sg_vrml_parent_destroy(node);
7368 1 : gf_node_free((GF_Node *)p);
7369 1 : }
7370 :
7371 :
7372 : static u32 LOD_get_field_count(GF_Node *node, u8 dummy)
7373 : {
7374 : return 6;
7375 : }
7376 :
7377 12 : static GF_Err LOD_get_field(GF_Node *node, GF_FieldInfo *info)
7378 : {
7379 12 : switch (info->fieldIndex) {
7380 2 : case 0:
7381 2 : info->name = "addChildren";
7382 2 : info->eventType = GF_SG_EVENT_IN;
7383 2 : info->on_event_in = ((X_LOD *)node)->on_addChildren;
7384 2 : info->fieldType = GF_SG_VRML_MFNODE;
7385 2 : info->NDTtype = NDT_SF3DNode;
7386 2 : info->far_ptr = & ((X_LOD *)node)->addChildren;
7387 2 : return GF_OK;
7388 2 : case 1:
7389 2 : info->name = "removeChildren";
7390 2 : info->eventType = GF_SG_EVENT_IN;
7391 2 : info->on_event_in = ((X_LOD *)node)->on_removeChildren;
7392 2 : info->fieldType = GF_SG_VRML_MFNODE;
7393 2 : info->NDTtype = NDT_SF3DNode;
7394 2 : info->far_ptr = & ((X_LOD *)node)->removeChildren;
7395 2 : return GF_OK;
7396 2 : case 2:
7397 2 : info->name = "children";
7398 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7399 2 : info->fieldType = GF_SG_VRML_MFNODE;
7400 2 : info->NDTtype = NDT_SF3DNode;
7401 2 : info->far_ptr = & ((X_LOD *)node)->children;
7402 2 : return GF_OK;
7403 2 : case 3:
7404 2 : info->name = "center";
7405 2 : info->eventType = GF_SG_EVENT_FIELD;
7406 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
7407 2 : info->far_ptr = & ((X_LOD *) node)->center;
7408 2 : return GF_OK;
7409 2 : case 4:
7410 2 : info->name = "range";
7411 2 : info->eventType = GF_SG_EVENT_FIELD;
7412 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
7413 2 : info->far_ptr = & ((X_LOD *) node)->range;
7414 2 : return GF_OK;
7415 2 : case 5:
7416 2 : info->name = "metadata";
7417 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7418 2 : info->fieldType = GF_SG_VRML_SFNODE;
7419 2 : info->NDTtype = NDT_SFMetadataNode;
7420 2 : info->far_ptr = & ((X_LOD *)node)->metadata;
7421 2 : return GF_OK;
7422 : default:
7423 : return GF_BAD_PARAM;
7424 : }
7425 : }
7426 :
7427 :
7428 6 : static s32 LOD_get_field_index_by_name(char *name)
7429 : {
7430 6 : if (!strcmp("addChildren", name)) return 0;
7431 5 : if (!strcmp("removeChildren", name)) return 1;
7432 4 : if (!strcmp("children", name)) return 2;
7433 3 : if (!strcmp("center", name)) return 3;
7434 2 : if (!strcmp("range", name)) return 4;
7435 1 : if (!strcmp("metadata", name)) return 5;
7436 0 : return -1;
7437 : }
7438 :
7439 :
7440 1 : static GF_Node *LOD_Create()
7441 : {
7442 : X_LOD *p;
7443 1 : GF_SAFEALLOC(p, X_LOD);
7444 1 : if(!p) return NULL;
7445 1 : gf_node_setup((GF_Node *)p, TAG_X3D_LOD);
7446 1 : gf_sg_vrml_parent_setup((GF_Node *) p);
7447 :
7448 : /*default field values*/
7449 1 : p->center.x = FLT2FIX(0);
7450 1 : p->center.y = FLT2FIX(0);
7451 1 : p->center.z = FLT2FIX(0);
7452 1 : return (GF_Node *)p;
7453 : }
7454 :
7455 :
7456 : /*
7457 : Material Node deletion
7458 : */
7459 :
7460 : static void Material_Del(GF_Node *node)
7461 : {
7462 : X_Material *p = (X_Material *) node;
7463 27 : gf_node_unregister((GF_Node *) p->metadata, node);
7464 27 : gf_node_free((GF_Node *)p);
7465 : }
7466 :
7467 :
7468 : static u32 Material_get_field_count(GF_Node *node, u8 dummy)
7469 : {
7470 : return 7;
7471 : }
7472 :
7473 40 : static GF_Err Material_get_field(GF_Node *node, GF_FieldInfo *info)
7474 : {
7475 40 : switch (info->fieldIndex) {
7476 2 : case 0:
7477 2 : info->name = "ambientIntensity";
7478 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7479 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
7480 2 : info->far_ptr = & ((X_Material *) node)->ambientIntensity;
7481 2 : return GF_OK;
7482 28 : case 1:
7483 28 : info->name = "diffuseColor";
7484 28 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7485 28 : info->fieldType = GF_SG_VRML_SFCOLOR;
7486 28 : info->far_ptr = & ((X_Material *) node)->diffuseColor;
7487 28 : return GF_OK;
7488 2 : case 2:
7489 2 : info->name = "emissiveColor";
7490 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7491 2 : info->fieldType = GF_SG_VRML_SFCOLOR;
7492 2 : info->far_ptr = & ((X_Material *) node)->emissiveColor;
7493 2 : return GF_OK;
7494 2 : case 3:
7495 2 : info->name = "shininess";
7496 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7497 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
7498 2 : info->far_ptr = & ((X_Material *) node)->shininess;
7499 2 : return GF_OK;
7500 2 : case 4:
7501 2 : info->name = "specularColor";
7502 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7503 2 : info->fieldType = GF_SG_VRML_SFCOLOR;
7504 2 : info->far_ptr = & ((X_Material *) node)->specularColor;
7505 2 : return GF_OK;
7506 2 : case 5:
7507 2 : info->name = "transparency";
7508 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7509 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
7510 2 : info->far_ptr = & ((X_Material *) node)->transparency;
7511 2 : return GF_OK;
7512 2 : case 6:
7513 2 : info->name = "metadata";
7514 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7515 2 : info->fieldType = GF_SG_VRML_SFNODE;
7516 2 : info->NDTtype = NDT_SFMetadataNode;
7517 2 : info->far_ptr = & ((X_Material *)node)->metadata;
7518 2 : return GF_OK;
7519 : default:
7520 : return GF_BAD_PARAM;
7521 : }
7522 : }
7523 :
7524 :
7525 33 : static s32 Material_get_field_index_by_name(char *name)
7526 : {
7527 33 : if (!strcmp("ambientIntensity", name)) return 0;
7528 32 : if (!strcmp("diffuseColor", name)) return 1;
7529 5 : if (!strcmp("emissiveColor", name)) return 2;
7530 4 : if (!strcmp("shininess", name)) return 3;
7531 3 : if (!strcmp("specularColor", name)) return 4;
7532 2 : if (!strcmp("transparency", name)) return 5;
7533 1 : if (!strcmp("metadata", name)) return 6;
7534 0 : return -1;
7535 : }
7536 :
7537 :
7538 27 : static GF_Node *Material_Create()
7539 : {
7540 : X_Material *p;
7541 27 : GF_SAFEALLOC(p, X_Material);
7542 27 : if(!p) return NULL;
7543 27 : gf_node_setup((GF_Node *)p, TAG_X3D_Material);
7544 :
7545 : /*default field values*/
7546 27 : p->ambientIntensity = FLT2FIX(0.2);
7547 27 : p->diffuseColor.red = FLT2FIX(0.8);
7548 27 : p->diffuseColor.green = FLT2FIX(0.8);
7549 27 : p->diffuseColor.blue = FLT2FIX(0.8);
7550 27 : p->emissiveColor.red = FLT2FIX(0);
7551 27 : p->emissiveColor.green = FLT2FIX(0);
7552 27 : p->emissiveColor.blue = FLT2FIX(0);
7553 27 : p->shininess = FLT2FIX(0.2);
7554 27 : p->specularColor.red = FLT2FIX(0);
7555 27 : p->specularColor.green = FLT2FIX(0);
7556 27 : p->specularColor.blue = FLT2FIX(0);
7557 27 : p->transparency = FLT2FIX(0);
7558 27 : return (GF_Node *)p;
7559 : }
7560 :
7561 :
7562 : /*
7563 : MetadataDouble Node deletion
7564 : */
7565 :
7566 1 : static void MetadataDouble_Del(GF_Node *node)
7567 : {
7568 : X_MetadataDouble *p = (X_MetadataDouble *) node;
7569 1 : gf_sg_sfstring_del(p->name);
7570 1 : gf_sg_sfstring_del(p->reference);
7571 1 : gf_sg_mfdouble_del(p->value);
7572 1 : gf_node_unregister((GF_Node *) p->metadata, node);
7573 1 : gf_node_free((GF_Node *)p);
7574 1 : }
7575 :
7576 :
7577 : static u32 MetadataDouble_get_field_count(GF_Node *node, u8 dummy)
7578 : {
7579 : return 4;
7580 : }
7581 :
7582 8 : static GF_Err MetadataDouble_get_field(GF_Node *node, GF_FieldInfo *info)
7583 : {
7584 8 : switch (info->fieldIndex) {
7585 2 : case 0:
7586 2 : info->name = "name";
7587 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7588 2 : info->fieldType = GF_SG_VRML_SFSTRING;
7589 2 : info->far_ptr = & ((X_MetadataDouble *) node)->name;
7590 2 : return GF_OK;
7591 2 : case 1:
7592 2 : info->name = "reference";
7593 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7594 2 : info->fieldType = GF_SG_VRML_SFSTRING;
7595 2 : info->far_ptr = & ((X_MetadataDouble *) node)->reference;
7596 2 : return GF_OK;
7597 2 : case 2:
7598 2 : info->name = "value";
7599 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7600 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
7601 2 : info->far_ptr = & ((X_MetadataDouble *) node)->value;
7602 2 : return GF_OK;
7603 2 : case 3:
7604 2 : info->name = "metadata";
7605 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7606 2 : info->fieldType = GF_SG_VRML_SFNODE;
7607 2 : info->NDTtype = NDT_SFMetadataNode;
7608 2 : info->far_ptr = & ((X_MetadataDouble *)node)->metadata;
7609 2 : return GF_OK;
7610 : default:
7611 : return GF_BAD_PARAM;
7612 : }
7613 : }
7614 :
7615 :
7616 4 : static s32 MetadataDouble_get_field_index_by_name(char *name)
7617 : {
7618 4 : if (!strcmp("name", name)) return 0;
7619 3 : if (!strcmp("reference", name)) return 1;
7620 2 : if (!strcmp("value", name)) return 2;
7621 1 : if (!strcmp("metadata", name)) return 3;
7622 0 : return -1;
7623 : }
7624 :
7625 :
7626 1 : static GF_Node *MetadataDouble_Create()
7627 : {
7628 : X_MetadataDouble *p;
7629 1 : GF_SAFEALLOC(p, X_MetadataDouble);
7630 1 : if(!p) return NULL;
7631 1 : gf_node_setup((GF_Node *)p, TAG_X3D_MetadataDouble);
7632 :
7633 : /*default field values*/
7634 1 : return (GF_Node *)p;
7635 : }
7636 :
7637 :
7638 : /*
7639 : MetadataFloat Node deletion
7640 : */
7641 :
7642 1 : static void MetadataFloat_Del(GF_Node *node)
7643 : {
7644 : X_MetadataFloat *p = (X_MetadataFloat *) node;
7645 1 : gf_sg_sfstring_del(p->name);
7646 1 : gf_sg_sfstring_del(p->reference);
7647 1 : gf_sg_mffloat_del(p->value);
7648 1 : gf_node_unregister((GF_Node *) p->metadata, node);
7649 1 : gf_node_free((GF_Node *)p);
7650 1 : }
7651 :
7652 :
7653 : static u32 MetadataFloat_get_field_count(GF_Node *node, u8 dummy)
7654 : {
7655 : return 4;
7656 : }
7657 :
7658 8 : static GF_Err MetadataFloat_get_field(GF_Node *node, GF_FieldInfo *info)
7659 : {
7660 8 : switch (info->fieldIndex) {
7661 2 : case 0:
7662 2 : info->name = "name";
7663 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7664 2 : info->fieldType = GF_SG_VRML_SFSTRING;
7665 2 : info->far_ptr = & ((X_MetadataFloat *) node)->name;
7666 2 : return GF_OK;
7667 2 : case 1:
7668 2 : info->name = "reference";
7669 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7670 2 : info->fieldType = GF_SG_VRML_SFSTRING;
7671 2 : info->far_ptr = & ((X_MetadataFloat *) node)->reference;
7672 2 : return GF_OK;
7673 2 : case 2:
7674 2 : info->name = "value";
7675 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7676 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
7677 2 : info->far_ptr = & ((X_MetadataFloat *) node)->value;
7678 2 : return GF_OK;
7679 2 : case 3:
7680 2 : info->name = "metadata";
7681 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7682 2 : info->fieldType = GF_SG_VRML_SFNODE;
7683 2 : info->NDTtype = NDT_SFMetadataNode;
7684 2 : info->far_ptr = & ((X_MetadataFloat *)node)->metadata;
7685 2 : return GF_OK;
7686 : default:
7687 : return GF_BAD_PARAM;
7688 : }
7689 : }
7690 :
7691 :
7692 4 : static s32 MetadataFloat_get_field_index_by_name(char *name)
7693 : {
7694 4 : if (!strcmp("name", name)) return 0;
7695 3 : if (!strcmp("reference", name)) return 1;
7696 2 : if (!strcmp("value", name)) return 2;
7697 1 : if (!strcmp("metadata", name)) return 3;
7698 0 : return -1;
7699 : }
7700 :
7701 :
7702 1 : static GF_Node *MetadataFloat_Create()
7703 : {
7704 : X_MetadataFloat *p;
7705 1 : GF_SAFEALLOC(p, X_MetadataFloat);
7706 1 : if(!p) return NULL;
7707 1 : gf_node_setup((GF_Node *)p, TAG_X3D_MetadataFloat);
7708 :
7709 : /*default field values*/
7710 1 : return (GF_Node *)p;
7711 : }
7712 :
7713 :
7714 : /*
7715 : MetadataInteger Node deletion
7716 : */
7717 :
7718 1 : static void MetadataInteger_Del(GF_Node *node)
7719 : {
7720 : X_MetadataInteger *p = (X_MetadataInteger *) node;
7721 1 : gf_sg_sfstring_del(p->name);
7722 1 : gf_sg_sfstring_del(p->reference);
7723 1 : gf_sg_mfint32_del(p->value);
7724 1 : gf_node_unregister((GF_Node *) p->metadata, node);
7725 1 : gf_node_free((GF_Node *)p);
7726 1 : }
7727 :
7728 :
7729 : static u32 MetadataInteger_get_field_count(GF_Node *node, u8 dummy)
7730 : {
7731 : return 4;
7732 : }
7733 :
7734 8 : static GF_Err MetadataInteger_get_field(GF_Node *node, GF_FieldInfo *info)
7735 : {
7736 8 : switch (info->fieldIndex) {
7737 2 : case 0:
7738 2 : info->name = "name";
7739 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7740 2 : info->fieldType = GF_SG_VRML_SFSTRING;
7741 2 : info->far_ptr = & ((X_MetadataInteger *) node)->name;
7742 2 : return GF_OK;
7743 2 : case 1:
7744 2 : info->name = "reference";
7745 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7746 2 : info->fieldType = GF_SG_VRML_SFSTRING;
7747 2 : info->far_ptr = & ((X_MetadataInteger *) node)->reference;
7748 2 : return GF_OK;
7749 2 : case 2:
7750 2 : info->name = "value";
7751 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7752 2 : info->fieldType = GF_SG_VRML_MFINT32;
7753 2 : info->far_ptr = & ((X_MetadataInteger *) node)->value;
7754 2 : return GF_OK;
7755 2 : case 3:
7756 2 : info->name = "metadata";
7757 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7758 2 : info->fieldType = GF_SG_VRML_SFNODE;
7759 2 : info->NDTtype = NDT_SFMetadataNode;
7760 2 : info->far_ptr = & ((X_MetadataInteger *)node)->metadata;
7761 2 : return GF_OK;
7762 : default:
7763 : return GF_BAD_PARAM;
7764 : }
7765 : }
7766 :
7767 :
7768 4 : static s32 MetadataInteger_get_field_index_by_name(char *name)
7769 : {
7770 4 : if (!strcmp("name", name)) return 0;
7771 3 : if (!strcmp("reference", name)) return 1;
7772 2 : if (!strcmp("value", name)) return 2;
7773 1 : if (!strcmp("metadata", name)) return 3;
7774 0 : return -1;
7775 : }
7776 :
7777 :
7778 1 : static GF_Node *MetadataInteger_Create()
7779 : {
7780 : X_MetadataInteger *p;
7781 1 : GF_SAFEALLOC(p, X_MetadataInteger);
7782 1 : if(!p) return NULL;
7783 1 : gf_node_setup((GF_Node *)p, TAG_X3D_MetadataInteger);
7784 :
7785 : /*default field values*/
7786 1 : return (GF_Node *)p;
7787 : }
7788 :
7789 :
7790 : /*
7791 : MetadataSet Node deletion
7792 : */
7793 :
7794 1 : static void MetadataSet_Del(GF_Node *node)
7795 : {
7796 : X_MetadataSet *p = (X_MetadataSet *) node;
7797 1 : gf_sg_sfstring_del(p->name);
7798 1 : gf_sg_sfstring_del(p->reference);
7799 1 : gf_node_unregister_children(node, p->value);
7800 1 : gf_node_unregister((GF_Node *) p->metadata, node);
7801 1 : gf_node_free((GF_Node *)p);
7802 1 : }
7803 :
7804 :
7805 : static u32 MetadataSet_get_field_count(GF_Node *node, u8 dummy)
7806 : {
7807 : return 4;
7808 : }
7809 :
7810 8 : static GF_Err MetadataSet_get_field(GF_Node *node, GF_FieldInfo *info)
7811 : {
7812 8 : switch (info->fieldIndex) {
7813 2 : case 0:
7814 2 : info->name = "name";
7815 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7816 2 : info->fieldType = GF_SG_VRML_SFSTRING;
7817 2 : info->far_ptr = & ((X_MetadataSet *) node)->name;
7818 2 : return GF_OK;
7819 2 : case 1:
7820 2 : info->name = "reference";
7821 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7822 2 : info->fieldType = GF_SG_VRML_SFSTRING;
7823 2 : info->far_ptr = & ((X_MetadataSet *) node)->reference;
7824 2 : return GF_OK;
7825 2 : case 2:
7826 2 : info->name = "value";
7827 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7828 2 : info->fieldType = GF_SG_VRML_MFNODE;
7829 2 : info->NDTtype = NDT_SFMetadataNode;
7830 2 : info->far_ptr = & ((X_MetadataSet *)node)->value;
7831 2 : return GF_OK;
7832 2 : case 3:
7833 2 : info->name = "metadata";
7834 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7835 2 : info->fieldType = GF_SG_VRML_SFNODE;
7836 2 : info->NDTtype = NDT_SFMetadataNode;
7837 2 : info->far_ptr = & ((X_MetadataSet *)node)->metadata;
7838 2 : return GF_OK;
7839 : default:
7840 : return GF_BAD_PARAM;
7841 : }
7842 : }
7843 :
7844 :
7845 4 : static s32 MetadataSet_get_field_index_by_name(char *name)
7846 : {
7847 4 : if (!strcmp("name", name)) return 0;
7848 3 : if (!strcmp("reference", name)) return 1;
7849 2 : if (!strcmp("value", name)) return 2;
7850 1 : if (!strcmp("metadata", name)) return 3;
7851 0 : return -1;
7852 : }
7853 :
7854 :
7855 1 : static GF_Node *MetadataSet_Create()
7856 : {
7857 : X_MetadataSet *p;
7858 1 : GF_SAFEALLOC(p, X_MetadataSet);
7859 1 : if(!p) return NULL;
7860 1 : gf_node_setup((GF_Node *)p, TAG_X3D_MetadataSet);
7861 :
7862 : /*default field values*/
7863 1 : return (GF_Node *)p;
7864 : }
7865 :
7866 :
7867 : /*
7868 : MetadataString Node deletion
7869 : */
7870 :
7871 1 : static void MetadataString_Del(GF_Node *node)
7872 : {
7873 : X_MetadataString *p = (X_MetadataString *) node;
7874 1 : gf_sg_sfstring_del(p->name);
7875 1 : gf_sg_sfstring_del(p->reference);
7876 1 : gf_sg_mfstring_del(p->value);
7877 1 : gf_node_unregister((GF_Node *) p->metadata, node);
7878 1 : gf_node_free((GF_Node *)p);
7879 1 : }
7880 :
7881 :
7882 : static u32 MetadataString_get_field_count(GF_Node *node, u8 dummy)
7883 : {
7884 : return 4;
7885 : }
7886 :
7887 8 : static GF_Err MetadataString_get_field(GF_Node *node, GF_FieldInfo *info)
7888 : {
7889 8 : switch (info->fieldIndex) {
7890 2 : case 0:
7891 2 : info->name = "name";
7892 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7893 2 : info->fieldType = GF_SG_VRML_SFSTRING;
7894 2 : info->far_ptr = & ((X_MetadataString *) node)->name;
7895 2 : return GF_OK;
7896 2 : case 1:
7897 2 : info->name = "reference";
7898 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7899 2 : info->fieldType = GF_SG_VRML_SFSTRING;
7900 2 : info->far_ptr = & ((X_MetadataString *) node)->reference;
7901 2 : return GF_OK;
7902 2 : case 2:
7903 2 : info->name = "value";
7904 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7905 2 : info->fieldType = GF_SG_VRML_MFSTRING;
7906 2 : info->far_ptr = & ((X_MetadataString *) node)->value;
7907 2 : return GF_OK;
7908 2 : case 3:
7909 2 : info->name = "metadata";
7910 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7911 2 : info->fieldType = GF_SG_VRML_SFNODE;
7912 2 : info->NDTtype = NDT_SFMetadataNode;
7913 2 : info->far_ptr = & ((X_MetadataString *)node)->metadata;
7914 2 : return GF_OK;
7915 : default:
7916 : return GF_BAD_PARAM;
7917 : }
7918 : }
7919 :
7920 :
7921 4 : static s32 MetadataString_get_field_index_by_name(char *name)
7922 : {
7923 4 : if (!strcmp("name", name)) return 0;
7924 3 : if (!strcmp("reference", name)) return 1;
7925 2 : if (!strcmp("value", name)) return 2;
7926 1 : if (!strcmp("metadata", name)) return 3;
7927 0 : return -1;
7928 : }
7929 :
7930 :
7931 1 : static GF_Node *MetadataString_Create()
7932 : {
7933 : X_MetadataString *p;
7934 1 : GF_SAFEALLOC(p, X_MetadataString);
7935 1 : if(!p) return NULL;
7936 1 : gf_node_setup((GF_Node *)p, TAG_X3D_MetadataString);
7937 :
7938 : /*default field values*/
7939 1 : return (GF_Node *)p;
7940 : }
7941 :
7942 :
7943 : /*
7944 : MovieTexture Node deletion
7945 : */
7946 :
7947 1 : static void MovieTexture_Del(GF_Node *node)
7948 : {
7949 : X_MovieTexture *p = (X_MovieTexture *) node;
7950 1 : gf_sg_mfurl_del(p->url);
7951 1 : gf_node_unregister((GF_Node *) p->metadata, node);
7952 1 : gf_node_free((GF_Node *)p);
7953 1 : }
7954 :
7955 :
7956 : static u32 MovieTexture_get_field_count(GF_Node *node, u8 dummy)
7957 : {
7958 : return 14;
7959 : }
7960 :
7961 28 : static GF_Err MovieTexture_get_field(GF_Node *node, GF_FieldInfo *info)
7962 : {
7963 28 : switch (info->fieldIndex) {
7964 2 : case 0:
7965 2 : info->name = "loop";
7966 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7967 2 : info->fieldType = GF_SG_VRML_SFBOOL;
7968 2 : info->far_ptr = & ((X_MovieTexture *) node)->loop;
7969 2 : return GF_OK;
7970 2 : case 1:
7971 2 : info->name = "speed";
7972 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7973 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
7974 2 : info->far_ptr = & ((X_MovieTexture *) node)->speed;
7975 2 : return GF_OK;
7976 2 : case 2:
7977 2 : info->name = "startTime";
7978 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7979 2 : info->fieldType = GF_SG_VRML_SFTIME;
7980 2 : info->far_ptr = & ((X_MovieTexture *) node)->startTime;
7981 2 : return GF_OK;
7982 2 : case 3:
7983 2 : info->name = "stopTime";
7984 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7985 2 : info->fieldType = GF_SG_VRML_SFTIME;
7986 2 : info->far_ptr = & ((X_MovieTexture *) node)->stopTime;
7987 2 : return GF_OK;
7988 2 : case 4:
7989 2 : info->name = "url";
7990 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7991 2 : info->fieldType = GF_SG_VRML_MFURL;
7992 2 : info->far_ptr = & ((X_MovieTexture *) node)->url;
7993 2 : return GF_OK;
7994 2 : case 5:
7995 2 : info->name = "repeatS";
7996 2 : info->eventType = GF_SG_EVENT_FIELD;
7997 2 : info->fieldType = GF_SG_VRML_SFBOOL;
7998 2 : info->far_ptr = & ((X_MovieTexture *) node)->repeatS;
7999 2 : return GF_OK;
8000 2 : case 6:
8001 2 : info->name = "repeatT";
8002 2 : info->eventType = GF_SG_EVENT_FIELD;
8003 2 : info->fieldType = GF_SG_VRML_SFBOOL;
8004 2 : info->far_ptr = & ((X_MovieTexture *) node)->repeatT;
8005 2 : return GF_OK;
8006 2 : case 7:
8007 2 : info->name = "duration_changed";
8008 2 : info->eventType = GF_SG_EVENT_OUT;
8009 2 : info->fieldType = GF_SG_VRML_SFTIME;
8010 2 : info->far_ptr = & ((X_MovieTexture *) node)->duration_changed;
8011 2 : return GF_OK;
8012 2 : case 8:
8013 2 : info->name = "isActive";
8014 2 : info->eventType = GF_SG_EVENT_OUT;
8015 2 : info->fieldType = GF_SG_VRML_SFBOOL;
8016 2 : info->far_ptr = & ((X_MovieTexture *) node)->isActive;
8017 2 : return GF_OK;
8018 2 : case 9:
8019 2 : info->name = "metadata";
8020 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8021 2 : info->fieldType = GF_SG_VRML_SFNODE;
8022 2 : info->NDTtype = NDT_SFMetadataNode;
8023 2 : info->far_ptr = & ((X_MovieTexture *)node)->metadata;
8024 2 : return GF_OK;
8025 2 : case 10:
8026 2 : info->name = "resumeTime";
8027 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8028 2 : info->fieldType = GF_SG_VRML_SFTIME;
8029 2 : info->far_ptr = & ((X_MovieTexture *) node)->resumeTime;
8030 2 : return GF_OK;
8031 2 : case 11:
8032 2 : info->name = "pauseTime";
8033 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8034 2 : info->fieldType = GF_SG_VRML_SFTIME;
8035 2 : info->far_ptr = & ((X_MovieTexture *) node)->pauseTime;
8036 2 : return GF_OK;
8037 2 : case 12:
8038 2 : info->name = "elapsedTime";
8039 2 : info->eventType = GF_SG_EVENT_OUT;
8040 2 : info->fieldType = GF_SG_VRML_SFTIME;
8041 2 : info->far_ptr = & ((X_MovieTexture *) node)->elapsedTime;
8042 2 : return GF_OK;
8043 2 : case 13:
8044 2 : info->name = "isPaused";
8045 2 : info->eventType = GF_SG_EVENT_OUT;
8046 2 : info->fieldType = GF_SG_VRML_SFBOOL;
8047 2 : info->far_ptr = & ((X_MovieTexture *) node)->isPaused;
8048 2 : return GF_OK;
8049 : default:
8050 : return GF_BAD_PARAM;
8051 : }
8052 : }
8053 :
8054 :
8055 14 : static s32 MovieTexture_get_field_index_by_name(char *name)
8056 : {
8057 14 : if (!strcmp("loop", name)) return 0;
8058 13 : if (!strcmp("speed", name)) return 1;
8059 12 : if (!strcmp("startTime", name)) return 2;
8060 11 : if (!strcmp("stopTime", name)) return 3;
8061 10 : if (!strcmp("url", name)) return 4;
8062 9 : if (!strcmp("repeatS", name)) return 5;
8063 8 : if (!strcmp("repeatT", name)) return 6;
8064 7 : if (!strcmp("duration_changed", name)) return 7;
8065 6 : if (!strcmp("isActive", name)) return 8;
8066 5 : if (!strcmp("metadata", name)) return 9;
8067 4 : if (!strcmp("resumeTime", name)) return 10;
8068 3 : if (!strcmp("pauseTime", name)) return 11;
8069 2 : if (!strcmp("elapsedTime", name)) return 12;
8070 1 : if (!strcmp("isPaused", name)) return 13;
8071 0 : return -1;
8072 : }
8073 :
8074 :
8075 1 : static GF_Node *MovieTexture_Create()
8076 : {
8077 : X_MovieTexture *p;
8078 1 : GF_SAFEALLOC(p, X_MovieTexture);
8079 1 : if(!p) return NULL;
8080 1 : gf_node_setup((GF_Node *)p, TAG_X3D_MovieTexture);
8081 :
8082 : /*default field values*/
8083 1 : p->speed = FLT2FIX(1.0);
8084 1 : p->startTime = 0;
8085 1 : p->stopTime = 0;
8086 1 : p->repeatS = 1;
8087 1 : p->repeatT = 1;
8088 1 : p->resumeTime = 0;
8089 1 : p->pauseTime = 0;
8090 1 : return (GF_Node *)p;
8091 : }
8092 :
8093 :
8094 : /*
8095 : MultiTexture Node deletion
8096 : */
8097 :
8098 1 : static void MultiTexture_Del(GF_Node *node)
8099 : {
8100 : X_MultiTexture *p = (X_MultiTexture *) node;
8101 1 : gf_sg_mfstring_del(p->function);
8102 1 : gf_sg_mfstring_del(p->mode);
8103 1 : gf_sg_mfstring_del(p->source);
8104 1 : gf_node_unregister_children(node, p->texture);
8105 1 : gf_node_unregister((GF_Node *) p->metadata, node);
8106 1 : gf_node_free((GF_Node *)p);
8107 1 : }
8108 :
8109 :
8110 : static u32 MultiTexture_get_field_count(GF_Node *node, u8 dummy)
8111 : {
8112 : return 7;
8113 : }
8114 :
8115 14 : static GF_Err MultiTexture_get_field(GF_Node *node, GF_FieldInfo *info)
8116 : {
8117 14 : switch (info->fieldIndex) {
8118 2 : case 0:
8119 2 : info->name = "alpha";
8120 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8121 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
8122 2 : info->far_ptr = & ((X_MultiTexture *) node)->alpha;
8123 2 : return GF_OK;
8124 2 : case 1:
8125 2 : info->name = "color";
8126 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8127 2 : info->fieldType = GF_SG_VRML_SFCOLOR;
8128 2 : info->far_ptr = & ((X_MultiTexture *) node)->color;
8129 2 : return GF_OK;
8130 2 : case 2:
8131 2 : info->name = "function";
8132 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8133 2 : info->fieldType = GF_SG_VRML_MFSTRING;
8134 2 : info->far_ptr = & ((X_MultiTexture *) node)->function;
8135 2 : return GF_OK;
8136 2 : case 3:
8137 2 : info->name = "mode";
8138 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8139 2 : info->fieldType = GF_SG_VRML_MFSTRING;
8140 2 : info->far_ptr = & ((X_MultiTexture *) node)->mode;
8141 2 : return GF_OK;
8142 2 : case 4:
8143 2 : info->name = "source";
8144 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8145 2 : info->fieldType = GF_SG_VRML_MFSTRING;
8146 2 : info->far_ptr = & ((X_MultiTexture *) node)->source;
8147 2 : return GF_OK;
8148 2 : case 5:
8149 2 : info->name = "texture";
8150 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8151 2 : info->fieldType = GF_SG_VRML_MFNODE;
8152 2 : info->NDTtype = NDT_SFTextureNode;
8153 2 : info->far_ptr = & ((X_MultiTexture *)node)->texture;
8154 2 : return GF_OK;
8155 2 : case 6:
8156 2 : info->name = "metadata";
8157 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8158 2 : info->fieldType = GF_SG_VRML_SFNODE;
8159 2 : info->NDTtype = NDT_SFMetadataNode;
8160 2 : info->far_ptr = & ((X_MultiTexture *)node)->metadata;
8161 2 : return GF_OK;
8162 : default:
8163 : return GF_BAD_PARAM;
8164 : }
8165 : }
8166 :
8167 :
8168 7 : static s32 MultiTexture_get_field_index_by_name(char *name)
8169 : {
8170 7 : if (!strcmp("alpha", name)) return 0;
8171 6 : if (!strcmp("color", name)) return 1;
8172 5 : if (!strcmp("function", name)) return 2;
8173 4 : if (!strcmp("mode", name)) return 3;
8174 3 : if (!strcmp("source", name)) return 4;
8175 2 : if (!strcmp("texture", name)) return 5;
8176 1 : if (!strcmp("metadata", name)) return 6;
8177 0 : return -1;
8178 : }
8179 :
8180 :
8181 1 : static GF_Node *MultiTexture_Create()
8182 : {
8183 : X_MultiTexture *p;
8184 1 : GF_SAFEALLOC(p, X_MultiTexture);
8185 1 : if(!p) return NULL;
8186 1 : gf_node_setup((GF_Node *)p, TAG_X3D_MultiTexture);
8187 :
8188 : /*default field values*/
8189 1 : p->alpha = FLT2FIX(1);
8190 1 : p->color.red = FLT2FIX(1);
8191 1 : p->color.green = FLT2FIX(1);
8192 1 : p->color.blue = FLT2FIX(1);
8193 1 : return (GF_Node *)p;
8194 : }
8195 :
8196 :
8197 : /*
8198 : MultiTextureCoordinate Node deletion
8199 : */
8200 :
8201 1 : static void MultiTextureCoordinate_Del(GF_Node *node)
8202 : {
8203 : X_MultiTextureCoordinate *p = (X_MultiTextureCoordinate *) node;
8204 1 : gf_node_unregister_children(node, p->texCoord);
8205 1 : gf_node_unregister((GF_Node *) p->metadata, node);
8206 1 : gf_node_free((GF_Node *)p);
8207 1 : }
8208 :
8209 :
8210 : static u32 MultiTextureCoordinate_get_field_count(GF_Node *node, u8 dummy)
8211 : {
8212 : return 2;
8213 : }
8214 :
8215 : static GF_Err MultiTextureCoordinate_get_field(GF_Node *node, GF_FieldInfo *info)
8216 : {
8217 4 : switch (info->fieldIndex) {
8218 2 : case 0:
8219 2 : info->name = "texCoord";
8220 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8221 2 : info->fieldType = GF_SG_VRML_MFNODE;
8222 2 : info->NDTtype = NDT_SFTextureCoordinateNode;
8223 2 : info->far_ptr = & ((X_MultiTextureCoordinate *)node)->texCoord;
8224 : return GF_OK;
8225 2 : case 1:
8226 2 : info->name = "metadata";
8227 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8228 2 : info->fieldType = GF_SG_VRML_SFNODE;
8229 2 : info->NDTtype = NDT_SFMetadataNode;
8230 2 : info->far_ptr = & ((X_MultiTextureCoordinate *)node)->metadata;
8231 : return GF_OK;
8232 : default:
8233 : return GF_BAD_PARAM;
8234 : }
8235 : }
8236 :
8237 :
8238 2 : static s32 MultiTextureCoordinate_get_field_index_by_name(char *name)
8239 : {
8240 2 : if (!strcmp("texCoord", name)) return 0;
8241 1 : if (!strcmp("metadata", name)) return 1;
8242 0 : return -1;
8243 : }
8244 :
8245 :
8246 1 : static GF_Node *MultiTextureCoordinate_Create()
8247 : {
8248 : X_MultiTextureCoordinate *p;
8249 1 : GF_SAFEALLOC(p, X_MultiTextureCoordinate);
8250 1 : if(!p) return NULL;
8251 1 : gf_node_setup((GF_Node *)p, TAG_X3D_MultiTextureCoordinate);
8252 :
8253 : /*default field values*/
8254 1 : return (GF_Node *)p;
8255 : }
8256 :
8257 :
8258 : /*
8259 : MultiTextureTransform Node deletion
8260 : */
8261 :
8262 1 : static void MultiTextureTransform_Del(GF_Node *node)
8263 : {
8264 : X_MultiTextureTransform *p = (X_MultiTextureTransform *) node;
8265 1 : gf_node_unregister_children(node, p->textureTransform);
8266 1 : gf_node_unregister((GF_Node *) p->metadata, node);
8267 1 : gf_node_free((GF_Node *)p);
8268 1 : }
8269 :
8270 :
8271 : static u32 MultiTextureTransform_get_field_count(GF_Node *node, u8 dummy)
8272 : {
8273 : return 2;
8274 : }
8275 :
8276 : static GF_Err MultiTextureTransform_get_field(GF_Node *node, GF_FieldInfo *info)
8277 : {
8278 4 : switch (info->fieldIndex) {
8279 2 : case 0:
8280 2 : info->name = "textureTransform";
8281 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8282 2 : info->fieldType = GF_SG_VRML_MFNODE;
8283 2 : info->NDTtype = NDT_SFTextureTransformNode;
8284 2 : info->far_ptr = & ((X_MultiTextureTransform *)node)->textureTransform;
8285 : return GF_OK;
8286 2 : case 1:
8287 2 : info->name = "metadata";
8288 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8289 2 : info->fieldType = GF_SG_VRML_SFNODE;
8290 2 : info->NDTtype = NDT_SFMetadataNode;
8291 2 : info->far_ptr = & ((X_MultiTextureTransform *)node)->metadata;
8292 : return GF_OK;
8293 : default:
8294 : return GF_BAD_PARAM;
8295 : }
8296 : }
8297 :
8298 :
8299 2 : static s32 MultiTextureTransform_get_field_index_by_name(char *name)
8300 : {
8301 2 : if (!strcmp("textureTransform", name)) return 0;
8302 1 : if (!strcmp("metadata", name)) return 1;
8303 0 : return -1;
8304 : }
8305 :
8306 :
8307 1 : static GF_Node *MultiTextureTransform_Create()
8308 : {
8309 : X_MultiTextureTransform *p;
8310 1 : GF_SAFEALLOC(p, X_MultiTextureTransform);
8311 1 : if(!p) return NULL;
8312 1 : gf_node_setup((GF_Node *)p, TAG_X3D_MultiTextureTransform);
8313 :
8314 : /*default field values*/
8315 1 : return (GF_Node *)p;
8316 : }
8317 :
8318 :
8319 : /*
8320 : NavigationInfo Node deletion
8321 : */
8322 :
8323 2 : static void NavigationInfo_Del(GF_Node *node)
8324 : {
8325 : X_NavigationInfo *p = (X_NavigationInfo *) node;
8326 2 : gf_sg_mffloat_del(p->avatarSize);
8327 2 : gf_sg_mfstring_del(p->type);
8328 2 : gf_node_unregister((GF_Node *) p->metadata, node);
8329 2 : gf_sg_mfstring_del(p->transitionType);
8330 2 : gf_node_free((GF_Node *)p);
8331 2 : }
8332 :
8333 :
8334 : static u32 NavigationInfo_get_field_count(GF_Node *node, u8 dummy)
8335 : {
8336 : return 10;
8337 : }
8338 :
8339 21 : static GF_Err NavigationInfo_get_field(GF_Node *node, GF_FieldInfo *info)
8340 : {
8341 21 : switch (info->fieldIndex) {
8342 2 : case 0:
8343 2 : info->name = "set_bind";
8344 2 : info->eventType = GF_SG_EVENT_IN;
8345 2 : info->on_event_in = ((X_NavigationInfo *)node)->on_set_bind;
8346 2 : info->fieldType = GF_SG_VRML_SFBOOL;
8347 2 : info->far_ptr = & ((X_NavigationInfo *) node)->set_bind;
8348 2 : return GF_OK;
8349 2 : case 1:
8350 2 : info->name = "avatarSize";
8351 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8352 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
8353 2 : info->far_ptr = & ((X_NavigationInfo *) node)->avatarSize;
8354 2 : return GF_OK;
8355 2 : case 2:
8356 2 : info->name = "headlight";
8357 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8358 2 : info->fieldType = GF_SG_VRML_SFBOOL;
8359 2 : info->far_ptr = & ((X_NavigationInfo *) node)->headlight;
8360 2 : return GF_OK;
8361 2 : case 3:
8362 2 : info->name = "speed";
8363 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8364 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
8365 2 : info->far_ptr = & ((X_NavigationInfo *) node)->speed;
8366 2 : return GF_OK;
8367 3 : case 4:
8368 3 : info->name = "type";
8369 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8370 3 : info->fieldType = GF_SG_VRML_MFSTRING;
8371 3 : info->far_ptr = & ((X_NavigationInfo *) node)->type;
8372 3 : return GF_OK;
8373 2 : case 5:
8374 2 : info->name = "visibilityLimit";
8375 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8376 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
8377 2 : info->far_ptr = & ((X_NavigationInfo *) node)->visibilityLimit;
8378 2 : return GF_OK;
8379 2 : case 6:
8380 2 : info->name = "isBound";
8381 2 : info->eventType = GF_SG_EVENT_OUT;
8382 2 : info->fieldType = GF_SG_VRML_SFBOOL;
8383 2 : info->far_ptr = & ((X_NavigationInfo *) node)->isBound;
8384 2 : return GF_OK;
8385 2 : case 7:
8386 2 : info->name = "metadata";
8387 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8388 2 : info->fieldType = GF_SG_VRML_SFNODE;
8389 2 : info->NDTtype = NDT_SFMetadataNode;
8390 2 : info->far_ptr = & ((X_NavigationInfo *)node)->metadata;
8391 2 : return GF_OK;
8392 2 : case 8:
8393 2 : info->name = "transitionType";
8394 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8395 2 : info->fieldType = GF_SG_VRML_MFSTRING;
8396 2 : info->far_ptr = & ((X_NavigationInfo *) node)->transitionType;
8397 2 : return GF_OK;
8398 2 : case 9:
8399 2 : info->name = "bindTime";
8400 2 : info->eventType = GF_SG_EVENT_OUT;
8401 2 : info->fieldType = GF_SG_VRML_SFTIME;
8402 2 : info->far_ptr = & ((X_NavigationInfo *) node)->bindTime;
8403 2 : return GF_OK;
8404 : default:
8405 : return GF_BAD_PARAM;
8406 : }
8407 : }
8408 :
8409 :
8410 11 : static s32 NavigationInfo_get_field_index_by_name(char *name)
8411 : {
8412 11 : if (!strcmp("set_bind", name)) return 0;
8413 10 : if (!strcmp("avatarSize", name)) return 1;
8414 9 : if (!strcmp("headlight", name)) return 2;
8415 8 : if (!strcmp("speed", name)) return 3;
8416 7 : if (!strcmp("type", name)) return 4;
8417 5 : if (!strcmp("visibilityLimit", name)) return 5;
8418 4 : if (!strcmp("isBound", name)) return 6;
8419 3 : if (!strcmp("metadata", name)) return 7;
8420 2 : if (!strcmp("transitionType", name)) return 8;
8421 1 : if (!strcmp("bindTime", name)) return 9;
8422 0 : return -1;
8423 : }
8424 :
8425 :
8426 2 : static GF_Node *NavigationInfo_Create()
8427 : {
8428 : X_NavigationInfo *p;
8429 2 : GF_SAFEALLOC(p, X_NavigationInfo);
8430 2 : if(!p) return NULL;
8431 2 : gf_node_setup((GF_Node *)p, TAG_X3D_NavigationInfo);
8432 :
8433 : /*default field values*/
8434 2 : p->avatarSize.vals = (SFFloat *)gf_malloc(sizeof(SFFloat)*3);
8435 2 : p->avatarSize.count = 3;
8436 2 : p->avatarSize.vals[0] = FLT2FIX(0.25);
8437 2 : p->avatarSize.vals[1] = FLT2FIX(1.6);
8438 2 : p->avatarSize.vals[2] = FLT2FIX(0.75);
8439 2 : p->headlight = 1;
8440 2 : p->speed = FLT2FIX(1.0);
8441 2 : p->type.vals = (char**)gf_malloc(sizeof(SFString)*2);
8442 2 : p->type.count = 2;
8443 2 : p->type.vals[0] = (char*)gf_malloc(sizeof(char) * 5);
8444 2 : strcpy(p->type.vals[0], "WALK");
8445 2 : p->type.vals[1] = (char*)gf_malloc(sizeof(char) * 4);
8446 2 : strcpy(p->type.vals[1], "ANY");
8447 2 : p->visibilityLimit = FLT2FIX(0.0);
8448 2 : p->transitionType.vals = (char**)gf_malloc(sizeof(SFString)*2);
8449 2 : p->transitionType.count = 2;
8450 2 : p->transitionType.vals[0] = (char*)gf_malloc(sizeof(char) * 5);
8451 2 : strcpy(p->transitionType.vals[0], "WALK");
8452 2 : p->transitionType.vals[1] = (char*)gf_malloc(sizeof(char) * 4);
8453 2 : strcpy(p->transitionType.vals[1], "ANY");
8454 2 : return (GF_Node *)p;
8455 : }
8456 :
8457 :
8458 : /*
8459 : Normal Node deletion
8460 : */
8461 :
8462 1 : static void Normal_Del(GF_Node *node)
8463 : {
8464 : X_Normal *p = (X_Normal *) node;
8465 1 : gf_sg_mfvec3f_del(p->vector);
8466 1 : gf_node_unregister((GF_Node *) p->metadata, node);
8467 1 : gf_node_free((GF_Node *)p);
8468 1 : }
8469 :
8470 :
8471 : static u32 Normal_get_field_count(GF_Node *node, u8 dummy)
8472 : {
8473 : return 2;
8474 : }
8475 :
8476 : static GF_Err Normal_get_field(GF_Node *node, GF_FieldInfo *info)
8477 : {
8478 4 : switch (info->fieldIndex) {
8479 2 : case 0:
8480 2 : info->name = "vector";
8481 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8482 2 : info->fieldType = GF_SG_VRML_MFVEC3F;
8483 2 : info->far_ptr = & ((X_Normal *) node)->vector;
8484 : return GF_OK;
8485 2 : case 1:
8486 2 : info->name = "metadata";
8487 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8488 2 : info->fieldType = GF_SG_VRML_SFNODE;
8489 2 : info->NDTtype = NDT_SFMetadataNode;
8490 2 : info->far_ptr = & ((X_Normal *)node)->metadata;
8491 : return GF_OK;
8492 : default:
8493 : return GF_BAD_PARAM;
8494 : }
8495 : }
8496 :
8497 :
8498 2 : static s32 Normal_get_field_index_by_name(char *name)
8499 : {
8500 2 : if (!strcmp("vector", name)) return 0;
8501 1 : if (!strcmp("metadata", name)) return 1;
8502 0 : return -1;
8503 : }
8504 :
8505 :
8506 1 : static GF_Node *Normal_Create()
8507 : {
8508 : X_Normal *p;
8509 1 : GF_SAFEALLOC(p, X_Normal);
8510 1 : if(!p) return NULL;
8511 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Normal);
8512 :
8513 : /*default field values*/
8514 1 : return (GF_Node *)p;
8515 : }
8516 :
8517 :
8518 : /*
8519 : NormalInterpolator Node deletion
8520 : */
8521 :
8522 1 : static void NormalInterpolator_Del(GF_Node *node)
8523 : {
8524 : X_NormalInterpolator *p = (X_NormalInterpolator *) node;
8525 1 : gf_sg_mffloat_del(p->key);
8526 1 : gf_sg_mfvec3f_del(p->keyValue);
8527 1 : gf_sg_mfvec3f_del(p->value_changed);
8528 1 : gf_node_unregister((GF_Node *) p->metadata, node);
8529 1 : gf_node_free((GF_Node *)p);
8530 1 : }
8531 :
8532 :
8533 : static u32 NormalInterpolator_get_field_count(GF_Node *node, u8 dummy)
8534 : {
8535 : return 5;
8536 : }
8537 :
8538 10 : static GF_Err NormalInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
8539 : {
8540 10 : switch (info->fieldIndex) {
8541 2 : case 0:
8542 2 : info->name = "set_fraction";
8543 2 : info->eventType = GF_SG_EVENT_IN;
8544 2 : info->on_event_in = ((X_NormalInterpolator *)node)->on_set_fraction;
8545 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
8546 2 : info->far_ptr = & ((X_NormalInterpolator *) node)->set_fraction;
8547 2 : return GF_OK;
8548 2 : case 1:
8549 2 : info->name = "key";
8550 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8551 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
8552 2 : info->far_ptr = & ((X_NormalInterpolator *) node)->key;
8553 2 : return GF_OK;
8554 2 : case 2:
8555 2 : info->name = "keyValue";
8556 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8557 2 : info->fieldType = GF_SG_VRML_MFVEC3F;
8558 2 : info->far_ptr = & ((X_NormalInterpolator *) node)->keyValue;
8559 2 : return GF_OK;
8560 2 : case 3:
8561 2 : info->name = "value_changed";
8562 2 : info->eventType = GF_SG_EVENT_OUT;
8563 2 : info->fieldType = GF_SG_VRML_MFVEC3F;
8564 2 : info->far_ptr = & ((X_NormalInterpolator *) node)->value_changed;
8565 2 : return GF_OK;
8566 2 : case 4:
8567 2 : info->name = "metadata";
8568 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8569 2 : info->fieldType = GF_SG_VRML_SFNODE;
8570 2 : info->NDTtype = NDT_SFMetadataNode;
8571 2 : info->far_ptr = & ((X_NormalInterpolator *)node)->metadata;
8572 2 : return GF_OK;
8573 : default:
8574 : return GF_BAD_PARAM;
8575 : }
8576 : }
8577 :
8578 :
8579 5 : static s32 NormalInterpolator_get_field_index_by_name(char *name)
8580 : {
8581 5 : if (!strcmp("set_fraction", name)) return 0;
8582 4 : if (!strcmp("key", name)) return 1;
8583 3 : if (!strcmp("keyValue", name)) return 2;
8584 2 : if (!strcmp("value_changed", name)) return 3;
8585 1 : if (!strcmp("metadata", name)) return 4;
8586 0 : return -1;
8587 : }
8588 :
8589 :
8590 1 : static GF_Node *NormalInterpolator_Create()
8591 : {
8592 : X_NormalInterpolator *p;
8593 1 : GF_SAFEALLOC(p, X_NormalInterpolator);
8594 1 : if(!p) return NULL;
8595 1 : gf_node_setup((GF_Node *)p, TAG_X3D_NormalInterpolator);
8596 :
8597 : /*default field values*/
8598 1 : return (GF_Node *)p;
8599 : }
8600 :
8601 :
8602 : /*
8603 : NurbsCurve Node deletion
8604 : */
8605 :
8606 1 : static void NurbsCurve_Del(GF_Node *node)
8607 : {
8608 : X_NurbsCurve *p = (X_NurbsCurve *) node;
8609 1 : gf_sg_mfvec3f_del(p->controlPoint);
8610 1 : gf_sg_mfdouble_del(p->weight);
8611 1 : gf_sg_mffloat_del(p->knot);
8612 1 : gf_node_unregister((GF_Node *) p->metadata, node);
8613 1 : gf_node_free((GF_Node *)p);
8614 1 : }
8615 :
8616 :
8617 : static u32 NurbsCurve_get_field_count(GF_Node *node, u8 dummy)
8618 : {
8619 : return 7;
8620 : }
8621 :
8622 14 : static GF_Err NurbsCurve_get_field(GF_Node *node, GF_FieldInfo *info)
8623 : {
8624 14 : switch (info->fieldIndex) {
8625 2 : case 0:
8626 2 : info->name = "controlPoint";
8627 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8628 2 : info->fieldType = GF_SG_VRML_MFVEC3F;
8629 2 : info->far_ptr = & ((X_NurbsCurve *) node)->controlPoint;
8630 2 : return GF_OK;
8631 2 : case 1:
8632 2 : info->name = "tessellation";
8633 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8634 2 : info->fieldType = GF_SG_VRML_SFINT32;
8635 2 : info->far_ptr = & ((X_NurbsCurve *) node)->tessellation;
8636 2 : return GF_OK;
8637 2 : case 2:
8638 2 : info->name = "weight";
8639 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8640 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
8641 2 : info->far_ptr = & ((X_NurbsCurve *) node)->weight;
8642 2 : return GF_OK;
8643 2 : case 3:
8644 2 : info->name = "closed";
8645 2 : info->eventType = GF_SG_EVENT_FIELD;
8646 2 : info->fieldType = GF_SG_VRML_SFBOOL;
8647 2 : info->far_ptr = & ((X_NurbsCurve *) node)->closed;
8648 2 : return GF_OK;
8649 2 : case 4:
8650 2 : info->name = "knot";
8651 2 : info->eventType = GF_SG_EVENT_FIELD;
8652 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
8653 2 : info->far_ptr = & ((X_NurbsCurve *) node)->knot;
8654 2 : return GF_OK;
8655 2 : case 5:
8656 2 : info->name = "order";
8657 2 : info->eventType = GF_SG_EVENT_FIELD;
8658 2 : info->fieldType = GF_SG_VRML_SFINT32;
8659 2 : info->far_ptr = & ((X_NurbsCurve *) node)->order;
8660 2 : return GF_OK;
8661 2 : case 6:
8662 2 : info->name = "metadata";
8663 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8664 2 : info->fieldType = GF_SG_VRML_SFNODE;
8665 2 : info->NDTtype = NDT_SFMetadataNode;
8666 2 : info->far_ptr = & ((X_NurbsCurve *)node)->metadata;
8667 2 : return GF_OK;
8668 : default:
8669 : return GF_BAD_PARAM;
8670 : }
8671 : }
8672 :
8673 :
8674 7 : static s32 NurbsCurve_get_field_index_by_name(char *name)
8675 : {
8676 7 : if (!strcmp("controlPoint", name)) return 0;
8677 6 : if (!strcmp("tessellation", name)) return 1;
8678 5 : if (!strcmp("weight", name)) return 2;
8679 4 : if (!strcmp("closed", name)) return 3;
8680 3 : if (!strcmp("knot", name)) return 4;
8681 2 : if (!strcmp("order", name)) return 5;
8682 1 : if (!strcmp("metadata", name)) return 6;
8683 0 : return -1;
8684 : }
8685 :
8686 :
8687 1 : static GF_Node *NurbsCurve_Create()
8688 : {
8689 : X_NurbsCurve *p;
8690 1 : GF_SAFEALLOC(p, X_NurbsCurve);
8691 1 : if(!p) return NULL;
8692 1 : gf_node_setup((GF_Node *)p, TAG_X3D_NurbsCurve);
8693 :
8694 : /*default field values*/
8695 1 : p->tessellation = 0;
8696 1 : p->order = 3;
8697 1 : return (GF_Node *)p;
8698 : }
8699 :
8700 :
8701 : /*
8702 : NurbsCurve2D Node deletion
8703 : */
8704 :
8705 1 : static void NurbsCurve2D_Del(GF_Node *node)
8706 : {
8707 : X_NurbsCurve2D *p = (X_NurbsCurve2D *) node;
8708 1 : gf_sg_mfvec2f_del(p->controlPoint);
8709 1 : gf_sg_mffloat_del(p->weight);
8710 1 : gf_sg_mffloat_del(p->knot);
8711 1 : gf_node_unregister((GF_Node *) p->metadata, node);
8712 1 : gf_node_free((GF_Node *)p);
8713 1 : }
8714 :
8715 :
8716 : static u32 NurbsCurve2D_get_field_count(GF_Node *node, u8 dummy)
8717 : {
8718 : return 7;
8719 : }
8720 :
8721 14 : static GF_Err NurbsCurve2D_get_field(GF_Node *node, GF_FieldInfo *info)
8722 : {
8723 14 : switch (info->fieldIndex) {
8724 2 : case 0:
8725 2 : info->name = "controlPoint";
8726 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8727 2 : info->fieldType = GF_SG_VRML_MFVEC2F;
8728 2 : info->far_ptr = & ((X_NurbsCurve2D *) node)->controlPoint;
8729 2 : return GF_OK;
8730 2 : case 1:
8731 2 : info->name = "tessellation";
8732 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8733 2 : info->fieldType = GF_SG_VRML_SFINT32;
8734 2 : info->far_ptr = & ((X_NurbsCurve2D *) node)->tessellation;
8735 2 : return GF_OK;
8736 2 : case 2:
8737 2 : info->name = "weight";
8738 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8739 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
8740 2 : info->far_ptr = & ((X_NurbsCurve2D *) node)->weight;
8741 2 : return GF_OK;
8742 2 : case 3:
8743 2 : info->name = "knot";
8744 2 : info->eventType = GF_SG_EVENT_FIELD;
8745 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
8746 2 : info->far_ptr = & ((X_NurbsCurve2D *) node)->knot;
8747 2 : return GF_OK;
8748 2 : case 4:
8749 2 : info->name = "order";
8750 2 : info->eventType = GF_SG_EVENT_FIELD;
8751 2 : info->fieldType = GF_SG_VRML_SFINT32;
8752 2 : info->far_ptr = & ((X_NurbsCurve2D *) node)->order;
8753 2 : return GF_OK;
8754 2 : case 5:
8755 2 : info->name = "closed";
8756 2 : info->eventType = GF_SG_EVENT_FIELD;
8757 2 : info->fieldType = GF_SG_VRML_SFBOOL;
8758 2 : info->far_ptr = & ((X_NurbsCurve2D *) node)->closed;
8759 2 : return GF_OK;
8760 2 : case 6:
8761 2 : info->name = "metadata";
8762 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8763 2 : info->fieldType = GF_SG_VRML_SFNODE;
8764 2 : info->NDTtype = NDT_SFMetadataNode;
8765 2 : info->far_ptr = & ((X_NurbsCurve2D *)node)->metadata;
8766 2 : return GF_OK;
8767 : default:
8768 : return GF_BAD_PARAM;
8769 : }
8770 : }
8771 :
8772 :
8773 7 : static s32 NurbsCurve2D_get_field_index_by_name(char *name)
8774 : {
8775 7 : if (!strcmp("controlPoint", name)) return 0;
8776 6 : if (!strcmp("tessellation", name)) return 1;
8777 5 : if (!strcmp("weight", name)) return 2;
8778 4 : if (!strcmp("knot", name)) return 3;
8779 3 : if (!strcmp("order", name)) return 4;
8780 2 : if (!strcmp("closed", name)) return 5;
8781 1 : if (!strcmp("metadata", name)) return 6;
8782 0 : return -1;
8783 : }
8784 :
8785 :
8786 1 : static GF_Node *NurbsCurve2D_Create()
8787 : {
8788 : X_NurbsCurve2D *p;
8789 1 : GF_SAFEALLOC(p, X_NurbsCurve2D);
8790 1 : if(!p) return NULL;
8791 1 : gf_node_setup((GF_Node *)p, TAG_X3D_NurbsCurve2D);
8792 :
8793 : /*default field values*/
8794 1 : p->tessellation = 0;
8795 1 : p->order = 3;
8796 1 : return (GF_Node *)p;
8797 : }
8798 :
8799 :
8800 : /*
8801 : NurbsOrientationInterpolator Node deletion
8802 : */
8803 :
8804 1 : static void NurbsOrientationInterpolator_Del(GF_Node *node)
8805 : {
8806 : X_NurbsOrientationInterpolator *p = (X_NurbsOrientationInterpolator *) node;
8807 1 : gf_node_unregister((GF_Node *) p->controlPoints, node);
8808 1 : gf_sg_mfdouble_del(p->knot);
8809 1 : gf_sg_mfdouble_del(p->weight);
8810 1 : gf_node_unregister((GF_Node *) p->metadata, node);
8811 1 : gf_node_free((GF_Node *)p);
8812 1 : }
8813 :
8814 :
8815 : static u32 NurbsOrientationInterpolator_get_field_count(GF_Node *node, u8 dummy)
8816 : {
8817 : return 7;
8818 : }
8819 :
8820 14 : static GF_Err NurbsOrientationInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
8821 : {
8822 14 : switch (info->fieldIndex) {
8823 2 : case 0:
8824 2 : info->name = "set_fraction";
8825 2 : info->eventType = GF_SG_EVENT_IN;
8826 2 : info->on_event_in = ((X_NurbsOrientationInterpolator *)node)->on_set_fraction;
8827 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
8828 2 : info->far_ptr = & ((X_NurbsOrientationInterpolator *) node)->set_fraction;
8829 2 : return GF_OK;
8830 2 : case 1:
8831 2 : info->name = "controlPoints";
8832 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8833 2 : info->fieldType = GF_SG_VRML_SFNODE;
8834 2 : info->NDTtype = NDT_SFCoordinateNode;
8835 2 : info->far_ptr = & ((X_NurbsOrientationInterpolator *)node)->controlPoints;
8836 2 : return GF_OK;
8837 2 : case 2:
8838 2 : info->name = "knot";
8839 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8840 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
8841 2 : info->far_ptr = & ((X_NurbsOrientationInterpolator *) node)->knot;
8842 2 : return GF_OK;
8843 2 : case 3:
8844 2 : info->name = "order";
8845 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8846 2 : info->fieldType = GF_SG_VRML_SFINT32;
8847 2 : info->far_ptr = & ((X_NurbsOrientationInterpolator *) node)->order;
8848 2 : return GF_OK;
8849 2 : case 4:
8850 2 : info->name = "weight";
8851 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8852 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
8853 2 : info->far_ptr = & ((X_NurbsOrientationInterpolator *) node)->weight;
8854 2 : return GF_OK;
8855 2 : case 5:
8856 2 : info->name = "value_changed";
8857 2 : info->eventType = GF_SG_EVENT_OUT;
8858 2 : info->fieldType = GF_SG_VRML_SFROTATION;
8859 2 : info->far_ptr = & ((X_NurbsOrientationInterpolator *) node)->value_changed;
8860 2 : return GF_OK;
8861 2 : case 6:
8862 2 : info->name = "metadata";
8863 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8864 2 : info->fieldType = GF_SG_VRML_SFNODE;
8865 2 : info->NDTtype = NDT_SFMetadataNode;
8866 2 : info->far_ptr = & ((X_NurbsOrientationInterpolator *)node)->metadata;
8867 2 : return GF_OK;
8868 : default:
8869 : return GF_BAD_PARAM;
8870 : }
8871 : }
8872 :
8873 :
8874 7 : static s32 NurbsOrientationInterpolator_get_field_index_by_name(char *name)
8875 : {
8876 7 : if (!strcmp("set_fraction", name)) return 0;
8877 6 : if (!strcmp("controlPoints", name)) return 1;
8878 5 : if (!strcmp("knot", name)) return 2;
8879 4 : if (!strcmp("order", name)) return 3;
8880 3 : if (!strcmp("weight", name)) return 4;
8881 2 : if (!strcmp("value_changed", name)) return 5;
8882 1 : if (!strcmp("metadata", name)) return 6;
8883 0 : return -1;
8884 : }
8885 :
8886 :
8887 1 : static GF_Node *NurbsOrientationInterpolator_Create()
8888 : {
8889 : X_NurbsOrientationInterpolator *p;
8890 1 : GF_SAFEALLOC(p, X_NurbsOrientationInterpolator);
8891 1 : if(!p) return NULL;
8892 1 : gf_node_setup((GF_Node *)p, TAG_X3D_NurbsOrientationInterpolator);
8893 :
8894 : /*default field values*/
8895 1 : p->order = 3;
8896 1 : return (GF_Node *)p;
8897 : }
8898 :
8899 :
8900 : /*
8901 : NurbsPatchSurface Node deletion
8902 : */
8903 :
8904 1 : static void NurbsPatchSurface_Del(GF_Node *node)
8905 : {
8906 : X_NurbsPatchSurface *p = (X_NurbsPatchSurface *) node;
8907 1 : gf_node_unregister((GF_Node *) p->controlPoint, node);
8908 1 : gf_node_unregister((GF_Node *) p->texCoord, node);
8909 1 : gf_sg_mfdouble_del(p->weight);
8910 1 : gf_sg_mfdouble_del(p->uKnot);
8911 1 : gf_sg_mfdouble_del(p->vKnot);
8912 1 : gf_node_unregister((GF_Node *) p->metadata, node);
8913 1 : gf_node_free((GF_Node *)p);
8914 1 : }
8915 :
8916 :
8917 : static u32 NurbsPatchSurface_get_field_count(GF_Node *node, u8 dummy)
8918 : {
8919 : return 15;
8920 : }
8921 :
8922 30 : static GF_Err NurbsPatchSurface_get_field(GF_Node *node, GF_FieldInfo *info)
8923 : {
8924 30 : switch (info->fieldIndex) {
8925 2 : case 0:
8926 2 : info->name = "controlPoint";
8927 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8928 2 : info->fieldType = GF_SG_VRML_SFNODE;
8929 2 : info->NDTtype = NDT_SFCoordinateNode;
8930 2 : info->far_ptr = & ((X_NurbsPatchSurface *)node)->controlPoint;
8931 2 : return GF_OK;
8932 2 : case 1:
8933 2 : info->name = "texCoord";
8934 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8935 2 : info->fieldType = GF_SG_VRML_SFNODE;
8936 2 : info->NDTtype = NDT_SFTextureCoordinateNode;
8937 2 : info->far_ptr = & ((X_NurbsPatchSurface *)node)->texCoord;
8938 2 : return GF_OK;
8939 2 : case 2:
8940 2 : info->name = "uTessellation";
8941 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8942 2 : info->fieldType = GF_SG_VRML_SFINT32;
8943 2 : info->far_ptr = & ((X_NurbsPatchSurface *) node)->uTessellation;
8944 2 : return GF_OK;
8945 2 : case 3:
8946 2 : info->name = "vTessellation";
8947 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8948 2 : info->fieldType = GF_SG_VRML_SFINT32;
8949 2 : info->far_ptr = & ((X_NurbsPatchSurface *) node)->vTessellation;
8950 2 : return GF_OK;
8951 2 : case 4:
8952 2 : info->name = "weight";
8953 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8954 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
8955 2 : info->far_ptr = & ((X_NurbsPatchSurface *) node)->weight;
8956 2 : return GF_OK;
8957 2 : case 5:
8958 2 : info->name = "solid";
8959 2 : info->eventType = GF_SG_EVENT_FIELD;
8960 2 : info->fieldType = GF_SG_VRML_SFBOOL;
8961 2 : info->far_ptr = & ((X_NurbsPatchSurface *) node)->solid;
8962 2 : return GF_OK;
8963 2 : case 6:
8964 2 : info->name = "uClosed";
8965 2 : info->eventType = GF_SG_EVENT_FIELD;
8966 2 : info->fieldType = GF_SG_VRML_SFBOOL;
8967 2 : info->far_ptr = & ((X_NurbsPatchSurface *) node)->uClosed;
8968 2 : return GF_OK;
8969 2 : case 7:
8970 2 : info->name = "uDimension";
8971 2 : info->eventType = GF_SG_EVENT_FIELD;
8972 2 : info->fieldType = GF_SG_VRML_SFINT32;
8973 2 : info->far_ptr = & ((X_NurbsPatchSurface *) node)->uDimension;
8974 2 : return GF_OK;
8975 2 : case 8:
8976 2 : info->name = "uKnot";
8977 2 : info->eventType = GF_SG_EVENT_FIELD;
8978 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
8979 2 : info->far_ptr = & ((X_NurbsPatchSurface *) node)->uKnot;
8980 2 : return GF_OK;
8981 2 : case 9:
8982 2 : info->name = "uOrder";
8983 2 : info->eventType = GF_SG_EVENT_FIELD;
8984 2 : info->fieldType = GF_SG_VRML_SFINT32;
8985 2 : info->far_ptr = & ((X_NurbsPatchSurface *) node)->uOrder;
8986 2 : return GF_OK;
8987 2 : case 10:
8988 2 : info->name = "vClosed";
8989 2 : info->eventType = GF_SG_EVENT_FIELD;
8990 2 : info->fieldType = GF_SG_VRML_SFBOOL;
8991 2 : info->far_ptr = & ((X_NurbsPatchSurface *) node)->vClosed;
8992 2 : return GF_OK;
8993 2 : case 11:
8994 2 : info->name = "vDimension";
8995 2 : info->eventType = GF_SG_EVENT_FIELD;
8996 2 : info->fieldType = GF_SG_VRML_SFINT32;
8997 2 : info->far_ptr = & ((X_NurbsPatchSurface *) node)->vDimension;
8998 2 : return GF_OK;
8999 2 : case 12:
9000 2 : info->name = "vKnot";
9001 2 : info->eventType = GF_SG_EVENT_FIELD;
9002 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
9003 2 : info->far_ptr = & ((X_NurbsPatchSurface *) node)->vKnot;
9004 2 : return GF_OK;
9005 2 : case 13:
9006 2 : info->name = "vOrder";
9007 2 : info->eventType = GF_SG_EVENT_FIELD;
9008 2 : info->fieldType = GF_SG_VRML_SFINT32;
9009 2 : info->far_ptr = & ((X_NurbsPatchSurface *) node)->vOrder;
9010 2 : return GF_OK;
9011 2 : case 14:
9012 2 : info->name = "metadata";
9013 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9014 2 : info->fieldType = GF_SG_VRML_SFNODE;
9015 2 : info->NDTtype = NDT_SFMetadataNode;
9016 2 : info->far_ptr = & ((X_NurbsPatchSurface *)node)->metadata;
9017 2 : return GF_OK;
9018 : default:
9019 : return GF_BAD_PARAM;
9020 : }
9021 : }
9022 :
9023 :
9024 15 : static s32 NurbsPatchSurface_get_field_index_by_name(char *name)
9025 : {
9026 15 : if (!strcmp("controlPoint", name)) return 0;
9027 14 : if (!strcmp("texCoord", name)) return 1;
9028 13 : if (!strcmp("uTessellation", name)) return 2;
9029 12 : if (!strcmp("vTessellation", name)) return 3;
9030 11 : if (!strcmp("weight", name)) return 4;
9031 10 : if (!strcmp("solid", name)) return 5;
9032 9 : if (!strcmp("uClosed", name)) return 6;
9033 8 : if (!strcmp("uDimension", name)) return 7;
9034 7 : if (!strcmp("uKnot", name)) return 8;
9035 6 : if (!strcmp("uOrder", name)) return 9;
9036 5 : if (!strcmp("vClosed", name)) return 10;
9037 4 : if (!strcmp("vDimension", name)) return 11;
9038 3 : if (!strcmp("vKnot", name)) return 12;
9039 2 : if (!strcmp("vOrder", name)) return 13;
9040 1 : if (!strcmp("metadata", name)) return 14;
9041 0 : return -1;
9042 : }
9043 :
9044 :
9045 1 : static GF_Node *NurbsPatchSurface_Create()
9046 : {
9047 : X_NurbsPatchSurface *p;
9048 1 : GF_SAFEALLOC(p, X_NurbsPatchSurface);
9049 1 : if(!p) return NULL;
9050 1 : gf_node_setup((GF_Node *)p, TAG_X3D_NurbsPatchSurface);
9051 :
9052 : /*default field values*/
9053 1 : p->uTessellation = 0;
9054 1 : p->vTessellation = 0;
9055 1 : p->solid = 1;
9056 1 : p->uDimension = 0;
9057 1 : p->uOrder = 3;
9058 1 : p->vDimension = 0;
9059 1 : p->vOrder = 3;
9060 1 : return (GF_Node *)p;
9061 : }
9062 :
9063 :
9064 : /*
9065 : NurbsPositionInterpolator Node deletion
9066 : */
9067 :
9068 1 : static void NurbsPositionInterpolator_Del(GF_Node *node)
9069 : {
9070 : X_NurbsPositionInterpolator *p = (X_NurbsPositionInterpolator *) node;
9071 1 : gf_node_unregister((GF_Node *) p->controlPoints, node);
9072 1 : gf_sg_mfdouble_del(p->knot);
9073 1 : gf_sg_mfdouble_del(p->weight);
9074 1 : gf_node_unregister((GF_Node *) p->metadata, node);
9075 1 : gf_node_free((GF_Node *)p);
9076 1 : }
9077 :
9078 :
9079 : static u32 NurbsPositionInterpolator_get_field_count(GF_Node *node, u8 dummy)
9080 : {
9081 : return 7;
9082 : }
9083 :
9084 14 : static GF_Err NurbsPositionInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
9085 : {
9086 14 : switch (info->fieldIndex) {
9087 2 : case 0:
9088 2 : info->name = "set_fraction";
9089 2 : info->eventType = GF_SG_EVENT_IN;
9090 2 : info->on_event_in = ((X_NurbsPositionInterpolator *)node)->on_set_fraction;
9091 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
9092 2 : info->far_ptr = & ((X_NurbsPositionInterpolator *) node)->set_fraction;
9093 2 : return GF_OK;
9094 2 : case 1:
9095 2 : info->name = "controlPoints";
9096 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9097 2 : info->fieldType = GF_SG_VRML_SFNODE;
9098 2 : info->NDTtype = NDT_SFCoordinateNode;
9099 2 : info->far_ptr = & ((X_NurbsPositionInterpolator *)node)->controlPoints;
9100 2 : return GF_OK;
9101 2 : case 2:
9102 2 : info->name = "knot";
9103 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9104 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
9105 2 : info->far_ptr = & ((X_NurbsPositionInterpolator *) node)->knot;
9106 2 : return GF_OK;
9107 2 : case 3:
9108 2 : info->name = "order";
9109 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9110 2 : info->fieldType = GF_SG_VRML_SFINT32;
9111 2 : info->far_ptr = & ((X_NurbsPositionInterpolator *) node)->order;
9112 2 : return GF_OK;
9113 2 : case 4:
9114 2 : info->name = "weight";
9115 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9116 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
9117 2 : info->far_ptr = & ((X_NurbsPositionInterpolator *) node)->weight;
9118 2 : return GF_OK;
9119 2 : case 5:
9120 2 : info->name = "value_changed";
9121 2 : info->eventType = GF_SG_EVENT_OUT;
9122 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
9123 2 : info->far_ptr = & ((X_NurbsPositionInterpolator *) node)->value_changed;
9124 2 : return GF_OK;
9125 2 : case 6:
9126 2 : info->name = "metadata";
9127 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9128 2 : info->fieldType = GF_SG_VRML_SFNODE;
9129 2 : info->NDTtype = NDT_SFMetadataNode;
9130 2 : info->far_ptr = & ((X_NurbsPositionInterpolator *)node)->metadata;
9131 2 : return GF_OK;
9132 : default:
9133 : return GF_BAD_PARAM;
9134 : }
9135 : }
9136 :
9137 :
9138 7 : static s32 NurbsPositionInterpolator_get_field_index_by_name(char *name)
9139 : {
9140 7 : if (!strcmp("set_fraction", name)) return 0;
9141 6 : if (!strcmp("controlPoints", name)) return 1;
9142 5 : if (!strcmp("knot", name)) return 2;
9143 4 : if (!strcmp("order", name)) return 3;
9144 3 : if (!strcmp("weight", name)) return 4;
9145 2 : if (!strcmp("value_changed", name)) return 5;
9146 1 : if (!strcmp("metadata", name)) return 6;
9147 0 : return -1;
9148 : }
9149 :
9150 :
9151 1 : static GF_Node *NurbsPositionInterpolator_Create()
9152 : {
9153 : X_NurbsPositionInterpolator *p;
9154 1 : GF_SAFEALLOC(p, X_NurbsPositionInterpolator);
9155 1 : if(!p) return NULL;
9156 1 : gf_node_setup((GF_Node *)p, TAG_X3D_NurbsPositionInterpolator);
9157 :
9158 : /*default field values*/
9159 1 : p->order = 3;
9160 1 : return (GF_Node *)p;
9161 : }
9162 :
9163 :
9164 : /*
9165 : NurbsSet Node deletion
9166 : */
9167 :
9168 1 : static void NurbsSet_Del(GF_Node *node)
9169 : {
9170 : X_NurbsSet *p = (X_NurbsSet *) node;
9171 1 : gf_node_unregister_children(node, p->addGeometry);
9172 1 : gf_node_unregister_children(node, p->removeGeometry);
9173 1 : gf_node_unregister_children(node, p->geometry);
9174 1 : gf_node_unregister((GF_Node *) p->metadata, node);
9175 1 : gf_node_free((GF_Node *)p);
9176 1 : }
9177 :
9178 :
9179 : static u32 NurbsSet_get_field_count(GF_Node *node, u8 dummy)
9180 : {
9181 : return 5;
9182 : }
9183 :
9184 10 : static GF_Err NurbsSet_get_field(GF_Node *node, GF_FieldInfo *info)
9185 : {
9186 10 : switch (info->fieldIndex) {
9187 2 : case 0:
9188 2 : info->name = "addGeometry";
9189 2 : info->eventType = GF_SG_EVENT_IN;
9190 2 : info->on_event_in = ((X_NurbsSet *)node)->on_addGeometry;
9191 2 : info->fieldType = GF_SG_VRML_MFNODE;
9192 2 : info->NDTtype = NDT_SFNurbsSurfaceNode;
9193 2 : info->far_ptr = & ((X_NurbsSet *)node)->addGeometry;
9194 2 : return GF_OK;
9195 2 : case 1:
9196 2 : info->name = "removeGeometry";
9197 2 : info->eventType = GF_SG_EVENT_IN;
9198 2 : info->on_event_in = ((X_NurbsSet *)node)->on_removeGeometry;
9199 2 : info->fieldType = GF_SG_VRML_MFNODE;
9200 2 : info->NDTtype = NDT_SFNurbsSurfaceNode;
9201 2 : info->far_ptr = & ((X_NurbsSet *)node)->removeGeometry;
9202 2 : return GF_OK;
9203 2 : case 2:
9204 2 : info->name = "geometry";
9205 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9206 2 : info->fieldType = GF_SG_VRML_MFNODE;
9207 2 : info->NDTtype = NDT_SFNurbsSurfaceNode;
9208 2 : info->far_ptr = & ((X_NurbsSet *)node)->geometry;
9209 2 : return GF_OK;
9210 2 : case 3:
9211 2 : info->name = "tessellationScale";
9212 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9213 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
9214 2 : info->far_ptr = & ((X_NurbsSet *) node)->tessellationScale;
9215 2 : return GF_OK;
9216 2 : case 4:
9217 2 : info->name = "metadata";
9218 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9219 2 : info->fieldType = GF_SG_VRML_SFNODE;
9220 2 : info->NDTtype = NDT_SFMetadataNode;
9221 2 : info->far_ptr = & ((X_NurbsSet *)node)->metadata;
9222 2 : return GF_OK;
9223 : default:
9224 : return GF_BAD_PARAM;
9225 : }
9226 : }
9227 :
9228 :
9229 5 : static s32 NurbsSet_get_field_index_by_name(char *name)
9230 : {
9231 5 : if (!strcmp("addGeometry", name)) return 0;
9232 4 : if (!strcmp("removeGeometry", name)) return 1;
9233 3 : if (!strcmp("geometry", name)) return 2;
9234 2 : if (!strcmp("tessellationScale", name)) return 3;
9235 1 : if (!strcmp("metadata", name)) return 4;
9236 0 : return -1;
9237 : }
9238 :
9239 :
9240 1 : static GF_Node *NurbsSet_Create()
9241 : {
9242 : X_NurbsSet *p;
9243 1 : GF_SAFEALLOC(p, X_NurbsSet);
9244 1 : if(!p) return NULL;
9245 1 : gf_node_setup((GF_Node *)p, TAG_X3D_NurbsSet);
9246 :
9247 : /*default field values*/
9248 1 : p->tessellationScale = FLT2FIX(1.0);
9249 1 : return (GF_Node *)p;
9250 : }
9251 :
9252 :
9253 : /*
9254 : NurbsSurfaceInterpolator Node deletion
9255 : */
9256 :
9257 1 : static void NurbsSurfaceInterpolator_Del(GF_Node *node)
9258 : {
9259 : X_NurbsSurfaceInterpolator *p = (X_NurbsSurfaceInterpolator *) node;
9260 1 : gf_node_unregister((GF_Node *) p->controlPoints, node);
9261 1 : gf_sg_mfdouble_del(p->weight);
9262 1 : gf_sg_mfdouble_del(p->uKnot);
9263 1 : gf_sg_mfdouble_del(p->vKnot);
9264 1 : gf_node_unregister((GF_Node *) p->metadata, node);
9265 1 : gf_node_free((GF_Node *)p);
9266 1 : }
9267 :
9268 :
9269 : static u32 NurbsSurfaceInterpolator_get_field_count(GF_Node *node, u8 dummy)
9270 : {
9271 : return 12;
9272 : }
9273 :
9274 24 : static GF_Err NurbsSurfaceInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
9275 : {
9276 24 : switch (info->fieldIndex) {
9277 2 : case 0:
9278 2 : info->name = "set_fraction";
9279 2 : info->eventType = GF_SG_EVENT_IN;
9280 2 : info->on_event_in = ((X_NurbsSurfaceInterpolator *)node)->on_set_fraction;
9281 2 : info->fieldType = GF_SG_VRML_SFVEC2F;
9282 2 : info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->set_fraction;
9283 2 : return GF_OK;
9284 2 : case 1:
9285 2 : info->name = "controlPoints";
9286 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9287 2 : info->fieldType = GF_SG_VRML_SFNODE;
9288 2 : info->NDTtype = NDT_SFCoordinateNode;
9289 2 : info->far_ptr = & ((X_NurbsSurfaceInterpolator *)node)->controlPoints;
9290 2 : return GF_OK;
9291 2 : case 2:
9292 2 : info->name = "weight";
9293 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9294 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
9295 2 : info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->weight;
9296 2 : return GF_OK;
9297 2 : case 3:
9298 2 : info->name = "position_changed";
9299 2 : info->eventType = GF_SG_EVENT_OUT;
9300 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
9301 2 : info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->position_changed;
9302 2 : return GF_OK;
9303 2 : case 4:
9304 2 : info->name = "normal_changed";
9305 2 : info->eventType = GF_SG_EVENT_OUT;
9306 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
9307 2 : info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->normal_changed;
9308 2 : return GF_OK;
9309 2 : case 5:
9310 2 : info->name = "uDimension";
9311 2 : info->eventType = GF_SG_EVENT_FIELD;
9312 2 : info->fieldType = GF_SG_VRML_SFINT32;
9313 2 : info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->uDimension;
9314 2 : return GF_OK;
9315 2 : case 6:
9316 2 : info->name = "uKnot";
9317 2 : info->eventType = GF_SG_EVENT_FIELD;
9318 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
9319 2 : info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->uKnot;
9320 2 : return GF_OK;
9321 2 : case 7:
9322 2 : info->name = "uOrder";
9323 2 : info->eventType = GF_SG_EVENT_FIELD;
9324 2 : info->fieldType = GF_SG_VRML_SFINT32;
9325 2 : info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->uOrder;
9326 2 : return GF_OK;
9327 2 : case 8:
9328 2 : info->name = "vDimension";
9329 2 : info->eventType = GF_SG_EVENT_FIELD;
9330 2 : info->fieldType = GF_SG_VRML_SFINT32;
9331 2 : info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->vDimension;
9332 2 : return GF_OK;
9333 2 : case 9:
9334 2 : info->name = "vKnot";
9335 2 : info->eventType = GF_SG_EVENT_FIELD;
9336 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
9337 2 : info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->vKnot;
9338 2 : return GF_OK;
9339 2 : case 10:
9340 2 : info->name = "vOrder";
9341 2 : info->eventType = GF_SG_EVENT_FIELD;
9342 2 : info->fieldType = GF_SG_VRML_SFINT32;
9343 2 : info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->vOrder;
9344 2 : return GF_OK;
9345 2 : case 11:
9346 2 : info->name = "metadata";
9347 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9348 2 : info->fieldType = GF_SG_VRML_SFNODE;
9349 2 : info->NDTtype = NDT_SFMetadataNode;
9350 2 : info->far_ptr = & ((X_NurbsSurfaceInterpolator *)node)->metadata;
9351 2 : return GF_OK;
9352 : default:
9353 : return GF_BAD_PARAM;
9354 : }
9355 : }
9356 :
9357 :
9358 12 : static s32 NurbsSurfaceInterpolator_get_field_index_by_name(char *name)
9359 : {
9360 12 : if (!strcmp("set_fraction", name)) return 0;
9361 11 : if (!strcmp("controlPoints", name)) return 1;
9362 10 : if (!strcmp("weight", name)) return 2;
9363 9 : if (!strcmp("position_changed", name)) return 3;
9364 8 : if (!strcmp("normal_changed", name)) return 4;
9365 7 : if (!strcmp("uDimension", name)) return 5;
9366 6 : if (!strcmp("uKnot", name)) return 6;
9367 5 : if (!strcmp("uOrder", name)) return 7;
9368 4 : if (!strcmp("vDimension", name)) return 8;
9369 3 : if (!strcmp("vKnot", name)) return 9;
9370 2 : if (!strcmp("vOrder", name)) return 10;
9371 1 : if (!strcmp("metadata", name)) return 11;
9372 0 : return -1;
9373 : }
9374 :
9375 :
9376 1 : static GF_Node *NurbsSurfaceInterpolator_Create()
9377 : {
9378 : X_NurbsSurfaceInterpolator *p;
9379 1 : GF_SAFEALLOC(p, X_NurbsSurfaceInterpolator);
9380 1 : if(!p) return NULL;
9381 1 : gf_node_setup((GF_Node *)p, TAG_X3D_NurbsSurfaceInterpolator);
9382 :
9383 : /*default field values*/
9384 1 : p->uDimension = 0;
9385 1 : p->uOrder = 3;
9386 1 : p->vDimension = 0;
9387 1 : p->vOrder = 3;
9388 1 : return (GF_Node *)p;
9389 : }
9390 :
9391 :
9392 : /*
9393 : NurbsSweptSurface Node deletion
9394 : */
9395 :
9396 1 : static void NurbsSweptSurface_Del(GF_Node *node)
9397 : {
9398 : X_NurbsSweptSurface *p = (X_NurbsSweptSurface *) node;
9399 1 : gf_node_unregister((GF_Node *) p->crossSectionCurve, node);
9400 1 : gf_node_unregister((GF_Node *) p->trajectoryCurve, node);
9401 1 : gf_node_unregister((GF_Node *) p->metadata, node);
9402 1 : gf_node_free((GF_Node *)p);
9403 1 : }
9404 :
9405 :
9406 : static u32 NurbsSweptSurface_get_field_count(GF_Node *node, u8 dummy)
9407 : {
9408 : return 5;
9409 : }
9410 :
9411 10 : static GF_Err NurbsSweptSurface_get_field(GF_Node *node, GF_FieldInfo *info)
9412 : {
9413 10 : switch (info->fieldIndex) {
9414 2 : case 0:
9415 2 : info->name = "crossSectionCurve";
9416 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9417 2 : info->fieldType = GF_SG_VRML_SFNODE;
9418 2 : info->NDTtype = NDT_SFNurbsControlCurveNode;
9419 2 : info->far_ptr = & ((X_NurbsSweptSurface *)node)->crossSectionCurve;
9420 2 : return GF_OK;
9421 2 : case 1:
9422 2 : info->name = "trajectoryCurve";
9423 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9424 2 : info->fieldType = GF_SG_VRML_SFNODE;
9425 2 : info->NDTtype = NDT_SFNurbsCurveNode;
9426 2 : info->far_ptr = & ((X_NurbsSweptSurface *)node)->trajectoryCurve;
9427 2 : return GF_OK;
9428 2 : case 2:
9429 2 : info->name = "ccw";
9430 2 : info->eventType = GF_SG_EVENT_FIELD;
9431 2 : info->fieldType = GF_SG_VRML_SFBOOL;
9432 2 : info->far_ptr = & ((X_NurbsSweptSurface *) node)->ccw;
9433 2 : return GF_OK;
9434 2 : case 3:
9435 2 : info->name = "solid";
9436 2 : info->eventType = GF_SG_EVENT_FIELD;
9437 2 : info->fieldType = GF_SG_VRML_SFBOOL;
9438 2 : info->far_ptr = & ((X_NurbsSweptSurface *) node)->solid;
9439 2 : return GF_OK;
9440 2 : case 4:
9441 2 : info->name = "metadata";
9442 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9443 2 : info->fieldType = GF_SG_VRML_SFNODE;
9444 2 : info->NDTtype = NDT_SFMetadataNode;
9445 2 : info->far_ptr = & ((X_NurbsSweptSurface *)node)->metadata;
9446 2 : return GF_OK;
9447 : default:
9448 : return GF_BAD_PARAM;
9449 : }
9450 : }
9451 :
9452 :
9453 5 : static s32 NurbsSweptSurface_get_field_index_by_name(char *name)
9454 : {
9455 5 : if (!strcmp("crossSectionCurve", name)) return 0;
9456 4 : if (!strcmp("trajectoryCurve", name)) return 1;
9457 3 : if (!strcmp("ccw", name)) return 2;
9458 2 : if (!strcmp("solid", name)) return 3;
9459 1 : if (!strcmp("metadata", name)) return 4;
9460 0 : return -1;
9461 : }
9462 :
9463 :
9464 1 : static GF_Node *NurbsSweptSurface_Create()
9465 : {
9466 : X_NurbsSweptSurface *p;
9467 1 : GF_SAFEALLOC(p, X_NurbsSweptSurface);
9468 1 : if(!p) return NULL;
9469 1 : gf_node_setup((GF_Node *)p, TAG_X3D_NurbsSweptSurface);
9470 :
9471 : /*default field values*/
9472 1 : p->ccw = 1;
9473 1 : p->solid = 1;
9474 1 : return (GF_Node *)p;
9475 : }
9476 :
9477 :
9478 : /*
9479 : NurbsSwungSurface Node deletion
9480 : */
9481 :
9482 1 : static void NurbsSwungSurface_Del(GF_Node *node)
9483 : {
9484 : X_NurbsSwungSurface *p = (X_NurbsSwungSurface *) node;
9485 1 : gf_node_unregister((GF_Node *) p->profileCurve, node);
9486 1 : gf_node_unregister((GF_Node *) p->trajectoryCurve, node);
9487 1 : gf_node_unregister((GF_Node *) p->metadata, node);
9488 1 : gf_node_free((GF_Node *)p);
9489 1 : }
9490 :
9491 :
9492 : static u32 NurbsSwungSurface_get_field_count(GF_Node *node, u8 dummy)
9493 : {
9494 : return 5;
9495 : }
9496 :
9497 10 : static GF_Err NurbsSwungSurface_get_field(GF_Node *node, GF_FieldInfo *info)
9498 : {
9499 10 : switch (info->fieldIndex) {
9500 2 : case 0:
9501 2 : info->name = "profileCurve";
9502 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9503 2 : info->fieldType = GF_SG_VRML_SFNODE;
9504 2 : info->NDTtype = NDT_SFNurbsControlCurveNode;
9505 2 : info->far_ptr = & ((X_NurbsSwungSurface *)node)->profileCurve;
9506 2 : return GF_OK;
9507 2 : case 1:
9508 2 : info->name = "trajectoryCurve";
9509 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9510 2 : info->fieldType = GF_SG_VRML_SFNODE;
9511 2 : info->NDTtype = NDT_SFNurbsControlCurveNode;
9512 2 : info->far_ptr = & ((X_NurbsSwungSurface *)node)->trajectoryCurve;
9513 2 : return GF_OK;
9514 2 : case 2:
9515 2 : info->name = "ccw";
9516 2 : info->eventType = GF_SG_EVENT_FIELD;
9517 2 : info->fieldType = GF_SG_VRML_SFBOOL;
9518 2 : info->far_ptr = & ((X_NurbsSwungSurface *) node)->ccw;
9519 2 : return GF_OK;
9520 2 : case 3:
9521 2 : info->name = "solid";
9522 2 : info->eventType = GF_SG_EVENT_FIELD;
9523 2 : info->fieldType = GF_SG_VRML_SFBOOL;
9524 2 : info->far_ptr = & ((X_NurbsSwungSurface *) node)->solid;
9525 2 : return GF_OK;
9526 2 : case 4:
9527 2 : info->name = "metadata";
9528 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9529 2 : info->fieldType = GF_SG_VRML_SFNODE;
9530 2 : info->NDTtype = NDT_SFMetadataNode;
9531 2 : info->far_ptr = & ((X_NurbsSwungSurface *)node)->metadata;
9532 2 : return GF_OK;
9533 : default:
9534 : return GF_BAD_PARAM;
9535 : }
9536 : }
9537 :
9538 :
9539 5 : static s32 NurbsSwungSurface_get_field_index_by_name(char *name)
9540 : {
9541 5 : if (!strcmp("profileCurve", name)) return 0;
9542 4 : if (!strcmp("trajectoryCurve", name)) return 1;
9543 3 : if (!strcmp("ccw", name)) return 2;
9544 2 : if (!strcmp("solid", name)) return 3;
9545 1 : if (!strcmp("metadata", name)) return 4;
9546 0 : return -1;
9547 : }
9548 :
9549 :
9550 1 : static GF_Node *NurbsSwungSurface_Create()
9551 : {
9552 : X_NurbsSwungSurface *p;
9553 1 : GF_SAFEALLOC(p, X_NurbsSwungSurface);
9554 1 : if(!p) return NULL;
9555 1 : gf_node_setup((GF_Node *)p, TAG_X3D_NurbsSwungSurface);
9556 :
9557 : /*default field values*/
9558 1 : p->ccw = 1;
9559 1 : p->solid = 1;
9560 1 : return (GF_Node *)p;
9561 : }
9562 :
9563 :
9564 : /*
9565 : NurbsTextureCoordinate Node deletion
9566 : */
9567 :
9568 1 : static void NurbsTextureCoordinate_Del(GF_Node *node)
9569 : {
9570 : X_NurbsTextureCoordinate *p = (X_NurbsTextureCoordinate *) node;
9571 1 : gf_sg_mfvec2f_del(p->controlPoint);
9572 1 : gf_sg_mffloat_del(p->weight);
9573 1 : gf_sg_mfdouble_del(p->uKnot);
9574 1 : gf_sg_mfdouble_del(p->vKnot);
9575 1 : gf_node_unregister((GF_Node *) p->metadata, node);
9576 1 : gf_node_free((GF_Node *)p);
9577 1 : }
9578 :
9579 :
9580 : static u32 NurbsTextureCoordinate_get_field_count(GF_Node *node, u8 dummy)
9581 : {
9582 : return 9;
9583 : }
9584 :
9585 18 : static GF_Err NurbsTextureCoordinate_get_field(GF_Node *node, GF_FieldInfo *info)
9586 : {
9587 18 : switch (info->fieldIndex) {
9588 2 : case 0:
9589 2 : info->name = "controlPoint";
9590 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9591 2 : info->fieldType = GF_SG_VRML_MFVEC2F;
9592 2 : info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->controlPoint;
9593 2 : return GF_OK;
9594 2 : case 1:
9595 2 : info->name = "weight";
9596 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9597 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
9598 2 : info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->weight;
9599 2 : return GF_OK;
9600 2 : case 2:
9601 2 : info->name = "uDimension";
9602 2 : info->eventType = GF_SG_EVENT_FIELD;
9603 2 : info->fieldType = GF_SG_VRML_SFINT32;
9604 2 : info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->uDimension;
9605 2 : return GF_OK;
9606 2 : case 3:
9607 2 : info->name = "uKnot";
9608 2 : info->eventType = GF_SG_EVENT_FIELD;
9609 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
9610 2 : info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->uKnot;
9611 2 : return GF_OK;
9612 2 : case 4:
9613 2 : info->name = "uOrder";
9614 2 : info->eventType = GF_SG_EVENT_FIELD;
9615 2 : info->fieldType = GF_SG_VRML_SFINT32;
9616 2 : info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->uOrder;
9617 2 : return GF_OK;
9618 2 : case 5:
9619 2 : info->name = "vDimension";
9620 2 : info->eventType = GF_SG_EVENT_FIELD;
9621 2 : info->fieldType = GF_SG_VRML_SFINT32;
9622 2 : info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->vDimension;
9623 2 : return GF_OK;
9624 2 : case 6:
9625 2 : info->name = "vKnot";
9626 2 : info->eventType = GF_SG_EVENT_FIELD;
9627 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
9628 2 : info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->vKnot;
9629 2 : return GF_OK;
9630 2 : case 7:
9631 2 : info->name = "vOrder";
9632 2 : info->eventType = GF_SG_EVENT_FIELD;
9633 2 : info->fieldType = GF_SG_VRML_SFINT32;
9634 2 : info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->vOrder;
9635 2 : return GF_OK;
9636 2 : case 8:
9637 2 : info->name = "metadata";
9638 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9639 2 : info->fieldType = GF_SG_VRML_SFNODE;
9640 2 : info->NDTtype = NDT_SFMetadataNode;
9641 2 : info->far_ptr = & ((X_NurbsTextureCoordinate *)node)->metadata;
9642 2 : return GF_OK;
9643 : default:
9644 : return GF_BAD_PARAM;
9645 : }
9646 : }
9647 :
9648 :
9649 9 : static s32 NurbsTextureCoordinate_get_field_index_by_name(char *name)
9650 : {
9651 9 : if (!strcmp("controlPoint", name)) return 0;
9652 8 : if (!strcmp("weight", name)) return 1;
9653 7 : if (!strcmp("uDimension", name)) return 2;
9654 6 : if (!strcmp("uKnot", name)) return 3;
9655 5 : if (!strcmp("uOrder", name)) return 4;
9656 4 : if (!strcmp("vDimension", name)) return 5;
9657 3 : if (!strcmp("vKnot", name)) return 6;
9658 2 : if (!strcmp("vOrder", name)) return 7;
9659 1 : if (!strcmp("metadata", name)) return 8;
9660 0 : return -1;
9661 : }
9662 :
9663 :
9664 1 : static GF_Node *NurbsTextureCoordinate_Create()
9665 : {
9666 : X_NurbsTextureCoordinate *p;
9667 1 : GF_SAFEALLOC(p, X_NurbsTextureCoordinate);
9668 1 : if(!p) return NULL;
9669 1 : gf_node_setup((GF_Node *)p, TAG_X3D_NurbsTextureCoordinate);
9670 :
9671 : /*default field values*/
9672 1 : p->uDimension = 0;
9673 1 : p->uOrder = 3;
9674 1 : p->vDimension = 0;
9675 1 : p->vOrder = 3;
9676 1 : return (GF_Node *)p;
9677 : }
9678 :
9679 :
9680 : /*
9681 : NurbsTrimmedSurface Node deletion
9682 : */
9683 :
9684 1 : static void NurbsTrimmedSurface_Del(GF_Node *node)
9685 : {
9686 : X_NurbsTrimmedSurface *p = (X_NurbsTrimmedSurface *) node;
9687 1 : gf_node_unregister_children(node, p->addTrimmingContour);
9688 1 : gf_node_unregister_children(node, p->removeTrimmingContour);
9689 1 : gf_node_unregister_children(node, p->trimmingContour);
9690 1 : gf_node_unregister((GF_Node *) p->controlPoint, node);
9691 1 : gf_node_unregister((GF_Node *) p->texCoord, node);
9692 1 : gf_sg_mfdouble_del(p->weight);
9693 1 : gf_sg_mfdouble_del(p->uKnot);
9694 1 : gf_sg_mfdouble_del(p->vKnot);
9695 1 : gf_node_unregister((GF_Node *) p->metadata, node);
9696 1 : gf_node_free((GF_Node *)p);
9697 1 : }
9698 :
9699 :
9700 : static u32 NurbsTrimmedSurface_get_field_count(GF_Node *node, u8 dummy)
9701 : {
9702 : return 18;
9703 : }
9704 :
9705 36 : static GF_Err NurbsTrimmedSurface_get_field(GF_Node *node, GF_FieldInfo *info)
9706 : {
9707 36 : switch (info->fieldIndex) {
9708 2 : case 0:
9709 2 : info->name = "addTrimmingContour";
9710 2 : info->eventType = GF_SG_EVENT_IN;
9711 2 : info->on_event_in = ((X_NurbsTrimmedSurface *)node)->on_addTrimmingContour;
9712 2 : info->fieldType = GF_SG_VRML_MFNODE;
9713 2 : info->NDTtype = NDT_SFNurbsControlCurveNode;
9714 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *)node)->addTrimmingContour;
9715 2 : return GF_OK;
9716 2 : case 1:
9717 2 : info->name = "removeTrimmingContour";
9718 2 : info->eventType = GF_SG_EVENT_IN;
9719 2 : info->on_event_in = ((X_NurbsTrimmedSurface *)node)->on_removeTrimmingContour;
9720 2 : info->fieldType = GF_SG_VRML_MFNODE;
9721 2 : info->NDTtype = NDT_SFNurbsControlCurveNode;
9722 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *)node)->removeTrimmingContour;
9723 2 : return GF_OK;
9724 2 : case 2:
9725 2 : info->name = "trimmingContour";
9726 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9727 2 : info->fieldType = GF_SG_VRML_MFNODE;
9728 2 : info->NDTtype = NDT_SFNurbsControlCurveNode;
9729 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *)node)->trimmingContour;
9730 2 : return GF_OK;
9731 2 : case 3:
9732 2 : info->name = "controlPoint";
9733 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9734 2 : info->fieldType = GF_SG_VRML_SFNODE;
9735 2 : info->NDTtype = NDT_SFCoordinateNode;
9736 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *)node)->controlPoint;
9737 2 : return GF_OK;
9738 2 : case 4:
9739 2 : info->name = "texCoord";
9740 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9741 2 : info->fieldType = GF_SG_VRML_SFNODE;
9742 2 : info->NDTtype = NDT_SFTextureCoordinateNode;
9743 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *)node)->texCoord;
9744 2 : return GF_OK;
9745 2 : case 5:
9746 2 : info->name = "uTessellation";
9747 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9748 2 : info->fieldType = GF_SG_VRML_SFINT32;
9749 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->uTessellation;
9750 2 : return GF_OK;
9751 2 : case 6:
9752 2 : info->name = "vTessellation";
9753 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9754 2 : info->fieldType = GF_SG_VRML_SFINT32;
9755 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->vTessellation;
9756 2 : return GF_OK;
9757 2 : case 7:
9758 2 : info->name = "weight";
9759 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9760 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
9761 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->weight;
9762 2 : return GF_OK;
9763 2 : case 8:
9764 2 : info->name = "solid";
9765 2 : info->eventType = GF_SG_EVENT_FIELD;
9766 2 : info->fieldType = GF_SG_VRML_SFBOOL;
9767 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->solid;
9768 2 : return GF_OK;
9769 2 : case 9:
9770 2 : info->name = "uClosed";
9771 2 : info->eventType = GF_SG_EVENT_FIELD;
9772 2 : info->fieldType = GF_SG_VRML_SFBOOL;
9773 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->uClosed;
9774 2 : return GF_OK;
9775 2 : case 10:
9776 2 : info->name = "uDimension";
9777 2 : info->eventType = GF_SG_EVENT_FIELD;
9778 2 : info->fieldType = GF_SG_VRML_SFINT32;
9779 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->uDimension;
9780 2 : return GF_OK;
9781 2 : case 11:
9782 2 : info->name = "uKnot";
9783 2 : info->eventType = GF_SG_EVENT_FIELD;
9784 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
9785 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->uKnot;
9786 2 : return GF_OK;
9787 2 : case 12:
9788 2 : info->name = "uOrder";
9789 2 : info->eventType = GF_SG_EVENT_FIELD;
9790 2 : info->fieldType = GF_SG_VRML_SFINT32;
9791 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->uOrder;
9792 2 : return GF_OK;
9793 2 : case 13:
9794 2 : info->name = "vClosed";
9795 2 : info->eventType = GF_SG_EVENT_FIELD;
9796 2 : info->fieldType = GF_SG_VRML_SFBOOL;
9797 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->vClosed;
9798 2 : return GF_OK;
9799 2 : case 14:
9800 2 : info->name = "vDimension";
9801 2 : info->eventType = GF_SG_EVENT_FIELD;
9802 2 : info->fieldType = GF_SG_VRML_SFINT32;
9803 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->vDimension;
9804 2 : return GF_OK;
9805 2 : case 15:
9806 2 : info->name = "vKnot";
9807 2 : info->eventType = GF_SG_EVENT_FIELD;
9808 2 : info->fieldType = GF_SG_VRML_MFDOUBLE;
9809 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->vKnot;
9810 2 : return GF_OK;
9811 2 : case 16:
9812 2 : info->name = "vOrder";
9813 2 : info->eventType = GF_SG_EVENT_FIELD;
9814 2 : info->fieldType = GF_SG_VRML_SFINT32;
9815 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->vOrder;
9816 2 : return GF_OK;
9817 2 : case 17:
9818 2 : info->name = "metadata";
9819 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9820 2 : info->fieldType = GF_SG_VRML_SFNODE;
9821 2 : info->NDTtype = NDT_SFMetadataNode;
9822 2 : info->far_ptr = & ((X_NurbsTrimmedSurface *)node)->metadata;
9823 2 : return GF_OK;
9824 : default:
9825 : return GF_BAD_PARAM;
9826 : }
9827 : }
9828 :
9829 :
9830 18 : static s32 NurbsTrimmedSurface_get_field_index_by_name(char *name)
9831 : {
9832 18 : if (!strcmp("addTrimmingContour", name)) return 0;
9833 17 : if (!strcmp("removeTrimmingContour", name)) return 1;
9834 16 : if (!strcmp("trimmingContour", name)) return 2;
9835 15 : if (!strcmp("controlPoint", name)) return 3;
9836 14 : if (!strcmp("texCoord", name)) return 4;
9837 13 : if (!strcmp("uTessellation", name)) return 5;
9838 12 : if (!strcmp("vTessellation", name)) return 6;
9839 11 : if (!strcmp("weight", name)) return 7;
9840 10 : if (!strcmp("solid", name)) return 8;
9841 9 : if (!strcmp("uClosed", name)) return 9;
9842 8 : if (!strcmp("uDimension", name)) return 10;
9843 7 : if (!strcmp("uKnot", name)) return 11;
9844 6 : if (!strcmp("uOrder", name)) return 12;
9845 5 : if (!strcmp("vClosed", name)) return 13;
9846 4 : if (!strcmp("vDimension", name)) return 14;
9847 3 : if (!strcmp("vKnot", name)) return 15;
9848 2 : if (!strcmp("vOrder", name)) return 16;
9849 1 : if (!strcmp("metadata", name)) return 17;
9850 0 : return -1;
9851 : }
9852 :
9853 :
9854 1 : static GF_Node *NurbsTrimmedSurface_Create()
9855 : {
9856 : X_NurbsTrimmedSurface *p;
9857 1 : GF_SAFEALLOC(p, X_NurbsTrimmedSurface);
9858 1 : if(!p) return NULL;
9859 1 : gf_node_setup((GF_Node *)p, TAG_X3D_NurbsTrimmedSurface);
9860 :
9861 : /*default field values*/
9862 1 : p->uTessellation = 0;
9863 1 : p->vTessellation = 0;
9864 1 : p->solid = 1;
9865 1 : p->uDimension = 0;
9866 1 : p->uOrder = 3;
9867 1 : p->vDimension = 0;
9868 1 : p->vOrder = 3;
9869 1 : return (GF_Node *)p;
9870 : }
9871 :
9872 :
9873 : /*
9874 : OrientationInterpolator Node deletion
9875 : */
9876 :
9877 1 : static void OrientationInterpolator_Del(GF_Node *node)
9878 : {
9879 : X_OrientationInterpolator *p = (X_OrientationInterpolator *) node;
9880 1 : gf_sg_mffloat_del(p->key);
9881 1 : gf_sg_mfrotation_del(p->keyValue);
9882 1 : gf_node_unregister((GF_Node *) p->metadata, node);
9883 1 : gf_node_free((GF_Node *)p);
9884 1 : }
9885 :
9886 :
9887 : static u32 OrientationInterpolator_get_field_count(GF_Node *node, u8 dummy)
9888 : {
9889 : return 5;
9890 : }
9891 :
9892 10 : static GF_Err OrientationInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
9893 : {
9894 10 : switch (info->fieldIndex) {
9895 2 : case 0:
9896 2 : info->name = "set_fraction";
9897 2 : info->eventType = GF_SG_EVENT_IN;
9898 2 : info->on_event_in = ((X_OrientationInterpolator *)node)->on_set_fraction;
9899 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
9900 2 : info->far_ptr = & ((X_OrientationInterpolator *) node)->set_fraction;
9901 2 : return GF_OK;
9902 2 : case 1:
9903 2 : info->name = "key";
9904 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9905 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
9906 2 : info->far_ptr = & ((X_OrientationInterpolator *) node)->key;
9907 2 : return GF_OK;
9908 2 : case 2:
9909 2 : info->name = "keyValue";
9910 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9911 2 : info->fieldType = GF_SG_VRML_MFROTATION;
9912 2 : info->far_ptr = & ((X_OrientationInterpolator *) node)->keyValue;
9913 2 : return GF_OK;
9914 2 : case 3:
9915 2 : info->name = "value_changed";
9916 2 : info->eventType = GF_SG_EVENT_OUT;
9917 2 : info->fieldType = GF_SG_VRML_SFROTATION;
9918 2 : info->far_ptr = & ((X_OrientationInterpolator *) node)->value_changed;
9919 2 : return GF_OK;
9920 2 : case 4:
9921 2 : info->name = "metadata";
9922 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9923 2 : info->fieldType = GF_SG_VRML_SFNODE;
9924 2 : info->NDTtype = NDT_SFMetadataNode;
9925 2 : info->far_ptr = & ((X_OrientationInterpolator *)node)->metadata;
9926 2 : return GF_OK;
9927 : default:
9928 : return GF_BAD_PARAM;
9929 : }
9930 : }
9931 :
9932 :
9933 5 : static s32 OrientationInterpolator_get_field_index_by_name(char *name)
9934 : {
9935 5 : if (!strcmp("set_fraction", name)) return 0;
9936 4 : if (!strcmp("key", name)) return 1;
9937 3 : if (!strcmp("keyValue", name)) return 2;
9938 2 : if (!strcmp("value_changed", name)) return 3;
9939 1 : if (!strcmp("metadata", name)) return 4;
9940 0 : return -1;
9941 : }
9942 :
9943 :
9944 1 : static GF_Node *OrientationInterpolator_Create()
9945 : {
9946 : X_OrientationInterpolator *p;
9947 1 : GF_SAFEALLOC(p, X_OrientationInterpolator);
9948 1 : if(!p) return NULL;
9949 1 : gf_node_setup((GF_Node *)p, TAG_X3D_OrientationInterpolator);
9950 :
9951 : /*default field values*/
9952 1 : return (GF_Node *)p;
9953 : }
9954 :
9955 :
9956 : /*
9957 : PixelTexture Node deletion
9958 : */
9959 :
9960 1 : static void PixelTexture_Del(GF_Node *node)
9961 : {
9962 : X_PixelTexture *p = (X_PixelTexture *) node;
9963 1 : gf_sg_sfimage_del(p->image);
9964 1 : gf_node_unregister((GF_Node *) p->metadata, node);
9965 1 : gf_node_free((GF_Node *)p);
9966 1 : }
9967 :
9968 :
9969 : static u32 PixelTexture_get_field_count(GF_Node *node, u8 dummy)
9970 : {
9971 : return 4;
9972 : }
9973 :
9974 8 : static GF_Err PixelTexture_get_field(GF_Node *node, GF_FieldInfo *info)
9975 : {
9976 8 : switch (info->fieldIndex) {
9977 2 : case 0:
9978 2 : info->name = "image";
9979 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9980 2 : info->fieldType = GF_SG_VRML_SFIMAGE;
9981 2 : info->far_ptr = & ((X_PixelTexture *) node)->image;
9982 2 : return GF_OK;
9983 2 : case 1:
9984 2 : info->name = "repeatS";
9985 2 : info->eventType = GF_SG_EVENT_FIELD;
9986 2 : info->fieldType = GF_SG_VRML_SFBOOL;
9987 2 : info->far_ptr = & ((X_PixelTexture *) node)->repeatS;
9988 2 : return GF_OK;
9989 2 : case 2:
9990 2 : info->name = "repeatT";
9991 2 : info->eventType = GF_SG_EVENT_FIELD;
9992 2 : info->fieldType = GF_SG_VRML_SFBOOL;
9993 2 : info->far_ptr = & ((X_PixelTexture *) node)->repeatT;
9994 2 : return GF_OK;
9995 2 : case 3:
9996 2 : info->name = "metadata";
9997 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9998 2 : info->fieldType = GF_SG_VRML_SFNODE;
9999 2 : info->NDTtype = NDT_SFMetadataNode;
10000 2 : info->far_ptr = & ((X_PixelTexture *)node)->metadata;
10001 2 : return GF_OK;
10002 : default:
10003 : return GF_BAD_PARAM;
10004 : }
10005 : }
10006 :
10007 :
10008 4 : static s32 PixelTexture_get_field_index_by_name(char *name)
10009 : {
10010 4 : if (!strcmp("image", name)) return 0;
10011 3 : if (!strcmp("repeatS", name)) return 1;
10012 2 : if (!strcmp("repeatT", name)) return 2;
10013 1 : if (!strcmp("metadata", name)) return 3;
10014 0 : return -1;
10015 : }
10016 :
10017 :
10018 1 : static GF_Node *PixelTexture_Create()
10019 : {
10020 : X_PixelTexture *p;
10021 1 : GF_SAFEALLOC(p, X_PixelTexture);
10022 1 : if(!p) return NULL;
10023 1 : gf_node_setup((GF_Node *)p, TAG_X3D_PixelTexture);
10024 :
10025 : /*default field values*/
10026 1 : p->repeatS = 1;
10027 1 : p->repeatT = 1;
10028 1 : return (GF_Node *)p;
10029 : }
10030 :
10031 :
10032 : /*
10033 : PlaneSensor Node deletion
10034 : */
10035 :
10036 1 : static void PlaneSensor_Del(GF_Node *node)
10037 : {
10038 : X_PlaneSensor *p = (X_PlaneSensor *) node;
10039 1 : gf_node_unregister((GF_Node *) p->metadata, node);
10040 1 : gf_sg_sfstring_del(p->description);
10041 1 : gf_node_free((GF_Node *)p);
10042 1 : }
10043 :
10044 :
10045 : static u32 PlaneSensor_get_field_count(GF_Node *node, u8 dummy)
10046 : {
10047 : return 11;
10048 : }
10049 :
10050 22 : static GF_Err PlaneSensor_get_field(GF_Node *node, GF_FieldInfo *info)
10051 : {
10052 22 : switch (info->fieldIndex) {
10053 2 : case 0:
10054 2 : info->name = "autoOffset";
10055 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10056 2 : info->fieldType = GF_SG_VRML_SFBOOL;
10057 2 : info->far_ptr = & ((X_PlaneSensor *) node)->autoOffset;
10058 2 : return GF_OK;
10059 2 : case 1:
10060 2 : info->name = "enabled";
10061 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10062 2 : info->fieldType = GF_SG_VRML_SFBOOL;
10063 2 : info->far_ptr = & ((X_PlaneSensor *) node)->enabled;
10064 2 : return GF_OK;
10065 2 : case 2:
10066 2 : info->name = "maxPosition";
10067 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10068 2 : info->fieldType = GF_SG_VRML_SFVEC2F;
10069 2 : info->far_ptr = & ((X_PlaneSensor *) node)->maxPosition;
10070 2 : return GF_OK;
10071 2 : case 3:
10072 2 : info->name = "minPosition";
10073 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10074 2 : info->fieldType = GF_SG_VRML_SFVEC2F;
10075 2 : info->far_ptr = & ((X_PlaneSensor *) node)->minPosition;
10076 2 : return GF_OK;
10077 2 : case 4:
10078 2 : info->name = "offset";
10079 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10080 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
10081 2 : info->far_ptr = & ((X_PlaneSensor *) node)->offset;
10082 2 : return GF_OK;
10083 2 : case 5:
10084 2 : info->name = "isActive";
10085 2 : info->eventType = GF_SG_EVENT_OUT;
10086 2 : info->fieldType = GF_SG_VRML_SFBOOL;
10087 2 : info->far_ptr = & ((X_PlaneSensor *) node)->isActive;
10088 2 : return GF_OK;
10089 2 : case 6:
10090 2 : info->name = "trackPoint_changed";
10091 2 : info->eventType = GF_SG_EVENT_OUT;
10092 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
10093 2 : info->far_ptr = & ((X_PlaneSensor *) node)->trackPoint_changed;
10094 2 : return GF_OK;
10095 2 : case 7:
10096 2 : info->name = "translation_changed";
10097 2 : info->eventType = GF_SG_EVENT_OUT;
10098 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
10099 2 : info->far_ptr = & ((X_PlaneSensor *) node)->translation_changed;
10100 2 : return GF_OK;
10101 2 : case 8:
10102 2 : info->name = "metadata";
10103 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10104 2 : info->fieldType = GF_SG_VRML_SFNODE;
10105 2 : info->NDTtype = NDT_SFMetadataNode;
10106 2 : info->far_ptr = & ((X_PlaneSensor *)node)->metadata;
10107 2 : return GF_OK;
10108 2 : case 9:
10109 2 : info->name = "description";
10110 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10111 2 : info->fieldType = GF_SG_VRML_SFSTRING;
10112 2 : info->far_ptr = & ((X_PlaneSensor *) node)->description;
10113 2 : return GF_OK;
10114 2 : case 10:
10115 2 : info->name = "isOver";
10116 2 : info->eventType = GF_SG_EVENT_OUT;
10117 2 : info->fieldType = GF_SG_VRML_SFBOOL;
10118 2 : info->far_ptr = & ((X_PlaneSensor *) node)->isOver;
10119 2 : return GF_OK;
10120 : default:
10121 : return GF_BAD_PARAM;
10122 : }
10123 : }
10124 :
10125 :
10126 11 : static s32 PlaneSensor_get_field_index_by_name(char *name)
10127 : {
10128 11 : if (!strcmp("autoOffset", name)) return 0;
10129 10 : if (!strcmp("enabled", name)) return 1;
10130 9 : if (!strcmp("maxPosition", name)) return 2;
10131 8 : if (!strcmp("minPosition", name)) return 3;
10132 7 : if (!strcmp("offset", name)) return 4;
10133 6 : if (!strcmp("isActive", name)) return 5;
10134 5 : if (!strcmp("trackPoint_changed", name)) return 6;
10135 4 : if (!strcmp("translation_changed", name)) return 7;
10136 3 : if (!strcmp("metadata", name)) return 8;
10137 2 : if (!strcmp("description", name)) return 9;
10138 1 : if (!strcmp("isOver", name)) return 10;
10139 0 : return -1;
10140 : }
10141 :
10142 :
10143 1 : static GF_Node *PlaneSensor_Create()
10144 : {
10145 : X_PlaneSensor *p;
10146 1 : GF_SAFEALLOC(p, X_PlaneSensor);
10147 1 : if(!p) return NULL;
10148 1 : gf_node_setup((GF_Node *)p, TAG_X3D_PlaneSensor);
10149 :
10150 : /*default field values*/
10151 1 : p->autoOffset = 1;
10152 1 : p->enabled = 1;
10153 1 : p->maxPosition.x = FLT2FIX(-1);
10154 1 : p->maxPosition.y = FLT2FIX(-1);
10155 1 : p->minPosition.x = FLT2FIX(0);
10156 1 : p->minPosition.y = FLT2FIX(0);
10157 1 : p->offset.x = FLT2FIX(0);
10158 1 : p->offset.y = FLT2FIX(0);
10159 1 : p->offset.z = FLT2FIX(0);
10160 1 : return (GF_Node *)p;
10161 : }
10162 :
10163 :
10164 : /*
10165 : PointLight Node deletion
10166 : */
10167 :
10168 : static void PointLight_Del(GF_Node *node)
10169 : {
10170 : X_PointLight *p = (X_PointLight *) node;
10171 1 : gf_node_unregister((GF_Node *) p->metadata, node);
10172 1 : gf_node_free((GF_Node *)p);
10173 : }
10174 :
10175 :
10176 : static u32 PointLight_get_field_count(GF_Node *node, u8 dummy)
10177 : {
10178 : return 8;
10179 : }
10180 :
10181 16 : static GF_Err PointLight_get_field(GF_Node *node, GF_FieldInfo *info)
10182 : {
10183 16 : switch (info->fieldIndex) {
10184 2 : case 0:
10185 2 : info->name = "ambientIntensity";
10186 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10187 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
10188 2 : info->far_ptr = & ((X_PointLight *) node)->ambientIntensity;
10189 2 : return GF_OK;
10190 2 : case 1:
10191 2 : info->name = "attenuation";
10192 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10193 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
10194 2 : info->far_ptr = & ((X_PointLight *) node)->attenuation;
10195 2 : return GF_OK;
10196 2 : case 2:
10197 2 : info->name = "color";
10198 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10199 2 : info->fieldType = GF_SG_VRML_SFCOLOR;
10200 2 : info->far_ptr = & ((X_PointLight *) node)->color;
10201 2 : return GF_OK;
10202 2 : case 3:
10203 2 : info->name = "intensity";
10204 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10205 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
10206 2 : info->far_ptr = & ((X_PointLight *) node)->intensity;
10207 2 : return GF_OK;
10208 2 : case 4:
10209 2 : info->name = "location";
10210 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10211 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
10212 2 : info->far_ptr = & ((X_PointLight *) node)->location;
10213 2 : return GF_OK;
10214 2 : case 5:
10215 2 : info->name = "on";
10216 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10217 2 : info->fieldType = GF_SG_VRML_SFBOOL;
10218 2 : info->far_ptr = & ((X_PointLight *) node)->on;
10219 2 : return GF_OK;
10220 2 : case 6:
10221 2 : info->name = "radius";
10222 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10223 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
10224 2 : info->far_ptr = & ((X_PointLight *) node)->radius;
10225 2 : return GF_OK;
10226 2 : case 7:
10227 2 : info->name = "metadata";
10228 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10229 2 : info->fieldType = GF_SG_VRML_SFNODE;
10230 2 : info->NDTtype = NDT_SFMetadataNode;
10231 2 : info->far_ptr = & ((X_PointLight *)node)->metadata;
10232 2 : return GF_OK;
10233 : default:
10234 : return GF_BAD_PARAM;
10235 : }
10236 : }
10237 :
10238 :
10239 8 : static s32 PointLight_get_field_index_by_name(char *name)
10240 : {
10241 8 : if (!strcmp("ambientIntensity", name)) return 0;
10242 7 : if (!strcmp("attenuation", name)) return 1;
10243 6 : if (!strcmp("color", name)) return 2;
10244 5 : if (!strcmp("intensity", name)) return 3;
10245 4 : if (!strcmp("location", name)) return 4;
10246 3 : if (!strcmp("on", name)) return 5;
10247 2 : if (!strcmp("radius", name)) return 6;
10248 1 : if (!strcmp("metadata", name)) return 7;
10249 0 : return -1;
10250 : }
10251 :
10252 :
10253 1 : static GF_Node *PointLight_Create()
10254 : {
10255 : X_PointLight *p;
10256 1 : GF_SAFEALLOC(p, X_PointLight);
10257 1 : if(!p) return NULL;
10258 1 : gf_node_setup((GF_Node *)p, TAG_X3D_PointLight);
10259 :
10260 : /*default field values*/
10261 1 : p->ambientIntensity = FLT2FIX(0);
10262 1 : p->attenuation.x = FLT2FIX(1);
10263 1 : p->attenuation.y = FLT2FIX(0);
10264 1 : p->attenuation.z = FLT2FIX(0);
10265 1 : p->color.red = FLT2FIX(1);
10266 1 : p->color.green = FLT2FIX(1);
10267 1 : p->color.blue = FLT2FIX(1);
10268 1 : p->intensity = FLT2FIX(1);
10269 1 : p->location.x = FLT2FIX(0);
10270 1 : p->location.y = FLT2FIX(0);
10271 1 : p->location.z = FLT2FIX(0);
10272 1 : p->on = 1;
10273 1 : p->radius = FLT2FIX(100);
10274 1 : return (GF_Node *)p;
10275 : }
10276 :
10277 :
10278 : /*
10279 : PointSet Node deletion
10280 : */
10281 :
10282 1 : static void PointSet_Del(GF_Node *node)
10283 : {
10284 : X_PointSet *p = (X_PointSet *) node;
10285 1 : gf_node_unregister((GF_Node *) p->color, node);
10286 1 : gf_node_unregister((GF_Node *) p->coord, node);
10287 1 : gf_node_unregister((GF_Node *) p->metadata, node);
10288 1 : gf_node_free((GF_Node *)p);
10289 1 : }
10290 :
10291 :
10292 : static u32 PointSet_get_field_count(GF_Node *node, u8 dummy)
10293 : {
10294 : return 3;
10295 : }
10296 :
10297 : static GF_Err PointSet_get_field(GF_Node *node, GF_FieldInfo *info)
10298 : {
10299 6 : switch (info->fieldIndex) {
10300 2 : case 0:
10301 2 : info->name = "color";
10302 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10303 2 : info->fieldType = GF_SG_VRML_SFNODE;
10304 2 : info->NDTtype = NDT_SFColorNode;
10305 2 : info->far_ptr = & ((X_PointSet *)node)->color;
10306 : return GF_OK;
10307 2 : case 1:
10308 2 : info->name = "coord";
10309 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10310 2 : info->fieldType = GF_SG_VRML_SFNODE;
10311 2 : info->NDTtype = NDT_SFCoordinateNode;
10312 2 : info->far_ptr = & ((X_PointSet *)node)->coord;
10313 : return GF_OK;
10314 2 : case 2:
10315 2 : info->name = "metadata";
10316 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10317 2 : info->fieldType = GF_SG_VRML_SFNODE;
10318 2 : info->NDTtype = NDT_SFMetadataNode;
10319 2 : info->far_ptr = & ((X_PointSet *)node)->metadata;
10320 : return GF_OK;
10321 : default:
10322 : return GF_BAD_PARAM;
10323 : }
10324 : }
10325 :
10326 :
10327 3 : static s32 PointSet_get_field_index_by_name(char *name)
10328 : {
10329 3 : if (!strcmp("color", name)) return 0;
10330 2 : if (!strcmp("coord", name)) return 1;
10331 1 : if (!strcmp("metadata", name)) return 2;
10332 0 : return -1;
10333 : }
10334 :
10335 :
10336 1 : static GF_Node *PointSet_Create()
10337 : {
10338 : X_PointSet *p;
10339 1 : GF_SAFEALLOC(p, X_PointSet);
10340 1 : if(!p) return NULL;
10341 1 : gf_node_setup((GF_Node *)p, TAG_X3D_PointSet);
10342 :
10343 : /*default field values*/
10344 1 : return (GF_Node *)p;
10345 : }
10346 :
10347 :
10348 : /*
10349 : Polyline2D Node deletion
10350 : */
10351 :
10352 2 : static void Polyline2D_Del(GF_Node *node)
10353 : {
10354 : X_Polyline2D *p = (X_Polyline2D *) node;
10355 2 : gf_sg_mfvec2f_del(p->lineSegments);
10356 2 : gf_node_unregister((GF_Node *) p->metadata, node);
10357 2 : gf_node_free((GF_Node *)p);
10358 2 : }
10359 :
10360 :
10361 : static u32 Polyline2D_get_field_count(GF_Node *node, u8 dummy)
10362 : {
10363 : return 2;
10364 : }
10365 :
10366 : static GF_Err Polyline2D_get_field(GF_Node *node, GF_FieldInfo *info)
10367 : {
10368 5 : switch (info->fieldIndex) {
10369 3 : case 0:
10370 3 : info->name = "lineSegments";
10371 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10372 3 : info->fieldType = GF_SG_VRML_MFVEC2F;
10373 3 : info->far_ptr = & ((X_Polyline2D *) node)->lineSegments;
10374 : return GF_OK;
10375 2 : case 1:
10376 2 : info->name = "metadata";
10377 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10378 2 : info->fieldType = GF_SG_VRML_SFNODE;
10379 2 : info->NDTtype = NDT_SFMetadataNode;
10380 2 : info->far_ptr = & ((X_Polyline2D *)node)->metadata;
10381 : return GF_OK;
10382 : default:
10383 : return GF_BAD_PARAM;
10384 : }
10385 : }
10386 :
10387 :
10388 3 : static s32 Polyline2D_get_field_index_by_name(char *name)
10389 : {
10390 3 : if (!strcmp("lineSegments", name)) return 0;
10391 1 : if (!strcmp("metadata", name)) return 1;
10392 0 : return -1;
10393 : }
10394 :
10395 :
10396 2 : static GF_Node *Polyline2D_Create()
10397 : {
10398 : X_Polyline2D *p;
10399 2 : GF_SAFEALLOC(p, X_Polyline2D);
10400 2 : if(!p) return NULL;
10401 2 : gf_node_setup((GF_Node *)p, TAG_X3D_Polyline2D);
10402 :
10403 : /*default field values*/
10404 2 : return (GF_Node *)p;
10405 : }
10406 :
10407 :
10408 : /*
10409 : Polypoint2D Node deletion
10410 : */
10411 :
10412 2 : static void Polypoint2D_Del(GF_Node *node)
10413 : {
10414 : X_Polypoint2D *p = (X_Polypoint2D *) node;
10415 2 : gf_sg_mfvec2f_del(p->point);
10416 2 : gf_node_unregister((GF_Node *) p->metadata, node);
10417 2 : gf_node_free((GF_Node *)p);
10418 2 : }
10419 :
10420 :
10421 : static u32 Polypoint2D_get_field_count(GF_Node *node, u8 dummy)
10422 : {
10423 : return 2;
10424 : }
10425 :
10426 : static GF_Err Polypoint2D_get_field(GF_Node *node, GF_FieldInfo *info)
10427 : {
10428 5 : switch (info->fieldIndex) {
10429 3 : case 0:
10430 3 : info->name = "point";
10431 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10432 3 : info->fieldType = GF_SG_VRML_MFVEC2F;
10433 3 : info->far_ptr = & ((X_Polypoint2D *) node)->point;
10434 : return GF_OK;
10435 2 : case 1:
10436 2 : info->name = "metadata";
10437 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10438 2 : info->fieldType = GF_SG_VRML_SFNODE;
10439 2 : info->NDTtype = NDT_SFMetadataNode;
10440 2 : info->far_ptr = & ((X_Polypoint2D *)node)->metadata;
10441 : return GF_OK;
10442 : default:
10443 : return GF_BAD_PARAM;
10444 : }
10445 : }
10446 :
10447 :
10448 3 : static s32 Polypoint2D_get_field_index_by_name(char *name)
10449 : {
10450 3 : if (!strcmp("point", name)) return 0;
10451 1 : if (!strcmp("metadata", name)) return 1;
10452 0 : return -1;
10453 : }
10454 :
10455 :
10456 2 : static GF_Node *Polypoint2D_Create()
10457 : {
10458 : X_Polypoint2D *p;
10459 2 : GF_SAFEALLOC(p, X_Polypoint2D);
10460 2 : if(!p) return NULL;
10461 2 : gf_node_setup((GF_Node *)p, TAG_X3D_Polypoint2D);
10462 :
10463 : /*default field values*/
10464 2 : return (GF_Node *)p;
10465 : }
10466 :
10467 :
10468 : /*
10469 : PositionInterpolator Node deletion
10470 : */
10471 :
10472 1 : static void PositionInterpolator_Del(GF_Node *node)
10473 : {
10474 : X_PositionInterpolator *p = (X_PositionInterpolator *) node;
10475 1 : gf_sg_mffloat_del(p->key);
10476 1 : gf_sg_mfvec3f_del(p->keyValue);
10477 1 : gf_node_unregister((GF_Node *) p->metadata, node);
10478 1 : gf_node_free((GF_Node *)p);
10479 1 : }
10480 :
10481 :
10482 : static u32 PositionInterpolator_get_field_count(GF_Node *node, u8 dummy)
10483 : {
10484 : return 5;
10485 : }
10486 :
10487 10 : static GF_Err PositionInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
10488 : {
10489 10 : switch (info->fieldIndex) {
10490 2 : case 0:
10491 2 : info->name = "set_fraction";
10492 2 : info->eventType = GF_SG_EVENT_IN;
10493 2 : info->on_event_in = ((X_PositionInterpolator *)node)->on_set_fraction;
10494 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
10495 2 : info->far_ptr = & ((X_PositionInterpolator *) node)->set_fraction;
10496 2 : return GF_OK;
10497 2 : case 1:
10498 2 : info->name = "key";
10499 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10500 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
10501 2 : info->far_ptr = & ((X_PositionInterpolator *) node)->key;
10502 2 : return GF_OK;
10503 2 : case 2:
10504 2 : info->name = "keyValue";
10505 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10506 2 : info->fieldType = GF_SG_VRML_MFVEC3F;
10507 2 : info->far_ptr = & ((X_PositionInterpolator *) node)->keyValue;
10508 2 : return GF_OK;
10509 2 : case 3:
10510 2 : info->name = "value_changed";
10511 2 : info->eventType = GF_SG_EVENT_OUT;
10512 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
10513 2 : info->far_ptr = & ((X_PositionInterpolator *) node)->value_changed;
10514 2 : return GF_OK;
10515 2 : case 4:
10516 2 : info->name = "metadata";
10517 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10518 2 : info->fieldType = GF_SG_VRML_SFNODE;
10519 2 : info->NDTtype = NDT_SFMetadataNode;
10520 2 : info->far_ptr = & ((X_PositionInterpolator *)node)->metadata;
10521 2 : return GF_OK;
10522 : default:
10523 : return GF_BAD_PARAM;
10524 : }
10525 : }
10526 :
10527 :
10528 5 : static s32 PositionInterpolator_get_field_index_by_name(char *name)
10529 : {
10530 5 : if (!strcmp("set_fraction", name)) return 0;
10531 4 : if (!strcmp("key", name)) return 1;
10532 3 : if (!strcmp("keyValue", name)) return 2;
10533 2 : if (!strcmp("value_changed", name)) return 3;
10534 1 : if (!strcmp("metadata", name)) return 4;
10535 0 : return -1;
10536 : }
10537 :
10538 :
10539 1 : static GF_Node *PositionInterpolator_Create()
10540 : {
10541 : X_PositionInterpolator *p;
10542 1 : GF_SAFEALLOC(p, X_PositionInterpolator);
10543 1 : if(!p) return NULL;
10544 1 : gf_node_setup((GF_Node *)p, TAG_X3D_PositionInterpolator);
10545 :
10546 : /*default field values*/
10547 1 : return (GF_Node *)p;
10548 : }
10549 :
10550 :
10551 : /*
10552 : PositionInterpolator2D Node deletion
10553 : */
10554 :
10555 1 : static void PositionInterpolator2D_Del(GF_Node *node)
10556 : {
10557 : X_PositionInterpolator2D *p = (X_PositionInterpolator2D *) node;
10558 1 : gf_sg_mffloat_del(p->key);
10559 1 : gf_sg_mfvec2f_del(p->keyValue);
10560 1 : gf_node_unregister((GF_Node *) p->metadata, node);
10561 1 : gf_node_free((GF_Node *)p);
10562 1 : }
10563 :
10564 :
10565 : static u32 PositionInterpolator2D_get_field_count(GF_Node *node, u8 dummy)
10566 : {
10567 : return 5;
10568 : }
10569 :
10570 10 : static GF_Err PositionInterpolator2D_get_field(GF_Node *node, GF_FieldInfo *info)
10571 : {
10572 10 : switch (info->fieldIndex) {
10573 2 : case 0:
10574 2 : info->name = "set_fraction";
10575 2 : info->eventType = GF_SG_EVENT_IN;
10576 2 : info->on_event_in = ((X_PositionInterpolator2D *)node)->on_set_fraction;
10577 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
10578 2 : info->far_ptr = & ((X_PositionInterpolator2D *) node)->set_fraction;
10579 2 : return GF_OK;
10580 2 : case 1:
10581 2 : info->name = "key";
10582 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10583 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
10584 2 : info->far_ptr = & ((X_PositionInterpolator2D *) node)->key;
10585 2 : return GF_OK;
10586 2 : case 2:
10587 2 : info->name = "keyValue";
10588 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10589 2 : info->fieldType = GF_SG_VRML_MFVEC2F;
10590 2 : info->far_ptr = & ((X_PositionInterpolator2D *) node)->keyValue;
10591 2 : return GF_OK;
10592 2 : case 3:
10593 2 : info->name = "value_changed";
10594 2 : info->eventType = GF_SG_EVENT_OUT;
10595 2 : info->fieldType = GF_SG_VRML_SFVEC2F;
10596 2 : info->far_ptr = & ((X_PositionInterpolator2D *) node)->value_changed;
10597 2 : return GF_OK;
10598 2 : case 4:
10599 2 : info->name = "metadata";
10600 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10601 2 : info->fieldType = GF_SG_VRML_SFNODE;
10602 2 : info->NDTtype = NDT_SFMetadataNode;
10603 2 : info->far_ptr = & ((X_PositionInterpolator2D *)node)->metadata;
10604 2 : return GF_OK;
10605 : default:
10606 : return GF_BAD_PARAM;
10607 : }
10608 : }
10609 :
10610 :
10611 5 : static s32 PositionInterpolator2D_get_field_index_by_name(char *name)
10612 : {
10613 5 : if (!strcmp("set_fraction", name)) return 0;
10614 4 : if (!strcmp("key", name)) return 1;
10615 3 : if (!strcmp("keyValue", name)) return 2;
10616 2 : if (!strcmp("value_changed", name)) return 3;
10617 1 : if (!strcmp("metadata", name)) return 4;
10618 0 : return -1;
10619 : }
10620 :
10621 :
10622 1 : static GF_Node *PositionInterpolator2D_Create()
10623 : {
10624 : X_PositionInterpolator2D *p;
10625 1 : GF_SAFEALLOC(p, X_PositionInterpolator2D);
10626 1 : if(!p) return NULL;
10627 1 : gf_node_setup((GF_Node *)p, TAG_X3D_PositionInterpolator2D);
10628 :
10629 : /*default field values*/
10630 1 : return (GF_Node *)p;
10631 : }
10632 :
10633 :
10634 : /*
10635 : ProximitySensor Node deletion
10636 : */
10637 :
10638 : static void ProximitySensor_Del(GF_Node *node)
10639 : {
10640 : X_ProximitySensor *p = (X_ProximitySensor *) node;
10641 1 : gf_node_unregister((GF_Node *) p->metadata, node);
10642 1 : gf_node_free((GF_Node *)p);
10643 : }
10644 :
10645 :
10646 : static u32 ProximitySensor_get_field_count(GF_Node *node, u8 dummy)
10647 : {
10648 : return 10;
10649 : }
10650 :
10651 20 : static GF_Err ProximitySensor_get_field(GF_Node *node, GF_FieldInfo *info)
10652 : {
10653 20 : switch (info->fieldIndex) {
10654 2 : case 0:
10655 2 : info->name = "center";
10656 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10657 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
10658 2 : info->far_ptr = & ((X_ProximitySensor *) node)->center;
10659 2 : return GF_OK;
10660 2 : case 1:
10661 2 : info->name = "size";
10662 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10663 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
10664 2 : info->far_ptr = & ((X_ProximitySensor *) node)->size;
10665 2 : return GF_OK;
10666 2 : case 2:
10667 2 : info->name = "enabled";
10668 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10669 2 : info->fieldType = GF_SG_VRML_SFBOOL;
10670 2 : info->far_ptr = & ((X_ProximitySensor *) node)->enabled;
10671 2 : return GF_OK;
10672 2 : case 3:
10673 2 : info->name = "isActive";
10674 2 : info->eventType = GF_SG_EVENT_OUT;
10675 2 : info->fieldType = GF_SG_VRML_SFBOOL;
10676 2 : info->far_ptr = & ((X_ProximitySensor *) node)->isActive;
10677 2 : return GF_OK;
10678 2 : case 4:
10679 2 : info->name = "position_changed";
10680 2 : info->eventType = GF_SG_EVENT_OUT;
10681 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
10682 2 : info->far_ptr = & ((X_ProximitySensor *) node)->position_changed;
10683 2 : return GF_OK;
10684 2 : case 5:
10685 2 : info->name = "orientation_changed";
10686 2 : info->eventType = GF_SG_EVENT_OUT;
10687 2 : info->fieldType = GF_SG_VRML_SFROTATION;
10688 2 : info->far_ptr = & ((X_ProximitySensor *) node)->orientation_changed;
10689 2 : return GF_OK;
10690 2 : case 6:
10691 2 : info->name = "enterTime";
10692 2 : info->eventType = GF_SG_EVENT_OUT;
10693 2 : info->fieldType = GF_SG_VRML_SFTIME;
10694 2 : info->far_ptr = & ((X_ProximitySensor *) node)->enterTime;
10695 2 : return GF_OK;
10696 2 : case 7:
10697 2 : info->name = "exitTime";
10698 2 : info->eventType = GF_SG_EVENT_OUT;
10699 2 : info->fieldType = GF_SG_VRML_SFTIME;
10700 2 : info->far_ptr = & ((X_ProximitySensor *) node)->exitTime;
10701 2 : return GF_OK;
10702 2 : case 8:
10703 2 : info->name = "metadata";
10704 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10705 2 : info->fieldType = GF_SG_VRML_SFNODE;
10706 2 : info->NDTtype = NDT_SFMetadataNode;
10707 2 : info->far_ptr = & ((X_ProximitySensor *)node)->metadata;
10708 2 : return GF_OK;
10709 2 : case 9:
10710 2 : info->name = "centerOfRotation_changed";
10711 2 : info->eventType = GF_SG_EVENT_OUT;
10712 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
10713 2 : info->far_ptr = & ((X_ProximitySensor *) node)->centerOfRotation_changed;
10714 2 : return GF_OK;
10715 : default:
10716 : return GF_BAD_PARAM;
10717 : }
10718 : }
10719 :
10720 :
10721 10 : static s32 ProximitySensor_get_field_index_by_name(char *name)
10722 : {
10723 10 : if (!strcmp("center", name)) return 0;
10724 9 : if (!strcmp("size", name)) return 1;
10725 8 : if (!strcmp("enabled", name)) return 2;
10726 7 : if (!strcmp("isActive", name)) return 3;
10727 6 : if (!strcmp("position_changed", name)) return 4;
10728 5 : if (!strcmp("orientation_changed", name)) return 5;
10729 4 : if (!strcmp("enterTime", name)) return 6;
10730 3 : if (!strcmp("exitTime", name)) return 7;
10731 2 : if (!strcmp("metadata", name)) return 8;
10732 1 : if (!strcmp("centerOfRotation_changed", name)) return 9;
10733 0 : return -1;
10734 : }
10735 :
10736 :
10737 1 : static GF_Node *ProximitySensor_Create()
10738 : {
10739 : X_ProximitySensor *p;
10740 1 : GF_SAFEALLOC(p, X_ProximitySensor);
10741 1 : if(!p) return NULL;
10742 1 : gf_node_setup((GF_Node *)p, TAG_X3D_ProximitySensor);
10743 :
10744 : /*default field values*/
10745 1 : p->center.x = FLT2FIX(0);
10746 1 : p->center.y = FLT2FIX(0);
10747 1 : p->center.z = FLT2FIX(0);
10748 1 : p->size.x = FLT2FIX(0);
10749 1 : p->size.y = FLT2FIX(0);
10750 1 : p->size.z = FLT2FIX(0);
10751 1 : p->enabled = 1;
10752 1 : return (GF_Node *)p;
10753 : }
10754 :
10755 :
10756 : /*
10757 : ReceiverPdu Node deletion
10758 : */
10759 :
10760 1 : static void ReceiverPdu_Del(GF_Node *node)
10761 : {
10762 : X_ReceiverPdu *p = (X_ReceiverPdu *) node;
10763 1 : gf_sg_sfstring_del(p->address);
10764 1 : gf_sg_sfstring_del(p->multicastRelayHost);
10765 1 : gf_sg_sfstring_del(p->networkMode);
10766 1 : gf_node_unregister((GF_Node *) p->metadata, node);
10767 1 : gf_node_free((GF_Node *)p);
10768 1 : }
10769 :
10770 :
10771 : static u32 ReceiverPdu_get_field_count(GF_Node *node, u8 dummy)
10772 : {
10773 : return 26;
10774 : }
10775 :
10776 52 : static GF_Err ReceiverPdu_get_field(GF_Node *node, GF_FieldInfo *info)
10777 : {
10778 52 : switch (info->fieldIndex) {
10779 2 : case 0:
10780 2 : info->name = "address";
10781 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10782 2 : info->fieldType = GF_SG_VRML_SFSTRING;
10783 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->address;
10784 2 : return GF_OK;
10785 2 : case 1:
10786 2 : info->name = "applicationID";
10787 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10788 2 : info->fieldType = GF_SG_VRML_SFINT32;
10789 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->applicationID;
10790 2 : return GF_OK;
10791 2 : case 2:
10792 2 : info->name = "entityID";
10793 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10794 2 : info->fieldType = GF_SG_VRML_SFINT32;
10795 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->entityID;
10796 2 : return GF_OK;
10797 2 : case 3:
10798 2 : info->name = "multicastRelayHost";
10799 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10800 2 : info->fieldType = GF_SG_VRML_SFSTRING;
10801 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->multicastRelayHost;
10802 2 : return GF_OK;
10803 2 : case 4:
10804 2 : info->name = "multicastRelayPort";
10805 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10806 2 : info->fieldType = GF_SG_VRML_SFINT32;
10807 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->multicastRelayPort;
10808 2 : return GF_OK;
10809 2 : case 5:
10810 2 : info->name = "networkMode";
10811 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10812 2 : info->fieldType = GF_SG_VRML_SFSTRING;
10813 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->networkMode;
10814 2 : return GF_OK;
10815 2 : case 6:
10816 2 : info->name = "port";
10817 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10818 2 : info->fieldType = GF_SG_VRML_SFINT32;
10819 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->port;
10820 2 : return GF_OK;
10821 2 : case 7:
10822 2 : info->name = "radioID";
10823 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10824 2 : info->fieldType = GF_SG_VRML_SFINT32;
10825 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->radioID;
10826 2 : return GF_OK;
10827 2 : case 8:
10828 2 : info->name = "readInterval";
10829 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10830 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
10831 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->readInterval;
10832 2 : return GF_OK;
10833 2 : case 9:
10834 2 : info->name = "receivedPower";
10835 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10836 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
10837 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->receivedPower;
10838 2 : return GF_OK;
10839 2 : case 10:
10840 2 : info->name = "receiverState";
10841 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10842 2 : info->fieldType = GF_SG_VRML_SFINT32;
10843 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->receiverState;
10844 2 : return GF_OK;
10845 2 : case 11:
10846 2 : info->name = "rtpHeaderExpected";
10847 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10848 2 : info->fieldType = GF_SG_VRML_SFBOOL;
10849 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->rtpHeaderExpected;
10850 2 : return GF_OK;
10851 2 : case 12:
10852 2 : info->name = "siteID";
10853 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10854 2 : info->fieldType = GF_SG_VRML_SFINT32;
10855 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->siteID;
10856 2 : return GF_OK;
10857 2 : case 13:
10858 2 : info->name = "transmitterApplicationID";
10859 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10860 2 : info->fieldType = GF_SG_VRML_SFINT32;
10861 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->transmitterApplicationID;
10862 2 : return GF_OK;
10863 2 : case 14:
10864 2 : info->name = "transmitterEntityID";
10865 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10866 2 : info->fieldType = GF_SG_VRML_SFINT32;
10867 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->transmitterEntityID;
10868 2 : return GF_OK;
10869 2 : case 15:
10870 2 : info->name = "transmitterRadioID";
10871 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10872 2 : info->fieldType = GF_SG_VRML_SFINT32;
10873 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->transmitterRadioID;
10874 2 : return GF_OK;
10875 2 : case 16:
10876 2 : info->name = "transmitterSiteID";
10877 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10878 2 : info->fieldType = GF_SG_VRML_SFINT32;
10879 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->transmitterSiteID;
10880 2 : return GF_OK;
10881 2 : case 17:
10882 2 : info->name = "whichGeometry";
10883 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10884 2 : info->fieldType = GF_SG_VRML_SFINT32;
10885 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->whichGeometry;
10886 2 : return GF_OK;
10887 2 : case 18:
10888 2 : info->name = "writeInterval";
10889 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10890 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
10891 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->writeInterval;
10892 2 : return GF_OK;
10893 2 : case 19:
10894 2 : info->name = "isActive";
10895 2 : info->eventType = GF_SG_EVENT_OUT;
10896 2 : info->fieldType = GF_SG_VRML_SFBOOL;
10897 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->isActive;
10898 2 : return GF_OK;
10899 2 : case 20:
10900 2 : info->name = "isNetworkReader";
10901 2 : info->eventType = GF_SG_EVENT_OUT;
10902 2 : info->fieldType = GF_SG_VRML_SFBOOL;
10903 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->isNetworkReader;
10904 2 : return GF_OK;
10905 2 : case 21:
10906 2 : info->name = "isNetworkWriter";
10907 2 : info->eventType = GF_SG_EVENT_OUT;
10908 2 : info->fieldType = GF_SG_VRML_SFBOOL;
10909 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->isNetworkWriter;
10910 2 : return GF_OK;
10911 2 : case 22:
10912 2 : info->name = "isRtpHeaderHeard";
10913 2 : info->eventType = GF_SG_EVENT_OUT;
10914 2 : info->fieldType = GF_SG_VRML_SFBOOL;
10915 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->isRtpHeaderHeard;
10916 2 : return GF_OK;
10917 2 : case 23:
10918 2 : info->name = "isStandAlone";
10919 2 : info->eventType = GF_SG_EVENT_OUT;
10920 2 : info->fieldType = GF_SG_VRML_SFBOOL;
10921 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->isStandAlone;
10922 2 : return GF_OK;
10923 2 : case 24:
10924 2 : info->name = "timestamp";
10925 2 : info->eventType = GF_SG_EVENT_OUT;
10926 2 : info->fieldType = GF_SG_VRML_SFTIME;
10927 2 : info->far_ptr = & ((X_ReceiverPdu *) node)->timestamp;
10928 2 : return GF_OK;
10929 2 : case 25:
10930 2 : info->name = "metadata";
10931 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10932 2 : info->fieldType = GF_SG_VRML_SFNODE;
10933 2 : info->NDTtype = NDT_SFMetadataNode;
10934 2 : info->far_ptr = & ((X_ReceiverPdu *)node)->metadata;
10935 2 : return GF_OK;
10936 : default:
10937 : return GF_BAD_PARAM;
10938 : }
10939 : }
10940 :
10941 :
10942 26 : static s32 ReceiverPdu_get_field_index_by_name(char *name)
10943 : {
10944 26 : if (!strcmp("address", name)) return 0;
10945 25 : if (!strcmp("applicationID", name)) return 1;
10946 24 : if (!strcmp("entityID", name)) return 2;
10947 23 : if (!strcmp("multicastRelayHost", name)) return 3;
10948 22 : if (!strcmp("multicastRelayPort", name)) return 4;
10949 21 : if (!strcmp("networkMode", name)) return 5;
10950 20 : if (!strcmp("port", name)) return 6;
10951 19 : if (!strcmp("radioID", name)) return 7;
10952 18 : if (!strcmp("readInterval", name)) return 8;
10953 17 : if (!strcmp("receivedPower", name)) return 9;
10954 16 : if (!strcmp("receiverState", name)) return 10;
10955 15 : if (!strcmp("rtpHeaderExpected", name)) return 11;
10956 14 : if (!strcmp("siteID", name)) return 12;
10957 13 : if (!strcmp("transmitterApplicationID", name)) return 13;
10958 12 : if (!strcmp("transmitterEntityID", name)) return 14;
10959 11 : if (!strcmp("transmitterRadioID", name)) return 15;
10960 10 : if (!strcmp("transmitterSiteID", name)) return 16;
10961 9 : if (!strcmp("whichGeometry", name)) return 17;
10962 8 : if (!strcmp("writeInterval", name)) return 18;
10963 7 : if (!strcmp("isActive", name)) return 19;
10964 6 : if (!strcmp("isNetworkReader", name)) return 20;
10965 5 : if (!strcmp("isNetworkWriter", name)) return 21;
10966 4 : if (!strcmp("isRtpHeaderHeard", name)) return 22;
10967 3 : if (!strcmp("isStandAlone", name)) return 23;
10968 2 : if (!strcmp("timestamp", name)) return 24;
10969 1 : if (!strcmp("metadata", name)) return 25;
10970 0 : return -1;
10971 : }
10972 :
10973 :
10974 1 : static GF_Node *ReceiverPdu_Create()
10975 : {
10976 : X_ReceiverPdu *p;
10977 1 : GF_SAFEALLOC(p, X_ReceiverPdu);
10978 1 : if(!p) return NULL;
10979 1 : gf_node_setup((GF_Node *)p, TAG_X3D_ReceiverPdu);
10980 :
10981 : /*default field values*/
10982 1 : p->address.buffer = (char*) gf_malloc(sizeof(char) * 10);
10983 : strcpy(p->address.buffer, "localhost");
10984 1 : p->applicationID = 1;
10985 1 : p->entityID = 0;
10986 1 : p->multicastRelayPort = 0;
10987 1 : p->networkMode.buffer = (char*) gf_malloc(sizeof(char) * 11);
10988 : strcpy(p->networkMode.buffer, "standAlone");
10989 1 : p->port = 0;
10990 1 : p->radioID = 0;
10991 1 : p->readInterval = FLT2FIX(0.1);
10992 1 : p->receivedPower = FLT2FIX(0.0);
10993 1 : p->receiverState = 0;
10994 1 : p->siteID = 0;
10995 1 : p->transmitterApplicationID = 1;
10996 1 : p->transmitterEntityID = 0;
10997 1 : p->transmitterRadioID = 0;
10998 1 : p->transmitterSiteID = 0;
10999 1 : p->whichGeometry = 1;
11000 1 : p->writeInterval = FLT2FIX(1.0);
11001 1 : return (GF_Node *)p;
11002 : }
11003 :
11004 :
11005 : /*
11006 : Rectangle2D Node deletion
11007 : */
11008 :
11009 : static void Rectangle2D_Del(GF_Node *node)
11010 : {
11011 : X_Rectangle2D *p = (X_Rectangle2D *) node;
11012 1 : gf_node_unregister((GF_Node *) p->metadata, node);
11013 1 : gf_node_free((GF_Node *)p);
11014 : }
11015 :
11016 :
11017 : static u32 Rectangle2D_get_field_count(GF_Node *node, u8 dummy)
11018 : {
11019 : return 2;
11020 : }
11021 :
11022 : static GF_Err Rectangle2D_get_field(GF_Node *node, GF_FieldInfo *info)
11023 : {
11024 4 : switch (info->fieldIndex) {
11025 2 : case 0:
11026 2 : info->name = "size";
11027 2 : info->eventType = GF_SG_EVENT_FIELD;
11028 2 : info->fieldType = GF_SG_VRML_SFVEC2F;
11029 2 : info->far_ptr = & ((X_Rectangle2D *) node)->size;
11030 : return GF_OK;
11031 2 : case 1:
11032 2 : info->name = "metadata";
11033 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11034 2 : info->fieldType = GF_SG_VRML_SFNODE;
11035 2 : info->NDTtype = NDT_SFMetadataNode;
11036 2 : info->far_ptr = & ((X_Rectangle2D *)node)->metadata;
11037 : return GF_OK;
11038 : default:
11039 : return GF_BAD_PARAM;
11040 : }
11041 : }
11042 :
11043 :
11044 2 : static s32 Rectangle2D_get_field_index_by_name(char *name)
11045 : {
11046 2 : if (!strcmp("size", name)) return 0;
11047 1 : if (!strcmp("metadata", name)) return 1;
11048 0 : return -1;
11049 : }
11050 :
11051 :
11052 1 : static GF_Node *Rectangle2D_Create()
11053 : {
11054 : X_Rectangle2D *p;
11055 1 : GF_SAFEALLOC(p, X_Rectangle2D);
11056 1 : if(!p) return NULL;
11057 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Rectangle2D);
11058 :
11059 : /*default field values*/
11060 1 : p->size.x = FLT2FIX(2);
11061 1 : p->size.y = FLT2FIX(2);
11062 1 : return (GF_Node *)p;
11063 : }
11064 :
11065 :
11066 : /*
11067 : ScalarInterpolator Node deletion
11068 : */
11069 :
11070 1 : static void ScalarInterpolator_Del(GF_Node *node)
11071 : {
11072 : X_ScalarInterpolator *p = (X_ScalarInterpolator *) node;
11073 1 : gf_sg_mffloat_del(p->key);
11074 1 : gf_sg_mffloat_del(p->keyValue);
11075 1 : gf_node_unregister((GF_Node *) p->metadata, node);
11076 1 : gf_node_free((GF_Node *)p);
11077 1 : }
11078 :
11079 :
11080 : static u32 ScalarInterpolator_get_field_count(GF_Node *node, u8 dummy)
11081 : {
11082 : return 5;
11083 : }
11084 :
11085 10 : static GF_Err ScalarInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
11086 : {
11087 10 : switch (info->fieldIndex) {
11088 2 : case 0:
11089 2 : info->name = "set_fraction";
11090 2 : info->eventType = GF_SG_EVENT_IN;
11091 2 : info->on_event_in = ((X_ScalarInterpolator *)node)->on_set_fraction;
11092 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11093 2 : info->far_ptr = & ((X_ScalarInterpolator *) node)->set_fraction;
11094 2 : return GF_OK;
11095 2 : case 1:
11096 2 : info->name = "key";
11097 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11098 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
11099 2 : info->far_ptr = & ((X_ScalarInterpolator *) node)->key;
11100 2 : return GF_OK;
11101 2 : case 2:
11102 2 : info->name = "keyValue";
11103 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11104 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
11105 2 : info->far_ptr = & ((X_ScalarInterpolator *) node)->keyValue;
11106 2 : return GF_OK;
11107 2 : case 3:
11108 2 : info->name = "value_changed";
11109 2 : info->eventType = GF_SG_EVENT_OUT;
11110 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11111 2 : info->far_ptr = & ((X_ScalarInterpolator *) node)->value_changed;
11112 2 : return GF_OK;
11113 2 : case 4:
11114 2 : info->name = "metadata";
11115 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11116 2 : info->fieldType = GF_SG_VRML_SFNODE;
11117 2 : info->NDTtype = NDT_SFMetadataNode;
11118 2 : info->far_ptr = & ((X_ScalarInterpolator *)node)->metadata;
11119 2 : return GF_OK;
11120 : default:
11121 : return GF_BAD_PARAM;
11122 : }
11123 : }
11124 :
11125 :
11126 5 : static s32 ScalarInterpolator_get_field_index_by_name(char *name)
11127 : {
11128 5 : if (!strcmp("set_fraction", name)) return 0;
11129 4 : if (!strcmp("key", name)) return 1;
11130 3 : if (!strcmp("keyValue", name)) return 2;
11131 2 : if (!strcmp("value_changed", name)) return 3;
11132 1 : if (!strcmp("metadata", name)) return 4;
11133 0 : return -1;
11134 : }
11135 :
11136 :
11137 1 : static GF_Node *ScalarInterpolator_Create()
11138 : {
11139 : X_ScalarInterpolator *p;
11140 1 : GF_SAFEALLOC(p, X_ScalarInterpolator);
11141 1 : if(!p) return NULL;
11142 1 : gf_node_setup((GF_Node *)p, TAG_X3D_ScalarInterpolator);
11143 :
11144 : /*default field values*/
11145 1 : return (GF_Node *)p;
11146 : }
11147 :
11148 :
11149 : /*
11150 : Script Node deletion
11151 : */
11152 :
11153 2 : static void Script_Del(GF_Node *node)
11154 : {
11155 : X_Script *p = (X_Script *) node;
11156 2 : gf_sg_mfscript_del(p->url);
11157 2 : gf_node_unregister((GF_Node *) p->metadata, node);
11158 2 : gf_node_free((GF_Node *)p);
11159 2 : }
11160 :
11161 :
11162 : static u32 Script_get_field_count(GF_Node *node, u8 dummy)
11163 : {
11164 : return 4;
11165 : }
11166 :
11167 107 : static GF_Err Script_get_field(GF_Node *node, GF_FieldInfo *info)
11168 : {
11169 107 : switch (info->fieldIndex) {
11170 29 : case 0:
11171 29 : info->name = "url";
11172 29 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11173 29 : info->fieldType = GF_SG_VRML_MFSCRIPT;
11174 29 : info->far_ptr = & ((X_Script *) node)->url;
11175 29 : return GF_OK;
11176 27 : case 1:
11177 27 : info->name = "directOutput";
11178 27 : info->eventType = GF_SG_EVENT_FIELD;
11179 27 : info->fieldType = GF_SG_VRML_SFBOOL;
11180 27 : info->far_ptr = & ((X_Script *) node)->directOutput;
11181 27 : return GF_OK;
11182 26 : case 2:
11183 26 : info->name = "mustEvaluate";
11184 26 : info->eventType = GF_SG_EVENT_FIELD;
11185 26 : info->fieldType = GF_SG_VRML_SFBOOL;
11186 26 : info->far_ptr = & ((X_Script *) node)->mustEvaluate;
11187 26 : return GF_OK;
11188 25 : case 3:
11189 25 : info->name = "metadata";
11190 25 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11191 25 : info->fieldType = GF_SG_VRML_SFNODE;
11192 25 : info->NDTtype = NDT_SFMetadataNode;
11193 25 : info->far_ptr = & ((X_Script *)node)->metadata;
11194 25 : return GF_OK;
11195 : default:
11196 : return GF_BAD_PARAM;
11197 : }
11198 : }
11199 :
11200 :
11201 0 : static s32 Script_get_field_index_by_name(char *name)
11202 : {
11203 0 : if (!strcmp("url", name)) return 0;
11204 0 : if (!strcmp("directOutput", name)) return 1;
11205 0 : if (!strcmp("mustEvaluate", name)) return 2;
11206 0 : if (!strcmp("metadata", name)) return 3;
11207 0 : return -1;
11208 : }
11209 :
11210 :
11211 2 : static GF_Node *Script_Create()
11212 : {
11213 : X_Script *p;
11214 2 : GF_SAFEALLOC(p, X_Script);
11215 2 : if(!p) return NULL;
11216 2 : gf_node_setup((GF_Node *)p, TAG_X3D_Script);
11217 :
11218 : /*default field values*/
11219 2 : return (GF_Node *)p;
11220 : }
11221 :
11222 :
11223 : /*
11224 : Shape Node deletion
11225 : */
11226 :
11227 33 : static void Shape_Del(GF_Node *node)
11228 : {
11229 : X_Shape *p = (X_Shape *) node;
11230 33 : gf_node_unregister((GF_Node *) p->appearance, node);
11231 33 : gf_node_unregister((GF_Node *) p->geometry, node);
11232 33 : gf_node_unregister((GF_Node *) p->metadata, node);
11233 33 : gf_node_free((GF_Node *)p);
11234 33 : }
11235 :
11236 :
11237 : static u32 Shape_get_field_count(GF_Node *node, u8 dummy)
11238 : {
11239 : return 3;
11240 : }
11241 :
11242 : static GF_Err Shape_get_field(GF_Node *node, GF_FieldInfo *info)
11243 : {
11244 68 : switch (info->fieldIndex) {
11245 32 : case 0:
11246 32 : info->name = "appearance";
11247 32 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11248 32 : info->fieldType = GF_SG_VRML_SFNODE;
11249 32 : info->NDTtype = NDT_SFAppearanceNode;
11250 32 : info->far_ptr = & ((X_Shape *)node)->appearance;
11251 : return GF_OK;
11252 34 : case 1:
11253 34 : info->name = "geometry";
11254 34 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11255 34 : info->fieldType = GF_SG_VRML_SFNODE;
11256 34 : info->NDTtype = NDT_SFGeometryNode;
11257 34 : info->far_ptr = & ((X_Shape *)node)->geometry;
11258 : return GF_OK;
11259 2 : case 2:
11260 2 : info->name = "metadata";
11261 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11262 2 : info->fieldType = GF_SG_VRML_SFNODE;
11263 2 : info->NDTtype = NDT_SFMetadataNode;
11264 2 : info->far_ptr = & ((X_Shape *)node)->metadata;
11265 : return GF_OK;
11266 : default:
11267 : return GF_BAD_PARAM;
11268 : }
11269 : }
11270 :
11271 :
11272 65 : static s32 Shape_get_field_index_by_name(char *name)
11273 : {
11274 65 : if (!strcmp("appearance", name)) return 0;
11275 34 : if (!strcmp("geometry", name)) return 1;
11276 1 : if (!strcmp("metadata", name)) return 2;
11277 0 : return -1;
11278 : }
11279 :
11280 :
11281 33 : static GF_Node *Shape_Create()
11282 : {
11283 : X_Shape *p;
11284 33 : GF_SAFEALLOC(p, X_Shape);
11285 33 : if(!p) return NULL;
11286 33 : gf_node_setup((GF_Node *)p, TAG_X3D_Shape);
11287 :
11288 : /*default field values*/
11289 33 : return (GF_Node *)p;
11290 : }
11291 :
11292 :
11293 : /*
11294 : SignalPdu Node deletion
11295 : */
11296 :
11297 1 : static void SignalPdu_Del(GF_Node *node)
11298 : {
11299 : X_SignalPdu *p = (X_SignalPdu *) node;
11300 1 : gf_sg_sfstring_del(p->address);
11301 1 : gf_sg_mfint32_del(p->data);
11302 1 : gf_sg_sfstring_del(p->multicastRelayHost);
11303 1 : gf_sg_sfstring_del(p->networkMode);
11304 1 : gf_node_unregister((GF_Node *) p->metadata, node);
11305 1 : gf_node_free((GF_Node *)p);
11306 1 : }
11307 :
11308 :
11309 : static u32 SignalPdu_get_field_count(GF_Node *node, u8 dummy)
11310 : {
11311 : return 26;
11312 : }
11313 :
11314 52 : static GF_Err SignalPdu_get_field(GF_Node *node, GF_FieldInfo *info)
11315 : {
11316 52 : switch (info->fieldIndex) {
11317 2 : case 0:
11318 2 : info->name = "address";
11319 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11320 2 : info->fieldType = GF_SG_VRML_SFSTRING;
11321 2 : info->far_ptr = & ((X_SignalPdu *) node)->address;
11322 2 : return GF_OK;
11323 2 : case 1:
11324 2 : info->name = "applicationID";
11325 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11326 2 : info->fieldType = GF_SG_VRML_SFINT32;
11327 2 : info->far_ptr = & ((X_SignalPdu *) node)->applicationID;
11328 2 : return GF_OK;
11329 2 : case 2:
11330 2 : info->name = "data";
11331 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11332 2 : info->fieldType = GF_SG_VRML_MFINT32;
11333 2 : info->far_ptr = & ((X_SignalPdu *) node)->data;
11334 2 : return GF_OK;
11335 2 : case 3:
11336 2 : info->name = "dataLength";
11337 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11338 2 : info->fieldType = GF_SG_VRML_SFINT32;
11339 2 : info->far_ptr = & ((X_SignalPdu *) node)->dataLength;
11340 2 : return GF_OK;
11341 2 : case 4:
11342 2 : info->name = "encodingScheme";
11343 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11344 2 : info->fieldType = GF_SG_VRML_SFINT32;
11345 2 : info->far_ptr = & ((X_SignalPdu *) node)->encodingScheme;
11346 2 : return GF_OK;
11347 2 : case 5:
11348 2 : info->name = "entityID";
11349 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11350 2 : info->fieldType = GF_SG_VRML_SFINT32;
11351 2 : info->far_ptr = & ((X_SignalPdu *) node)->entityID;
11352 2 : return GF_OK;
11353 2 : case 6:
11354 2 : info->name = "multicastRelayHost";
11355 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11356 2 : info->fieldType = GF_SG_VRML_SFSTRING;
11357 2 : info->far_ptr = & ((X_SignalPdu *) node)->multicastRelayHost;
11358 2 : return GF_OK;
11359 2 : case 7:
11360 2 : info->name = "multicastRelayPort";
11361 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11362 2 : info->fieldType = GF_SG_VRML_SFINT32;
11363 2 : info->far_ptr = & ((X_SignalPdu *) node)->multicastRelayPort;
11364 2 : return GF_OK;
11365 2 : case 8:
11366 2 : info->name = "networkMode";
11367 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11368 2 : info->fieldType = GF_SG_VRML_SFSTRING;
11369 2 : info->far_ptr = & ((X_SignalPdu *) node)->networkMode;
11370 2 : return GF_OK;
11371 2 : case 9:
11372 2 : info->name = "port";
11373 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11374 2 : info->fieldType = GF_SG_VRML_SFINT32;
11375 2 : info->far_ptr = & ((X_SignalPdu *) node)->port;
11376 2 : return GF_OK;
11377 2 : case 10:
11378 2 : info->name = "radioID";
11379 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11380 2 : info->fieldType = GF_SG_VRML_SFINT32;
11381 2 : info->far_ptr = & ((X_SignalPdu *) node)->radioID;
11382 2 : return GF_OK;
11383 2 : case 11:
11384 2 : info->name = "readInterval";
11385 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11386 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11387 2 : info->far_ptr = & ((X_SignalPdu *) node)->readInterval;
11388 2 : return GF_OK;
11389 2 : case 12:
11390 2 : info->name = "rtpHeaderExpected";
11391 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11392 2 : info->fieldType = GF_SG_VRML_SFBOOL;
11393 2 : info->far_ptr = & ((X_SignalPdu *) node)->rtpHeaderExpected;
11394 2 : return GF_OK;
11395 2 : case 13:
11396 2 : info->name = "sampleRate";
11397 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11398 2 : info->fieldType = GF_SG_VRML_SFINT32;
11399 2 : info->far_ptr = & ((X_SignalPdu *) node)->sampleRate;
11400 2 : return GF_OK;
11401 2 : case 14:
11402 2 : info->name = "samples";
11403 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11404 2 : info->fieldType = GF_SG_VRML_SFINT32;
11405 2 : info->far_ptr = & ((X_SignalPdu *) node)->samples;
11406 2 : return GF_OK;
11407 2 : case 15:
11408 2 : info->name = "siteID";
11409 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11410 2 : info->fieldType = GF_SG_VRML_SFINT32;
11411 2 : info->far_ptr = & ((X_SignalPdu *) node)->siteID;
11412 2 : return GF_OK;
11413 2 : case 16:
11414 2 : info->name = "tdlType";
11415 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11416 2 : info->fieldType = GF_SG_VRML_SFINT32;
11417 2 : info->far_ptr = & ((X_SignalPdu *) node)->tdlType;
11418 2 : return GF_OK;
11419 2 : case 17:
11420 2 : info->name = "whichGeometry";
11421 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11422 2 : info->fieldType = GF_SG_VRML_SFINT32;
11423 2 : info->far_ptr = & ((X_SignalPdu *) node)->whichGeometry;
11424 2 : return GF_OK;
11425 2 : case 18:
11426 2 : info->name = "writeInterval";
11427 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11428 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11429 2 : info->far_ptr = & ((X_SignalPdu *) node)->writeInterval;
11430 2 : return GF_OK;
11431 2 : case 19:
11432 2 : info->name = "isActive";
11433 2 : info->eventType = GF_SG_EVENT_OUT;
11434 2 : info->fieldType = GF_SG_VRML_SFBOOL;
11435 2 : info->far_ptr = & ((X_SignalPdu *) node)->isActive;
11436 2 : return GF_OK;
11437 2 : case 20:
11438 2 : info->name = "isNetworkReader";
11439 2 : info->eventType = GF_SG_EVENT_OUT;
11440 2 : info->fieldType = GF_SG_VRML_SFBOOL;
11441 2 : info->far_ptr = & ((X_SignalPdu *) node)->isNetworkReader;
11442 2 : return GF_OK;
11443 2 : case 21:
11444 2 : info->name = "isNetworkWriter";
11445 2 : info->eventType = GF_SG_EVENT_OUT;
11446 2 : info->fieldType = GF_SG_VRML_SFBOOL;
11447 2 : info->far_ptr = & ((X_SignalPdu *) node)->isNetworkWriter;
11448 2 : return GF_OK;
11449 2 : case 22:
11450 2 : info->name = "isRtpHeaderHeard";
11451 2 : info->eventType = GF_SG_EVENT_OUT;
11452 2 : info->fieldType = GF_SG_VRML_SFBOOL;
11453 2 : info->far_ptr = & ((X_SignalPdu *) node)->isRtpHeaderHeard;
11454 2 : return GF_OK;
11455 2 : case 23:
11456 2 : info->name = "isStandAlone";
11457 2 : info->eventType = GF_SG_EVENT_OUT;
11458 2 : info->fieldType = GF_SG_VRML_SFBOOL;
11459 2 : info->far_ptr = & ((X_SignalPdu *) node)->isStandAlone;
11460 2 : return GF_OK;
11461 2 : case 24:
11462 2 : info->name = "timestamp";
11463 2 : info->eventType = GF_SG_EVENT_OUT;
11464 2 : info->fieldType = GF_SG_VRML_SFTIME;
11465 2 : info->far_ptr = & ((X_SignalPdu *) node)->timestamp;
11466 2 : return GF_OK;
11467 2 : case 25:
11468 2 : info->name = "metadata";
11469 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11470 2 : info->fieldType = GF_SG_VRML_SFNODE;
11471 2 : info->NDTtype = NDT_SFMetadataNode;
11472 2 : info->far_ptr = & ((X_SignalPdu *)node)->metadata;
11473 2 : return GF_OK;
11474 : default:
11475 : return GF_BAD_PARAM;
11476 : }
11477 : }
11478 :
11479 :
11480 26 : static s32 SignalPdu_get_field_index_by_name(char *name)
11481 : {
11482 26 : if (!strcmp("address", name)) return 0;
11483 25 : if (!strcmp("applicationID", name)) return 1;
11484 24 : if (!strcmp("data", name)) return 2;
11485 23 : if (!strcmp("dataLength", name)) return 3;
11486 22 : if (!strcmp("encodingScheme", name)) return 4;
11487 21 : if (!strcmp("entityID", name)) return 5;
11488 20 : if (!strcmp("multicastRelayHost", name)) return 6;
11489 19 : if (!strcmp("multicastRelayPort", name)) return 7;
11490 18 : if (!strcmp("networkMode", name)) return 8;
11491 17 : if (!strcmp("port", name)) return 9;
11492 16 : if (!strcmp("radioID", name)) return 10;
11493 15 : if (!strcmp("readInterval", name)) return 11;
11494 14 : if (!strcmp("rtpHeaderExpected", name)) return 12;
11495 13 : if (!strcmp("sampleRate", name)) return 13;
11496 12 : if (!strcmp("samples", name)) return 14;
11497 11 : if (!strcmp("siteID", name)) return 15;
11498 10 : if (!strcmp("tdlType", name)) return 16;
11499 9 : if (!strcmp("whichGeometry", name)) return 17;
11500 8 : if (!strcmp("writeInterval", name)) return 18;
11501 7 : if (!strcmp("isActive", name)) return 19;
11502 6 : if (!strcmp("isNetworkReader", name)) return 20;
11503 5 : if (!strcmp("isNetworkWriter", name)) return 21;
11504 4 : if (!strcmp("isRtpHeaderHeard", name)) return 22;
11505 3 : if (!strcmp("isStandAlone", name)) return 23;
11506 2 : if (!strcmp("timestamp", name)) return 24;
11507 1 : if (!strcmp("metadata", name)) return 25;
11508 0 : return -1;
11509 : }
11510 :
11511 :
11512 1 : static GF_Node *SignalPdu_Create()
11513 : {
11514 : X_SignalPdu *p;
11515 1 : GF_SAFEALLOC(p, X_SignalPdu);
11516 1 : if(!p) return NULL;
11517 1 : gf_node_setup((GF_Node *)p, TAG_X3D_SignalPdu);
11518 :
11519 : /*default field values*/
11520 1 : p->address.buffer = (char*) gf_malloc(sizeof(char) * 10);
11521 : strcpy(p->address.buffer, "localhost");
11522 1 : p->applicationID = 1;
11523 1 : p->dataLength = 0;
11524 1 : p->encodingScheme = 0;
11525 1 : p->entityID = 0;
11526 1 : p->multicastRelayPort = 0;
11527 1 : p->networkMode.buffer = (char*) gf_malloc(sizeof(char) * 11);
11528 : strcpy(p->networkMode.buffer, "standAlone");
11529 1 : p->port = 0;
11530 1 : p->radioID = 0;
11531 1 : p->readInterval = FLT2FIX(0.1);
11532 1 : p->sampleRate = 0;
11533 1 : p->samples = 0;
11534 1 : p->siteID = 0;
11535 1 : p->tdlType = 0;
11536 1 : p->whichGeometry = 1;
11537 1 : p->writeInterval = FLT2FIX(1.0);
11538 1 : return (GF_Node *)p;
11539 : }
11540 :
11541 :
11542 : /*
11543 : Sound Node deletion
11544 : */
11545 :
11546 1 : static void Sound_Del(GF_Node *node)
11547 : {
11548 : X_Sound *p = (X_Sound *) node;
11549 1 : gf_node_unregister((GF_Node *) p->source, node);
11550 1 : gf_node_unregister((GF_Node *) p->metadata, node);
11551 1 : gf_node_free((GF_Node *)p);
11552 1 : }
11553 :
11554 :
11555 : static u32 Sound_get_field_count(GF_Node *node, u8 dummy)
11556 : {
11557 : return 11;
11558 : }
11559 :
11560 22 : static GF_Err Sound_get_field(GF_Node *node, GF_FieldInfo *info)
11561 : {
11562 22 : switch (info->fieldIndex) {
11563 2 : case 0:
11564 2 : info->name = "direction";
11565 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11566 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
11567 2 : info->far_ptr = & ((X_Sound *) node)->direction;
11568 2 : return GF_OK;
11569 2 : case 1:
11570 2 : info->name = "intensity";
11571 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11572 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11573 2 : info->far_ptr = & ((X_Sound *) node)->intensity;
11574 2 : return GF_OK;
11575 2 : case 2:
11576 2 : info->name = "location";
11577 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11578 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
11579 2 : info->far_ptr = & ((X_Sound *) node)->location;
11580 2 : return GF_OK;
11581 2 : case 3:
11582 2 : info->name = "maxBack";
11583 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11584 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11585 2 : info->far_ptr = & ((X_Sound *) node)->maxBack;
11586 2 : return GF_OK;
11587 2 : case 4:
11588 2 : info->name = "maxFront";
11589 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11590 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11591 2 : info->far_ptr = & ((X_Sound *) node)->maxFront;
11592 2 : return GF_OK;
11593 2 : case 5:
11594 2 : info->name = "minBack";
11595 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11596 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11597 2 : info->far_ptr = & ((X_Sound *) node)->minBack;
11598 2 : return GF_OK;
11599 2 : case 6:
11600 2 : info->name = "minFront";
11601 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11602 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11603 2 : info->far_ptr = & ((X_Sound *) node)->minFront;
11604 2 : return GF_OK;
11605 2 : case 7:
11606 2 : info->name = "priority";
11607 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11608 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11609 2 : info->far_ptr = & ((X_Sound *) node)->priority;
11610 2 : return GF_OK;
11611 2 : case 8:
11612 2 : info->name = "source";
11613 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11614 2 : info->fieldType = GF_SG_VRML_SFNODE;
11615 2 : info->NDTtype = NDT_SFAudioNode;
11616 2 : info->far_ptr = & ((X_Sound *)node)->source;
11617 2 : return GF_OK;
11618 2 : case 9:
11619 2 : info->name = "spatialize";
11620 2 : info->eventType = GF_SG_EVENT_FIELD;
11621 2 : info->fieldType = GF_SG_VRML_SFBOOL;
11622 2 : info->far_ptr = & ((X_Sound *) node)->spatialize;
11623 2 : return GF_OK;
11624 2 : case 10:
11625 2 : info->name = "metadata";
11626 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11627 2 : info->fieldType = GF_SG_VRML_SFNODE;
11628 2 : info->NDTtype = NDT_SFMetadataNode;
11629 2 : info->far_ptr = & ((X_Sound *)node)->metadata;
11630 2 : return GF_OK;
11631 : default:
11632 : return GF_BAD_PARAM;
11633 : }
11634 : }
11635 :
11636 :
11637 11 : static s32 Sound_get_field_index_by_name(char *name)
11638 : {
11639 11 : if (!strcmp("direction", name)) return 0;
11640 10 : if (!strcmp("intensity", name)) return 1;
11641 9 : if (!strcmp("location", name)) return 2;
11642 8 : if (!strcmp("maxBack", name)) return 3;
11643 7 : if (!strcmp("maxFront", name)) return 4;
11644 6 : if (!strcmp("minBack", name)) return 5;
11645 5 : if (!strcmp("minFront", name)) return 6;
11646 4 : if (!strcmp("priority", name)) return 7;
11647 3 : if (!strcmp("source", name)) return 8;
11648 2 : if (!strcmp("spatialize", name)) return 9;
11649 1 : if (!strcmp("metadata", name)) return 10;
11650 0 : return -1;
11651 : }
11652 :
11653 :
11654 1 : static GF_Node *Sound_Create()
11655 : {
11656 : X_Sound *p;
11657 1 : GF_SAFEALLOC(p, X_Sound);
11658 1 : if(!p) return NULL;
11659 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Sound);
11660 :
11661 : /*default field values*/
11662 1 : p->direction.x = FLT2FIX(0);
11663 1 : p->direction.y = FLT2FIX(0);
11664 1 : p->direction.z = FLT2FIX(1);
11665 1 : p->intensity = FLT2FIX(1);
11666 1 : p->location.x = FLT2FIX(0);
11667 1 : p->location.y = FLT2FIX(0);
11668 1 : p->location.z = FLT2FIX(0);
11669 1 : p->maxBack = FLT2FIX(10);
11670 1 : p->maxFront = FLT2FIX(10);
11671 1 : p->minBack = FLT2FIX(1);
11672 1 : p->minFront = FLT2FIX(1);
11673 1 : p->priority = FLT2FIX(0);
11674 1 : p->spatialize = 1;
11675 1 : return (GF_Node *)p;
11676 : }
11677 :
11678 :
11679 : /*
11680 : Sphere Node deletion
11681 : */
11682 :
11683 : static void Sphere_Del(GF_Node *node)
11684 : {
11685 : X_Sphere *p = (X_Sphere *) node;
11686 1 : gf_node_unregister((GF_Node *) p->metadata, node);
11687 1 : gf_node_free((GF_Node *)p);
11688 : }
11689 :
11690 :
11691 : static u32 Sphere_get_field_count(GF_Node *node, u8 dummy)
11692 : {
11693 : return 2;
11694 : }
11695 :
11696 : static GF_Err Sphere_get_field(GF_Node *node, GF_FieldInfo *info)
11697 : {
11698 4 : switch (info->fieldIndex) {
11699 2 : case 0:
11700 2 : info->name = "radius";
11701 2 : info->eventType = GF_SG_EVENT_FIELD;
11702 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11703 2 : info->far_ptr = & ((X_Sphere *) node)->radius;
11704 : return GF_OK;
11705 2 : case 1:
11706 2 : info->name = "metadata";
11707 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11708 2 : info->fieldType = GF_SG_VRML_SFNODE;
11709 2 : info->NDTtype = NDT_SFMetadataNode;
11710 2 : info->far_ptr = & ((X_Sphere *)node)->metadata;
11711 : return GF_OK;
11712 : default:
11713 : return GF_BAD_PARAM;
11714 : }
11715 : }
11716 :
11717 :
11718 2 : static s32 Sphere_get_field_index_by_name(char *name)
11719 : {
11720 2 : if (!strcmp("radius", name)) return 0;
11721 1 : if (!strcmp("metadata", name)) return 1;
11722 0 : return -1;
11723 : }
11724 :
11725 :
11726 1 : static GF_Node *Sphere_Create()
11727 : {
11728 : X_Sphere *p;
11729 1 : GF_SAFEALLOC(p, X_Sphere);
11730 1 : if(!p) return NULL;
11731 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Sphere);
11732 :
11733 : /*default field values*/
11734 1 : p->radius = FLT2FIX(1);
11735 1 : return (GF_Node *)p;
11736 : }
11737 :
11738 :
11739 : /*
11740 : SphereSensor Node deletion
11741 : */
11742 :
11743 1 : static void SphereSensor_Del(GF_Node *node)
11744 : {
11745 : X_SphereSensor *p = (X_SphereSensor *) node;
11746 1 : gf_node_unregister((GF_Node *) p->metadata, node);
11747 1 : gf_sg_sfstring_del(p->description);
11748 1 : gf_node_free((GF_Node *)p);
11749 1 : }
11750 :
11751 :
11752 : static u32 SphereSensor_get_field_count(GF_Node *node, u8 dummy)
11753 : {
11754 : return 9;
11755 : }
11756 :
11757 18 : static GF_Err SphereSensor_get_field(GF_Node *node, GF_FieldInfo *info)
11758 : {
11759 18 : switch (info->fieldIndex) {
11760 2 : case 0:
11761 2 : info->name = "autoOffset";
11762 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11763 2 : info->fieldType = GF_SG_VRML_SFBOOL;
11764 2 : info->far_ptr = & ((X_SphereSensor *) node)->autoOffset;
11765 2 : return GF_OK;
11766 2 : case 1:
11767 2 : info->name = "enabled";
11768 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11769 2 : info->fieldType = GF_SG_VRML_SFBOOL;
11770 2 : info->far_ptr = & ((X_SphereSensor *) node)->enabled;
11771 2 : return GF_OK;
11772 2 : case 2:
11773 2 : info->name = "offset";
11774 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11775 2 : info->fieldType = GF_SG_VRML_SFROTATION;
11776 2 : info->far_ptr = & ((X_SphereSensor *) node)->offset;
11777 2 : return GF_OK;
11778 2 : case 3:
11779 2 : info->name = "isActive";
11780 2 : info->eventType = GF_SG_EVENT_OUT;
11781 2 : info->fieldType = GF_SG_VRML_SFBOOL;
11782 2 : info->far_ptr = & ((X_SphereSensor *) node)->isActive;
11783 2 : return GF_OK;
11784 2 : case 4:
11785 2 : info->name = "rotation_changed";
11786 2 : info->eventType = GF_SG_EVENT_OUT;
11787 2 : info->fieldType = GF_SG_VRML_SFROTATION;
11788 2 : info->far_ptr = & ((X_SphereSensor *) node)->rotation_changed;
11789 2 : return GF_OK;
11790 2 : case 5:
11791 2 : info->name = "trackPoint_changed";
11792 2 : info->eventType = GF_SG_EVENT_OUT;
11793 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
11794 2 : info->far_ptr = & ((X_SphereSensor *) node)->trackPoint_changed;
11795 2 : return GF_OK;
11796 2 : case 6:
11797 2 : info->name = "metadata";
11798 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11799 2 : info->fieldType = GF_SG_VRML_SFNODE;
11800 2 : info->NDTtype = NDT_SFMetadataNode;
11801 2 : info->far_ptr = & ((X_SphereSensor *)node)->metadata;
11802 2 : return GF_OK;
11803 2 : case 7:
11804 2 : info->name = "description";
11805 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11806 2 : info->fieldType = GF_SG_VRML_SFSTRING;
11807 2 : info->far_ptr = & ((X_SphereSensor *) node)->description;
11808 2 : return GF_OK;
11809 2 : case 8:
11810 2 : info->name = "isOver";
11811 2 : info->eventType = GF_SG_EVENT_OUT;
11812 2 : info->fieldType = GF_SG_VRML_SFBOOL;
11813 2 : info->far_ptr = & ((X_SphereSensor *) node)->isOver;
11814 2 : return GF_OK;
11815 : default:
11816 : return GF_BAD_PARAM;
11817 : }
11818 : }
11819 :
11820 :
11821 9 : static s32 SphereSensor_get_field_index_by_name(char *name)
11822 : {
11823 9 : if (!strcmp("autoOffset", name)) return 0;
11824 8 : if (!strcmp("enabled", name)) return 1;
11825 7 : if (!strcmp("offset", name)) return 2;
11826 6 : if (!strcmp("isActive", name)) return 3;
11827 5 : if (!strcmp("rotation_changed", name)) return 4;
11828 4 : if (!strcmp("trackPoint_changed", name)) return 5;
11829 3 : if (!strcmp("metadata", name)) return 6;
11830 2 : if (!strcmp("description", name)) return 7;
11831 1 : if (!strcmp("isOver", name)) return 8;
11832 0 : return -1;
11833 : }
11834 :
11835 :
11836 1 : static GF_Node *SphereSensor_Create()
11837 : {
11838 : X_SphereSensor *p;
11839 1 : GF_SAFEALLOC(p, X_SphereSensor);
11840 1 : if(!p) return NULL;
11841 1 : gf_node_setup((GF_Node *)p, TAG_X3D_SphereSensor);
11842 :
11843 : /*default field values*/
11844 1 : p->autoOffset = 1;
11845 1 : p->enabled = 1;
11846 1 : p->offset.x = FLT2FIX(0);
11847 1 : p->offset.y = FLT2FIX(1);
11848 1 : p->offset.z = FLT2FIX(0);
11849 1 : p->offset.q = FLT2FIX(0);
11850 1 : return (GF_Node *)p;
11851 : }
11852 :
11853 :
11854 : /*
11855 : SpotLight Node deletion
11856 : */
11857 :
11858 : static void SpotLight_Del(GF_Node *node)
11859 : {
11860 : X_SpotLight *p = (X_SpotLight *) node;
11861 1 : gf_node_unregister((GF_Node *) p->metadata, node);
11862 1 : gf_node_free((GF_Node *)p);
11863 : }
11864 :
11865 :
11866 : static u32 SpotLight_get_field_count(GF_Node *node, u8 dummy)
11867 : {
11868 : return 11;
11869 : }
11870 :
11871 22 : static GF_Err SpotLight_get_field(GF_Node *node, GF_FieldInfo *info)
11872 : {
11873 22 : switch (info->fieldIndex) {
11874 2 : case 0:
11875 2 : info->name = "ambientIntensity";
11876 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11877 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11878 2 : info->far_ptr = & ((X_SpotLight *) node)->ambientIntensity;
11879 2 : return GF_OK;
11880 2 : case 1:
11881 2 : info->name = "attenuation";
11882 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11883 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
11884 2 : info->far_ptr = & ((X_SpotLight *) node)->attenuation;
11885 2 : return GF_OK;
11886 2 : case 2:
11887 2 : info->name = "beamWidth";
11888 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11889 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11890 2 : info->far_ptr = & ((X_SpotLight *) node)->beamWidth;
11891 2 : return GF_OK;
11892 2 : case 3:
11893 2 : info->name = "color";
11894 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11895 2 : info->fieldType = GF_SG_VRML_SFCOLOR;
11896 2 : info->far_ptr = & ((X_SpotLight *) node)->color;
11897 2 : return GF_OK;
11898 2 : case 4:
11899 2 : info->name = "cutOffAngle";
11900 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11901 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11902 2 : info->far_ptr = & ((X_SpotLight *) node)->cutOffAngle;
11903 2 : return GF_OK;
11904 2 : case 5:
11905 2 : info->name = "direction";
11906 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11907 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
11908 2 : info->far_ptr = & ((X_SpotLight *) node)->direction;
11909 2 : return GF_OK;
11910 2 : case 6:
11911 2 : info->name = "intensity";
11912 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11913 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11914 2 : info->far_ptr = & ((X_SpotLight *) node)->intensity;
11915 2 : return GF_OK;
11916 2 : case 7:
11917 2 : info->name = "location";
11918 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11919 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
11920 2 : info->far_ptr = & ((X_SpotLight *) node)->location;
11921 2 : return GF_OK;
11922 2 : case 8:
11923 2 : info->name = "on";
11924 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11925 2 : info->fieldType = GF_SG_VRML_SFBOOL;
11926 2 : info->far_ptr = & ((X_SpotLight *) node)->on;
11927 2 : return GF_OK;
11928 2 : case 9:
11929 2 : info->name = "radius";
11930 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11931 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
11932 2 : info->far_ptr = & ((X_SpotLight *) node)->radius;
11933 2 : return GF_OK;
11934 2 : case 10:
11935 2 : info->name = "metadata";
11936 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11937 2 : info->fieldType = GF_SG_VRML_SFNODE;
11938 2 : info->NDTtype = NDT_SFMetadataNode;
11939 2 : info->far_ptr = & ((X_SpotLight *)node)->metadata;
11940 2 : return GF_OK;
11941 : default:
11942 : return GF_BAD_PARAM;
11943 : }
11944 : }
11945 :
11946 :
11947 11 : static s32 SpotLight_get_field_index_by_name(char *name)
11948 : {
11949 11 : if (!strcmp("ambientIntensity", name)) return 0;
11950 10 : if (!strcmp("attenuation", name)) return 1;
11951 9 : if (!strcmp("beamWidth", name)) return 2;
11952 8 : if (!strcmp("color", name)) return 3;
11953 7 : if (!strcmp("cutOffAngle", name)) return 4;
11954 6 : if (!strcmp("direction", name)) return 5;
11955 5 : if (!strcmp("intensity", name)) return 6;
11956 4 : if (!strcmp("location", name)) return 7;
11957 3 : if (!strcmp("on", name)) return 8;
11958 2 : if (!strcmp("radius", name)) return 9;
11959 1 : if (!strcmp("metadata", name)) return 10;
11960 0 : return -1;
11961 : }
11962 :
11963 :
11964 1 : static GF_Node *SpotLight_Create()
11965 : {
11966 : X_SpotLight *p;
11967 1 : GF_SAFEALLOC(p, X_SpotLight);
11968 1 : if(!p) return NULL;
11969 1 : gf_node_setup((GF_Node *)p, TAG_X3D_SpotLight);
11970 :
11971 : /*default field values*/
11972 1 : p->ambientIntensity = FLT2FIX(0);
11973 1 : p->attenuation.x = FLT2FIX(1);
11974 1 : p->attenuation.y = FLT2FIX(0);
11975 1 : p->attenuation.z = FLT2FIX(0);
11976 1 : p->beamWidth = FLT2FIX(1.570796);
11977 1 : p->color.red = FLT2FIX(1);
11978 1 : p->color.green = FLT2FIX(1);
11979 1 : p->color.blue = FLT2FIX(1);
11980 1 : p->cutOffAngle = FLT2FIX(0.785398);
11981 1 : p->direction.x = FLT2FIX(0);
11982 1 : p->direction.y = FLT2FIX(0);
11983 1 : p->direction.z = FLT2FIX(-1);
11984 1 : p->intensity = FLT2FIX(1);
11985 1 : p->location.x = FLT2FIX(0);
11986 1 : p->location.y = FLT2FIX(0);
11987 1 : p->location.z = FLT2FIX(0);
11988 1 : p->on = 1;
11989 1 : p->radius = FLT2FIX(100);
11990 1 : return (GF_Node *)p;
11991 : }
11992 :
11993 :
11994 : /*
11995 : StaticGroup Node deletion
11996 : */
11997 :
11998 2 : static void StaticGroup_Del(GF_Node *node)
11999 : {
12000 : X_StaticGroup *p = (X_StaticGroup *) node;
12001 2 : gf_node_unregister((GF_Node *) p->metadata, node);
12002 2 : gf_sg_vrml_parent_destroy(node);
12003 2 : gf_node_free((GF_Node *)p);
12004 2 : }
12005 :
12006 :
12007 : static u32 StaticGroup_get_field_count(GF_Node *node, u8 dummy)
12008 : {
12009 : return 2;
12010 : }
12011 :
12012 : static GF_Err StaticGroup_get_field(GF_Node *node, GF_FieldInfo *info)
12013 : {
12014 5 : switch (info->fieldIndex) {
12015 3 : case 0:
12016 3 : info->name = "children";
12017 3 : info->eventType = GF_SG_EVENT_FIELD;
12018 3 : info->fieldType = GF_SG_VRML_MFNODE;
12019 3 : info->NDTtype = NDT_SF3DNode;
12020 3 : info->far_ptr = & ((X_StaticGroup *)node)->children;
12021 : return GF_OK;
12022 2 : case 1:
12023 2 : info->name = "metadata";
12024 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12025 2 : info->fieldType = GF_SG_VRML_SFNODE;
12026 2 : info->NDTtype = NDT_SFMetadataNode;
12027 2 : info->far_ptr = & ((X_StaticGroup *)node)->metadata;
12028 : return GF_OK;
12029 : default:
12030 : return GF_BAD_PARAM;
12031 : }
12032 : }
12033 :
12034 :
12035 3 : static s32 StaticGroup_get_field_index_by_name(char *name)
12036 : {
12037 3 : if (!strcmp("children", name)) return 0;
12038 1 : if (!strcmp("metadata", name)) return 1;
12039 0 : return -1;
12040 : }
12041 :
12042 :
12043 2 : static GF_Node *StaticGroup_Create()
12044 : {
12045 : X_StaticGroup *p;
12046 2 : GF_SAFEALLOC(p, X_StaticGroup);
12047 2 : if(!p) return NULL;
12048 2 : gf_node_setup((GF_Node *)p, TAG_X3D_StaticGroup);
12049 2 : gf_sg_vrml_parent_setup((GF_Node *) p);
12050 :
12051 : /*default field values*/
12052 2 : return (GF_Node *)p;
12053 : }
12054 :
12055 :
12056 : /*
12057 : StringSensor Node deletion
12058 : */
12059 :
12060 2 : static void StringSensor_Del(GF_Node *node)
12061 : {
12062 : X_StringSensor *p = (X_StringSensor *) node;
12063 2 : gf_sg_sfstring_del(p->enteredText);
12064 2 : gf_sg_sfstring_del(p->finalText);
12065 2 : gf_node_unregister((GF_Node *) p->metadata, node);
12066 2 : gf_node_free((GF_Node *)p);
12067 2 : }
12068 :
12069 :
12070 : static u32 StringSensor_get_field_count(GF_Node *node, u8 dummy)
12071 : {
12072 : return 6;
12073 : }
12074 :
12075 14 : static GF_Err StringSensor_get_field(GF_Node *node, GF_FieldInfo *info)
12076 : {
12077 14 : switch (info->fieldIndex) {
12078 2 : case 0:
12079 2 : info->name = "deletionAllowed";
12080 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12081 2 : info->fieldType = GF_SG_VRML_SFBOOL;
12082 2 : info->far_ptr = & ((X_StringSensor *) node)->deletionAllowed;
12083 2 : return GF_OK;
12084 2 : case 1:
12085 2 : info->name = "enabled";
12086 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12087 2 : info->fieldType = GF_SG_VRML_SFBOOL;
12088 2 : info->far_ptr = & ((X_StringSensor *) node)->enabled;
12089 2 : return GF_OK;
12090 3 : case 2:
12091 3 : info->name = "enteredText";
12092 3 : info->eventType = GF_SG_EVENT_OUT;
12093 3 : info->fieldType = GF_SG_VRML_SFSTRING;
12094 3 : info->far_ptr = & ((X_StringSensor *) node)->enteredText;
12095 3 : return GF_OK;
12096 3 : case 3:
12097 3 : info->name = "finalText";
12098 3 : info->eventType = GF_SG_EVENT_OUT;
12099 3 : info->fieldType = GF_SG_VRML_SFSTRING;
12100 3 : info->far_ptr = & ((X_StringSensor *) node)->finalText;
12101 3 : return GF_OK;
12102 2 : case 4:
12103 2 : info->name = "isActive";
12104 2 : info->eventType = GF_SG_EVENT_OUT;
12105 2 : info->fieldType = GF_SG_VRML_SFBOOL;
12106 2 : info->far_ptr = & ((X_StringSensor *) node)->isActive;
12107 2 : return GF_OK;
12108 2 : case 5:
12109 2 : info->name = "metadata";
12110 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12111 2 : info->fieldType = GF_SG_VRML_SFNODE;
12112 2 : info->NDTtype = NDT_SFMetadataNode;
12113 2 : info->far_ptr = & ((X_StringSensor *)node)->metadata;
12114 2 : return GF_OK;
12115 : default:
12116 : return GF_BAD_PARAM;
12117 : }
12118 : }
12119 :
12120 :
12121 8 : static s32 StringSensor_get_field_index_by_name(char *name)
12122 : {
12123 8 : if (!strcmp("deletionAllowed", name)) return 0;
12124 7 : if (!strcmp("enabled", name)) return 1;
12125 6 : if (!strcmp("enteredText", name)) return 2;
12126 4 : if (!strcmp("finalText", name)) return 3;
12127 2 : if (!strcmp("isActive", name)) return 4;
12128 1 : if (!strcmp("metadata", name)) return 5;
12129 0 : return -1;
12130 : }
12131 :
12132 :
12133 2 : static GF_Node *StringSensor_Create()
12134 : {
12135 : X_StringSensor *p;
12136 2 : GF_SAFEALLOC(p, X_StringSensor);
12137 2 : if(!p) return NULL;
12138 2 : gf_node_setup((GF_Node *)p, TAG_X3D_StringSensor);
12139 :
12140 : /*default field values*/
12141 2 : p->deletionAllowed = 1;
12142 2 : p->enabled = 1;
12143 2 : return (GF_Node *)p;
12144 : }
12145 :
12146 :
12147 : /*
12148 : Switch Node deletion
12149 : */
12150 :
12151 1 : static void Switch_Del(GF_Node *node)
12152 : {
12153 : X_Switch *p = (X_Switch *) node;
12154 1 : gf_node_unregister((GF_Node *) p->metadata, node);
12155 1 : gf_sg_vrml_parent_destroy(node);
12156 1 : gf_node_free((GF_Node *)p);
12157 1 : }
12158 :
12159 :
12160 : static u32 Switch_get_field_count(GF_Node *node, u8 dummy)
12161 : {
12162 : return 5;
12163 : }
12164 :
12165 10 : static GF_Err Switch_get_field(GF_Node *node, GF_FieldInfo *info)
12166 : {
12167 10 : switch (info->fieldIndex) {
12168 2 : case 0:
12169 2 : info->name = "addChildren";
12170 2 : info->eventType = GF_SG_EVENT_IN;
12171 2 : info->on_event_in = ((X_Switch *)node)->on_addChildren;
12172 2 : info->fieldType = GF_SG_VRML_MFNODE;
12173 2 : info->NDTtype = NDT_SF3DNode;
12174 2 : info->far_ptr = & ((X_Switch *)node)->addChildren;
12175 2 : return GF_OK;
12176 2 : case 1:
12177 2 : info->name = "removeChildren";
12178 2 : info->eventType = GF_SG_EVENT_IN;
12179 2 : info->on_event_in = ((X_Switch *)node)->on_removeChildren;
12180 2 : info->fieldType = GF_SG_VRML_MFNODE;
12181 2 : info->NDTtype = NDT_SF3DNode;
12182 2 : info->far_ptr = & ((X_Switch *)node)->removeChildren;
12183 2 : return GF_OK;
12184 2 : case 2:
12185 2 : info->name = "children";
12186 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12187 2 : info->fieldType = GF_SG_VRML_MFNODE;
12188 2 : info->NDTtype = NDT_SF3DNode;
12189 2 : info->far_ptr = & ((X_Switch *)node)->children;
12190 2 : return GF_OK;
12191 2 : case 3:
12192 2 : info->name = "whichChoice";
12193 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12194 2 : info->fieldType = GF_SG_VRML_SFINT32;
12195 2 : info->far_ptr = & ((X_Switch *) node)->whichChoice;
12196 2 : return GF_OK;
12197 2 : case 4:
12198 2 : info->name = "metadata";
12199 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12200 2 : info->fieldType = GF_SG_VRML_SFNODE;
12201 2 : info->NDTtype = NDT_SFMetadataNode;
12202 2 : info->far_ptr = & ((X_Switch *)node)->metadata;
12203 2 : return GF_OK;
12204 : default:
12205 : return GF_BAD_PARAM;
12206 : }
12207 : }
12208 :
12209 :
12210 5 : static s32 Switch_get_field_index_by_name(char *name)
12211 : {
12212 5 : if (!strcmp("addChildren", name)) return 0;
12213 4 : if (!strcmp("removeChildren", name)) return 1;
12214 3 : if (!strcmp("children", name)) return 2;
12215 2 : if (!strcmp("whichChoice", name)) return 3;
12216 1 : if (!strcmp("metadata", name)) return 4;
12217 0 : return -1;
12218 : }
12219 :
12220 :
12221 1 : static GF_Node *Switch_Create()
12222 : {
12223 : X_Switch *p;
12224 1 : GF_SAFEALLOC(p, X_Switch);
12225 1 : if(!p) return NULL;
12226 1 : gf_node_setup((GF_Node *)p, TAG_X3D_Switch);
12227 1 : gf_sg_vrml_parent_setup((GF_Node *) p);
12228 :
12229 : /*default field values*/
12230 1 : p->whichChoice = -1;
12231 1 : return (GF_Node *)p;
12232 : }
12233 :
12234 :
12235 : /*
12236 : Text Node deletion
12237 : */
12238 :
12239 7 : static void Text_Del(GF_Node *node)
12240 : {
12241 : X_Text *p = (X_Text *) node;
12242 7 : gf_sg_mfstring_del(p->string);
12243 7 : gf_sg_mffloat_del(p->length);
12244 7 : gf_node_unregister((GF_Node *) p->fontStyle, node);
12245 7 : gf_node_unregister((GF_Node *) p->metadata, node);
12246 7 : gf_node_free((GF_Node *)p);
12247 7 : }
12248 :
12249 :
12250 : static u32 Text_get_field_count(GF_Node *node, u8 dummy)
12251 : {
12252 : return 5;
12253 : }
12254 :
12255 24 : static GF_Err Text_get_field(GF_Node *node, GF_FieldInfo *info)
12256 : {
12257 24 : switch (info->fieldIndex) {
12258 10 : case 0:
12259 10 : info->name = "string";
12260 10 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12261 10 : info->fieldType = GF_SG_VRML_MFSTRING;
12262 10 : info->far_ptr = & ((X_Text *) node)->string;
12263 10 : return GF_OK;
12264 2 : case 1:
12265 2 : info->name = "length";
12266 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12267 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
12268 2 : info->far_ptr = & ((X_Text *) node)->length;
12269 2 : return GF_OK;
12270 8 : case 2:
12271 8 : info->name = "fontStyle";
12272 8 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12273 8 : info->fieldType = GF_SG_VRML_SFNODE;
12274 8 : info->NDTtype = NDT_SFFontStyleNode;
12275 8 : info->far_ptr = & ((X_Text *)node)->fontStyle;
12276 8 : return GF_OK;
12277 2 : case 3:
12278 2 : info->name = "maxExtent";
12279 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12280 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
12281 2 : info->far_ptr = & ((X_Text *) node)->maxExtent;
12282 2 : return GF_OK;
12283 2 : case 4:
12284 2 : info->name = "metadata";
12285 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12286 2 : info->fieldType = GF_SG_VRML_SFNODE;
12287 2 : info->NDTtype = NDT_SFMetadataNode;
12288 2 : info->far_ptr = & ((X_Text *)node)->metadata;
12289 2 : return GF_OK;
12290 : default:
12291 : return GF_BAD_PARAM;
12292 : }
12293 : }
12294 :
12295 :
12296 19 : static s32 Text_get_field_index_by_name(char *name)
12297 : {
12298 19 : if (!strcmp("string", name)) return 0;
12299 10 : if (!strcmp("length", name)) return 1;
12300 9 : if (!strcmp("fontStyle", name)) return 2;
12301 2 : if (!strcmp("maxExtent", name)) return 3;
12302 1 : if (!strcmp("metadata", name)) return 4;
12303 0 : return -1;
12304 : }
12305 :
12306 :
12307 7 : static GF_Node *Text_Create()
12308 : {
12309 : X_Text *p;
12310 7 : GF_SAFEALLOC(p, X_Text);
12311 7 : if(!p) return NULL;
12312 7 : gf_node_setup((GF_Node *)p, TAG_X3D_Text);
12313 :
12314 : /*default field values*/
12315 7 : p->maxExtent = FLT2FIX(0.0);
12316 7 : return (GF_Node *)p;
12317 : }
12318 :
12319 :
12320 : /*
12321 : TextureBackground Node deletion
12322 : */
12323 :
12324 1 : static void TextureBackground_Del(GF_Node *node)
12325 : {
12326 : X_TextureBackground *p = (X_TextureBackground *) node;
12327 1 : gf_sg_mffloat_del(p->groundAngle);
12328 1 : gf_sg_mfcolor_del(p->groundColor);
12329 1 : gf_node_unregister((GF_Node *) p->backTexture, node);
12330 1 : gf_node_unregister((GF_Node *) p->bottomTexture, node);
12331 1 : gf_node_unregister((GF_Node *) p->frontTexture, node);
12332 1 : gf_node_unregister((GF_Node *) p->leftTexture, node);
12333 1 : gf_node_unregister((GF_Node *) p->rightTexture, node);
12334 1 : gf_node_unregister((GF_Node *) p->topTexture, node);
12335 1 : gf_sg_mffloat_del(p->skyAngle);
12336 1 : gf_sg_mfcolor_del(p->skyColor);
12337 1 : gf_sg_mffloat_del(p->transparency);
12338 1 : gf_node_unregister((GF_Node *) p->metadata, node);
12339 1 : gf_node_free((GF_Node *)p);
12340 1 : }
12341 :
12342 :
12343 : static u32 TextureBackground_get_field_count(GF_Node *node, u8 dummy)
12344 : {
12345 : return 15;
12346 : }
12347 :
12348 30 : static GF_Err TextureBackground_get_field(GF_Node *node, GF_FieldInfo *info)
12349 : {
12350 30 : switch (info->fieldIndex) {
12351 2 : case 0:
12352 2 : info->name = "set_bind";
12353 2 : info->eventType = GF_SG_EVENT_IN;
12354 2 : info->on_event_in = ((X_TextureBackground *)node)->on_set_bind;
12355 2 : info->fieldType = GF_SG_VRML_SFBOOL;
12356 2 : info->far_ptr = & ((X_TextureBackground *) node)->set_bind;
12357 2 : return GF_OK;
12358 2 : case 1:
12359 2 : info->name = "groundAngle";
12360 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12361 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
12362 2 : info->far_ptr = & ((X_TextureBackground *) node)->groundAngle;
12363 2 : return GF_OK;
12364 2 : case 2:
12365 2 : info->name = "groundColor";
12366 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12367 2 : info->fieldType = GF_SG_VRML_MFCOLOR;
12368 2 : info->far_ptr = & ((X_TextureBackground *) node)->groundColor;
12369 2 : return GF_OK;
12370 2 : case 3:
12371 2 : info->name = "backTexture";
12372 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12373 2 : info->fieldType = GF_SG_VRML_SFNODE;
12374 2 : info->NDTtype = NDT_SFTextureNode;
12375 2 : info->far_ptr = & ((X_TextureBackground *)node)->backTexture;
12376 2 : return GF_OK;
12377 2 : case 4:
12378 2 : info->name = "bottomTexture";
12379 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12380 2 : info->fieldType = GF_SG_VRML_SFNODE;
12381 2 : info->NDTtype = NDT_SFTextureNode;
12382 2 : info->far_ptr = & ((X_TextureBackground *)node)->bottomTexture;
12383 2 : return GF_OK;
12384 2 : case 5:
12385 2 : info->name = "frontTexture";
12386 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12387 2 : info->fieldType = GF_SG_VRML_SFNODE;
12388 2 : info->NDTtype = NDT_SFTextureNode;
12389 2 : info->far_ptr = & ((X_TextureBackground *)node)->frontTexture;
12390 2 : return GF_OK;
12391 2 : case 6:
12392 2 : info->name = "leftTexture";
12393 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12394 2 : info->fieldType = GF_SG_VRML_SFNODE;
12395 2 : info->NDTtype = NDT_SFTextureNode;
12396 2 : info->far_ptr = & ((X_TextureBackground *)node)->leftTexture;
12397 2 : return GF_OK;
12398 2 : case 7:
12399 2 : info->name = "rightTexture";
12400 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12401 2 : info->fieldType = GF_SG_VRML_SFNODE;
12402 2 : info->NDTtype = NDT_SFTextureNode;
12403 2 : info->far_ptr = & ((X_TextureBackground *)node)->rightTexture;
12404 2 : return GF_OK;
12405 2 : case 8:
12406 2 : info->name = "topTexture";
12407 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12408 2 : info->fieldType = GF_SG_VRML_SFNODE;
12409 2 : info->NDTtype = NDT_SFTextureNode;
12410 2 : info->far_ptr = & ((X_TextureBackground *)node)->topTexture;
12411 2 : return GF_OK;
12412 2 : case 9:
12413 2 : info->name = "skyAngle";
12414 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12415 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
12416 2 : info->far_ptr = & ((X_TextureBackground *) node)->skyAngle;
12417 2 : return GF_OK;
12418 2 : case 10:
12419 2 : info->name = "skyColor";
12420 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12421 2 : info->fieldType = GF_SG_VRML_MFCOLOR;
12422 2 : info->far_ptr = & ((X_TextureBackground *) node)->skyColor;
12423 2 : return GF_OK;
12424 2 : case 11:
12425 2 : info->name = "transparency";
12426 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12427 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
12428 2 : info->far_ptr = & ((X_TextureBackground *) node)->transparency;
12429 2 : return GF_OK;
12430 2 : case 12:
12431 2 : info->name = "bindTime";
12432 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12433 2 : info->fieldType = GF_SG_VRML_SFTIME;
12434 2 : info->far_ptr = & ((X_TextureBackground *) node)->bindTime;
12435 2 : return GF_OK;
12436 2 : case 13:
12437 2 : info->name = "isBound";
12438 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12439 2 : info->fieldType = GF_SG_VRML_SFBOOL;
12440 2 : info->far_ptr = & ((X_TextureBackground *) node)->isBound;
12441 2 : return GF_OK;
12442 2 : case 14:
12443 2 : info->name = "metadata";
12444 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12445 2 : info->fieldType = GF_SG_VRML_SFNODE;
12446 2 : info->NDTtype = NDT_SFMetadataNode;
12447 2 : info->far_ptr = & ((X_TextureBackground *)node)->metadata;
12448 2 : return GF_OK;
12449 : default:
12450 : return GF_BAD_PARAM;
12451 : }
12452 : }
12453 :
12454 :
12455 15 : static s32 TextureBackground_get_field_index_by_name(char *name)
12456 : {
12457 15 : if (!strcmp("set_bind", name)) return 0;
12458 14 : if (!strcmp("groundAngle", name)) return 1;
12459 13 : if (!strcmp("groundColor", name)) return 2;
12460 12 : if (!strcmp("backTexture", name)) return 3;
12461 11 : if (!strcmp("bottomTexture", name)) return 4;
12462 10 : if (!strcmp("frontTexture", name)) return 5;
12463 9 : if (!strcmp("leftTexture", name)) return 6;
12464 8 : if (!strcmp("rightTexture", name)) return 7;
12465 7 : if (!strcmp("topTexture", name)) return 8;
12466 6 : if (!strcmp("skyAngle", name)) return 9;
12467 5 : if (!strcmp("skyColor", name)) return 10;
12468 4 : if (!strcmp("transparency", name)) return 11;
12469 3 : if (!strcmp("bindTime", name)) return 12;
12470 2 : if (!strcmp("isBound", name)) return 13;
12471 1 : if (!strcmp("metadata", name)) return 14;
12472 0 : return -1;
12473 : }
12474 :
12475 :
12476 1 : static GF_Node *TextureBackground_Create()
12477 : {
12478 : X_TextureBackground *p;
12479 1 : GF_SAFEALLOC(p, X_TextureBackground);
12480 1 : if(!p) return NULL;
12481 1 : gf_node_setup((GF_Node *)p, TAG_X3D_TextureBackground);
12482 :
12483 : /*default field values*/
12484 1 : p->skyColor.vals = (SFColor*)gf_malloc(sizeof(SFColor)*1);
12485 1 : p->skyColor.count = 1;
12486 1 : p->skyColor.vals[0].red = FLT2FIX(0);
12487 1 : p->skyColor.vals[0].green = FLT2FIX(0);
12488 1 : p->skyColor.vals[0].blue = FLT2FIX(0);
12489 1 : p->transparency.vals = (SFFloat *)gf_malloc(sizeof(SFFloat)*1);
12490 1 : p->transparency.count = 1;
12491 1 : p->transparency.vals[0] = FLT2FIX(0);
12492 1 : return (GF_Node *)p;
12493 : }
12494 :
12495 :
12496 : /*
12497 : TextureCoordinate Node deletion
12498 : */
12499 :
12500 1 : static void TextureCoordinate_Del(GF_Node *node)
12501 : {
12502 : X_TextureCoordinate *p = (X_TextureCoordinate *) node;
12503 1 : gf_sg_mfvec2f_del(p->point);
12504 1 : gf_node_unregister((GF_Node *) p->metadata, node);
12505 1 : gf_node_free((GF_Node *)p);
12506 1 : }
12507 :
12508 :
12509 : static u32 TextureCoordinate_get_field_count(GF_Node *node, u8 dummy)
12510 : {
12511 : return 2;
12512 : }
12513 :
12514 : static GF_Err TextureCoordinate_get_field(GF_Node *node, GF_FieldInfo *info)
12515 : {
12516 4 : switch (info->fieldIndex) {
12517 2 : case 0:
12518 2 : info->name = "point";
12519 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12520 2 : info->fieldType = GF_SG_VRML_MFVEC2F;
12521 2 : info->far_ptr = & ((X_TextureCoordinate *) node)->point;
12522 : return GF_OK;
12523 2 : case 1:
12524 2 : info->name = "metadata";
12525 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12526 2 : info->fieldType = GF_SG_VRML_SFNODE;
12527 2 : info->NDTtype = NDT_SFMetadataNode;
12528 2 : info->far_ptr = & ((X_TextureCoordinate *)node)->metadata;
12529 : return GF_OK;
12530 : default:
12531 : return GF_BAD_PARAM;
12532 : }
12533 : }
12534 :
12535 :
12536 2 : static s32 TextureCoordinate_get_field_index_by_name(char *name)
12537 : {
12538 2 : if (!strcmp("point", name)) return 0;
12539 1 : if (!strcmp("metadata", name)) return 1;
12540 0 : return -1;
12541 : }
12542 :
12543 :
12544 1 : static GF_Node *TextureCoordinate_Create()
12545 : {
12546 : X_TextureCoordinate *p;
12547 1 : GF_SAFEALLOC(p, X_TextureCoordinate);
12548 1 : if(!p) return NULL;
12549 1 : gf_node_setup((GF_Node *)p, TAG_X3D_TextureCoordinate);
12550 :
12551 : /*default field values*/
12552 1 : return (GF_Node *)p;
12553 : }
12554 :
12555 :
12556 : /*
12557 : TextureCoordinateGenerator Node deletion
12558 : */
12559 :
12560 2 : static void TextureCoordinateGenerator_Del(GF_Node *node)
12561 : {
12562 : X_TextureCoordinateGenerator *p = (X_TextureCoordinateGenerator *) node;
12563 2 : gf_sg_sfstring_del(p->mode);
12564 2 : gf_sg_mffloat_del(p->parameter);
12565 2 : gf_node_unregister((GF_Node *) p->metadata, node);
12566 2 : gf_node_free((GF_Node *)p);
12567 2 : }
12568 :
12569 :
12570 : static u32 TextureCoordinateGenerator_get_field_count(GF_Node *node, u8 dummy)
12571 : {
12572 : return 3;
12573 : }
12574 :
12575 : static GF_Err TextureCoordinateGenerator_get_field(GF_Node *node, GF_FieldInfo *info)
12576 : {
12577 7 : switch (info->fieldIndex) {
12578 3 : case 0:
12579 3 : info->name = "mode";
12580 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12581 3 : info->fieldType = GF_SG_VRML_SFSTRING;
12582 3 : info->far_ptr = & ((X_TextureCoordinateGenerator *) node)->mode;
12583 : return GF_OK;
12584 2 : case 1:
12585 2 : info->name = "parameter";
12586 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12587 2 : info->fieldType = GF_SG_VRML_MFFLOAT;
12588 2 : info->far_ptr = & ((X_TextureCoordinateGenerator *) node)->parameter;
12589 : return GF_OK;
12590 2 : case 2:
12591 2 : info->name = "metadata";
12592 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12593 2 : info->fieldType = GF_SG_VRML_SFNODE;
12594 2 : info->NDTtype = NDT_SFMetadataNode;
12595 2 : info->far_ptr = & ((X_TextureCoordinateGenerator *)node)->metadata;
12596 : return GF_OK;
12597 : default:
12598 : return GF_BAD_PARAM;
12599 : }
12600 : }
12601 :
12602 :
12603 4 : static s32 TextureCoordinateGenerator_get_field_index_by_name(char *name)
12604 : {
12605 4 : if (!strcmp("mode", name)) return 0;
12606 2 : if (!strcmp("parameter", name)) return 1;
12607 1 : if (!strcmp("metadata", name)) return 2;
12608 0 : return -1;
12609 : }
12610 :
12611 :
12612 2 : static GF_Node *TextureCoordinateGenerator_Create()
12613 : {
12614 : X_TextureCoordinateGenerator *p;
12615 2 : GF_SAFEALLOC(p, X_TextureCoordinateGenerator);
12616 2 : if(!p) return NULL;
12617 2 : gf_node_setup((GF_Node *)p, TAG_X3D_TextureCoordinateGenerator);
12618 :
12619 : /*default field values*/
12620 2 : p->mode.buffer = (char*) gf_malloc(sizeof(char) * 7);
12621 : strcpy(p->mode.buffer, "SPHERE");
12622 2 : return (GF_Node *)p;
12623 : }
12624 :
12625 :
12626 : /*
12627 : TextureTransform Node deletion
12628 : */
12629 :
12630 : static void TextureTransform_Del(GF_Node *node)
12631 : {
12632 : X_TextureTransform *p = (X_TextureTransform *) node;
12633 1 : gf_node_unregister((GF_Node *) p->metadata, node);
12634 1 : gf_node_free((GF_Node *)p);
12635 : }
12636 :
12637 :
12638 : static u32 TextureTransform_get_field_count(GF_Node *node, u8 dummy)
12639 : {
12640 : return 5;
12641 : }
12642 :
12643 10 : static GF_Err TextureTransform_get_field(GF_Node *node, GF_FieldInfo *info)
12644 : {
12645 10 : switch (info->fieldIndex) {
12646 2 : case 0:
12647 2 : info->name = "center";
12648 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12649 2 : info->fieldType = GF_SG_VRML_SFVEC2F;
12650 2 : info->far_ptr = & ((X_TextureTransform *) node)->center;
12651 2 : return GF_OK;
12652 2 : case 1:
12653 2 : info->name = "rotation";
12654 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12655 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
12656 2 : info->far_ptr = & ((X_TextureTransform *) node)->rotation;
12657 2 : return GF_OK;
12658 2 : case 2:
12659 2 : info->name = "scale";
12660 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12661 2 : info->fieldType = GF_SG_VRML_SFVEC2F;
12662 2 : info->far_ptr = & ((X_TextureTransform *) node)->scale;
12663 2 : return GF_OK;
12664 2 : case 3:
12665 2 : info->name = "translation";
12666 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12667 2 : info->fieldType = GF_SG_VRML_SFVEC2F;
12668 2 : info->far_ptr = & ((X_TextureTransform *) node)->translation;
12669 2 : return GF_OK;
12670 2 : case 4:
12671 2 : info->name = "metadata";
12672 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12673 2 : info->fieldType = GF_SG_VRML_SFNODE;
12674 2 : info->NDTtype = NDT_SFMetadataNode;
12675 2 : info->far_ptr = & ((X_TextureTransform *)node)->metadata;
12676 2 : return GF_OK;
12677 : default:
12678 : return GF_BAD_PARAM;
12679 : }
12680 : }
12681 :
12682 :
12683 5 : static s32 TextureTransform_get_field_index_by_name(char *name)
12684 : {
12685 5 : if (!strcmp("center", name)) return 0;
12686 4 : if (!strcmp("rotation", name)) return 1;
12687 3 : if (!strcmp("scale", name)) return 2;
12688 2 : if (!strcmp("translation", name)) return 3;
12689 1 : if (!strcmp("metadata", name)) return 4;
12690 0 : return -1;
12691 : }
12692 :
12693 :
12694 1 : static GF_Node *TextureTransform_Create()
12695 : {
12696 : X_TextureTransform *p;
12697 1 : GF_SAFEALLOC(p, X_TextureTransform);
12698 1 : if(!p) return NULL;
12699 1 : gf_node_setup((GF_Node *)p, TAG_X3D_TextureTransform);
12700 :
12701 : /*default field values*/
12702 1 : p->center.x = FLT2FIX(0);
12703 1 : p->center.y = FLT2FIX(0);
12704 1 : p->rotation = FLT2FIX(0);
12705 1 : p->scale.x = FLT2FIX(1);
12706 1 : p->scale.y = FLT2FIX(1);
12707 1 : p->translation.x = FLT2FIX(0);
12708 1 : p->translation.y = FLT2FIX(0);
12709 1 : return (GF_Node *)p;
12710 : }
12711 :
12712 :
12713 : /*
12714 : TimeSensor Node deletion
12715 : */
12716 :
12717 : static void TimeSensor_Del(GF_Node *node)
12718 : {
12719 : X_TimeSensor *p = (X_TimeSensor *) node;
12720 2 : gf_node_unregister((GF_Node *) p->metadata, node);
12721 2 : gf_node_free((GF_Node *)p);
12722 : }
12723 :
12724 :
12725 : static u32 TimeSensor_get_field_count(GF_Node *node, u8 dummy)
12726 : {
12727 : return 14;
12728 : }
12729 :
12730 39 : static GF_Err TimeSensor_get_field(GF_Node *node, GF_FieldInfo *info)
12731 : {
12732 39 : switch (info->fieldIndex) {
12733 2 : case 0:
12734 2 : info->name = "cycleInterval";
12735 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12736 2 : info->fieldType = GF_SG_VRML_SFTIME;
12737 2 : info->far_ptr = & ((X_TimeSensor *) node)->cycleInterval;
12738 2 : return GF_OK;
12739 2 : case 1:
12740 2 : info->name = "enabled";
12741 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12742 2 : info->fieldType = GF_SG_VRML_SFBOOL;
12743 2 : info->far_ptr = & ((X_TimeSensor *) node)->enabled;
12744 2 : return GF_OK;
12745 2 : case 2:
12746 2 : info->name = "loop";
12747 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12748 2 : info->fieldType = GF_SG_VRML_SFBOOL;
12749 2 : info->far_ptr = & ((X_TimeSensor *) node)->loop;
12750 2 : return GF_OK;
12751 2 : case 3:
12752 2 : info->name = "startTime";
12753 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12754 2 : info->fieldType = GF_SG_VRML_SFTIME;
12755 2 : info->far_ptr = & ((X_TimeSensor *) node)->startTime;
12756 2 : return GF_OK;
12757 2 : case 4:
12758 2 : info->name = "stopTime";
12759 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12760 2 : info->fieldType = GF_SG_VRML_SFTIME;
12761 2 : info->far_ptr = & ((X_TimeSensor *) node)->stopTime;
12762 2 : return GF_OK;
12763 2 : case 5:
12764 2 : info->name = "cycleTime";
12765 2 : info->eventType = GF_SG_EVENT_OUT;
12766 2 : info->fieldType = GF_SG_VRML_SFTIME;
12767 2 : info->far_ptr = & ((X_TimeSensor *) node)->cycleTime;
12768 2 : return GF_OK;
12769 4 : case 6:
12770 4 : info->name = "fraction_changed";
12771 4 : info->eventType = GF_SG_EVENT_OUT;
12772 4 : info->fieldType = GF_SG_VRML_SFFLOAT;
12773 4 : info->far_ptr = & ((X_TimeSensor *) node)->fraction_changed;
12774 4 : return GF_OK;
12775 10 : case 7:
12776 10 : info->name = "isActive";
12777 10 : info->eventType = GF_SG_EVENT_OUT;
12778 10 : info->fieldType = GF_SG_VRML_SFBOOL;
12779 10 : info->far_ptr = & ((X_TimeSensor *) node)->isActive;
12780 10 : return GF_OK;
12781 3 : case 8:
12782 3 : info->name = "time";
12783 3 : info->eventType = GF_SG_EVENT_OUT;
12784 3 : info->fieldType = GF_SG_VRML_SFTIME;
12785 3 : info->far_ptr = & ((X_TimeSensor *) node)->time;
12786 3 : return GF_OK;
12787 2 : case 9:
12788 2 : info->name = "metadata";
12789 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12790 2 : info->fieldType = GF_SG_VRML_SFNODE;
12791 2 : info->NDTtype = NDT_SFMetadataNode;
12792 2 : info->far_ptr = & ((X_TimeSensor *)node)->metadata;
12793 2 : return GF_OK;
12794 2 : case 10:
12795 2 : info->name = "pauseTime";
12796 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12797 2 : info->fieldType = GF_SG_VRML_SFTIME;
12798 2 : info->far_ptr = & ((X_TimeSensor *) node)->pauseTime;
12799 2 : return GF_OK;
12800 2 : case 11:
12801 2 : info->name = "resumeTime";
12802 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12803 2 : info->fieldType = GF_SG_VRML_SFTIME;
12804 2 : info->far_ptr = & ((X_TimeSensor *) node)->resumeTime;
12805 2 : return GF_OK;
12806 2 : case 12:
12807 2 : info->name = "elapsedTime";
12808 2 : info->eventType = GF_SG_EVENT_OUT;
12809 2 : info->fieldType = GF_SG_VRML_SFTIME;
12810 2 : info->far_ptr = & ((X_TimeSensor *) node)->elapsedTime;
12811 2 : return GF_OK;
12812 2 : case 13:
12813 2 : info->name = "isPaused";
12814 2 : info->eventType = GF_SG_EVENT_OUT;
12815 2 : info->fieldType = GF_SG_VRML_SFBOOL;
12816 2 : info->far_ptr = & ((X_TimeSensor *) node)->isPaused;
12817 2 : return GF_OK;
12818 : default:
12819 : return GF_BAD_PARAM;
12820 : }
12821 : }
12822 :
12823 :
12824 25 : static s32 TimeSensor_get_field_index_by_name(char *name)
12825 : {
12826 25 : if (!strcmp("cycleInterval", name)) return 0;
12827 24 : if (!strcmp("enabled", name)) return 1;
12828 23 : if (!strcmp("loop", name)) return 2;
12829 22 : if (!strcmp("startTime", name)) return 3;
12830 21 : if (!strcmp("stopTime", name)) return 4;
12831 20 : if (!strcmp("cycleTime", name)) return 5;
12832 19 : if (!strcmp("fraction_changed", name)) return 6;
12833 16 : if (!strcmp("isActive", name)) return 7;
12834 7 : if (!strcmp("time", name)) return 8;
12835 5 : if (!strcmp("metadata", name)) return 9;
12836 4 : if (!strcmp("pauseTime", name)) return 10;
12837 3 : if (!strcmp("resumeTime", name)) return 11;
12838 2 : if (!strcmp("elapsedTime", name)) return 12;
12839 1 : if (!strcmp("isPaused", name)) return 13;
12840 0 : return -1;
12841 : }
12842 :
12843 :
12844 2 : static GF_Node *TimeSensor_Create()
12845 : {
12846 : X_TimeSensor *p;
12847 2 : GF_SAFEALLOC(p, X_TimeSensor);
12848 2 : if(!p) return NULL;
12849 2 : gf_node_setup((GF_Node *)p, TAG_X3D_TimeSensor);
12850 :
12851 : /*default field values*/
12852 2 : p->cycleInterval = 1;
12853 2 : p->enabled = 1;
12854 2 : p->startTime = 0;
12855 2 : p->stopTime = 0;
12856 2 : p->pauseTime = 0;
12857 2 : p->resumeTime = 0;
12858 2 : return (GF_Node *)p;
12859 : }
12860 :
12861 :
12862 : /*
12863 : TimeTrigger Node deletion
12864 : */
12865 :
12866 : static void TimeTrigger_Del(GF_Node *node)
12867 : {
12868 : X_TimeTrigger *p = (X_TimeTrigger *) node;
12869 2 : gf_node_unregister((GF_Node *) p->metadata, node);
12870 2 : gf_node_free((GF_Node *)p);
12871 : }
12872 :
12873 :
12874 : static u32 TimeTrigger_get_field_count(GF_Node *node, u8 dummy)
12875 : {
12876 : return 3;
12877 : }
12878 :
12879 : static GF_Err TimeTrigger_get_field(GF_Node *node, GF_FieldInfo *info)
12880 : {
12881 7 : switch (info->fieldIndex) {
12882 3 : case 0:
12883 3 : info->name = "set_boolean";
12884 3 : info->eventType = GF_SG_EVENT_IN;
12885 3 : info->on_event_in = ((X_TimeTrigger *)node)->on_set_boolean;
12886 3 : info->fieldType = GF_SG_VRML_SFBOOL;
12887 3 : info->far_ptr = & ((X_TimeTrigger *) node)->set_boolean;
12888 : return GF_OK;
12889 2 : case 1:
12890 2 : info->name = "triggerTime";
12891 2 : info->eventType = GF_SG_EVENT_OUT;
12892 2 : info->fieldType = GF_SG_VRML_SFTIME;
12893 2 : info->far_ptr = & ((X_TimeTrigger *) node)->triggerTime;
12894 : return GF_OK;
12895 2 : case 2:
12896 2 : info->name = "metadata";
12897 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12898 2 : info->fieldType = GF_SG_VRML_SFNODE;
12899 2 : info->NDTtype = NDT_SFMetadataNode;
12900 2 : info->far_ptr = & ((X_TimeTrigger *)node)->metadata;
12901 : return GF_OK;
12902 : default:
12903 : return GF_BAD_PARAM;
12904 : }
12905 : }
12906 :
12907 :
12908 4 : static s32 TimeTrigger_get_field_index_by_name(char *name)
12909 : {
12910 4 : if (!strcmp("set_boolean", name)) return 0;
12911 2 : if (!strcmp("triggerTime", name)) return 1;
12912 1 : if (!strcmp("metadata", name)) return 2;
12913 0 : return -1;
12914 : }
12915 :
12916 :
12917 2 : static GF_Node *TimeTrigger_Create()
12918 : {
12919 : X_TimeTrigger *p;
12920 2 : GF_SAFEALLOC(p, X_TimeTrigger);
12921 2 : if(!p) return NULL;
12922 2 : gf_node_setup((GF_Node *)p, TAG_X3D_TimeTrigger);
12923 :
12924 : /*default field values*/
12925 2 : return (GF_Node *)p;
12926 : }
12927 :
12928 :
12929 : /*
12930 : TouchSensor Node deletion
12931 : */
12932 :
12933 1 : static void TouchSensor_Del(GF_Node *node)
12934 : {
12935 : X_TouchSensor *p = (X_TouchSensor *) node;
12936 1 : gf_node_unregister((GF_Node *) p->metadata, node);
12937 1 : gf_sg_sfstring_del(p->description);
12938 1 : gf_node_free((GF_Node *)p);
12939 1 : }
12940 :
12941 :
12942 : static u32 TouchSensor_get_field_count(GF_Node *node, u8 dummy)
12943 : {
12944 : return 9;
12945 : }
12946 :
12947 18 : static GF_Err TouchSensor_get_field(GF_Node *node, GF_FieldInfo *info)
12948 : {
12949 18 : switch (info->fieldIndex) {
12950 2 : case 0:
12951 2 : info->name = "enabled";
12952 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12953 2 : info->fieldType = GF_SG_VRML_SFBOOL;
12954 2 : info->far_ptr = & ((X_TouchSensor *) node)->enabled;
12955 2 : return GF_OK;
12956 2 : case 1:
12957 2 : info->name = "hitNormal_changed";
12958 2 : info->eventType = GF_SG_EVENT_OUT;
12959 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
12960 2 : info->far_ptr = & ((X_TouchSensor *) node)->hitNormal_changed;
12961 2 : return GF_OK;
12962 2 : case 2:
12963 2 : info->name = "hitPoint_changed";
12964 2 : info->eventType = GF_SG_EVENT_OUT;
12965 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
12966 2 : info->far_ptr = & ((X_TouchSensor *) node)->hitPoint_changed;
12967 2 : return GF_OK;
12968 2 : case 3:
12969 2 : info->name = "hitTexCoord_changed";
12970 2 : info->eventType = GF_SG_EVENT_OUT;
12971 2 : info->fieldType = GF_SG_VRML_SFVEC2F;
12972 2 : info->far_ptr = & ((X_TouchSensor *) node)->hitTexCoord_changed;
12973 2 : return GF_OK;
12974 2 : case 4:
12975 2 : info->name = "isActive";
12976 2 : info->eventType = GF_SG_EVENT_OUT;
12977 2 : info->fieldType = GF_SG_VRML_SFBOOL;
12978 2 : info->far_ptr = & ((X_TouchSensor *) node)->isActive;
12979 2 : return GF_OK;
12980 2 : case 5:
12981 2 : info->name = "isOver";
12982 2 : info->eventType = GF_SG_EVENT_OUT;
12983 2 : info->fieldType = GF_SG_VRML_SFBOOL;
12984 2 : info->far_ptr = & ((X_TouchSensor *) node)->isOver;
12985 2 : return GF_OK;
12986 2 : case 6:
12987 2 : info->name = "touchTime";
12988 2 : info->eventType = GF_SG_EVENT_OUT;
12989 2 : info->fieldType = GF_SG_VRML_SFTIME;
12990 2 : info->far_ptr = & ((X_TouchSensor *) node)->touchTime;
12991 2 : return GF_OK;
12992 2 : case 7:
12993 2 : info->name = "metadata";
12994 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12995 2 : info->fieldType = GF_SG_VRML_SFNODE;
12996 2 : info->NDTtype = NDT_SFMetadataNode;
12997 2 : info->far_ptr = & ((X_TouchSensor *)node)->metadata;
12998 2 : return GF_OK;
12999 2 : case 8:
13000 2 : info->name = "description";
13001 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13002 2 : info->fieldType = GF_SG_VRML_SFSTRING;
13003 2 : info->far_ptr = & ((X_TouchSensor *) node)->description;
13004 2 : return GF_OK;
13005 : default:
13006 : return GF_BAD_PARAM;
13007 : }
13008 : }
13009 :
13010 :
13011 9 : static s32 TouchSensor_get_field_index_by_name(char *name)
13012 : {
13013 9 : if (!strcmp("enabled", name)) return 0;
13014 8 : if (!strcmp("hitNormal_changed", name)) return 1;
13015 7 : if (!strcmp("hitPoint_changed", name)) return 2;
13016 6 : if (!strcmp("hitTexCoord_changed", name)) return 3;
13017 5 : if (!strcmp("isActive", name)) return 4;
13018 4 : if (!strcmp("isOver", name)) return 5;
13019 3 : if (!strcmp("touchTime", name)) return 6;
13020 2 : if (!strcmp("metadata", name)) return 7;
13021 1 : if (!strcmp("description", name)) return 8;
13022 0 : return -1;
13023 : }
13024 :
13025 :
13026 1 : static GF_Node *TouchSensor_Create()
13027 : {
13028 : X_TouchSensor *p;
13029 1 : GF_SAFEALLOC(p, X_TouchSensor);
13030 1 : if(!p) return NULL;
13031 1 : gf_node_setup((GF_Node *)p, TAG_X3D_TouchSensor);
13032 :
13033 : /*default field values*/
13034 1 : p->enabled = 1;
13035 1 : return (GF_Node *)p;
13036 : }
13037 :
13038 :
13039 : /*
13040 : Transform Node deletion
13041 : */
13042 :
13043 31 : static void Transform_Del(GF_Node *node)
13044 : {
13045 : X_Transform *p = (X_Transform *) node;
13046 31 : gf_node_unregister((GF_Node *) p->metadata, node);
13047 31 : gf_sg_vrml_parent_destroy(node);
13048 31 : gf_node_free((GF_Node *)p);
13049 31 : }
13050 :
13051 :
13052 : static u32 Transform_get_field_count(GF_Node *node, u8 dummy)
13053 : {
13054 : return 9;
13055 : }
13056 :
13057 65 : static GF_Err Transform_get_field(GF_Node *node, GF_FieldInfo *info)
13058 : {
13059 65 : switch (info->fieldIndex) {
13060 2 : case 0:
13061 2 : info->name = "addChildren";
13062 2 : info->eventType = GF_SG_EVENT_IN;
13063 2 : info->on_event_in = ((X_Transform *)node)->on_addChildren;
13064 2 : info->fieldType = GF_SG_VRML_MFNODE;
13065 2 : info->NDTtype = NDT_SF3DNode;
13066 2 : info->far_ptr = & ((X_Transform *)node)->addChildren;
13067 2 : return GF_OK;
13068 2 : case 1:
13069 2 : info->name = "removeChildren";
13070 2 : info->eventType = GF_SG_EVENT_IN;
13071 2 : info->on_event_in = ((X_Transform *)node)->on_removeChildren;
13072 2 : info->fieldType = GF_SG_VRML_MFNODE;
13073 2 : info->NDTtype = NDT_SF3DNode;
13074 2 : info->far_ptr = & ((X_Transform *)node)->removeChildren;
13075 2 : return GF_OK;
13076 2 : case 2:
13077 2 : info->name = "center";
13078 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13079 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
13080 2 : info->far_ptr = & ((X_Transform *) node)->center;
13081 2 : return GF_OK;
13082 32 : case 3:
13083 32 : info->name = "children";
13084 32 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13085 32 : info->fieldType = GF_SG_VRML_MFNODE;
13086 32 : info->NDTtype = NDT_SF3DNode;
13087 32 : info->far_ptr = & ((X_Transform *)node)->children;
13088 32 : return GF_OK;
13089 2 : case 4:
13090 2 : info->name = "rotation";
13091 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13092 2 : info->fieldType = GF_SG_VRML_SFROTATION;
13093 2 : info->far_ptr = & ((X_Transform *) node)->rotation;
13094 2 : return GF_OK;
13095 2 : case 5:
13096 2 : info->name = "scale";
13097 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13098 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
13099 2 : info->far_ptr = & ((X_Transform *) node)->scale;
13100 2 : return GF_OK;
13101 2 : case 6:
13102 2 : info->name = "scaleOrientation";
13103 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13104 2 : info->fieldType = GF_SG_VRML_SFROTATION;
13105 2 : info->far_ptr = & ((X_Transform *) node)->scaleOrientation;
13106 2 : return GF_OK;
13107 19 : case 7:
13108 19 : info->name = "translation";
13109 19 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13110 19 : info->fieldType = GF_SG_VRML_SFVEC3F;
13111 19 : info->far_ptr = & ((X_Transform *) node)->translation;
13112 19 : return GF_OK;
13113 2 : case 8:
13114 2 : info->name = "metadata";
13115 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13116 2 : info->fieldType = GF_SG_VRML_SFNODE;
13117 2 : info->NDTtype = NDT_SFMetadataNode;
13118 2 : info->far_ptr = & ((X_Transform *)node)->metadata;
13119 2 : return GF_OK;
13120 : default:
13121 : return GF_BAD_PARAM;
13122 : }
13123 : }
13124 :
13125 :
13126 56 : static s32 Transform_get_field_index_by_name(char *name)
13127 : {
13128 56 : if (!strcmp("addChildren", name)) return 0;
13129 55 : if (!strcmp("removeChildren", name)) return 1;
13130 54 : if (!strcmp("center", name)) return 2;
13131 53 : if (!strcmp("children", name)) return 3;
13132 22 : if (!strcmp("rotation", name)) return 4;
13133 21 : if (!strcmp("scale", name)) return 5;
13134 20 : if (!strcmp("scaleOrientation", name)) return 6;
13135 19 : if (!strcmp("translation", name)) return 7;
13136 1 : if (!strcmp("metadata", name)) return 8;
13137 0 : return -1;
13138 : }
13139 :
13140 :
13141 31 : static GF_Node *Transform_Create()
13142 : {
13143 : X_Transform *p;
13144 31 : GF_SAFEALLOC(p, X_Transform);
13145 31 : if(!p) return NULL;
13146 31 : gf_node_setup((GF_Node *)p, TAG_X3D_Transform);
13147 31 : gf_sg_vrml_parent_setup((GF_Node *) p);
13148 :
13149 : /*default field values*/
13150 31 : p->center.x = FLT2FIX(0);
13151 31 : p->center.y = FLT2FIX(0);
13152 31 : p->center.z = FLT2FIX(0);
13153 31 : p->rotation.x = FLT2FIX(0);
13154 31 : p->rotation.y = FLT2FIX(0);
13155 31 : p->rotation.z = FLT2FIX(1);
13156 31 : p->rotation.q = FLT2FIX(0);
13157 31 : p->scale.x = FLT2FIX(1);
13158 31 : p->scale.y = FLT2FIX(1);
13159 31 : p->scale.z = FLT2FIX(1);
13160 31 : p->scaleOrientation.x = FLT2FIX(0);
13161 31 : p->scaleOrientation.y = FLT2FIX(0);
13162 31 : p->scaleOrientation.z = FLT2FIX(1);
13163 31 : p->scaleOrientation.q = FLT2FIX(0);
13164 31 : p->translation.x = FLT2FIX(0);
13165 31 : p->translation.y = FLT2FIX(0);
13166 31 : p->translation.z = FLT2FIX(0);
13167 31 : return (GF_Node *)p;
13168 : }
13169 :
13170 :
13171 : /*
13172 : TransmitterPdu Node deletion
13173 : */
13174 :
13175 1 : static void TransmitterPdu_Del(GF_Node *node)
13176 : {
13177 : X_TransmitterPdu *p = (X_TransmitterPdu *) node;
13178 1 : gf_sg_sfstring_del(p->address);
13179 1 : gf_sg_sfstring_del(p->multicastRelayHost);
13180 1 : gf_sg_sfstring_del(p->networkMode);
13181 1 : gf_node_unregister((GF_Node *) p->metadata, node);
13182 1 : gf_node_free((GF_Node *)p);
13183 1 : }
13184 :
13185 :
13186 : static u32 TransmitterPdu_get_field_count(GF_Node *node, u8 dummy)
13187 : {
13188 : return 42;
13189 : }
13190 :
13191 84 : static GF_Err TransmitterPdu_get_field(GF_Node *node, GF_FieldInfo *info)
13192 : {
13193 84 : switch (info->fieldIndex) {
13194 2 : case 0:
13195 2 : info->name = "address";
13196 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13197 2 : info->fieldType = GF_SG_VRML_SFSTRING;
13198 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->address;
13199 2 : return GF_OK;
13200 2 : case 1:
13201 2 : info->name = "antennaLocation";
13202 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13203 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
13204 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->antennaLocation;
13205 2 : return GF_OK;
13206 2 : case 2:
13207 2 : info->name = "antennaPatternLength";
13208 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13209 2 : info->fieldType = GF_SG_VRML_SFINT32;
13210 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->antennaPatternLength;
13211 2 : return GF_OK;
13212 2 : case 3:
13213 2 : info->name = "antennaPatternType";
13214 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13215 2 : info->fieldType = GF_SG_VRML_SFINT32;
13216 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->antennaPatternType;
13217 2 : return GF_OK;
13218 2 : case 4:
13219 2 : info->name = "applicationID";
13220 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13221 2 : info->fieldType = GF_SG_VRML_SFINT32;
13222 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->applicationID;
13223 2 : return GF_OK;
13224 2 : case 5:
13225 2 : info->name = "cryptoKeyID";
13226 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13227 2 : info->fieldType = GF_SG_VRML_SFINT32;
13228 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->cryptoKeyID;
13229 2 : return GF_OK;
13230 2 : case 6:
13231 2 : info->name = "cryptoSystem";
13232 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13233 2 : info->fieldType = GF_SG_VRML_SFINT32;
13234 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->cryptoSystem;
13235 2 : return GF_OK;
13236 2 : case 7:
13237 2 : info->name = "entityID";
13238 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13239 2 : info->fieldType = GF_SG_VRML_SFINT32;
13240 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->entityID;
13241 2 : return GF_OK;
13242 2 : case 8:
13243 2 : info->name = "frequency";
13244 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13245 2 : info->fieldType = GF_SG_VRML_SFINT32;
13246 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->frequency;
13247 2 : return GF_OK;
13248 2 : case 9:
13249 2 : info->name = "inputSource";
13250 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13251 2 : info->fieldType = GF_SG_VRML_SFINT32;
13252 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->inputSource;
13253 2 : return GF_OK;
13254 2 : case 10:
13255 2 : info->name = "lengthOfModulationParameters";
13256 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13257 2 : info->fieldType = GF_SG_VRML_SFINT32;
13258 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->lengthOfModulationParameters;
13259 2 : return GF_OK;
13260 2 : case 11:
13261 2 : info->name = "modulationTypeDetail";
13262 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13263 2 : info->fieldType = GF_SG_VRML_SFINT32;
13264 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->modulationTypeDetail;
13265 2 : return GF_OK;
13266 2 : case 12:
13267 2 : info->name = "modulationTypeMajor";
13268 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13269 2 : info->fieldType = GF_SG_VRML_SFINT32;
13270 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->modulationTypeMajor;
13271 2 : return GF_OK;
13272 2 : case 13:
13273 2 : info->name = "modulationTypeSpreadSpectrum";
13274 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13275 2 : info->fieldType = GF_SG_VRML_SFINT32;
13276 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->modulationTypeSpreadSpectrum;
13277 2 : return GF_OK;
13278 2 : case 14:
13279 2 : info->name = "modulationTypeSystem";
13280 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13281 2 : info->fieldType = GF_SG_VRML_SFINT32;
13282 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->modulationTypeSystem;
13283 2 : return GF_OK;
13284 2 : case 15:
13285 2 : info->name = "multicastRelayHost";
13286 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13287 2 : info->fieldType = GF_SG_VRML_SFSTRING;
13288 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->multicastRelayHost;
13289 2 : return GF_OK;
13290 2 : case 16:
13291 2 : info->name = "multicastRelayPort";
13292 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13293 2 : info->fieldType = GF_SG_VRML_SFINT32;
13294 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->multicastRelayPort;
13295 2 : return GF_OK;
13296 2 : case 17:
13297 2 : info->name = "networkMode";
13298 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13299 2 : info->fieldType = GF_SG_VRML_SFSTRING;
13300 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->networkMode;
13301 2 : return GF_OK;
13302 2 : case 18:
13303 2 : info->name = "port";
13304 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13305 2 : info->fieldType = GF_SG_VRML_SFINT32;
13306 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->port;
13307 2 : return GF_OK;
13308 2 : case 19:
13309 2 : info->name = "power";
13310 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13311 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
13312 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->power;
13313 2 : return GF_OK;
13314 2 : case 20:
13315 2 : info->name = "radioEntityTypeCategory";
13316 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13317 2 : info->fieldType = GF_SG_VRML_SFINT32;
13318 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->radioEntityTypeCategory;
13319 2 : return GF_OK;
13320 2 : case 21:
13321 2 : info->name = "radioEntityTypeCountry";
13322 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13323 2 : info->fieldType = GF_SG_VRML_SFINT32;
13324 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->radioEntityTypeCountry;
13325 2 : return GF_OK;
13326 2 : case 22:
13327 2 : info->name = "radioEntityTypeDomain";
13328 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13329 2 : info->fieldType = GF_SG_VRML_SFINT32;
13330 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->radioEntityTypeDomain;
13331 2 : return GF_OK;
13332 2 : case 23:
13333 2 : info->name = "radioEntityTypeKind";
13334 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13335 2 : info->fieldType = GF_SG_VRML_SFINT32;
13336 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->radioEntityTypeKind;
13337 2 : return GF_OK;
13338 2 : case 24:
13339 2 : info->name = "radioEntityTypeNomenclature";
13340 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13341 2 : info->fieldType = GF_SG_VRML_SFINT32;
13342 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->radioEntityTypeNomenclature;
13343 2 : return GF_OK;
13344 2 : case 25:
13345 2 : info->name = "radioEntityTypeNomenclatureVersion";
13346 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13347 2 : info->fieldType = GF_SG_VRML_SFINT32;
13348 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->radioEntityTypeNomenclatureVersion;
13349 2 : return GF_OK;
13350 2 : case 26:
13351 2 : info->name = "radioID";
13352 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13353 2 : info->fieldType = GF_SG_VRML_SFINT32;
13354 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->radioID;
13355 2 : return GF_OK;
13356 2 : case 27:
13357 2 : info->name = "readInterval";
13358 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13359 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
13360 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->readInterval;
13361 2 : return GF_OK;
13362 2 : case 28:
13363 2 : info->name = "relativeAntennaLocation";
13364 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13365 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
13366 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->relativeAntennaLocation;
13367 2 : return GF_OK;
13368 2 : case 29:
13369 2 : info->name = "rtpHeaderExpected";
13370 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13371 2 : info->fieldType = GF_SG_VRML_SFBOOL;
13372 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->rtpHeaderExpected;
13373 2 : return GF_OK;
13374 2 : case 30:
13375 2 : info->name = "siteID";
13376 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13377 2 : info->fieldType = GF_SG_VRML_SFINT32;
13378 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->siteID;
13379 2 : return GF_OK;
13380 2 : case 31:
13381 2 : info->name = "transmitFrequencyBandwidth";
13382 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13383 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
13384 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->transmitFrequencyBandwidth;
13385 2 : return GF_OK;
13386 2 : case 32:
13387 2 : info->name = "transmitState";
13388 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13389 2 : info->fieldType = GF_SG_VRML_SFINT32;
13390 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->transmitState;
13391 2 : return GF_OK;
13392 2 : case 33:
13393 2 : info->name = "whichGeometry";
13394 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13395 2 : info->fieldType = GF_SG_VRML_SFINT32;
13396 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->whichGeometry;
13397 2 : return GF_OK;
13398 2 : case 34:
13399 2 : info->name = "writeInterval";
13400 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13401 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
13402 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->writeInterval;
13403 2 : return GF_OK;
13404 2 : case 35:
13405 2 : info->name = "isActive";
13406 2 : info->eventType = GF_SG_EVENT_OUT;
13407 2 : info->fieldType = GF_SG_VRML_SFBOOL;
13408 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->isActive;
13409 2 : return GF_OK;
13410 2 : case 36:
13411 2 : info->name = "isNetworkReader";
13412 2 : info->eventType = GF_SG_EVENT_OUT;
13413 2 : info->fieldType = GF_SG_VRML_SFBOOL;
13414 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->isNetworkReader;
13415 2 : return GF_OK;
13416 2 : case 37:
13417 2 : info->name = "isNetworkWriter";
13418 2 : info->eventType = GF_SG_EVENT_OUT;
13419 2 : info->fieldType = GF_SG_VRML_SFBOOL;
13420 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->isNetworkWriter;
13421 2 : return GF_OK;
13422 2 : case 38:
13423 2 : info->name = "isRtpHeaderHeard";
13424 2 : info->eventType = GF_SG_EVENT_OUT;
13425 2 : info->fieldType = GF_SG_VRML_SFBOOL;
13426 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->isRtpHeaderHeard;
13427 2 : return GF_OK;
13428 2 : case 39:
13429 2 : info->name = "isStandAlone";
13430 2 : info->eventType = GF_SG_EVENT_OUT;
13431 2 : info->fieldType = GF_SG_VRML_SFBOOL;
13432 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->isStandAlone;
13433 2 : return GF_OK;
13434 2 : case 40:
13435 2 : info->name = "timestamp";
13436 2 : info->eventType = GF_SG_EVENT_OUT;
13437 2 : info->fieldType = GF_SG_VRML_SFTIME;
13438 2 : info->far_ptr = & ((X_TransmitterPdu *) node)->timestamp;
13439 2 : return GF_OK;
13440 2 : case 41:
13441 2 : info->name = "metadata";
13442 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13443 2 : info->fieldType = GF_SG_VRML_SFNODE;
13444 2 : info->NDTtype = NDT_SFMetadataNode;
13445 2 : info->far_ptr = & ((X_TransmitterPdu *)node)->metadata;
13446 2 : return GF_OK;
13447 : default:
13448 : return GF_BAD_PARAM;
13449 : }
13450 : }
13451 :
13452 :
13453 42 : static s32 TransmitterPdu_get_field_index_by_name(char *name)
13454 : {
13455 42 : if (!strcmp("address", name)) return 0;
13456 41 : if (!strcmp("antennaLocation", name)) return 1;
13457 40 : if (!strcmp("antennaPatternLength", name)) return 2;
13458 39 : if (!strcmp("antennaPatternType", name)) return 3;
13459 38 : if (!strcmp("applicationID", name)) return 4;
13460 37 : if (!strcmp("cryptoKeyID", name)) return 5;
13461 36 : if (!strcmp("cryptoSystem", name)) return 6;
13462 35 : if (!strcmp("entityID", name)) return 7;
13463 34 : if (!strcmp("frequency", name)) return 8;
13464 33 : if (!strcmp("inputSource", name)) return 9;
13465 32 : if (!strcmp("lengthOfModulationParameters", name)) return 10;
13466 31 : if (!strcmp("modulationTypeDetail", name)) return 11;
13467 30 : if (!strcmp("modulationTypeMajor", name)) return 12;
13468 29 : if (!strcmp("modulationTypeSpreadSpectrum", name)) return 13;
13469 28 : if (!strcmp("modulationTypeSystem", name)) return 14;
13470 27 : if (!strcmp("multicastRelayHost", name)) return 15;
13471 26 : if (!strcmp("multicastRelayPort", name)) return 16;
13472 25 : if (!strcmp("networkMode", name)) return 17;
13473 24 : if (!strcmp("port", name)) return 18;
13474 23 : if (!strcmp("power", name)) return 19;
13475 22 : if (!strcmp("radioEntityTypeCategory", name)) return 20;
13476 21 : if (!strcmp("radioEntityTypeCountry", name)) return 21;
13477 20 : if (!strcmp("radioEntityTypeDomain", name)) return 22;
13478 19 : if (!strcmp("radioEntityTypeKind", name)) return 23;
13479 18 : if (!strcmp("radioEntityTypeNomenclature", name)) return 24;
13480 17 : if (!strcmp("radioEntityTypeNomenclatureVersion", name)) return 25;
13481 16 : if (!strcmp("radioID", name)) return 26;
13482 15 : if (!strcmp("readInterval", name)) return 27;
13483 14 : if (!strcmp("relativeAntennaLocation", name)) return 28;
13484 13 : if (!strcmp("rtpHeaderExpected", name)) return 29;
13485 12 : if (!strcmp("siteID", name)) return 30;
13486 11 : if (!strcmp("transmitFrequencyBandwidth", name)) return 31;
13487 10 : if (!strcmp("transmitState", name)) return 32;
13488 9 : if (!strcmp("whichGeometry", name)) return 33;
13489 8 : if (!strcmp("writeInterval", name)) return 34;
13490 7 : if (!strcmp("isActive", name)) return 35;
13491 6 : if (!strcmp("isNetworkReader", name)) return 36;
13492 5 : if (!strcmp("isNetworkWriter", name)) return 37;
13493 4 : if (!strcmp("isRtpHeaderHeard", name)) return 38;
13494 3 : if (!strcmp("isStandAlone", name)) return 39;
13495 2 : if (!strcmp("timestamp", name)) return 40;
13496 1 : if (!strcmp("metadata", name)) return 41;
13497 0 : return -1;
13498 : }
13499 :
13500 :
13501 1 : static GF_Node *TransmitterPdu_Create()
13502 : {
13503 : X_TransmitterPdu *p;
13504 1 : GF_SAFEALLOC(p, X_TransmitterPdu);
13505 1 : if(!p) return NULL;
13506 1 : gf_node_setup((GF_Node *)p, TAG_X3D_TransmitterPdu);
13507 :
13508 : /*default field values*/
13509 1 : p->address.buffer = (char*) gf_malloc(sizeof(char) * 10);
13510 : strcpy(p->address.buffer, "localhost");
13511 1 : p->antennaLocation.x = FLT2FIX(0);
13512 1 : p->antennaLocation.y = FLT2FIX(0);
13513 1 : p->antennaLocation.z = FLT2FIX(0);
13514 1 : p->antennaPatternLength = 0;
13515 1 : p->antennaPatternType = 0;
13516 1 : p->applicationID = 1;
13517 1 : p->cryptoKeyID = 0;
13518 1 : p->cryptoSystem = 0;
13519 1 : p->entityID = 0;
13520 1 : p->frequency = 0;
13521 1 : p->inputSource = 0;
13522 1 : p->lengthOfModulationParameters = 0;
13523 1 : p->modulationTypeDetail = 0;
13524 1 : p->modulationTypeMajor = 0;
13525 1 : p->modulationTypeSpreadSpectrum = 0;
13526 1 : p->modulationTypeSystem = 0;
13527 1 : p->multicastRelayPort = 0;
13528 1 : p->networkMode.buffer = (char*) gf_malloc(sizeof(char) * 11);
13529 : strcpy(p->networkMode.buffer, "standAlone");
13530 1 : p->port = 0;
13531 1 : p->power = FLT2FIX(0.0);
13532 1 : p->radioEntityTypeCategory = 0;
13533 1 : p->radioEntityTypeCountry = 0;
13534 1 : p->radioEntityTypeDomain = 0;
13535 1 : p->radioEntityTypeKind = 0;
13536 1 : p->radioEntityTypeNomenclature = 0;
13537 1 : p->radioEntityTypeNomenclatureVersion = 0;
13538 1 : p->radioID = 0;
13539 1 : p->readInterval = FLT2FIX(0.1);
13540 1 : p->relativeAntennaLocation.x = FLT2FIX(0);
13541 1 : p->relativeAntennaLocation.y = FLT2FIX(0);
13542 1 : p->relativeAntennaLocation.z = FLT2FIX(0);
13543 1 : p->siteID = 0;
13544 1 : p->transmitFrequencyBandwidth = FLT2FIX(0.0);
13545 1 : p->transmitState = 0;
13546 1 : p->whichGeometry = 1;
13547 1 : p->writeInterval = FLT2FIX(1.0);
13548 1 : return (GF_Node *)p;
13549 : }
13550 :
13551 :
13552 : /*
13553 : TriangleFanSet Node deletion
13554 : */
13555 :
13556 2 : static void TriangleFanSet_Del(GF_Node *node)
13557 : {
13558 : X_TriangleFanSet *p = (X_TriangleFanSet *) node;
13559 2 : gf_node_unregister((GF_Node *) p->color, node);
13560 2 : gf_node_unregister((GF_Node *) p->coord, node);
13561 2 : gf_sg_mfint32_del(p->fanCount);
13562 2 : gf_node_unregister((GF_Node *) p->normal, node);
13563 2 : gf_node_unregister((GF_Node *) p->texCoord, node);
13564 2 : gf_node_unregister((GF_Node *) p->metadata, node);
13565 2 : gf_node_free((GF_Node *)p);
13566 2 : }
13567 :
13568 :
13569 : static u32 TriangleFanSet_get_field_count(GF_Node *node, u8 dummy)
13570 : {
13571 : return 10;
13572 : }
13573 :
13574 25 : static GF_Err TriangleFanSet_get_field(GF_Node *node, GF_FieldInfo *info)
13575 : {
13576 25 : switch (info->fieldIndex) {
13577 3 : case 0:
13578 3 : info->name = "color";
13579 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13580 3 : info->fieldType = GF_SG_VRML_SFNODE;
13581 3 : info->NDTtype = NDT_SFColorNode;
13582 3 : info->far_ptr = & ((X_TriangleFanSet *)node)->color;
13583 3 : return GF_OK;
13584 3 : case 1:
13585 3 : info->name = "coord";
13586 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13587 3 : info->fieldType = GF_SG_VRML_SFNODE;
13588 3 : info->NDTtype = NDT_SFCoordinateNode;
13589 3 : info->far_ptr = & ((X_TriangleFanSet *)node)->coord;
13590 3 : return GF_OK;
13591 3 : case 2:
13592 3 : info->name = "fanCount";
13593 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13594 3 : info->fieldType = GF_SG_VRML_MFINT32;
13595 3 : info->far_ptr = & ((X_TriangleFanSet *) node)->fanCount;
13596 3 : return GF_OK;
13597 2 : case 3:
13598 2 : info->name = "normal";
13599 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13600 2 : info->fieldType = GF_SG_VRML_SFNODE;
13601 2 : info->NDTtype = NDT_SFNormalNode;
13602 2 : info->far_ptr = & ((X_TriangleFanSet *)node)->normal;
13603 2 : return GF_OK;
13604 2 : case 4:
13605 2 : info->name = "texCoord";
13606 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13607 2 : info->fieldType = GF_SG_VRML_SFNODE;
13608 2 : info->NDTtype = NDT_SFTextureCoordinateNode;
13609 2 : info->far_ptr = & ((X_TriangleFanSet *)node)->texCoord;
13610 2 : return GF_OK;
13611 3 : case 5:
13612 3 : info->name = "ccw";
13613 3 : info->eventType = GF_SG_EVENT_FIELD;
13614 3 : info->fieldType = GF_SG_VRML_SFBOOL;
13615 3 : info->far_ptr = & ((X_TriangleFanSet *) node)->ccw;
13616 3 : return GF_OK;
13617 2 : case 6:
13618 2 : info->name = "colorPerVertex";
13619 2 : info->eventType = GF_SG_EVENT_FIELD;
13620 2 : info->fieldType = GF_SG_VRML_SFBOOL;
13621 2 : info->far_ptr = & ((X_TriangleFanSet *) node)->colorPerVertex;
13622 2 : return GF_OK;
13623 2 : case 7:
13624 2 : info->name = "normalPerVertex";
13625 2 : info->eventType = GF_SG_EVENT_FIELD;
13626 2 : info->fieldType = GF_SG_VRML_SFBOOL;
13627 2 : info->far_ptr = & ((X_TriangleFanSet *) node)->normalPerVertex;
13628 2 : return GF_OK;
13629 3 : case 8:
13630 3 : info->name = "solid";
13631 3 : info->eventType = GF_SG_EVENT_FIELD;
13632 3 : info->fieldType = GF_SG_VRML_SFBOOL;
13633 3 : info->far_ptr = & ((X_TriangleFanSet *) node)->solid;
13634 3 : return GF_OK;
13635 2 : case 9:
13636 2 : info->name = "metadata";
13637 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13638 2 : info->fieldType = GF_SG_VRML_SFNODE;
13639 2 : info->NDTtype = NDT_SFMetadataNode;
13640 2 : info->far_ptr = & ((X_TriangleFanSet *)node)->metadata;
13641 2 : return GF_OK;
13642 : default:
13643 : return GF_BAD_PARAM;
13644 : }
13645 : }
13646 :
13647 :
13648 15 : static s32 TriangleFanSet_get_field_index_by_name(char *name)
13649 : {
13650 15 : if (!strcmp("color", name)) return 0;
13651 13 : if (!strcmp("coord", name)) return 1;
13652 11 : if (!strcmp("fanCount", name)) return 2;
13653 9 : if (!strcmp("normal", name)) return 3;
13654 8 : if (!strcmp("texCoord", name)) return 4;
13655 7 : if (!strcmp("ccw", name)) return 5;
13656 5 : if (!strcmp("colorPerVertex", name)) return 6;
13657 4 : if (!strcmp("normalPerVertex", name)) return 7;
13658 3 : if (!strcmp("solid", name)) return 8;
13659 1 : if (!strcmp("metadata", name)) return 9;
13660 0 : return -1;
13661 : }
13662 :
13663 :
13664 2 : static GF_Node *TriangleFanSet_Create()
13665 : {
13666 : X_TriangleFanSet *p;
13667 2 : GF_SAFEALLOC(p, X_TriangleFanSet);
13668 2 : if(!p) return NULL;
13669 2 : gf_node_setup((GF_Node *)p, TAG_X3D_TriangleFanSet);
13670 :
13671 : /*default field values*/
13672 2 : p->ccw = 1;
13673 2 : p->colorPerVertex = 1;
13674 2 : p->normalPerVertex = 1;
13675 2 : p->solid = 1;
13676 2 : return (GF_Node *)p;
13677 : }
13678 :
13679 :
13680 : /*
13681 : TriangleSet Node deletion
13682 : */
13683 :
13684 2 : static void TriangleSet_Del(GF_Node *node)
13685 : {
13686 : X_TriangleSet *p = (X_TriangleSet *) node;
13687 2 : gf_node_unregister((GF_Node *) p->color, node);
13688 2 : gf_node_unregister((GF_Node *) p->coord, node);
13689 2 : gf_node_unregister((GF_Node *) p->normal, node);
13690 2 : gf_node_unregister((GF_Node *) p->texCoord, node);
13691 2 : gf_node_unregister((GF_Node *) p->metadata, node);
13692 2 : gf_node_free((GF_Node *)p);
13693 2 : }
13694 :
13695 :
13696 : static u32 TriangleSet_get_field_count(GF_Node *node, u8 dummy)
13697 : {
13698 : return 9;
13699 : }
13700 :
13701 21 : static GF_Err TriangleSet_get_field(GF_Node *node, GF_FieldInfo *info)
13702 : {
13703 21 : switch (info->fieldIndex) {
13704 3 : case 0:
13705 3 : info->name = "color";
13706 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13707 3 : info->fieldType = GF_SG_VRML_SFNODE;
13708 3 : info->NDTtype = NDT_SFColorNode;
13709 3 : info->far_ptr = & ((X_TriangleSet *)node)->color;
13710 3 : return GF_OK;
13711 3 : case 1:
13712 3 : info->name = "coord";
13713 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13714 3 : info->fieldType = GF_SG_VRML_SFNODE;
13715 3 : info->NDTtype = NDT_SFCoordinateNode;
13716 3 : info->far_ptr = & ((X_TriangleSet *)node)->coord;
13717 3 : return GF_OK;
13718 2 : case 2:
13719 2 : info->name = "normal";
13720 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13721 2 : info->fieldType = GF_SG_VRML_SFNODE;
13722 2 : info->NDTtype = NDT_SFNormalNode;
13723 2 : info->far_ptr = & ((X_TriangleSet *)node)->normal;
13724 2 : return GF_OK;
13725 2 : case 3:
13726 2 : info->name = "texCoord";
13727 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13728 2 : info->fieldType = GF_SG_VRML_SFNODE;
13729 2 : info->NDTtype = NDT_SFTextureCoordinateNode;
13730 2 : info->far_ptr = & ((X_TriangleSet *)node)->texCoord;
13731 2 : return GF_OK;
13732 2 : case 4:
13733 2 : info->name = "ccw";
13734 2 : info->eventType = GF_SG_EVENT_FIELD;
13735 2 : info->fieldType = GF_SG_VRML_SFBOOL;
13736 2 : info->far_ptr = & ((X_TriangleSet *) node)->ccw;
13737 2 : return GF_OK;
13738 2 : case 5:
13739 2 : info->name = "colorPerVertex";
13740 2 : info->eventType = GF_SG_EVENT_FIELD;
13741 2 : info->fieldType = GF_SG_VRML_SFBOOL;
13742 2 : info->far_ptr = & ((X_TriangleSet *) node)->colorPerVertex;
13743 2 : return GF_OK;
13744 2 : case 6:
13745 2 : info->name = "normalPerVertex";
13746 2 : info->eventType = GF_SG_EVENT_FIELD;
13747 2 : info->fieldType = GF_SG_VRML_SFBOOL;
13748 2 : info->far_ptr = & ((X_TriangleSet *) node)->normalPerVertex;
13749 2 : return GF_OK;
13750 3 : case 7:
13751 3 : info->name = "solid";
13752 3 : info->eventType = GF_SG_EVENT_FIELD;
13753 3 : info->fieldType = GF_SG_VRML_SFBOOL;
13754 3 : info->far_ptr = & ((X_TriangleSet *) node)->solid;
13755 3 : return GF_OK;
13756 2 : case 8:
13757 2 : info->name = "metadata";
13758 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13759 2 : info->fieldType = GF_SG_VRML_SFNODE;
13760 2 : info->NDTtype = NDT_SFMetadataNode;
13761 2 : info->far_ptr = & ((X_TriangleSet *)node)->metadata;
13762 2 : return GF_OK;
13763 : default:
13764 : return GF_BAD_PARAM;
13765 : }
13766 : }
13767 :
13768 :
13769 12 : static s32 TriangleSet_get_field_index_by_name(char *name)
13770 : {
13771 12 : if (!strcmp("color", name)) return 0;
13772 10 : if (!strcmp("coord", name)) return 1;
13773 8 : if (!strcmp("normal", name)) return 2;
13774 7 : if (!strcmp("texCoord", name)) return 3;
13775 6 : if (!strcmp("ccw", name)) return 4;
13776 5 : if (!strcmp("colorPerVertex", name)) return 5;
13777 4 : if (!strcmp("normalPerVertex", name)) return 6;
13778 3 : if (!strcmp("solid", name)) return 7;
13779 1 : if (!strcmp("metadata", name)) return 8;
13780 0 : return -1;
13781 : }
13782 :
13783 :
13784 2 : static GF_Node *TriangleSet_Create()
13785 : {
13786 : X_TriangleSet *p;
13787 2 : GF_SAFEALLOC(p, X_TriangleSet);
13788 2 : if(!p) return NULL;
13789 2 : gf_node_setup((GF_Node *)p, TAG_X3D_TriangleSet);
13790 :
13791 : /*default field values*/
13792 2 : p->ccw = 1;
13793 2 : p->colorPerVertex = 1;
13794 2 : p->normalPerVertex = 1;
13795 2 : p->solid = 1;
13796 2 : return (GF_Node *)p;
13797 : }
13798 :
13799 :
13800 : /*
13801 : TriangleSet2D Node deletion
13802 : */
13803 :
13804 2 : static void TriangleSet2D_Del(GF_Node *node)
13805 : {
13806 : X_TriangleSet2D *p = (X_TriangleSet2D *) node;
13807 2 : gf_sg_mfvec2f_del(p->vertices);
13808 2 : gf_node_unregister((GF_Node *) p->metadata, node);
13809 2 : gf_node_free((GF_Node *)p);
13810 2 : }
13811 :
13812 :
13813 : static u32 TriangleSet2D_get_field_count(GF_Node *node, u8 dummy)
13814 : {
13815 : return 2;
13816 : }
13817 :
13818 : static GF_Err TriangleSet2D_get_field(GF_Node *node, GF_FieldInfo *info)
13819 : {
13820 5 : switch (info->fieldIndex) {
13821 3 : case 0:
13822 3 : info->name = "vertices";
13823 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13824 3 : info->fieldType = GF_SG_VRML_MFVEC2F;
13825 3 : info->far_ptr = & ((X_TriangleSet2D *) node)->vertices;
13826 : return GF_OK;
13827 2 : case 1:
13828 2 : info->name = "metadata";
13829 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13830 2 : info->fieldType = GF_SG_VRML_SFNODE;
13831 2 : info->NDTtype = NDT_SFMetadataNode;
13832 2 : info->far_ptr = & ((X_TriangleSet2D *)node)->metadata;
13833 : return GF_OK;
13834 : default:
13835 : return GF_BAD_PARAM;
13836 : }
13837 : }
13838 :
13839 :
13840 3 : static s32 TriangleSet2D_get_field_index_by_name(char *name)
13841 : {
13842 3 : if (!strcmp("vertices", name)) return 0;
13843 1 : if (!strcmp("metadata", name)) return 1;
13844 0 : return -1;
13845 : }
13846 :
13847 :
13848 2 : static GF_Node *TriangleSet2D_Create()
13849 : {
13850 : X_TriangleSet2D *p;
13851 2 : GF_SAFEALLOC(p, X_TriangleSet2D);
13852 2 : if(!p) return NULL;
13853 2 : gf_node_setup((GF_Node *)p, TAG_X3D_TriangleSet2D);
13854 :
13855 : /*default field values*/
13856 2 : return (GF_Node *)p;
13857 : }
13858 :
13859 :
13860 : /*
13861 : TriangleStripSet Node deletion
13862 : */
13863 :
13864 2 : static void TriangleStripSet_Del(GF_Node *node)
13865 : {
13866 : X_TriangleStripSet *p = (X_TriangleStripSet *) node;
13867 2 : gf_node_unregister((GF_Node *) p->color, node);
13868 2 : gf_node_unregister((GF_Node *) p->coord, node);
13869 2 : gf_node_unregister((GF_Node *) p->normal, node);
13870 2 : gf_sg_mfint32_del(p->stripCount);
13871 2 : gf_node_unregister((GF_Node *) p->texCoord, node);
13872 2 : gf_node_unregister((GF_Node *) p->metadata, node);
13873 2 : gf_node_free((GF_Node *)p);
13874 2 : }
13875 :
13876 :
13877 : static u32 TriangleStripSet_get_field_count(GF_Node *node, u8 dummy)
13878 : {
13879 : return 10;
13880 : }
13881 :
13882 25 : static GF_Err TriangleStripSet_get_field(GF_Node *node, GF_FieldInfo *info)
13883 : {
13884 25 : switch (info->fieldIndex) {
13885 3 : case 0:
13886 3 : info->name = "color";
13887 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13888 3 : info->fieldType = GF_SG_VRML_SFNODE;
13889 3 : info->NDTtype = NDT_SFColorNode;
13890 3 : info->far_ptr = & ((X_TriangleStripSet *)node)->color;
13891 3 : return GF_OK;
13892 3 : case 1:
13893 3 : info->name = "coord";
13894 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13895 3 : info->fieldType = GF_SG_VRML_SFNODE;
13896 3 : info->NDTtype = NDT_SFCoordinateNode;
13897 3 : info->far_ptr = & ((X_TriangleStripSet *)node)->coord;
13898 3 : return GF_OK;
13899 2 : case 2:
13900 2 : info->name = "normal";
13901 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13902 2 : info->fieldType = GF_SG_VRML_SFNODE;
13903 2 : info->NDTtype = NDT_SFNormalNode;
13904 2 : info->far_ptr = & ((X_TriangleStripSet *)node)->normal;
13905 2 : return GF_OK;
13906 3 : case 3:
13907 3 : info->name = "stripCount";
13908 3 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13909 3 : info->fieldType = GF_SG_VRML_MFINT32;
13910 3 : info->far_ptr = & ((X_TriangleStripSet *) node)->stripCount;
13911 3 : return GF_OK;
13912 2 : case 4:
13913 2 : info->name = "texCoord";
13914 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13915 2 : info->fieldType = GF_SG_VRML_SFNODE;
13916 2 : info->NDTtype = NDT_SFTextureCoordinateNode;
13917 2 : info->far_ptr = & ((X_TriangleStripSet *)node)->texCoord;
13918 2 : return GF_OK;
13919 3 : case 5:
13920 3 : info->name = "ccw";
13921 3 : info->eventType = GF_SG_EVENT_FIELD;
13922 3 : info->fieldType = GF_SG_VRML_SFBOOL;
13923 3 : info->far_ptr = & ((X_TriangleStripSet *) node)->ccw;
13924 3 : return GF_OK;
13925 2 : case 6:
13926 2 : info->name = "colorPerVertex";
13927 2 : info->eventType = GF_SG_EVENT_FIELD;
13928 2 : info->fieldType = GF_SG_VRML_SFBOOL;
13929 2 : info->far_ptr = & ((X_TriangleStripSet *) node)->colorPerVertex;
13930 2 : return GF_OK;
13931 2 : case 7:
13932 2 : info->name = "normalPerVertex";
13933 2 : info->eventType = GF_SG_EVENT_FIELD;
13934 2 : info->fieldType = GF_SG_VRML_SFBOOL;
13935 2 : info->far_ptr = & ((X_TriangleStripSet *) node)->normalPerVertex;
13936 2 : return GF_OK;
13937 3 : case 8:
13938 3 : info->name = "solid";
13939 3 : info->eventType = GF_SG_EVENT_FIELD;
13940 3 : info->fieldType = GF_SG_VRML_SFBOOL;
13941 3 : info->far_ptr = & ((X_TriangleStripSet *) node)->solid;
13942 3 : return GF_OK;
13943 2 : case 9:
13944 2 : info->name = "metadata";
13945 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13946 2 : info->fieldType = GF_SG_VRML_SFNODE;
13947 2 : info->NDTtype = NDT_SFMetadataNode;
13948 2 : info->far_ptr = & ((X_TriangleStripSet *)node)->metadata;
13949 2 : return GF_OK;
13950 : default:
13951 : return GF_BAD_PARAM;
13952 : }
13953 : }
13954 :
13955 :
13956 15 : static s32 TriangleStripSet_get_field_index_by_name(char *name)
13957 : {
13958 15 : if (!strcmp("color", name)) return 0;
13959 13 : if (!strcmp("coord", name)) return 1;
13960 11 : if (!strcmp("normal", name)) return 2;
13961 10 : if (!strcmp("stripCount", name)) return 3;
13962 8 : if (!strcmp("texCoord", name)) return 4;
13963 7 : if (!strcmp("ccw", name)) return 5;
13964 5 : if (!strcmp("colorPerVertex", name)) return 6;
13965 4 : if (!strcmp("normalPerVertex", name)) return 7;
13966 3 : if (!strcmp("solid", name)) return 8;
13967 1 : if (!strcmp("metadata", name)) return 9;
13968 0 : return -1;
13969 : }
13970 :
13971 :
13972 2 : static GF_Node *TriangleStripSet_Create()
13973 : {
13974 : X_TriangleStripSet *p;
13975 2 : GF_SAFEALLOC(p, X_TriangleStripSet);
13976 2 : if(!p) return NULL;
13977 2 : gf_node_setup((GF_Node *)p, TAG_X3D_TriangleStripSet);
13978 :
13979 : /*default field values*/
13980 2 : p->ccw = 1;
13981 2 : p->colorPerVertex = 1;
13982 2 : p->normalPerVertex = 1;
13983 2 : p->solid = 1;
13984 2 : return (GF_Node *)p;
13985 : }
13986 :
13987 :
13988 : /*
13989 : Viewpoint Node deletion
13990 : */
13991 :
13992 19 : static void Viewpoint_Del(GF_Node *node)
13993 : {
13994 : X_Viewpoint *p = (X_Viewpoint *) node;
13995 19 : gf_sg_sfstring_del(p->description);
13996 19 : gf_node_unregister((GF_Node *) p->metadata, node);
13997 19 : gf_node_free((GF_Node *)p);
13998 19 : }
13999 :
14000 :
14001 : static u32 Viewpoint_get_field_count(GF_Node *node, u8 dummy)
14002 : {
14003 : return 10;
14004 : }
14005 :
14006 38 : static GF_Err Viewpoint_get_field(GF_Node *node, GF_FieldInfo *info)
14007 : {
14008 38 : switch (info->fieldIndex) {
14009 2 : case 0:
14010 2 : info->name = "set_bind";
14011 2 : info->eventType = GF_SG_EVENT_IN;
14012 2 : info->on_event_in = ((X_Viewpoint *)node)->on_set_bind;
14013 2 : info->fieldType = GF_SG_VRML_SFBOOL;
14014 2 : info->far_ptr = & ((X_Viewpoint *) node)->set_bind;
14015 2 : return GF_OK;
14016 2 : case 1:
14017 2 : info->name = "fieldOfView";
14018 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14019 2 : info->fieldType = GF_SG_VRML_SFFLOAT;
14020 2 : info->far_ptr = & ((X_Viewpoint *) node)->fieldOfView;
14021 2 : return GF_OK;
14022 2 : case 2:
14023 2 : info->name = "jump";
14024 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14025 2 : info->fieldType = GF_SG_VRML_SFBOOL;
14026 2 : info->far_ptr = & ((X_Viewpoint *) node)->jump;
14027 2 : return GF_OK;
14028 2 : case 3:
14029 2 : info->name = "orientation";
14030 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14031 2 : info->fieldType = GF_SG_VRML_SFROTATION;
14032 2 : info->far_ptr = & ((X_Viewpoint *) node)->orientation;
14033 2 : return GF_OK;
14034 20 : case 4:
14035 20 : info->name = "position";
14036 20 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14037 20 : info->fieldType = GF_SG_VRML_SFVEC3F;
14038 20 : info->far_ptr = & ((X_Viewpoint *) node)->position;
14039 20 : return GF_OK;
14040 2 : case 5:
14041 2 : info->name = "description";
14042 2 : info->eventType = GF_SG_EVENT_FIELD;
14043 2 : info->fieldType = GF_SG_VRML_SFSTRING;
14044 2 : info->far_ptr = & ((X_Viewpoint *) node)->description;
14045 2 : return GF_OK;
14046 2 : case 6:
14047 2 : info->name = "bindTime";
14048 2 : info->eventType = GF_SG_EVENT_OUT;
14049 2 : info->fieldType = GF_SG_VRML_SFTIME;
14050 2 : info->far_ptr = & ((X_Viewpoint *) node)->bindTime;
14051 2 : return GF_OK;
14052 2 : case 7:
14053 2 : info->name = "isBound";
14054 2 : info->eventType = GF_SG_EVENT_OUT;
14055 2 : info->fieldType = GF_SG_VRML_SFBOOL;
14056 2 : info->far_ptr = & ((X_Viewpoint *) node)->isBound;
14057 2 : return GF_OK;
14058 2 : case 8:
14059 2 : info->name = "metadata";
14060 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14061 2 : info->fieldType = GF_SG_VRML_SFNODE;
14062 2 : info->NDTtype = NDT_SFMetadataNode;
14063 2 : info->far_ptr = & ((X_Viewpoint *)node)->metadata;
14064 2 : return GF_OK;
14065 2 : case 9:
14066 2 : info->name = "centerOfRotation";
14067 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14068 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
14069 2 : info->far_ptr = & ((X_Viewpoint *) node)->centerOfRotation;
14070 2 : return GF_OK;
14071 : default:
14072 : return GF_BAD_PARAM;
14073 : }
14074 : }
14075 :
14076 :
14077 28 : static s32 Viewpoint_get_field_index_by_name(char *name)
14078 : {
14079 28 : if (!strcmp("set_bind", name)) return 0;
14080 27 : if (!strcmp("fieldOfView", name)) return 1;
14081 26 : if (!strcmp("jump", name)) return 2;
14082 25 : if (!strcmp("orientation", name)) return 3;
14083 24 : if (!strcmp("position", name)) return 4;
14084 5 : if (!strcmp("description", name)) return 5;
14085 4 : if (!strcmp("bindTime", name)) return 6;
14086 3 : if (!strcmp("isBound", name)) return 7;
14087 2 : if (!strcmp("metadata", name)) return 8;
14088 1 : if (!strcmp("centerOfRotation", name)) return 9;
14089 0 : return -1;
14090 : }
14091 :
14092 :
14093 19 : static GF_Node *Viewpoint_Create()
14094 : {
14095 : X_Viewpoint *p;
14096 19 : GF_SAFEALLOC(p, X_Viewpoint);
14097 19 : if(!p) return NULL;
14098 19 : gf_node_setup((GF_Node *)p, TAG_X3D_Viewpoint);
14099 :
14100 : /*default field values*/
14101 19 : p->fieldOfView = FLT2FIX(0.785398);
14102 19 : p->jump = 1;
14103 19 : p->orientation.x = FLT2FIX(0);
14104 19 : p->orientation.y = FLT2FIX(0);
14105 19 : p->orientation.z = FLT2FIX(1);
14106 19 : p->orientation.q = FLT2FIX(0);
14107 19 : p->position.x = FLT2FIX(0);
14108 19 : p->position.y = FLT2FIX(0);
14109 19 : p->position.z = FLT2FIX(10);
14110 19 : p->centerOfRotation.x = FLT2FIX(0);
14111 19 : p->centerOfRotation.y = FLT2FIX(0);
14112 19 : p->centerOfRotation.z = FLT2FIX(0);
14113 19 : return (GF_Node *)p;
14114 : }
14115 :
14116 :
14117 : /*
14118 : VisibilitySensor Node deletion
14119 : */
14120 :
14121 : static void VisibilitySensor_Del(GF_Node *node)
14122 : {
14123 : X_VisibilitySensor *p = (X_VisibilitySensor *) node;
14124 1 : gf_node_unregister((GF_Node *) p->metadata, node);
14125 1 : gf_node_free((GF_Node *)p);
14126 : }
14127 :
14128 :
14129 : static u32 VisibilitySensor_get_field_count(GF_Node *node, u8 dummy)
14130 : {
14131 : return 7;
14132 : }
14133 :
14134 14 : static GF_Err VisibilitySensor_get_field(GF_Node *node, GF_FieldInfo *info)
14135 : {
14136 14 : switch (info->fieldIndex) {
14137 2 : case 0:
14138 2 : info->name = "center";
14139 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14140 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
14141 2 : info->far_ptr = & ((X_VisibilitySensor *) node)->center;
14142 2 : return GF_OK;
14143 2 : case 1:
14144 2 : info->name = "enabled";
14145 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14146 2 : info->fieldType = GF_SG_VRML_SFBOOL;
14147 2 : info->far_ptr = & ((X_VisibilitySensor *) node)->enabled;
14148 2 : return GF_OK;
14149 2 : case 2:
14150 2 : info->name = "size";
14151 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14152 2 : info->fieldType = GF_SG_VRML_SFVEC3F;
14153 2 : info->far_ptr = & ((X_VisibilitySensor *) node)->size;
14154 2 : return GF_OK;
14155 2 : case 3:
14156 2 : info->name = "enterTime";
14157 2 : info->eventType = GF_SG_EVENT_OUT;
14158 2 : info->fieldType = GF_SG_VRML_SFTIME;
14159 2 : info->far_ptr = & ((X_VisibilitySensor *) node)->enterTime;
14160 2 : return GF_OK;
14161 2 : case 4:
14162 2 : info->name = "exitTime";
14163 2 : info->eventType = GF_SG_EVENT_OUT;
14164 2 : info->fieldType = GF_SG_VRML_SFTIME;
14165 2 : info->far_ptr = & ((X_VisibilitySensor *) node)->exitTime;
14166 2 : return GF_OK;
14167 2 : case 5:
14168 2 : info->name = "isActive";
14169 2 : info->eventType = GF_SG_EVENT_OUT;
14170 2 : info->fieldType = GF_SG_VRML_SFBOOL;
14171 2 : info->far_ptr = & ((X_VisibilitySensor *) node)->isActive;
14172 2 : return GF_OK;
14173 2 : case 6:
14174 2 : info->name = "metadata";
14175 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14176 2 : info->fieldType = GF_SG_VRML_SFNODE;
14177 2 : info->NDTtype = NDT_SFMetadataNode;
14178 2 : info->far_ptr = & ((X_VisibilitySensor *)node)->metadata;
14179 2 : return GF_OK;
14180 : default:
14181 : return GF_BAD_PARAM;
14182 : }
14183 : }
14184 :
14185 :
14186 7 : static s32 VisibilitySensor_get_field_index_by_name(char *name)
14187 : {
14188 7 : if (!strcmp("center", name)) return 0;
14189 6 : if (!strcmp("enabled", name)) return 1;
14190 5 : if (!strcmp("size", name)) return 2;
14191 4 : if (!strcmp("enterTime", name)) return 3;
14192 3 : if (!strcmp("exitTime", name)) return 4;
14193 2 : if (!strcmp("isActive", name)) return 5;
14194 1 : if (!strcmp("metadata", name)) return 6;
14195 0 : return -1;
14196 : }
14197 :
14198 :
14199 1 : static GF_Node *VisibilitySensor_Create()
14200 : {
14201 : X_VisibilitySensor *p;
14202 1 : GF_SAFEALLOC(p, X_VisibilitySensor);
14203 1 : if(!p) return NULL;
14204 1 : gf_node_setup((GF_Node *)p, TAG_X3D_VisibilitySensor);
14205 :
14206 : /*default field values*/
14207 1 : p->center.x = FLT2FIX(0);
14208 1 : p->center.y = FLT2FIX(0);
14209 1 : p->center.z = FLT2FIX(0);
14210 1 : p->enabled = 1;
14211 1 : p->size.x = FLT2FIX(0);
14212 1 : p->size.y = FLT2FIX(0);
14213 1 : p->size.z = FLT2FIX(0);
14214 1 : return (GF_Node *)p;
14215 : }
14216 :
14217 :
14218 : /*
14219 : WorldInfo Node deletion
14220 : */
14221 :
14222 19 : static void WorldInfo_Del(GF_Node *node)
14223 : {
14224 : X_WorldInfo *p = (X_WorldInfo *) node;
14225 19 : gf_sg_mfstring_del(p->info);
14226 19 : gf_sg_sfstring_del(p->title);
14227 19 : gf_node_unregister((GF_Node *) p->metadata, node);
14228 19 : gf_node_free((GF_Node *)p);
14229 19 : }
14230 :
14231 :
14232 : static u32 WorldInfo_get_field_count(GF_Node *node, u8 dummy)
14233 : {
14234 : return 3;
14235 : }
14236 :
14237 : static GF_Err WorldInfo_get_field(GF_Node *node, GF_FieldInfo *info)
14238 : {
14239 42 : switch (info->fieldIndex) {
14240 20 : case 0:
14241 20 : info->name = "info";
14242 20 : info->eventType = GF_SG_EVENT_FIELD;
14243 20 : info->fieldType = GF_SG_VRML_MFSTRING;
14244 20 : info->far_ptr = & ((X_WorldInfo *) node)->info;
14245 : return GF_OK;
14246 20 : case 1:
14247 20 : info->name = "title";
14248 20 : info->eventType = GF_SG_EVENT_FIELD;
14249 20 : info->fieldType = GF_SG_VRML_SFSTRING;
14250 20 : info->far_ptr = & ((X_WorldInfo *) node)->title;
14251 : return GF_OK;
14252 2 : case 2:
14253 2 : info->name = "metadata";
14254 2 : info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14255 2 : info->fieldType = GF_SG_VRML_SFNODE;
14256 2 : info->NDTtype = NDT_SFMetadataNode;
14257 2 : info->far_ptr = & ((X_WorldInfo *)node)->metadata;
14258 : return GF_OK;
14259 : default:
14260 : return GF_BAD_PARAM;
14261 : }
14262 : }
14263 :
14264 :
14265 39 : static s32 WorldInfo_get_field_index_by_name(char *name)
14266 : {
14267 39 : if (!strcmp("info", name)) return 0;
14268 20 : if (!strcmp("title", name)) return 1;
14269 1 : if (!strcmp("metadata", name)) return 2;
14270 0 : return -1;
14271 : }
14272 :
14273 :
14274 19 : static GF_Node *WorldInfo_Create()
14275 : {
14276 : X_WorldInfo *p;
14277 19 : GF_SAFEALLOC(p, X_WorldInfo);
14278 19 : if(!p) return NULL;
14279 19 : gf_node_setup((GF_Node *)p, TAG_X3D_WorldInfo);
14280 :
14281 : /*default field values*/
14282 19 : return (GF_Node *)p;
14283 : }
14284 :
14285 :
14286 :
14287 :
14288 402 : GF_Node *gf_sg_x3d_node_new(u32 NodeTag)
14289 : {
14290 402 : switch (NodeTag) {
14291 1 : case TAG_X3D_Anchor:
14292 1 : return Anchor_Create();
14293 27 : case TAG_X3D_Appearance:
14294 27 : return Appearance_Create();
14295 2 : case TAG_X3D_Arc2D:
14296 2 : return Arc2D_Create();
14297 2 : case TAG_X3D_ArcClose2D:
14298 2 : return ArcClose2D_Create();
14299 1 : case TAG_X3D_AudioClip:
14300 1 : return AudioClip_Create();
14301 1 : case TAG_X3D_Background:
14302 1 : return Background_Create();
14303 1 : case TAG_X3D_Billboard:
14304 1 : return Billboard_Create();
14305 2 : case TAG_X3D_BooleanFilter:
14306 2 : return BooleanFilter_Create();
14307 2 : case TAG_X3D_BooleanSequencer:
14308 2 : return BooleanSequencer_Create();
14309 2 : case TAG_X3D_BooleanToggle:
14310 2 : return BooleanToggle_Create();
14311 2 : case TAG_X3D_BooleanTrigger:
14312 2 : return BooleanTrigger_Create();
14313 2 : case TAG_X3D_Box:
14314 2 : return Box_Create();
14315 1 : case TAG_X3D_Circle2D:
14316 1 : return Circle2D_Create();
14317 1 : case TAG_X3D_Collision:
14318 1 : return Collision_Create();
14319 8 : case TAG_X3D_Color:
14320 8 : return Color_Create();
14321 1 : case TAG_X3D_ColorInterpolator:
14322 1 : return ColorInterpolator_Create();
14323 2 : case TAG_X3D_ColorRGBA:
14324 2 : return ColorRGBA_Create();
14325 1 : case TAG_X3D_Cone:
14326 1 : return Cone_Create();
14327 1 : case TAG_X3D_Contour2D:
14328 1 : return Contour2D_Create();
14329 1 : case TAG_X3D_ContourPolyline2D:
14330 1 : return ContourPolyline2D_Create();
14331 19 : case TAG_X3D_Coordinate:
14332 19 : return Coordinate_Create();
14333 1 : case TAG_X3D_CoordinateDouble:
14334 1 : return CoordinateDouble_Create();
14335 1 : case TAG_X3D_Coordinate2D:
14336 1 : return Coordinate2D_Create();
14337 1 : case TAG_X3D_CoordinateInterpolator:
14338 1 : return CoordinateInterpolator_Create();
14339 1 : case TAG_X3D_CoordinateInterpolator2D:
14340 1 : return CoordinateInterpolator2D_Create();
14341 1 : case TAG_X3D_Cylinder:
14342 1 : return Cylinder_Create();
14343 1 : case TAG_X3D_CylinderSensor:
14344 1 : return CylinderSensor_Create();
14345 1 : case TAG_X3D_DirectionalLight:
14346 1 : return DirectionalLight_Create();
14347 2 : case TAG_X3D_Disk2D:
14348 2 : return Disk2D_Create();
14349 2 : case TAG_X3D_ElevationGrid:
14350 2 : return ElevationGrid_Create();
14351 1 : case TAG_X3D_EspduTransform:
14352 1 : return EspduTransform_Create();
14353 1 : case TAG_X3D_Extrusion:
14354 1 : return Extrusion_Create();
14355 2 : case TAG_X3D_FillProperties:
14356 2 : return FillProperties_Create();
14357 1 : case TAG_X3D_Fog:
14358 1 : return Fog_Create();
14359 3 : case TAG_X3D_FontStyle:
14360 3 : return FontStyle_Create();
14361 1 : case TAG_X3D_GeoCoordinate:
14362 1 : return GeoCoordinate_Create();
14363 1 : case TAG_X3D_GeoElevationGrid:
14364 1 : return GeoElevationGrid_Create();
14365 1 : case TAG_X3D_GeoLocation:
14366 1 : return GeoLocation_Create();
14367 1 : case TAG_X3D_GeoLOD:
14368 1 : return GeoLOD_Create();
14369 1 : case TAG_X3D_GeoMetadata:
14370 1 : return GeoMetadata_Create();
14371 1 : case TAG_X3D_GeoOrigin:
14372 1 : return GeoOrigin_Create();
14373 1 : case TAG_X3D_GeoPositionInterpolator:
14374 1 : return GeoPositionInterpolator_Create();
14375 1 : case TAG_X3D_GeoTouchSensor:
14376 1 : return GeoTouchSensor_Create();
14377 1 : case TAG_X3D_GeoViewpoint:
14378 1 : return GeoViewpoint_Create();
14379 49 : case TAG_X3D_Group:
14380 49 : return Group_Create();
14381 1 : case TAG_X3D_HAnimDisplacer:
14382 1 : return HAnimDisplacer_Create();
14383 1 : case TAG_X3D_HAnimHumanoid:
14384 1 : return HAnimHumanoid_Create();
14385 1 : case TAG_X3D_HAnimJoint:
14386 1 : return HAnimJoint_Create();
14387 1 : case TAG_X3D_HAnimSegment:
14388 1 : return HAnimSegment_Create();
14389 1 : case TAG_X3D_HAnimSite:
14390 1 : return HAnimSite_Create();
14391 1 : case TAG_X3D_ImageTexture:
14392 1 : return ImageTexture_Create();
14393 13 : case TAG_X3D_IndexedFaceSet:
14394 13 : return IndexedFaceSet_Create();
14395 1 : case TAG_X3D_IndexedLineSet:
14396 1 : return IndexedLineSet_Create();
14397 2 : case TAG_X3D_IndexedTriangleFanSet:
14398 2 : return IndexedTriangleFanSet_Create();
14399 2 : case TAG_X3D_IndexedTriangleSet:
14400 2 : return IndexedTriangleSet_Create();
14401 2 : case TAG_X3D_IndexedTriangleStripSet:
14402 2 : return IndexedTriangleStripSet_Create();
14403 1 : case TAG_X3D_Inline:
14404 1 : return Inline_Create();
14405 2 : case TAG_X3D_IntegerSequencer:
14406 2 : return IntegerSequencer_Create();
14407 2 : case TAG_X3D_IntegerTrigger:
14408 2 : return IntegerTrigger_Create();
14409 2 : case TAG_X3D_KeySensor:
14410 2 : return KeySensor_Create();
14411 1 : case TAG_X3D_LineProperties:
14412 1 : return LineProperties_Create();
14413 2 : case TAG_X3D_LineSet:
14414 2 : return LineSet_Create();
14415 1 : case TAG_X3D_LoadSensor:
14416 1 : return LoadSensor_Create();
14417 1 : case TAG_X3D_LOD:
14418 1 : return LOD_Create();
14419 27 : case TAG_X3D_Material:
14420 27 : return Material_Create();
14421 1 : case TAG_X3D_MetadataDouble:
14422 1 : return MetadataDouble_Create();
14423 1 : case TAG_X3D_MetadataFloat:
14424 1 : return MetadataFloat_Create();
14425 1 : case TAG_X3D_MetadataInteger:
14426 1 : return MetadataInteger_Create();
14427 1 : case TAG_X3D_MetadataSet:
14428 1 : return MetadataSet_Create();
14429 1 : case TAG_X3D_MetadataString:
14430 1 : return MetadataString_Create();
14431 1 : case TAG_X3D_MovieTexture:
14432 1 : return MovieTexture_Create();
14433 1 : case TAG_X3D_MultiTexture:
14434 1 : return MultiTexture_Create();
14435 1 : case TAG_X3D_MultiTextureCoordinate:
14436 1 : return MultiTextureCoordinate_Create();
14437 1 : case TAG_X3D_MultiTextureTransform:
14438 1 : return MultiTextureTransform_Create();
14439 2 : case TAG_X3D_NavigationInfo:
14440 2 : return NavigationInfo_Create();
14441 1 : case TAG_X3D_Normal:
14442 1 : return Normal_Create();
14443 1 : case TAG_X3D_NormalInterpolator:
14444 1 : return NormalInterpolator_Create();
14445 1 : case TAG_X3D_NurbsCurve:
14446 1 : return NurbsCurve_Create();
14447 1 : case TAG_X3D_NurbsCurve2D:
14448 1 : return NurbsCurve2D_Create();
14449 1 : case TAG_X3D_NurbsOrientationInterpolator:
14450 1 : return NurbsOrientationInterpolator_Create();
14451 1 : case TAG_X3D_NurbsPatchSurface:
14452 1 : return NurbsPatchSurface_Create();
14453 1 : case TAG_X3D_NurbsPositionInterpolator:
14454 1 : return NurbsPositionInterpolator_Create();
14455 1 : case TAG_X3D_NurbsSet:
14456 1 : return NurbsSet_Create();
14457 1 : case TAG_X3D_NurbsSurfaceInterpolator:
14458 1 : return NurbsSurfaceInterpolator_Create();
14459 1 : case TAG_X3D_NurbsSweptSurface:
14460 1 : return NurbsSweptSurface_Create();
14461 1 : case TAG_X3D_NurbsSwungSurface:
14462 1 : return NurbsSwungSurface_Create();
14463 1 : case TAG_X3D_NurbsTextureCoordinate:
14464 1 : return NurbsTextureCoordinate_Create();
14465 1 : case TAG_X3D_NurbsTrimmedSurface:
14466 1 : return NurbsTrimmedSurface_Create();
14467 1 : case TAG_X3D_OrientationInterpolator:
14468 1 : return OrientationInterpolator_Create();
14469 1 : case TAG_X3D_PixelTexture:
14470 1 : return PixelTexture_Create();
14471 1 : case TAG_X3D_PlaneSensor:
14472 1 : return PlaneSensor_Create();
14473 1 : case TAG_X3D_PointLight:
14474 1 : return PointLight_Create();
14475 1 : case TAG_X3D_PointSet:
14476 1 : return PointSet_Create();
14477 2 : case TAG_X3D_Polyline2D:
14478 2 : return Polyline2D_Create();
14479 2 : case TAG_X3D_Polypoint2D:
14480 2 : return Polypoint2D_Create();
14481 1 : case TAG_X3D_PositionInterpolator:
14482 1 : return PositionInterpolator_Create();
14483 1 : case TAG_X3D_PositionInterpolator2D:
14484 1 : return PositionInterpolator2D_Create();
14485 1 : case TAG_X3D_ProximitySensor:
14486 1 : return ProximitySensor_Create();
14487 1 : case TAG_X3D_ReceiverPdu:
14488 1 : return ReceiverPdu_Create();
14489 1 : case TAG_X3D_Rectangle2D:
14490 1 : return Rectangle2D_Create();
14491 1 : case TAG_X3D_ScalarInterpolator:
14492 1 : return ScalarInterpolator_Create();
14493 2 : case TAG_X3D_Script:
14494 2 : return Script_Create();
14495 33 : case TAG_X3D_Shape:
14496 33 : return Shape_Create();
14497 1 : case TAG_X3D_SignalPdu:
14498 1 : return SignalPdu_Create();
14499 1 : case TAG_X3D_Sound:
14500 1 : return Sound_Create();
14501 1 : case TAG_X3D_Sphere:
14502 1 : return Sphere_Create();
14503 1 : case TAG_X3D_SphereSensor:
14504 1 : return SphereSensor_Create();
14505 1 : case TAG_X3D_SpotLight:
14506 1 : return SpotLight_Create();
14507 2 : case TAG_X3D_StaticGroup:
14508 2 : return StaticGroup_Create();
14509 2 : case TAG_X3D_StringSensor:
14510 2 : return StringSensor_Create();
14511 1 : case TAG_X3D_Switch:
14512 1 : return Switch_Create();
14513 7 : case TAG_X3D_Text:
14514 7 : return Text_Create();
14515 1 : case TAG_X3D_TextureBackground:
14516 1 : return TextureBackground_Create();
14517 1 : case TAG_X3D_TextureCoordinate:
14518 1 : return TextureCoordinate_Create();
14519 2 : case TAG_X3D_TextureCoordinateGenerator:
14520 2 : return TextureCoordinateGenerator_Create();
14521 1 : case TAG_X3D_TextureTransform:
14522 1 : return TextureTransform_Create();
14523 2 : case TAG_X3D_TimeSensor:
14524 2 : return TimeSensor_Create();
14525 2 : case TAG_X3D_TimeTrigger:
14526 2 : return TimeTrigger_Create();
14527 1 : case TAG_X3D_TouchSensor:
14528 1 : return TouchSensor_Create();
14529 31 : case TAG_X3D_Transform:
14530 31 : return Transform_Create();
14531 1 : case TAG_X3D_TransmitterPdu:
14532 1 : return TransmitterPdu_Create();
14533 2 : case TAG_X3D_TriangleFanSet:
14534 2 : return TriangleFanSet_Create();
14535 2 : case TAG_X3D_TriangleSet:
14536 2 : return TriangleSet_Create();
14537 2 : case TAG_X3D_TriangleSet2D:
14538 2 : return TriangleSet2D_Create();
14539 2 : case TAG_X3D_TriangleStripSet:
14540 2 : return TriangleStripSet_Create();
14541 19 : case TAG_X3D_Viewpoint:
14542 19 : return Viewpoint_Create();
14543 1 : case TAG_X3D_VisibilitySensor:
14544 1 : return VisibilitySensor_Create();
14545 19 : case TAG_X3D_WorldInfo:
14546 19 : return WorldInfo_Create();
14547 : default:
14548 : return NULL;
14549 : }
14550 : }
14551 :
14552 129 : const char *gf_sg_x3d_node_get_class_name(u32 NodeTag)
14553 : {
14554 129 : switch (NodeTag) {
14555 : case TAG_X3D_Anchor:
14556 : return "Anchor";
14557 1 : case TAG_X3D_Appearance:
14558 1 : return "Appearance";
14559 1 : case TAG_X3D_Arc2D:
14560 1 : return "Arc2D";
14561 1 : case TAG_X3D_ArcClose2D:
14562 1 : return "ArcClose2D";
14563 1 : case TAG_X3D_AudioClip:
14564 1 : return "AudioClip";
14565 1 : case TAG_X3D_Background:
14566 1 : return "Background";
14567 1 : case TAG_X3D_Billboard:
14568 1 : return "Billboard";
14569 1 : case TAG_X3D_BooleanFilter:
14570 1 : return "BooleanFilter";
14571 1 : case TAG_X3D_BooleanSequencer:
14572 1 : return "BooleanSequencer";
14573 1 : case TAG_X3D_BooleanToggle:
14574 1 : return "BooleanToggle";
14575 1 : case TAG_X3D_BooleanTrigger:
14576 1 : return "BooleanTrigger";
14577 1 : case TAG_X3D_Box:
14578 1 : return "Box";
14579 1 : case TAG_X3D_Circle2D:
14580 1 : return "Circle2D";
14581 1 : case TAG_X3D_Collision:
14582 1 : return "Collision";
14583 1 : case TAG_X3D_Color:
14584 1 : return "Color";
14585 1 : case TAG_X3D_ColorInterpolator:
14586 1 : return "ColorInterpolator";
14587 1 : case TAG_X3D_ColorRGBA:
14588 1 : return "ColorRGBA";
14589 1 : case TAG_X3D_Cone:
14590 1 : return "Cone";
14591 1 : case TAG_X3D_Contour2D:
14592 1 : return "Contour2D";
14593 1 : case TAG_X3D_ContourPolyline2D:
14594 1 : return "ContourPolyline2D";
14595 1 : case TAG_X3D_Coordinate:
14596 1 : return "Coordinate";
14597 1 : case TAG_X3D_CoordinateDouble:
14598 1 : return "CoordinateDouble";
14599 1 : case TAG_X3D_Coordinate2D:
14600 1 : return "Coordinate2D";
14601 1 : case TAG_X3D_CoordinateInterpolator:
14602 1 : return "CoordinateInterpolator";
14603 1 : case TAG_X3D_CoordinateInterpolator2D:
14604 1 : return "CoordinateInterpolator2D";
14605 1 : case TAG_X3D_Cylinder:
14606 1 : return "Cylinder";
14607 1 : case TAG_X3D_CylinderSensor:
14608 1 : return "CylinderSensor";
14609 1 : case TAG_X3D_DirectionalLight:
14610 1 : return "DirectionalLight";
14611 1 : case TAG_X3D_Disk2D:
14612 1 : return "Disk2D";
14613 2 : case TAG_X3D_ElevationGrid:
14614 2 : return "ElevationGrid";
14615 1 : case TAG_X3D_EspduTransform:
14616 1 : return "EspduTransform";
14617 1 : case TAG_X3D_Extrusion:
14618 1 : return "Extrusion";
14619 1 : case TAG_X3D_FillProperties:
14620 1 : return "FillProperties";
14621 1 : case TAG_X3D_Fog:
14622 1 : return "Fog";
14623 1 : case TAG_X3D_FontStyle:
14624 1 : return "FontStyle";
14625 1 : case TAG_X3D_GeoCoordinate:
14626 1 : return "GeoCoordinate";
14627 1 : case TAG_X3D_GeoElevationGrid:
14628 1 : return "GeoElevationGrid";
14629 1 : case TAG_X3D_GeoLocation:
14630 1 : return "GeoLocation";
14631 1 : case TAG_X3D_GeoLOD:
14632 1 : return "GeoLOD";
14633 1 : case TAG_X3D_GeoMetadata:
14634 1 : return "GeoMetadata";
14635 1 : case TAG_X3D_GeoOrigin:
14636 1 : return "GeoOrigin";
14637 1 : case TAG_X3D_GeoPositionInterpolator:
14638 1 : return "GeoPositionInterpolator";
14639 1 : case TAG_X3D_GeoTouchSensor:
14640 1 : return "GeoTouchSensor";
14641 1 : case TAG_X3D_GeoViewpoint:
14642 1 : return "GeoViewpoint";
14643 1 : case TAG_X3D_Group:
14644 1 : return "Group";
14645 1 : case TAG_X3D_HAnimDisplacer:
14646 1 : return "HAnimDisplacer";
14647 1 : case TAG_X3D_HAnimHumanoid:
14648 1 : return "HAnimHumanoid";
14649 1 : case TAG_X3D_HAnimJoint:
14650 1 : return "HAnimJoint";
14651 1 : case TAG_X3D_HAnimSegment:
14652 1 : return "HAnimSegment";
14653 1 : case TAG_X3D_HAnimSite:
14654 1 : return "HAnimSite";
14655 1 : case TAG_X3D_ImageTexture:
14656 1 : return "ImageTexture";
14657 1 : case TAG_X3D_IndexedFaceSet:
14658 1 : return "IndexedFaceSet";
14659 1 : case TAG_X3D_IndexedLineSet:
14660 1 : return "IndexedLineSet";
14661 1 : case TAG_X3D_IndexedTriangleFanSet:
14662 1 : return "IndexedTriangleFanSet";
14663 1 : case TAG_X3D_IndexedTriangleSet:
14664 1 : return "IndexedTriangleSet";
14665 1 : case TAG_X3D_IndexedTriangleStripSet:
14666 1 : return "IndexedTriangleStripSet";
14667 1 : case TAG_X3D_Inline:
14668 1 : return "Inline";
14669 1 : case TAG_X3D_IntegerSequencer:
14670 1 : return "IntegerSequencer";
14671 1 : case TAG_X3D_IntegerTrigger:
14672 1 : return "IntegerTrigger";
14673 1 : case TAG_X3D_KeySensor:
14674 1 : return "KeySensor";
14675 1 : case TAG_X3D_LineProperties:
14676 1 : return "LineProperties";
14677 1 : case TAG_X3D_LineSet:
14678 1 : return "LineSet";
14679 1 : case TAG_X3D_LoadSensor:
14680 1 : return "LoadSensor";
14681 1 : case TAG_X3D_LOD:
14682 1 : return "LOD";
14683 1 : case TAG_X3D_Material:
14684 1 : return "Material";
14685 1 : case TAG_X3D_MetadataDouble:
14686 1 : return "MetadataDouble";
14687 1 : case TAG_X3D_MetadataFloat:
14688 1 : return "MetadataFloat";
14689 1 : case TAG_X3D_MetadataInteger:
14690 1 : return "MetadataInteger";
14691 1 : case TAG_X3D_MetadataSet:
14692 1 : return "MetadataSet";
14693 1 : case TAG_X3D_MetadataString:
14694 1 : return "MetadataString";
14695 1 : case TAG_X3D_MovieTexture:
14696 1 : return "MovieTexture";
14697 1 : case TAG_X3D_MultiTexture:
14698 1 : return "MultiTexture";
14699 1 : case TAG_X3D_MultiTextureCoordinate:
14700 1 : return "MultiTextureCoordinate";
14701 1 : case TAG_X3D_MultiTextureTransform:
14702 1 : return "MultiTextureTransform";
14703 1 : case TAG_X3D_NavigationInfo:
14704 1 : return "NavigationInfo";
14705 1 : case TAG_X3D_Normal:
14706 1 : return "Normal";
14707 1 : case TAG_X3D_NormalInterpolator:
14708 1 : return "NormalInterpolator";
14709 1 : case TAG_X3D_NurbsCurve:
14710 1 : return "NurbsCurve";
14711 1 : case TAG_X3D_NurbsCurve2D:
14712 1 : return "NurbsCurve2D";
14713 1 : case TAG_X3D_NurbsOrientationInterpolator:
14714 1 : return "NurbsOrientationInterpolator";
14715 1 : case TAG_X3D_NurbsPatchSurface:
14716 1 : return "NurbsPatchSurface";
14717 1 : case TAG_X3D_NurbsPositionInterpolator:
14718 1 : return "NurbsPositionInterpolator";
14719 1 : case TAG_X3D_NurbsSet:
14720 1 : return "NurbsSet";
14721 1 : case TAG_X3D_NurbsSurfaceInterpolator:
14722 1 : return "NurbsSurfaceInterpolator";
14723 1 : case TAG_X3D_NurbsSweptSurface:
14724 1 : return "NurbsSweptSurface";
14725 1 : case TAG_X3D_NurbsSwungSurface:
14726 1 : return "NurbsSwungSurface";
14727 1 : case TAG_X3D_NurbsTextureCoordinate:
14728 1 : return "NurbsTextureCoordinate";
14729 1 : case TAG_X3D_NurbsTrimmedSurface:
14730 1 : return "NurbsTrimmedSurface";
14731 1 : case TAG_X3D_OrientationInterpolator:
14732 1 : return "OrientationInterpolator";
14733 1 : case TAG_X3D_PixelTexture:
14734 1 : return "PixelTexture";
14735 1 : case TAG_X3D_PlaneSensor:
14736 1 : return "PlaneSensor";
14737 1 : case TAG_X3D_PointLight:
14738 1 : return "PointLight";
14739 1 : case TAG_X3D_PointSet:
14740 1 : return "PointSet";
14741 1 : case TAG_X3D_Polyline2D:
14742 1 : return "Polyline2D";
14743 1 : case TAG_X3D_Polypoint2D:
14744 1 : return "Polypoint2D";
14745 1 : case TAG_X3D_PositionInterpolator:
14746 1 : return "PositionInterpolator";
14747 1 : case TAG_X3D_PositionInterpolator2D:
14748 1 : return "PositionInterpolator2D";
14749 1 : case TAG_X3D_ProximitySensor:
14750 1 : return "ProximitySensor";
14751 1 : case TAG_X3D_ReceiverPdu:
14752 1 : return "ReceiverPdu";
14753 1 : case TAG_X3D_Rectangle2D:
14754 1 : return "Rectangle2D";
14755 1 : case TAG_X3D_ScalarInterpolator:
14756 1 : return "ScalarInterpolator";
14757 1 : case TAG_X3D_Script:
14758 1 : return "Script";
14759 1 : case TAG_X3D_Shape:
14760 1 : return "Shape";
14761 1 : case TAG_X3D_SignalPdu:
14762 1 : return "SignalPdu";
14763 1 : case TAG_X3D_Sound:
14764 1 : return "Sound";
14765 1 : case TAG_X3D_Sphere:
14766 1 : return "Sphere";
14767 1 : case TAG_X3D_SphereSensor:
14768 1 : return "SphereSensor";
14769 1 : case TAG_X3D_SpotLight:
14770 1 : return "SpotLight";
14771 1 : case TAG_X3D_StaticGroup:
14772 1 : return "StaticGroup";
14773 1 : case TAG_X3D_StringSensor:
14774 1 : return "StringSensor";
14775 1 : case TAG_X3D_Switch:
14776 1 : return "Switch";
14777 1 : case TAG_X3D_Text:
14778 1 : return "Text";
14779 1 : case TAG_X3D_TextureBackground:
14780 1 : return "TextureBackground";
14781 1 : case TAG_X3D_TextureCoordinate:
14782 1 : return "TextureCoordinate";
14783 1 : case TAG_X3D_TextureCoordinateGenerator:
14784 1 : return "TextureCoordinateGenerator";
14785 1 : case TAG_X3D_TextureTransform:
14786 1 : return "TextureTransform";
14787 1 : case TAG_X3D_TimeSensor:
14788 1 : return "TimeSensor";
14789 1 : case TAG_X3D_TimeTrigger:
14790 1 : return "TimeTrigger";
14791 1 : case TAG_X3D_TouchSensor:
14792 1 : return "TouchSensor";
14793 1 : case TAG_X3D_Transform:
14794 1 : return "Transform";
14795 1 : case TAG_X3D_TransmitterPdu:
14796 1 : return "TransmitterPdu";
14797 1 : case TAG_X3D_TriangleFanSet:
14798 1 : return "TriangleFanSet";
14799 1 : case TAG_X3D_TriangleSet:
14800 1 : return "TriangleSet";
14801 1 : case TAG_X3D_TriangleSet2D:
14802 1 : return "TriangleSet2D";
14803 1 : case TAG_X3D_TriangleStripSet:
14804 1 : return "TriangleStripSet";
14805 1 : case TAG_X3D_Viewpoint:
14806 1 : return "Viewpoint";
14807 1 : case TAG_X3D_VisibilitySensor:
14808 1 : return "VisibilitySensor";
14809 1 : case TAG_X3D_WorldInfo:
14810 1 : return "WorldInfo";
14811 0 : default:
14812 0 : return "Unknown Node";
14813 : }
14814 : }
14815 :
14816 402 : void gf_sg_x3d_node_del(GF_Node *node)
14817 : {
14818 402 : switch (node->sgprivate->tag) {
14819 1 : case TAG_X3D_Anchor:
14820 1 : Anchor_Del(node);
14821 1 : return;
14822 27 : case TAG_X3D_Appearance:
14823 27 : Appearance_Del(node);
14824 27 : return;
14825 : case TAG_X3D_Arc2D:
14826 : Arc2D_Del(node);
14827 : return;
14828 2 : case TAG_X3D_ArcClose2D:
14829 2 : ArcClose2D_Del(node);
14830 2 : return;
14831 1 : case TAG_X3D_AudioClip:
14832 1 : AudioClip_Del(node);
14833 1 : return;
14834 1 : case TAG_X3D_Background:
14835 1 : Background_Del(node);
14836 1 : return;
14837 1 : case TAG_X3D_Billboard:
14838 1 : Billboard_Del(node);
14839 1 : return;
14840 : case TAG_X3D_BooleanFilter:
14841 : BooleanFilter_Del(node);
14842 : return;
14843 2 : case TAG_X3D_BooleanSequencer:
14844 2 : BooleanSequencer_Del(node);
14845 2 : return;
14846 : case TAG_X3D_BooleanToggle:
14847 : BooleanToggle_Del(node);
14848 : return;
14849 : case TAG_X3D_BooleanTrigger:
14850 : BooleanTrigger_Del(node);
14851 : return;
14852 : case TAG_X3D_Box:
14853 : Box_Del(node);
14854 : return;
14855 : case TAG_X3D_Circle2D:
14856 : Circle2D_Del(node);
14857 : return;
14858 1 : case TAG_X3D_Collision:
14859 1 : Collision_Del(node);
14860 1 : return;
14861 8 : case TAG_X3D_Color:
14862 8 : Color_Del(node);
14863 8 : return;
14864 1 : case TAG_X3D_ColorInterpolator:
14865 1 : ColorInterpolator_Del(node);
14866 1 : return;
14867 2 : case TAG_X3D_ColorRGBA:
14868 2 : ColorRGBA_Del(node);
14869 2 : return;
14870 : case TAG_X3D_Cone:
14871 : Cone_Del(node);
14872 : return;
14873 1 : case TAG_X3D_Contour2D:
14874 1 : Contour2D_Del(node);
14875 1 : return;
14876 1 : case TAG_X3D_ContourPolyline2D:
14877 1 : ContourPolyline2D_Del(node);
14878 1 : return;
14879 19 : case TAG_X3D_Coordinate:
14880 19 : Coordinate_Del(node);
14881 19 : return;
14882 1 : case TAG_X3D_CoordinateDouble:
14883 1 : CoordinateDouble_Del(node);
14884 1 : return;
14885 1 : case TAG_X3D_Coordinate2D:
14886 1 : Coordinate2D_Del(node);
14887 1 : return;
14888 1 : case TAG_X3D_CoordinateInterpolator:
14889 1 : CoordinateInterpolator_Del(node);
14890 1 : return;
14891 1 : case TAG_X3D_CoordinateInterpolator2D:
14892 1 : CoordinateInterpolator2D_Del(node);
14893 1 : return;
14894 : case TAG_X3D_Cylinder:
14895 : Cylinder_Del(node);
14896 : return;
14897 1 : case TAG_X3D_CylinderSensor:
14898 1 : CylinderSensor_Del(node);
14899 1 : return;
14900 : case TAG_X3D_DirectionalLight:
14901 : DirectionalLight_Del(node);
14902 : return;
14903 : case TAG_X3D_Disk2D:
14904 : Disk2D_Del(node);
14905 : return;
14906 2 : case TAG_X3D_ElevationGrid:
14907 2 : ElevationGrid_Del(node);
14908 2 : return;
14909 1 : case TAG_X3D_EspduTransform:
14910 1 : EspduTransform_Del(node);
14911 1 : return;
14912 1 : case TAG_X3D_Extrusion:
14913 1 : Extrusion_Del(node);
14914 1 : return;
14915 : case TAG_X3D_FillProperties:
14916 : FillProperties_Del(node);
14917 : return;
14918 1 : case TAG_X3D_Fog:
14919 1 : Fog_Del(node);
14920 1 : return;
14921 3 : case TAG_X3D_FontStyle:
14922 3 : FontStyle_Del(node);
14923 3 : return;
14924 1 : case TAG_X3D_GeoCoordinate:
14925 1 : GeoCoordinate_Del(node);
14926 1 : return;
14927 1 : case TAG_X3D_GeoElevationGrid:
14928 1 : GeoElevationGrid_Del(node);
14929 1 : return;
14930 1 : case TAG_X3D_GeoLocation:
14931 1 : GeoLocation_Del(node);
14932 1 : return;
14933 1 : case TAG_X3D_GeoLOD:
14934 1 : GeoLOD_Del(node);
14935 1 : return;
14936 1 : case TAG_X3D_GeoMetadata:
14937 1 : GeoMetadata_Del(node);
14938 1 : return;
14939 1 : case TAG_X3D_GeoOrigin:
14940 1 : GeoOrigin_Del(node);
14941 1 : return;
14942 1 : case TAG_X3D_GeoPositionInterpolator:
14943 1 : GeoPositionInterpolator_Del(node);
14944 1 : return;
14945 1 : case TAG_X3D_GeoTouchSensor:
14946 1 : GeoTouchSensor_Del(node);
14947 1 : return;
14948 1 : case TAG_X3D_GeoViewpoint:
14949 1 : GeoViewpoint_Del(node);
14950 1 : return;
14951 49 : case TAG_X3D_Group:
14952 49 : Group_Del(node);
14953 49 : return;
14954 1 : case TAG_X3D_HAnimDisplacer:
14955 1 : HAnimDisplacer_Del(node);
14956 1 : return;
14957 1 : case TAG_X3D_HAnimHumanoid:
14958 1 : HAnimHumanoid_Del(node);
14959 1 : return;
14960 1 : case TAG_X3D_HAnimJoint:
14961 1 : HAnimJoint_Del(node);
14962 1 : return;
14963 1 : case TAG_X3D_HAnimSegment:
14964 1 : HAnimSegment_Del(node);
14965 1 : return;
14966 1 : case TAG_X3D_HAnimSite:
14967 1 : HAnimSite_Del(node);
14968 1 : return;
14969 1 : case TAG_X3D_ImageTexture:
14970 1 : ImageTexture_Del(node);
14971 1 : return;
14972 13 : case TAG_X3D_IndexedFaceSet:
14973 13 : IndexedFaceSet_Del(node);
14974 13 : return;
14975 1 : case TAG_X3D_IndexedLineSet:
14976 1 : IndexedLineSet_Del(node);
14977 1 : return;
14978 2 : case TAG_X3D_IndexedTriangleFanSet:
14979 2 : IndexedTriangleFanSet_Del(node);
14980 2 : return;
14981 2 : case TAG_X3D_IndexedTriangleSet:
14982 2 : IndexedTriangleSet_Del(node);
14983 2 : return;
14984 2 : case TAG_X3D_IndexedTriangleStripSet:
14985 2 : IndexedTriangleStripSet_Del(node);
14986 2 : return;
14987 1 : case TAG_X3D_Inline:
14988 1 : Inline_Del(node);
14989 1 : return;
14990 2 : case TAG_X3D_IntegerSequencer:
14991 2 : IntegerSequencer_Del(node);
14992 2 : return;
14993 : case TAG_X3D_IntegerTrigger:
14994 : IntegerTrigger_Del(node);
14995 : return;
14996 2 : case TAG_X3D_KeySensor:
14997 2 : KeySensor_Del(node);
14998 2 : return;
14999 : case TAG_X3D_LineProperties:
15000 : LineProperties_Del(node);
15001 : return;
15002 2 : case TAG_X3D_LineSet:
15003 2 : LineSet_Del(node);
15004 2 : return;
15005 1 : case TAG_X3D_LoadSensor:
15006 1 : LoadSensor_Del(node);
15007 1 : return;
15008 1 : case TAG_X3D_LOD:
15009 1 : LOD_Del(node);
15010 1 : return;
15011 : case TAG_X3D_Material:
15012 : Material_Del(node);
15013 : return;
15014 1 : case TAG_X3D_MetadataDouble:
15015 1 : MetadataDouble_Del(node);
15016 1 : return;
15017 1 : case TAG_X3D_MetadataFloat:
15018 1 : MetadataFloat_Del(node);
15019 1 : return;
15020 1 : case TAG_X3D_MetadataInteger:
15021 1 : MetadataInteger_Del(node);
15022 1 : return;
15023 1 : case TAG_X3D_MetadataSet:
15024 1 : MetadataSet_Del(node);
15025 1 : return;
15026 1 : case TAG_X3D_MetadataString:
15027 1 : MetadataString_Del(node);
15028 1 : return;
15029 1 : case TAG_X3D_MovieTexture:
15030 1 : MovieTexture_Del(node);
15031 1 : return;
15032 1 : case TAG_X3D_MultiTexture:
15033 1 : MultiTexture_Del(node);
15034 1 : return;
15035 1 : case TAG_X3D_MultiTextureCoordinate:
15036 1 : MultiTextureCoordinate_Del(node);
15037 1 : return;
15038 1 : case TAG_X3D_MultiTextureTransform:
15039 1 : MultiTextureTransform_Del(node);
15040 1 : return;
15041 2 : case TAG_X3D_NavigationInfo:
15042 2 : NavigationInfo_Del(node);
15043 2 : return;
15044 1 : case TAG_X3D_Normal:
15045 1 : Normal_Del(node);
15046 1 : return;
15047 1 : case TAG_X3D_NormalInterpolator:
15048 1 : NormalInterpolator_Del(node);
15049 1 : return;
15050 1 : case TAG_X3D_NurbsCurve:
15051 1 : NurbsCurve_Del(node);
15052 1 : return;
15053 1 : case TAG_X3D_NurbsCurve2D:
15054 1 : NurbsCurve2D_Del(node);
15055 1 : return;
15056 1 : case TAG_X3D_NurbsOrientationInterpolator:
15057 1 : NurbsOrientationInterpolator_Del(node);
15058 1 : return;
15059 1 : case TAG_X3D_NurbsPatchSurface:
15060 1 : NurbsPatchSurface_Del(node);
15061 1 : return;
15062 1 : case TAG_X3D_NurbsPositionInterpolator:
15063 1 : NurbsPositionInterpolator_Del(node);
15064 1 : return;
15065 1 : case TAG_X3D_NurbsSet:
15066 1 : NurbsSet_Del(node);
15067 1 : return;
15068 1 : case TAG_X3D_NurbsSurfaceInterpolator:
15069 1 : NurbsSurfaceInterpolator_Del(node);
15070 1 : return;
15071 1 : case TAG_X3D_NurbsSweptSurface:
15072 1 : NurbsSweptSurface_Del(node);
15073 1 : return;
15074 1 : case TAG_X3D_NurbsSwungSurface:
15075 1 : NurbsSwungSurface_Del(node);
15076 1 : return;
15077 1 : case TAG_X3D_NurbsTextureCoordinate:
15078 1 : NurbsTextureCoordinate_Del(node);
15079 1 : return;
15080 1 : case TAG_X3D_NurbsTrimmedSurface:
15081 1 : NurbsTrimmedSurface_Del(node);
15082 1 : return;
15083 1 : case TAG_X3D_OrientationInterpolator:
15084 1 : OrientationInterpolator_Del(node);
15085 1 : return;
15086 1 : case TAG_X3D_PixelTexture:
15087 1 : PixelTexture_Del(node);
15088 1 : return;
15089 1 : case TAG_X3D_PlaneSensor:
15090 1 : PlaneSensor_Del(node);
15091 1 : return;
15092 : case TAG_X3D_PointLight:
15093 : PointLight_Del(node);
15094 : return;
15095 1 : case TAG_X3D_PointSet:
15096 1 : PointSet_Del(node);
15097 1 : return;
15098 2 : case TAG_X3D_Polyline2D:
15099 2 : Polyline2D_Del(node);
15100 2 : return;
15101 2 : case TAG_X3D_Polypoint2D:
15102 2 : Polypoint2D_Del(node);
15103 2 : return;
15104 1 : case TAG_X3D_PositionInterpolator:
15105 1 : PositionInterpolator_Del(node);
15106 1 : return;
15107 1 : case TAG_X3D_PositionInterpolator2D:
15108 1 : PositionInterpolator2D_Del(node);
15109 1 : return;
15110 : case TAG_X3D_ProximitySensor:
15111 : ProximitySensor_Del(node);
15112 : return;
15113 1 : case TAG_X3D_ReceiverPdu:
15114 1 : ReceiverPdu_Del(node);
15115 1 : return;
15116 : case TAG_X3D_Rectangle2D:
15117 : Rectangle2D_Del(node);
15118 : return;
15119 1 : case TAG_X3D_ScalarInterpolator:
15120 1 : ScalarInterpolator_Del(node);
15121 1 : return;
15122 2 : case TAG_X3D_Script:
15123 2 : Script_Del(node);
15124 2 : return;
15125 33 : case TAG_X3D_Shape:
15126 33 : Shape_Del(node);
15127 33 : return;
15128 1 : case TAG_X3D_SignalPdu:
15129 1 : SignalPdu_Del(node);
15130 1 : return;
15131 1 : case TAG_X3D_Sound:
15132 1 : Sound_Del(node);
15133 1 : return;
15134 : case TAG_X3D_Sphere:
15135 : Sphere_Del(node);
15136 : return;
15137 1 : case TAG_X3D_SphereSensor:
15138 1 : SphereSensor_Del(node);
15139 1 : return;
15140 : case TAG_X3D_SpotLight:
15141 : SpotLight_Del(node);
15142 : return;
15143 2 : case TAG_X3D_StaticGroup:
15144 2 : StaticGroup_Del(node);
15145 2 : return;
15146 2 : case TAG_X3D_StringSensor:
15147 2 : StringSensor_Del(node);
15148 2 : return;
15149 1 : case TAG_X3D_Switch:
15150 1 : Switch_Del(node);
15151 1 : return;
15152 7 : case TAG_X3D_Text:
15153 7 : Text_Del(node);
15154 7 : return;
15155 1 : case TAG_X3D_TextureBackground:
15156 1 : TextureBackground_Del(node);
15157 1 : return;
15158 1 : case TAG_X3D_TextureCoordinate:
15159 1 : TextureCoordinate_Del(node);
15160 1 : return;
15161 2 : case TAG_X3D_TextureCoordinateGenerator:
15162 2 : TextureCoordinateGenerator_Del(node);
15163 2 : return;
15164 : case TAG_X3D_TextureTransform:
15165 : TextureTransform_Del(node);
15166 : return;
15167 : case TAG_X3D_TimeSensor:
15168 : TimeSensor_Del(node);
15169 : return;
15170 : case TAG_X3D_TimeTrigger:
15171 : TimeTrigger_Del(node);
15172 : return;
15173 1 : case TAG_X3D_TouchSensor:
15174 1 : TouchSensor_Del(node);
15175 1 : return;
15176 31 : case TAG_X3D_Transform:
15177 31 : Transform_Del(node);
15178 31 : return;
15179 1 : case TAG_X3D_TransmitterPdu:
15180 1 : TransmitterPdu_Del(node);
15181 1 : return;
15182 2 : case TAG_X3D_TriangleFanSet:
15183 2 : TriangleFanSet_Del(node);
15184 2 : return;
15185 2 : case TAG_X3D_TriangleSet:
15186 2 : TriangleSet_Del(node);
15187 2 : return;
15188 2 : case TAG_X3D_TriangleSet2D:
15189 2 : TriangleSet2D_Del(node);
15190 2 : return;
15191 2 : case TAG_X3D_TriangleStripSet:
15192 2 : TriangleStripSet_Del(node);
15193 2 : return;
15194 19 : case TAG_X3D_Viewpoint:
15195 19 : Viewpoint_Del(node);
15196 19 : return;
15197 : case TAG_X3D_VisibilitySensor:
15198 : VisibilitySensor_Del(node);
15199 : return;
15200 19 : case TAG_X3D_WorldInfo:
15201 19 : WorldInfo_Del(node);
15202 19 : return;
15203 : default:
15204 : return;
15205 : }
15206 : }
15207 :
15208 129 : u32 gf_sg_x3d_node_get_field_count(GF_Node *node)
15209 : {
15210 129 : switch (node->sgprivate->tag) {
15211 : case TAG_X3D_Anchor:
15212 : return Anchor_get_field_count(node, 0);
15213 : case TAG_X3D_Appearance:
15214 : return Appearance_get_field_count(node, 0);
15215 : case TAG_X3D_Arc2D:
15216 : return Arc2D_get_field_count(node, 0);
15217 : case TAG_X3D_ArcClose2D:
15218 : return ArcClose2D_get_field_count(node, 0);
15219 : case TAG_X3D_AudioClip:
15220 : return AudioClip_get_field_count(node, 0);
15221 : case TAG_X3D_Background:
15222 : return Background_get_field_count(node, 0);
15223 : case TAG_X3D_Billboard:
15224 : return Billboard_get_field_count(node, 0);
15225 : case TAG_X3D_BooleanFilter:
15226 : return BooleanFilter_get_field_count(node, 0);
15227 : case TAG_X3D_BooleanSequencer:
15228 : return BooleanSequencer_get_field_count(node, 0);
15229 : case TAG_X3D_BooleanToggle:
15230 : return BooleanToggle_get_field_count(node, 0);
15231 : case TAG_X3D_BooleanTrigger:
15232 : return BooleanTrigger_get_field_count(node, 0);
15233 : case TAG_X3D_Box:
15234 : return Box_get_field_count(node, 0);
15235 : case TAG_X3D_Circle2D:
15236 : return Circle2D_get_field_count(node, 0);
15237 : case TAG_X3D_Collision:
15238 : return Collision_get_field_count(node, 0);
15239 : case TAG_X3D_Color:
15240 : return Color_get_field_count(node, 0);
15241 : case TAG_X3D_ColorInterpolator:
15242 : return ColorInterpolator_get_field_count(node, 0);
15243 : case TAG_X3D_ColorRGBA:
15244 : return ColorRGBA_get_field_count(node, 0);
15245 : case TAG_X3D_Cone:
15246 : return Cone_get_field_count(node, 0);
15247 : case TAG_X3D_Contour2D:
15248 : return Contour2D_get_field_count(node, 0);
15249 : case TAG_X3D_ContourPolyline2D:
15250 : return ContourPolyline2D_get_field_count(node, 0);
15251 : case TAG_X3D_Coordinate:
15252 : return Coordinate_get_field_count(node, 0);
15253 : case TAG_X3D_CoordinateDouble:
15254 : return CoordinateDouble_get_field_count(node, 0);
15255 : case TAG_X3D_Coordinate2D:
15256 : return Coordinate2D_get_field_count(node, 0);
15257 : case TAG_X3D_CoordinateInterpolator:
15258 : return CoordinateInterpolator_get_field_count(node, 0);
15259 : case TAG_X3D_CoordinateInterpolator2D:
15260 : return CoordinateInterpolator2D_get_field_count(node, 0);
15261 : case TAG_X3D_Cylinder:
15262 : return Cylinder_get_field_count(node, 0);
15263 : case TAG_X3D_CylinderSensor:
15264 : return CylinderSensor_get_field_count(node, 0);
15265 : case TAG_X3D_DirectionalLight:
15266 : return DirectionalLight_get_field_count(node, 0);
15267 : case TAG_X3D_Disk2D:
15268 : return Disk2D_get_field_count(node, 0);
15269 : case TAG_X3D_ElevationGrid:
15270 : return ElevationGrid_get_field_count(node, 0);
15271 : case TAG_X3D_EspduTransform:
15272 : return EspduTransform_get_field_count(node, 0);
15273 : case TAG_X3D_Extrusion:
15274 : return Extrusion_get_field_count(node, 0);
15275 : case TAG_X3D_FillProperties:
15276 : return FillProperties_get_field_count(node, 0);
15277 : case TAG_X3D_Fog:
15278 : return Fog_get_field_count(node, 0);
15279 : case TAG_X3D_FontStyle:
15280 : return FontStyle_get_field_count(node, 0);
15281 : case TAG_X3D_GeoCoordinate:
15282 : return GeoCoordinate_get_field_count(node, 0);
15283 : case TAG_X3D_GeoElevationGrid:
15284 : return GeoElevationGrid_get_field_count(node, 0);
15285 : case TAG_X3D_GeoLocation:
15286 : return GeoLocation_get_field_count(node, 0);
15287 : case TAG_X3D_GeoLOD:
15288 : return GeoLOD_get_field_count(node, 0);
15289 : case TAG_X3D_GeoMetadata:
15290 : return GeoMetadata_get_field_count(node, 0);
15291 : case TAG_X3D_GeoOrigin:
15292 : return GeoOrigin_get_field_count(node, 0);
15293 : case TAG_X3D_GeoPositionInterpolator:
15294 : return GeoPositionInterpolator_get_field_count(node, 0);
15295 : case TAG_X3D_GeoTouchSensor:
15296 : return GeoTouchSensor_get_field_count(node, 0);
15297 : case TAG_X3D_GeoViewpoint:
15298 : return GeoViewpoint_get_field_count(node, 0);
15299 : case TAG_X3D_Group:
15300 : return Group_get_field_count(node, 0);
15301 : case TAG_X3D_HAnimDisplacer:
15302 : return HAnimDisplacer_get_field_count(node, 0);
15303 : case TAG_X3D_HAnimHumanoid:
15304 : return HAnimHumanoid_get_field_count(node, 0);
15305 : case TAG_X3D_HAnimJoint:
15306 : return HAnimJoint_get_field_count(node, 0);
15307 : case TAG_X3D_HAnimSegment:
15308 : return HAnimSegment_get_field_count(node, 0);
15309 : case TAG_X3D_HAnimSite:
15310 : return HAnimSite_get_field_count(node, 0);
15311 : case TAG_X3D_ImageTexture:
15312 : return ImageTexture_get_field_count(node, 0);
15313 : case TAG_X3D_IndexedFaceSet:
15314 : return IndexedFaceSet_get_field_count(node, 0);
15315 : case TAG_X3D_IndexedLineSet:
15316 : return IndexedLineSet_get_field_count(node, 0);
15317 : case TAG_X3D_IndexedTriangleFanSet:
15318 : return IndexedTriangleFanSet_get_field_count(node, 0);
15319 : case TAG_X3D_IndexedTriangleSet:
15320 : return IndexedTriangleSet_get_field_count(node, 0);
15321 : case TAG_X3D_IndexedTriangleStripSet:
15322 : return IndexedTriangleStripSet_get_field_count(node, 0);
15323 : case TAG_X3D_Inline:
15324 : return Inline_get_field_count(node, 0);
15325 : case TAG_X3D_IntegerSequencer:
15326 : return IntegerSequencer_get_field_count(node, 0);
15327 : case TAG_X3D_IntegerTrigger:
15328 : return IntegerTrigger_get_field_count(node, 0);
15329 : case TAG_X3D_KeySensor:
15330 : return KeySensor_get_field_count(node, 0);
15331 : case TAG_X3D_LineProperties:
15332 : return LineProperties_get_field_count(node, 0);
15333 : case TAG_X3D_LineSet:
15334 : return LineSet_get_field_count(node, 0);
15335 : case TAG_X3D_LoadSensor:
15336 : return LoadSensor_get_field_count(node, 0);
15337 : case TAG_X3D_LOD:
15338 : return LOD_get_field_count(node, 0);
15339 : case TAG_X3D_Material:
15340 : return Material_get_field_count(node, 0);
15341 : case TAG_X3D_MetadataDouble:
15342 : return MetadataDouble_get_field_count(node, 0);
15343 : case TAG_X3D_MetadataFloat:
15344 : return MetadataFloat_get_field_count(node, 0);
15345 : case TAG_X3D_MetadataInteger:
15346 : return MetadataInteger_get_field_count(node, 0);
15347 : case TAG_X3D_MetadataSet:
15348 : return MetadataSet_get_field_count(node, 0);
15349 : case TAG_X3D_MetadataString:
15350 : return MetadataString_get_field_count(node, 0);
15351 : case TAG_X3D_MovieTexture:
15352 : return MovieTexture_get_field_count(node, 0);
15353 : case TAG_X3D_MultiTexture:
15354 : return MultiTexture_get_field_count(node, 0);
15355 : case TAG_X3D_MultiTextureCoordinate:
15356 : return MultiTextureCoordinate_get_field_count(node, 0);
15357 : case TAG_X3D_MultiTextureTransform:
15358 : return MultiTextureTransform_get_field_count(node, 0);
15359 : case TAG_X3D_NavigationInfo:
15360 : return NavigationInfo_get_field_count(node, 0);
15361 : case TAG_X3D_Normal:
15362 : return Normal_get_field_count(node, 0);
15363 : case TAG_X3D_NormalInterpolator:
15364 : return NormalInterpolator_get_field_count(node, 0);
15365 : case TAG_X3D_NurbsCurve:
15366 : return NurbsCurve_get_field_count(node, 0);
15367 : case TAG_X3D_NurbsCurve2D:
15368 : return NurbsCurve2D_get_field_count(node, 0);
15369 : case TAG_X3D_NurbsOrientationInterpolator:
15370 : return NurbsOrientationInterpolator_get_field_count(node, 0);
15371 : case TAG_X3D_NurbsPatchSurface:
15372 : return NurbsPatchSurface_get_field_count(node, 0);
15373 : case TAG_X3D_NurbsPositionInterpolator:
15374 : return NurbsPositionInterpolator_get_field_count(node, 0);
15375 : case TAG_X3D_NurbsSet:
15376 : return NurbsSet_get_field_count(node, 0);
15377 : case TAG_X3D_NurbsSurfaceInterpolator:
15378 : return NurbsSurfaceInterpolator_get_field_count(node, 0);
15379 : case TAG_X3D_NurbsSweptSurface:
15380 : return NurbsSweptSurface_get_field_count(node, 0);
15381 : case TAG_X3D_NurbsSwungSurface:
15382 : return NurbsSwungSurface_get_field_count(node, 0);
15383 : case TAG_X3D_NurbsTextureCoordinate:
15384 : return NurbsTextureCoordinate_get_field_count(node, 0);
15385 : case TAG_X3D_NurbsTrimmedSurface:
15386 : return NurbsTrimmedSurface_get_field_count(node, 0);
15387 : case TAG_X3D_OrientationInterpolator:
15388 : return OrientationInterpolator_get_field_count(node, 0);
15389 : case TAG_X3D_PixelTexture:
15390 : return PixelTexture_get_field_count(node, 0);
15391 : case TAG_X3D_PlaneSensor:
15392 : return PlaneSensor_get_field_count(node, 0);
15393 : case TAG_X3D_PointLight:
15394 : return PointLight_get_field_count(node, 0);
15395 : case TAG_X3D_PointSet:
15396 : return PointSet_get_field_count(node, 0);
15397 : case TAG_X3D_Polyline2D:
15398 : return Polyline2D_get_field_count(node, 0);
15399 : case TAG_X3D_Polypoint2D:
15400 : return Polypoint2D_get_field_count(node, 0);
15401 : case TAG_X3D_PositionInterpolator:
15402 : return PositionInterpolator_get_field_count(node, 0);
15403 : case TAG_X3D_PositionInterpolator2D:
15404 : return PositionInterpolator2D_get_field_count(node, 0);
15405 : case TAG_X3D_ProximitySensor:
15406 : return ProximitySensor_get_field_count(node, 0);
15407 : case TAG_X3D_ReceiverPdu:
15408 : return ReceiverPdu_get_field_count(node, 0);
15409 : case TAG_X3D_Rectangle2D:
15410 : return Rectangle2D_get_field_count(node, 0);
15411 : case TAG_X3D_ScalarInterpolator:
15412 : return ScalarInterpolator_get_field_count(node, 0);
15413 : case TAG_X3D_Script:
15414 : return Script_get_field_count(node, 0);
15415 : case TAG_X3D_Shape:
15416 : return Shape_get_field_count(node, 0);
15417 : case TAG_X3D_SignalPdu:
15418 : return SignalPdu_get_field_count(node, 0);
15419 : case TAG_X3D_Sound:
15420 : return Sound_get_field_count(node, 0);
15421 : case TAG_X3D_Sphere:
15422 : return Sphere_get_field_count(node, 0);
15423 : case TAG_X3D_SphereSensor:
15424 : return SphereSensor_get_field_count(node, 0);
15425 : case TAG_X3D_SpotLight:
15426 : return SpotLight_get_field_count(node, 0);
15427 : case TAG_X3D_StaticGroup:
15428 : return StaticGroup_get_field_count(node, 0);
15429 : case TAG_X3D_StringSensor:
15430 : return StringSensor_get_field_count(node, 0);
15431 : case TAG_X3D_Switch:
15432 : return Switch_get_field_count(node, 0);
15433 : case TAG_X3D_Text:
15434 : return Text_get_field_count(node, 0);
15435 : case TAG_X3D_TextureBackground:
15436 : return TextureBackground_get_field_count(node, 0);
15437 : case TAG_X3D_TextureCoordinate:
15438 : return TextureCoordinate_get_field_count(node, 0);
15439 : case TAG_X3D_TextureCoordinateGenerator:
15440 : return TextureCoordinateGenerator_get_field_count(node, 0);
15441 : case TAG_X3D_TextureTransform:
15442 : return TextureTransform_get_field_count(node, 0);
15443 : case TAG_X3D_TimeSensor:
15444 : return TimeSensor_get_field_count(node, 0);
15445 : case TAG_X3D_TimeTrigger:
15446 : return TimeTrigger_get_field_count(node, 0);
15447 : case TAG_X3D_TouchSensor:
15448 : return TouchSensor_get_field_count(node, 0);
15449 : case TAG_X3D_Transform:
15450 : return Transform_get_field_count(node, 0);
15451 : case TAG_X3D_TransmitterPdu:
15452 : return TransmitterPdu_get_field_count(node, 0);
15453 : case TAG_X3D_TriangleFanSet:
15454 : return TriangleFanSet_get_field_count(node, 0);
15455 : case TAG_X3D_TriangleSet:
15456 : return TriangleSet_get_field_count(node, 0);
15457 : case TAG_X3D_TriangleSet2D:
15458 : return TriangleSet2D_get_field_count(node, 0);
15459 : case TAG_X3D_TriangleStripSet:
15460 : return TriangleStripSet_get_field_count(node, 0);
15461 : case TAG_X3D_Viewpoint:
15462 : return Viewpoint_get_field_count(node, 0);
15463 : case TAG_X3D_VisibilitySensor:
15464 : return VisibilitySensor_get_field_count(node, 0);
15465 : case TAG_X3D_WorldInfo:
15466 : return WorldInfo_get_field_count(node, 0);
15467 : default:
15468 : return 0;
15469 : }
15470 : }
15471 :
15472 2602 : GF_Err gf_sg_x3d_node_get_field(GF_Node *node, GF_FieldInfo *field)
15473 : {
15474 2602 : switch (node->sgprivate->tag) {
15475 14 : case TAG_X3D_Anchor:
15476 14 : return Anchor_get_field(node, field);
15477 39 : case TAG_X3D_Appearance:
15478 39 : return Appearance_get_field(node, field);
15479 9 : case TAG_X3D_Arc2D:
15480 9 : return Arc2D_get_field(node, field);
15481 12 : case TAG_X3D_ArcClose2D:
15482 12 : return ArcClose2D_get_field(node, field);
15483 26 : case TAG_X3D_AudioClip:
15484 26 : return AudioClip_get_field(node, field);
15485 28 : case TAG_X3D_Background:
15486 28 : return Background_get_field(node, field);
15487 10 : case TAG_X3D_Billboard:
15488 10 : return Billboard_get_field(node, field);
15489 11 : case TAG_X3D_BooleanFilter:
15490 11 : return BooleanFilter_get_field(node, field);
15491 19 : case TAG_X3D_BooleanSequencer:
15492 19 : return BooleanSequencer_get_field(node, field);
15493 : case TAG_X3D_BooleanToggle:
15494 : return BooleanToggle_get_field(node, field);
15495 : case TAG_X3D_BooleanTrigger:
15496 : return BooleanTrigger_get_field(node, field);
15497 : case TAG_X3D_Box:
15498 : return Box_get_field(node, field);
15499 : case TAG_X3D_Circle2D:
15500 : return Circle2D_get_field(node, field);
15501 16 : case TAG_X3D_Collision:
15502 16 : return Collision_get_field(node, field);
15503 : case TAG_X3D_Color:
15504 : return Color_get_field(node, field);
15505 10 : case TAG_X3D_ColorInterpolator:
15506 10 : return ColorInterpolator_get_field(node, field);
15507 : case TAG_X3D_ColorRGBA:
15508 : return ColorRGBA_get_field(node, field);
15509 10 : case TAG_X3D_Cone:
15510 10 : return Cone_get_field(node, field);
15511 8 : case TAG_X3D_Contour2D:
15512 8 : return Contour2D_get_field(node, field);
15513 : case TAG_X3D_ContourPolyline2D:
15514 : return ContourPolyline2D_get_field(node, field);
15515 : case TAG_X3D_Coordinate:
15516 : return Coordinate_get_field(node, field);
15517 : case TAG_X3D_CoordinateDouble:
15518 : return CoordinateDouble_get_field(node, field);
15519 : case TAG_X3D_Coordinate2D:
15520 : return Coordinate2D_get_field(node, field);
15521 10 : case TAG_X3D_CoordinateInterpolator:
15522 10 : return CoordinateInterpolator_get_field(node, field);
15523 10 : case TAG_X3D_CoordinateInterpolator2D:
15524 10 : return CoordinateInterpolator2D_get_field(node, field);
15525 12 : case TAG_X3D_Cylinder:
15526 12 : return Cylinder_get_field(node, field);
15527 24 : case TAG_X3D_CylinderSensor:
15528 24 : return CylinderSensor_get_field(node, field);
15529 12 : case TAG_X3D_DirectionalLight:
15530 12 : return DirectionalLight_get_field(node, field);
15531 : case TAG_X3D_Disk2D:
15532 : return Disk2D_get_field(node, field);
15533 45 : case TAG_X3D_ElevationGrid:
15534 45 : return ElevationGrid_get_field(node, field);
15535 172 : case TAG_X3D_EspduTransform:
15536 172 : return EspduTransform_get_field(node, field);
15537 30 : case TAG_X3D_Extrusion:
15538 30 : return Extrusion_get_field(node, field);
15539 11 : case TAG_X3D_FillProperties:
15540 11 : return FillProperties_get_field(node, field);
15541 14 : case TAG_X3D_Fog:
15542 14 : return Fog_get_field(node, field);
15543 23 : case TAG_X3D_FontStyle:
15544 23 : return FontStyle_get_field(node, field);
15545 8 : case TAG_X3D_GeoCoordinate:
15546 8 : return GeoCoordinate_get_field(node, field);
15547 38 : case TAG_X3D_GeoElevationGrid:
15548 38 : return GeoElevationGrid_get_field(node, field);
15549 14 : case TAG_X3D_GeoLocation:
15550 14 : return GeoLocation_get_field(node, field);
15551 24 : case TAG_X3D_GeoLOD:
15552 24 : return GeoLOD_get_field(node, field);
15553 8 : case TAG_X3D_GeoMetadata:
15554 8 : return GeoMetadata_get_field(node, field);
15555 8 : case TAG_X3D_GeoOrigin:
15556 8 : return GeoOrigin_get_field(node, field);
15557 16 : case TAG_X3D_GeoPositionInterpolator:
15558 16 : return GeoPositionInterpolator_get_field(node, field);
15559 22 : case TAG_X3D_GeoTouchSensor:
15560 22 : return GeoTouchSensor_get_field(node, field);
15561 32 : case TAG_X3D_GeoViewpoint:
15562 32 : return GeoViewpoint_get_field(node, field);
15563 31 : case TAG_X3D_Group:
15564 31 : return Group_get_field(node, field);
15565 10 : case TAG_X3D_HAnimDisplacer:
15566 10 : return HAnimDisplacer_get_field(node, field);
15567 34 : case TAG_X3D_HAnimHumanoid:
15568 34 : return HAnimHumanoid_get_field(node, field);
15569 34 : case TAG_X3D_HAnimJoint:
15570 34 : return HAnimJoint_get_field(node, field);
15571 20 : case TAG_X3D_HAnimSegment:
15572 20 : return HAnimSegment_get_field(node, field);
15573 20 : case TAG_X3D_HAnimSite:
15574 20 : return HAnimSite_get_field(node, field);
15575 8 : case TAG_X3D_ImageTexture:
15576 8 : return ImageTexture_get_field(node, field);
15577 96 : case TAG_X3D_IndexedFaceSet:
15578 96 : return IndexedFaceSet_get_field(node, field);
15579 16 : case TAG_X3D_IndexedLineSet:
15580 16 : return IndexedLineSet_get_field(node, field);
15581 27 : case TAG_X3D_IndexedTriangleFanSet:
15582 27 : return IndexedTriangleFanSet_get_field(node, field);
15583 26 : case TAG_X3D_IndexedTriangleSet:
15584 26 : return IndexedTriangleSet_get_field(node, field);
15585 28 : case TAG_X3D_IndexedTriangleStripSet:
15586 28 : return IndexedTriangleStripSet_get_field(node, field);
15587 : case TAG_X3D_Inline:
15588 : return Inline_get_field(node, field);
15589 19 : case TAG_X3D_IntegerSequencer:
15590 19 : return IntegerSequencer_get_field(node, field);
15591 10 : case TAG_X3D_IntegerTrigger:
15592 10 : return IntegerTrigger_get_field(node, field);
15593 27 : case TAG_X3D_KeySensor:
15594 27 : return KeySensor_get_field(node, field);
15595 8 : case TAG_X3D_LineProperties:
15596 8 : return LineProperties_get_field(node, field);
15597 11 : case TAG_X3D_LineSet:
15598 11 : return LineSet_get_field(node, field);
15599 16 : case TAG_X3D_LoadSensor:
15600 16 : return LoadSensor_get_field(node, field);
15601 12 : case TAG_X3D_LOD:
15602 12 : return LOD_get_field(node, field);
15603 40 : case TAG_X3D_Material:
15604 40 : return Material_get_field(node, field);
15605 8 : case TAG_X3D_MetadataDouble:
15606 8 : return MetadataDouble_get_field(node, field);
15607 8 : case TAG_X3D_MetadataFloat:
15608 8 : return MetadataFloat_get_field(node, field);
15609 8 : case TAG_X3D_MetadataInteger:
15610 8 : return MetadataInteger_get_field(node, field);
15611 8 : case TAG_X3D_MetadataSet:
15612 8 : return MetadataSet_get_field(node, field);
15613 8 : case TAG_X3D_MetadataString:
15614 8 : return MetadataString_get_field(node, field);
15615 28 : case TAG_X3D_MovieTexture:
15616 28 : return MovieTexture_get_field(node, field);
15617 14 : case TAG_X3D_MultiTexture:
15618 14 : return MultiTexture_get_field(node, field);
15619 : case TAG_X3D_MultiTextureCoordinate:
15620 : return MultiTextureCoordinate_get_field(node, field);
15621 : case TAG_X3D_MultiTextureTransform:
15622 : return MultiTextureTransform_get_field(node, field);
15623 21 : case TAG_X3D_NavigationInfo:
15624 21 : return NavigationInfo_get_field(node, field);
15625 : case TAG_X3D_Normal:
15626 : return Normal_get_field(node, field);
15627 10 : case TAG_X3D_NormalInterpolator:
15628 10 : return NormalInterpolator_get_field(node, field);
15629 14 : case TAG_X3D_NurbsCurve:
15630 14 : return NurbsCurve_get_field(node, field);
15631 14 : case TAG_X3D_NurbsCurve2D:
15632 14 : return NurbsCurve2D_get_field(node, field);
15633 14 : case TAG_X3D_NurbsOrientationInterpolator:
15634 14 : return NurbsOrientationInterpolator_get_field(node, field);
15635 30 : case TAG_X3D_NurbsPatchSurface:
15636 30 : return NurbsPatchSurface_get_field(node, field);
15637 14 : case TAG_X3D_NurbsPositionInterpolator:
15638 14 : return NurbsPositionInterpolator_get_field(node, field);
15639 10 : case TAG_X3D_NurbsSet:
15640 10 : return NurbsSet_get_field(node, field);
15641 24 : case TAG_X3D_NurbsSurfaceInterpolator:
15642 24 : return NurbsSurfaceInterpolator_get_field(node, field);
15643 10 : case TAG_X3D_NurbsSweptSurface:
15644 10 : return NurbsSweptSurface_get_field(node, field);
15645 10 : case TAG_X3D_NurbsSwungSurface:
15646 10 : return NurbsSwungSurface_get_field(node, field);
15647 18 : case TAG_X3D_NurbsTextureCoordinate:
15648 18 : return NurbsTextureCoordinate_get_field(node, field);
15649 36 : case TAG_X3D_NurbsTrimmedSurface:
15650 36 : return NurbsTrimmedSurface_get_field(node, field);
15651 10 : case TAG_X3D_OrientationInterpolator:
15652 10 : return OrientationInterpolator_get_field(node, field);
15653 8 : case TAG_X3D_PixelTexture:
15654 8 : return PixelTexture_get_field(node, field);
15655 22 : case TAG_X3D_PlaneSensor:
15656 22 : return PlaneSensor_get_field(node, field);
15657 16 : case TAG_X3D_PointLight:
15658 16 : return PointLight_get_field(node, field);
15659 : case TAG_X3D_PointSet:
15660 : return PointSet_get_field(node, field);
15661 : case TAG_X3D_Polyline2D:
15662 : return Polyline2D_get_field(node, field);
15663 : case TAG_X3D_Polypoint2D:
15664 : return Polypoint2D_get_field(node, field);
15665 10 : case TAG_X3D_PositionInterpolator:
15666 10 : return PositionInterpolator_get_field(node, field);
15667 10 : case TAG_X3D_PositionInterpolator2D:
15668 10 : return PositionInterpolator2D_get_field(node, field);
15669 20 : case TAG_X3D_ProximitySensor:
15670 20 : return ProximitySensor_get_field(node, field);
15671 52 : case TAG_X3D_ReceiverPdu:
15672 52 : return ReceiverPdu_get_field(node, field);
15673 : case TAG_X3D_Rectangle2D:
15674 : return Rectangle2D_get_field(node, field);
15675 10 : case TAG_X3D_ScalarInterpolator:
15676 10 : return ScalarInterpolator_get_field(node, field);
15677 107 : case TAG_X3D_Script:
15678 107 : return Script_get_field(node, field);
15679 : case TAG_X3D_Shape:
15680 : return Shape_get_field(node, field);
15681 52 : case TAG_X3D_SignalPdu:
15682 52 : return SignalPdu_get_field(node, field);
15683 22 : case TAG_X3D_Sound:
15684 22 : return Sound_get_field(node, field);
15685 : case TAG_X3D_Sphere:
15686 : return Sphere_get_field(node, field);
15687 18 : case TAG_X3D_SphereSensor:
15688 18 : return SphereSensor_get_field(node, field);
15689 22 : case TAG_X3D_SpotLight:
15690 22 : return SpotLight_get_field(node, field);
15691 : case TAG_X3D_StaticGroup:
15692 : return StaticGroup_get_field(node, field);
15693 14 : case TAG_X3D_StringSensor:
15694 14 : return StringSensor_get_field(node, field);
15695 10 : case TAG_X3D_Switch:
15696 10 : return Switch_get_field(node, field);
15697 24 : case TAG_X3D_Text:
15698 24 : return Text_get_field(node, field);
15699 30 : case TAG_X3D_TextureBackground:
15700 30 : return TextureBackground_get_field(node, field);
15701 : case TAG_X3D_TextureCoordinate:
15702 : return TextureCoordinate_get_field(node, field);
15703 : case TAG_X3D_TextureCoordinateGenerator:
15704 : return TextureCoordinateGenerator_get_field(node, field);
15705 10 : case TAG_X3D_TextureTransform:
15706 10 : return TextureTransform_get_field(node, field);
15707 39 : case TAG_X3D_TimeSensor:
15708 39 : return TimeSensor_get_field(node, field);
15709 : case TAG_X3D_TimeTrigger:
15710 : return TimeTrigger_get_field(node, field);
15711 18 : case TAG_X3D_TouchSensor:
15712 18 : return TouchSensor_get_field(node, field);
15713 65 : case TAG_X3D_Transform:
15714 65 : return Transform_get_field(node, field);
15715 84 : case TAG_X3D_TransmitterPdu:
15716 84 : return TransmitterPdu_get_field(node, field);
15717 25 : case TAG_X3D_TriangleFanSet:
15718 25 : return TriangleFanSet_get_field(node, field);
15719 21 : case TAG_X3D_TriangleSet:
15720 21 : return TriangleSet_get_field(node, field);
15721 : case TAG_X3D_TriangleSet2D:
15722 : return TriangleSet2D_get_field(node, field);
15723 25 : case TAG_X3D_TriangleStripSet:
15724 25 : return TriangleStripSet_get_field(node, field);
15725 38 : case TAG_X3D_Viewpoint:
15726 38 : return Viewpoint_get_field(node, field);
15727 14 : case TAG_X3D_VisibilitySensor:
15728 14 : return VisibilitySensor_get_field(node, field);
15729 : case TAG_X3D_WorldInfo:
15730 : return WorldInfo_get_field(node, field);
15731 : default:
15732 : return GF_BAD_PARAM;
15733 : }
15734 : }
15735 :
15736 :
15737 : GF_EXPORT
15738 1086 : u32 gf_node_x3d_type_by_class_name(const char *node_name)
15739 : {
15740 1086 : if(!node_name) return 0;
15741 1086 : if (!strcmp(node_name, "Anchor")) return TAG_X3D_Anchor;
15742 1085 : if (!strcmp(node_name, "Appearance")) return TAG_X3D_Appearance;
15743 1058 : if (!strcmp(node_name, "Arc2D")) return TAG_X3D_Arc2D;
15744 1056 : if (!strcmp(node_name, "ArcClose2D")) return TAG_X3D_ArcClose2D;
15745 1054 : if (!strcmp(node_name, "AudioClip")) return TAG_X3D_AudioClip;
15746 1053 : if (!strcmp(node_name, "Background")) return TAG_X3D_Background;
15747 1052 : if (!strcmp(node_name, "Billboard")) return TAG_X3D_Billboard;
15748 1051 : if (!strcmp(node_name, "BooleanFilter")) return TAG_X3D_BooleanFilter;
15749 1049 : if (!strcmp(node_name, "BooleanSequencer")) return TAG_X3D_BooleanSequencer;
15750 1047 : if (!strcmp(node_name, "BooleanToggle")) return TAG_X3D_BooleanToggle;
15751 1045 : if (!strcmp(node_name, "BooleanTrigger")) return TAG_X3D_BooleanTrigger;
15752 1043 : if (!strcmp(node_name, "Box")) return TAG_X3D_Box;
15753 1041 : if (!strcmp(node_name, "Circle2D")) return TAG_X3D_Circle2D;
15754 1040 : if (!strcmp(node_name, "Collision")) return TAG_X3D_Collision;
15755 1039 : if (!strcmp(node_name, "Color")) return TAG_X3D_Color;
15756 1031 : if (!strcmp(node_name, "ColorInterpolator")) return TAG_X3D_ColorInterpolator;
15757 1030 : if (!strcmp(node_name, "ColorRGBA")) return TAG_X3D_ColorRGBA;
15758 1028 : if (!strcmp(node_name, "Cone")) return TAG_X3D_Cone;
15759 1027 : if (!strcmp(node_name, "Contour2D")) return TAG_X3D_Contour2D;
15760 1026 : if (!strcmp(node_name, "ContourPolyline2D")) return TAG_X3D_ContourPolyline2D;
15761 1025 : if (!strcmp(node_name, "Coordinate")) return TAG_X3D_Coordinate;
15762 1006 : if (!strcmp(node_name, "CoordinateDouble")) return TAG_X3D_CoordinateDouble;
15763 1005 : if (!strcmp(node_name, "Coordinate2D")) return TAG_X3D_Coordinate2D;
15764 1004 : if (!strcmp(node_name, "CoordinateInterpolator")) return TAG_X3D_CoordinateInterpolator;
15765 1003 : if (!strcmp(node_name, "CoordinateInterpolator2D")) return TAG_X3D_CoordinateInterpolator2D;
15766 1002 : if (!strcmp(node_name, "Cylinder")) return TAG_X3D_Cylinder;
15767 1001 : if (!strcmp(node_name, "CylinderSensor")) return TAG_X3D_CylinderSensor;
15768 1000 : if (!strcmp(node_name, "DirectionalLight")) return TAG_X3D_DirectionalLight;
15769 999 : if (!strcmp(node_name, "Disk2D")) return TAG_X3D_Disk2D;
15770 997 : if (!strcmp(node_name, "ElevationGrid")) return TAG_X3D_ElevationGrid;
15771 995 : if (!strcmp(node_name, "EspduTransform")) return TAG_X3D_EspduTransform;
15772 994 : if (!strcmp(node_name, "Extrusion")) return TAG_X3D_Extrusion;
15773 993 : if (!strcmp(node_name, "FillProperties")) return TAG_X3D_FillProperties;
15774 991 : if (!strcmp(node_name, "Fog")) return TAG_X3D_Fog;
15775 990 : if (!strcmp(node_name, "FontStyle")) return TAG_X3D_FontStyle;
15776 987 : if (!strcmp(node_name, "GeoCoordinate")) return TAG_X3D_GeoCoordinate;
15777 986 : if (!strcmp(node_name, "GeoElevationGrid")) return TAG_X3D_GeoElevationGrid;
15778 985 : if (!strcmp(node_name, "GeoLocation")) return TAG_X3D_GeoLocation;
15779 984 : if (!strcmp(node_name, "GeoLOD")) return TAG_X3D_GeoLOD;
15780 983 : if (!strcmp(node_name, "GeoMetadata")) return TAG_X3D_GeoMetadata;
15781 982 : if (!strcmp(node_name, "GeoOrigin")) return TAG_X3D_GeoOrigin;
15782 981 : if (!strcmp(node_name, "GeoPositionInterpolator")) return TAG_X3D_GeoPositionInterpolator;
15783 980 : if (!strcmp(node_name, "GeoTouchSensor")) return TAG_X3D_GeoTouchSensor;
15784 979 : if (!strcmp(node_name, "GeoViewpoint")) return TAG_X3D_GeoViewpoint;
15785 978 : if (!strcmp(node_name, "Group")) return TAG_X3D_Group;
15786 957 : if (!strcmp(node_name, "HAnimDisplacer")) return TAG_X3D_HAnimDisplacer;
15787 956 : if (!strcmp(node_name, "HAnimHumanoid")) return TAG_X3D_HAnimHumanoid;
15788 955 : if (!strcmp(node_name, "HAnimJoint")) return TAG_X3D_HAnimJoint;
15789 954 : if (!strcmp(node_name, "HAnimSegment")) return TAG_X3D_HAnimSegment;
15790 953 : if (!strcmp(node_name, "HAnimSite")) return TAG_X3D_HAnimSite;
15791 952 : if (!strcmp(node_name, "ImageTexture")) return TAG_X3D_ImageTexture;
15792 951 : if (!strcmp(node_name, "IndexedFaceSet")) return TAG_X3D_IndexedFaceSet;
15793 938 : if (!strcmp(node_name, "IndexedLineSet")) return TAG_X3D_IndexedLineSet;
15794 937 : if (!strcmp(node_name, "IndexedTriangleFanSet")) return TAG_X3D_IndexedTriangleFanSet;
15795 935 : if (!strcmp(node_name, "IndexedTriangleSet")) return TAG_X3D_IndexedTriangleSet;
15796 933 : if (!strcmp(node_name, "IndexedTriangleStripSet")) return TAG_X3D_IndexedTriangleStripSet;
15797 931 : if (!strcmp(node_name, "Inline")) return TAG_X3D_Inline;
15798 930 : if (!strcmp(node_name, "IntegerSequencer")) return TAG_X3D_IntegerSequencer;
15799 928 : if (!strcmp(node_name, "IntegerTrigger")) return TAG_X3D_IntegerTrigger;
15800 926 : if (!strcmp(node_name, "KeySensor")) return TAG_X3D_KeySensor;
15801 924 : if (!strcmp(node_name, "LineProperties")) return TAG_X3D_LineProperties;
15802 923 : if (!strcmp(node_name, "LineSet")) return TAG_X3D_LineSet;
15803 921 : if (!strcmp(node_name, "LoadSensor")) return TAG_X3D_LoadSensor;
15804 920 : if (!strcmp(node_name, "LOD")) return TAG_X3D_LOD;
15805 919 : if (!strcmp(node_name, "Material")) return TAG_X3D_Material;
15806 892 : if (!strcmp(node_name, "MetadataDouble")) return TAG_X3D_MetadataDouble;
15807 891 : if (!strcmp(node_name, "MetadataFloat")) return TAG_X3D_MetadataFloat;
15808 890 : if (!strcmp(node_name, "MetadataInteger")) return TAG_X3D_MetadataInteger;
15809 889 : if (!strcmp(node_name, "MetadataSet")) return TAG_X3D_MetadataSet;
15810 888 : if (!strcmp(node_name, "MetadataString")) return TAG_X3D_MetadataString;
15811 887 : if (!strcmp(node_name, "MovieTexture")) return TAG_X3D_MovieTexture;
15812 886 : if (!strcmp(node_name, "MultiTexture")) return TAG_X3D_MultiTexture;
15813 885 : if (!strcmp(node_name, "MultiTextureCoordinate")) return TAG_X3D_MultiTextureCoordinate;
15814 884 : if (!strcmp(node_name, "MultiTextureTransform")) return TAG_X3D_MultiTextureTransform;
15815 883 : if (!strcmp(node_name, "NavigationInfo")) return TAG_X3D_NavigationInfo;
15816 881 : if (!strcmp(node_name, "Normal")) return TAG_X3D_Normal;
15817 880 : if (!strcmp(node_name, "NormalInterpolator")) return TAG_X3D_NormalInterpolator;
15818 879 : if (!strcmp(node_name, "NurbsCurve")) return TAG_X3D_NurbsCurve;
15819 878 : if (!strcmp(node_name, "NurbsCurve2D")) return TAG_X3D_NurbsCurve2D;
15820 877 : if (!strcmp(node_name, "NurbsOrientationInterpolator")) return TAG_X3D_NurbsOrientationInterpolator;
15821 876 : if (!strcmp(node_name, "NurbsPatchSurface")) return TAG_X3D_NurbsPatchSurface;
15822 875 : if (!strcmp(node_name, "NurbsPositionInterpolator")) return TAG_X3D_NurbsPositionInterpolator;
15823 874 : if (!strcmp(node_name, "NurbsSet")) return TAG_X3D_NurbsSet;
15824 873 : if (!strcmp(node_name, "NurbsSurfaceInterpolator")) return TAG_X3D_NurbsSurfaceInterpolator;
15825 872 : if (!strcmp(node_name, "NurbsSweptSurface")) return TAG_X3D_NurbsSweptSurface;
15826 871 : if (!strcmp(node_name, "NurbsSwungSurface")) return TAG_X3D_NurbsSwungSurface;
15827 870 : if (!strcmp(node_name, "NurbsTextureCoordinate")) return TAG_X3D_NurbsTextureCoordinate;
15828 869 : if (!strcmp(node_name, "NurbsTrimmedSurface")) return TAG_X3D_NurbsTrimmedSurface;
15829 868 : if (!strcmp(node_name, "OrientationInterpolator")) return TAG_X3D_OrientationInterpolator;
15830 867 : if (!strcmp(node_name, "PixelTexture")) return TAG_X3D_PixelTexture;
15831 866 : if (!strcmp(node_name, "PlaneSensor")) return TAG_X3D_PlaneSensor;
15832 865 : if (!strcmp(node_name, "PointLight")) return TAG_X3D_PointLight;
15833 864 : if (!strcmp(node_name, "PointSet")) return TAG_X3D_PointSet;
15834 863 : if (!strcmp(node_name, "Polyline2D")) return TAG_X3D_Polyline2D;
15835 861 : if (!strcmp(node_name, "Polypoint2D")) return TAG_X3D_Polypoint2D;
15836 859 : if (!strcmp(node_name, "PositionInterpolator")) return TAG_X3D_PositionInterpolator;
15837 858 : if (!strcmp(node_name, "PositionInterpolator2D")) return TAG_X3D_PositionInterpolator2D;
15838 857 : if (!strcmp(node_name, "ProximitySensor")) return TAG_X3D_ProximitySensor;
15839 856 : if (!strcmp(node_name, "ReceiverPdu")) return TAG_X3D_ReceiverPdu;
15840 855 : if (!strcmp(node_name, "Rectangle2D")) return TAG_X3D_Rectangle2D;
15841 854 : if (!strcmp(node_name, "ScalarInterpolator")) return TAG_X3D_ScalarInterpolator;
15842 853 : if (!strcmp(node_name, "Script")) return TAG_X3D_Script;
15843 851 : if (!strcmp(node_name, "Shape")) return TAG_X3D_Shape;
15844 818 : if (!strcmp(node_name, "SignalPdu")) return TAG_X3D_SignalPdu;
15845 817 : if (!strcmp(node_name, "Sound")) return TAG_X3D_Sound;
15846 816 : if (!strcmp(node_name, "Sphere")) return TAG_X3D_Sphere;
15847 815 : if (!strcmp(node_name, "SphereSensor")) return TAG_X3D_SphereSensor;
15848 814 : if (!strcmp(node_name, "SpotLight")) return TAG_X3D_SpotLight;
15849 813 : if (!strcmp(node_name, "StaticGroup")) return TAG_X3D_StaticGroup;
15850 811 : if (!strcmp(node_name, "StringSensor")) return TAG_X3D_StringSensor;
15851 809 : if (!strcmp(node_name, "Switch")) return TAG_X3D_Switch;
15852 808 : if (!strcmp(node_name, "Text")) return TAG_X3D_Text;
15853 801 : if (!strcmp(node_name, "TextureBackground")) return TAG_X3D_TextureBackground;
15854 800 : if (!strcmp(node_name, "TextureCoordinate")) return TAG_X3D_TextureCoordinate;
15855 799 : if (!strcmp(node_name, "TextureCoordinateGenerator")) return TAG_X3D_TextureCoordinateGenerator;
15856 797 : if (!strcmp(node_name, "TextureTransform")) return TAG_X3D_TextureTransform;
15857 796 : if (!strcmp(node_name, "TimeSensor")) return TAG_X3D_TimeSensor;
15858 794 : if (!strcmp(node_name, "TimeTrigger")) return TAG_X3D_TimeTrigger;
15859 792 : if (!strcmp(node_name, "TouchSensor")) return TAG_X3D_TouchSensor;
15860 791 : if (!strcmp(node_name, "Transform")) return TAG_X3D_Transform;
15861 760 : if (!strcmp(node_name, "TransmitterPdu")) return TAG_X3D_TransmitterPdu;
15862 759 : if (!strcmp(node_name, "TriangleFanSet")) return TAG_X3D_TriangleFanSet;
15863 757 : if (!strcmp(node_name, "TriangleSet")) return TAG_X3D_TriangleSet;
15864 755 : if (!strcmp(node_name, "TriangleSet2D")) return TAG_X3D_TriangleSet2D;
15865 753 : if (!strcmp(node_name, "TriangleStripSet")) return TAG_X3D_TriangleStripSet;
15866 751 : if (!strcmp(node_name, "Viewpoint")) return TAG_X3D_Viewpoint;
15867 732 : if (!strcmp(node_name, "VisibilitySensor")) return TAG_X3D_VisibilitySensor;
15868 731 : if (!strcmp(node_name, "WorldInfo")) return TAG_X3D_WorldInfo;
15869 712 : return 0;
15870 : }
15871 :
15872 1448 : s32 gf_sg_x3d_node_get_field_index_by_name(GF_Node *node, char *name)
15873 : {
15874 1448 : switch (node->sgprivate->tag) {
15875 7 : case TAG_X3D_Anchor:
15876 7 : return Anchor_get_field_index_by_name(name);
15877 33 : case TAG_X3D_Appearance:
15878 33 : return Appearance_get_field_index_by_name(name);
15879 5 : case TAG_X3D_Arc2D:
15880 5 : return Arc2D_get_field_index_by_name(name);
15881 7 : case TAG_X3D_ArcClose2D:
15882 7 : return ArcClose2D_get_field_index_by_name(name);
15883 13 : case TAG_X3D_AudioClip:
15884 13 : return AudioClip_get_field_index_by_name(name);
15885 14 : case TAG_X3D_Background:
15886 14 : return Background_get_field_index_by_name(name);
15887 5 : case TAG_X3D_Billboard:
15888 5 : return Billboard_get_field_index_by_name(name);
15889 6 : case TAG_X3D_BooleanFilter:
15890 6 : return BooleanFilter_get_field_index_by_name(name);
15891 12 : case TAG_X3D_BooleanSequencer:
15892 12 : return BooleanSequencer_get_field_index_by_name(name);
15893 4 : case TAG_X3D_BooleanToggle:
15894 4 : return BooleanToggle_get_field_index_by_name(name);
15895 4 : case TAG_X3D_BooleanTrigger:
15896 4 : return BooleanTrigger_get_field_index_by_name(name);
15897 3 : case TAG_X3D_Box:
15898 3 : return Box_get_field_index_by_name(name);
15899 2 : case TAG_X3D_Circle2D:
15900 2 : return Circle2D_get_field_index_by_name(name);
15901 8 : case TAG_X3D_Collision:
15902 8 : return Collision_get_field_index_by_name(name);
15903 9 : case TAG_X3D_Color:
15904 9 : return Color_get_field_index_by_name(name);
15905 5 : case TAG_X3D_ColorInterpolator:
15906 5 : return ColorInterpolator_get_field_index_by_name(name);
15907 3 : case TAG_X3D_ColorRGBA:
15908 3 : return ColorRGBA_get_field_index_by_name(name);
15909 5 : case TAG_X3D_Cone:
15910 5 : return Cone_get_field_index_by_name(name);
15911 4 : case TAG_X3D_Contour2D:
15912 4 : return Contour2D_get_field_index_by_name(name);
15913 2 : case TAG_X3D_ContourPolyline2D:
15914 2 : return ContourPolyline2D_get_field_index_by_name(name);
15915 20 : case TAG_X3D_Coordinate:
15916 20 : return Coordinate_get_field_index_by_name(name);
15917 2 : case TAG_X3D_CoordinateDouble:
15918 2 : return CoordinateDouble_get_field_index_by_name(name);
15919 2 : case TAG_X3D_Coordinate2D:
15920 2 : return Coordinate2D_get_field_index_by_name(name);
15921 5 : case TAG_X3D_CoordinateInterpolator:
15922 5 : return CoordinateInterpolator_get_field_index_by_name(name);
15923 5 : case TAG_X3D_CoordinateInterpolator2D:
15924 5 : return CoordinateInterpolator2D_get_field_index_by_name(name);
15925 6 : case TAG_X3D_Cylinder:
15926 6 : return Cylinder_get_field_index_by_name(name);
15927 12 : case TAG_X3D_CylinderSensor:
15928 12 : return CylinderSensor_get_field_index_by_name(name);
15929 6 : case TAG_X3D_DirectionalLight:
15930 6 : return DirectionalLight_get_field_index_by_name(name);
15931 5 : case TAG_X3D_Disk2D:
15932 5 : return Disk2D_get_field_index_by_name(name);
15933 15 : case TAG_X3D_ElevationGrid:
15934 15 : return ElevationGrid_get_field_index_by_name(name);
15935 86 : case TAG_X3D_EspduTransform:
15936 86 : return EspduTransform_get_field_index_by_name(name);
15937 15 : case TAG_X3D_Extrusion:
15938 15 : return Extrusion_get_field_index_by_name(name);
15939 7 : case TAG_X3D_FillProperties:
15940 7 : return FillProperties_get_field_index_by_name(name);
15941 7 : case TAG_X3D_Fog:
15942 7 : return Fog_get_field_index_by_name(name);
15943 13 : case TAG_X3D_FontStyle:
15944 13 : return FontStyle_get_field_index_by_name(name);
15945 4 : case TAG_X3D_GeoCoordinate:
15946 4 : return GeoCoordinate_get_field_index_by_name(name);
15947 19 : case TAG_X3D_GeoElevationGrid:
15948 19 : return GeoElevationGrid_get_field_index_by_name(name);
15949 7 : case TAG_X3D_GeoLocation:
15950 7 : return GeoLocation_get_field_index_by_name(name);
15951 12 : case TAG_X3D_GeoLOD:
15952 12 : return GeoLOD_get_field_index_by_name(name);
15953 4 : case TAG_X3D_GeoMetadata:
15954 4 : return GeoMetadata_get_field_index_by_name(name);
15955 4 : case TAG_X3D_GeoOrigin:
15956 4 : return GeoOrigin_get_field_index_by_name(name);
15957 8 : case TAG_X3D_GeoPositionInterpolator:
15958 8 : return GeoPositionInterpolator_get_field_index_by_name(name);
15959 11 : case TAG_X3D_GeoTouchSensor:
15960 11 : return GeoTouchSensor_get_field_index_by_name(name);
15961 16 : case TAG_X3D_GeoViewpoint:
15962 16 : return GeoViewpoint_get_field_index_by_name(name);
15963 24 : case TAG_X3D_Group:
15964 24 : return Group_get_field_index_by_name(name);
15965 5 : case TAG_X3D_HAnimDisplacer:
15966 5 : return HAnimDisplacer_get_field_index_by_name(name);
15967 17 : case TAG_X3D_HAnimHumanoid:
15968 17 : return HAnimHumanoid_get_field_index_by_name(name);
15969 17 : case TAG_X3D_HAnimJoint:
15970 17 : return HAnimJoint_get_field_index_by_name(name);
15971 10 : case TAG_X3D_HAnimSegment:
15972 10 : return HAnimSegment_get_field_index_by_name(name);
15973 10 : case TAG_X3D_HAnimSite:
15974 10 : return HAnimSite_get_field_index_by_name(name);
15975 4 : case TAG_X3D_ImageTexture:
15976 4 : return ImageTexture_get_field_index_by_name(name);
15977 77 : case TAG_X3D_IndexedFaceSet:
15978 77 : return IndexedFaceSet_get_field_index_by_name(name);
15979 8 : case TAG_X3D_IndexedLineSet:
15980 8 : return IndexedLineSet_get_field_index_by_name(name);
15981 16 : case TAG_X3D_IndexedTriangleFanSet:
15982 16 : return IndexedTriangleFanSet_get_field_index_by_name(name);
15983 15 : case TAG_X3D_IndexedTriangleSet:
15984 15 : return IndexedTriangleSet_get_field_index_by_name(name);
15985 17 : case TAG_X3D_IndexedTriangleStripSet:
15986 17 : return IndexedTriangleStripSet_get_field_index_by_name(name);
15987 3 : case TAG_X3D_Inline:
15988 3 : return Inline_get_field_index_by_name(name);
15989 12 : case TAG_X3D_IntegerSequencer:
15990 12 : return IntegerSequencer_get_field_index_by_name(name);
15991 6 : case TAG_X3D_IntegerTrigger:
15992 6 : return IntegerTrigger_get_field_index_by_name(name);
15993 17 : case TAG_X3D_KeySensor:
15994 17 : return KeySensor_get_field_index_by_name(name);
15995 4 : case TAG_X3D_LineProperties:
15996 4 : return LineProperties_get_field_index_by_name(name);
15997 7 : case TAG_X3D_LineSet:
15998 7 : return LineSet_get_field_index_by_name(name);
15999 8 : case TAG_X3D_LoadSensor:
16000 8 : return LoadSensor_get_field_index_by_name(name);
16001 6 : case TAG_X3D_LOD:
16002 6 : return LOD_get_field_index_by_name(name);
16003 33 : case TAG_X3D_Material:
16004 33 : return Material_get_field_index_by_name(name);
16005 4 : case TAG_X3D_MetadataDouble:
16006 4 : return MetadataDouble_get_field_index_by_name(name);
16007 4 : case TAG_X3D_MetadataFloat:
16008 4 : return MetadataFloat_get_field_index_by_name(name);
16009 4 : case TAG_X3D_MetadataInteger:
16010 4 : return MetadataInteger_get_field_index_by_name(name);
16011 4 : case TAG_X3D_MetadataSet:
16012 4 : return MetadataSet_get_field_index_by_name(name);
16013 4 : case TAG_X3D_MetadataString:
16014 4 : return MetadataString_get_field_index_by_name(name);
16015 14 : case TAG_X3D_MovieTexture:
16016 14 : return MovieTexture_get_field_index_by_name(name);
16017 7 : case TAG_X3D_MultiTexture:
16018 7 : return MultiTexture_get_field_index_by_name(name);
16019 2 : case TAG_X3D_MultiTextureCoordinate:
16020 2 : return MultiTextureCoordinate_get_field_index_by_name(name);
16021 2 : case TAG_X3D_MultiTextureTransform:
16022 2 : return MultiTextureTransform_get_field_index_by_name(name);
16023 11 : case TAG_X3D_NavigationInfo:
16024 11 : return NavigationInfo_get_field_index_by_name(name);
16025 2 : case TAG_X3D_Normal:
16026 2 : return Normal_get_field_index_by_name(name);
16027 5 : case TAG_X3D_NormalInterpolator:
16028 5 : return NormalInterpolator_get_field_index_by_name(name);
16029 7 : case TAG_X3D_NurbsCurve:
16030 7 : return NurbsCurve_get_field_index_by_name(name);
16031 7 : case TAG_X3D_NurbsCurve2D:
16032 7 : return NurbsCurve2D_get_field_index_by_name(name);
16033 7 : case TAG_X3D_NurbsOrientationInterpolator:
16034 7 : return NurbsOrientationInterpolator_get_field_index_by_name(name);
16035 15 : case TAG_X3D_NurbsPatchSurface:
16036 15 : return NurbsPatchSurface_get_field_index_by_name(name);
16037 7 : case TAG_X3D_NurbsPositionInterpolator:
16038 7 : return NurbsPositionInterpolator_get_field_index_by_name(name);
16039 5 : case TAG_X3D_NurbsSet:
16040 5 : return NurbsSet_get_field_index_by_name(name);
16041 12 : case TAG_X3D_NurbsSurfaceInterpolator:
16042 12 : return NurbsSurfaceInterpolator_get_field_index_by_name(name);
16043 5 : case TAG_X3D_NurbsSweptSurface:
16044 5 : return NurbsSweptSurface_get_field_index_by_name(name);
16045 5 : case TAG_X3D_NurbsSwungSurface:
16046 5 : return NurbsSwungSurface_get_field_index_by_name(name);
16047 9 : case TAG_X3D_NurbsTextureCoordinate:
16048 9 : return NurbsTextureCoordinate_get_field_index_by_name(name);
16049 18 : case TAG_X3D_NurbsTrimmedSurface:
16050 18 : return NurbsTrimmedSurface_get_field_index_by_name(name);
16051 5 : case TAG_X3D_OrientationInterpolator:
16052 5 : return OrientationInterpolator_get_field_index_by_name(name);
16053 4 : case TAG_X3D_PixelTexture:
16054 4 : return PixelTexture_get_field_index_by_name(name);
16055 11 : case TAG_X3D_PlaneSensor:
16056 11 : return PlaneSensor_get_field_index_by_name(name);
16057 8 : case TAG_X3D_PointLight:
16058 8 : return PointLight_get_field_index_by_name(name);
16059 3 : case TAG_X3D_PointSet:
16060 3 : return PointSet_get_field_index_by_name(name);
16061 3 : case TAG_X3D_Polyline2D:
16062 3 : return Polyline2D_get_field_index_by_name(name);
16063 3 : case TAG_X3D_Polypoint2D:
16064 3 : return Polypoint2D_get_field_index_by_name(name);
16065 5 : case TAG_X3D_PositionInterpolator:
16066 5 : return PositionInterpolator_get_field_index_by_name(name);
16067 5 : case TAG_X3D_PositionInterpolator2D:
16068 5 : return PositionInterpolator2D_get_field_index_by_name(name);
16069 10 : case TAG_X3D_ProximitySensor:
16070 10 : return ProximitySensor_get_field_index_by_name(name);
16071 26 : case TAG_X3D_ReceiverPdu:
16072 26 : return ReceiverPdu_get_field_index_by_name(name);
16073 2 : case TAG_X3D_Rectangle2D:
16074 2 : return Rectangle2D_get_field_index_by_name(name);
16075 5 : case TAG_X3D_ScalarInterpolator:
16076 5 : return ScalarInterpolator_get_field_index_by_name(name);
16077 0 : case TAG_X3D_Script:
16078 0 : return Script_get_field_index_by_name(name);
16079 65 : case TAG_X3D_Shape:
16080 65 : return Shape_get_field_index_by_name(name);
16081 26 : case TAG_X3D_SignalPdu:
16082 26 : return SignalPdu_get_field_index_by_name(name);
16083 11 : case TAG_X3D_Sound:
16084 11 : return Sound_get_field_index_by_name(name);
16085 2 : case TAG_X3D_Sphere:
16086 2 : return Sphere_get_field_index_by_name(name);
16087 9 : case TAG_X3D_SphereSensor:
16088 9 : return SphereSensor_get_field_index_by_name(name);
16089 11 : case TAG_X3D_SpotLight:
16090 11 : return SpotLight_get_field_index_by_name(name);
16091 3 : case TAG_X3D_StaticGroup:
16092 3 : return StaticGroup_get_field_index_by_name(name);
16093 8 : case TAG_X3D_StringSensor:
16094 8 : return StringSensor_get_field_index_by_name(name);
16095 5 : case TAG_X3D_Switch:
16096 5 : return Switch_get_field_index_by_name(name);
16097 19 : case TAG_X3D_Text:
16098 19 : return Text_get_field_index_by_name(name);
16099 15 : case TAG_X3D_TextureBackground:
16100 15 : return TextureBackground_get_field_index_by_name(name);
16101 2 : case TAG_X3D_TextureCoordinate:
16102 2 : return TextureCoordinate_get_field_index_by_name(name);
16103 4 : case TAG_X3D_TextureCoordinateGenerator:
16104 4 : return TextureCoordinateGenerator_get_field_index_by_name(name);
16105 5 : case TAG_X3D_TextureTransform:
16106 5 : return TextureTransform_get_field_index_by_name(name);
16107 25 : case TAG_X3D_TimeSensor:
16108 25 : return TimeSensor_get_field_index_by_name(name);
16109 4 : case TAG_X3D_TimeTrigger:
16110 4 : return TimeTrigger_get_field_index_by_name(name);
16111 9 : case TAG_X3D_TouchSensor:
16112 9 : return TouchSensor_get_field_index_by_name(name);
16113 56 : case TAG_X3D_Transform:
16114 56 : return Transform_get_field_index_by_name(name);
16115 42 : case TAG_X3D_TransmitterPdu:
16116 42 : return TransmitterPdu_get_field_index_by_name(name);
16117 15 : case TAG_X3D_TriangleFanSet:
16118 15 : return TriangleFanSet_get_field_index_by_name(name);
16119 12 : case TAG_X3D_TriangleSet:
16120 12 : return TriangleSet_get_field_index_by_name(name);
16121 3 : case TAG_X3D_TriangleSet2D:
16122 3 : return TriangleSet2D_get_field_index_by_name(name);
16123 15 : case TAG_X3D_TriangleStripSet:
16124 15 : return TriangleStripSet_get_field_index_by_name(name);
16125 28 : case TAG_X3D_Viewpoint:
16126 28 : return Viewpoint_get_field_index_by_name(name);
16127 7 : case TAG_X3D_VisibilitySensor:
16128 7 : return VisibilitySensor_get_field_index_by_name(name);
16129 39 : case TAG_X3D_WorldInfo:
16130 39 : return WorldInfo_get_field_index_by_name(name);
16131 : default:
16132 : return -1;
16133 : }
16134 : }
16135 :
16136 :
16137 :
16138 : /* NDT X3D */
16139 :
16140 : #define SFWorldNode_X3D_Count 127
16141 : static const u32 SFWorldNode_X3D_TypeToTag[127] = {
16142 : TAG_X3D_Anchor, TAG_X3D_Appearance, TAG_X3D_Arc2D, TAG_X3D_ArcClose2D, TAG_X3D_AudioClip, TAG_X3D_Background, TAG_X3D_Billboard, TAG_X3D_BooleanFilter, TAG_X3D_BooleanSequencer, TAG_X3D_BooleanToggle, TAG_X3D_BooleanTrigger, TAG_X3D_Box, TAG_X3D_Circle2D, TAG_X3D_Collision, TAG_X3D_Color, TAG_X3D_ColorInterpolator, TAG_X3D_ColorRGBA, TAG_X3D_Cone, TAG_X3D_Contour2D, TAG_X3D_ContourPolyline2D, TAG_X3D_Coordinate, TAG_X3D_CoordinateDouble, TAG_X3D_Coordinate2D, TAG_X3D_CoordinateInterpolator, TAG_X3D_CoordinateInterpolator2D, TAG_X3D_Cylinder, TAG_X3D_CylinderSensor, TAG_X3D_DirectionalLight, TAG_X3D_Disk2D, TAG_X3D_ElevationGrid, TAG_X3D_EspduTransform, TAG_X3D_Extrusion, TAG_X3D_FillProperties, TAG_X3D_Fog, TAG_X3D_FontStyle, TAG_X3D_GeoCoordinate, TAG_X3D_GeoElevationGrid, TAG_X3D_GeoLocation, TAG_X3D_GeoLOD, TAG_X3D_GeoMetadata, TAG_X3D_GeoPositionInterpolator, TAG_X3D_GeoTouchSensor, TAG_X3D_GeoViewpoint, TAG_X3D_Group, TAG_X3D_HAnimDisplacer, TAG_X3D_HAnimHumanoid, TAG_X3D_HAnimJoint, TAG_X3D_HAnimSegment, TAG_X3D_HAnimSite, TAG_X3D_ImageTexture, TAG_X3D_IndexedFaceSet, TAG_X3D_IndexedLineSet, TAG_X3D_IndexedTriangleFanSet, TAG_X3D_IndexedTriangleSet, TAG_X3D_IndexedTriangleStripSet, TAG_X3D_Inline, TAG_X3D_IntegerSequencer, TAG_X3D_IntegerTrigger, TAG_X3D_KeySensor, TAG_X3D_LineProperties, TAG_X3D_LineSet, TAG_X3D_LoadSensor, TAG_X3D_LOD, TAG_X3D_Material, TAG_X3D_MetadataDouble, TAG_X3D_MetadataFloat, TAG_X3D_MetadataInteger, TAG_X3D_MetadataSet, TAG_X3D_MetadataString, TAG_X3D_MovieTexture, TAG_X3D_MultiTexture, TAG_X3D_MultiTextureCoordinate, TAG_X3D_MultiTextureTransform, TAG_X3D_NavigationInfo, TAG_X3D_Normal, TAG_X3D_NormalInterpolator, TAG_X3D_NurbsCurve, TAG_X3D_NurbsCurve2D, TAG_X3D_NurbsOrientationInterpolator, TAG_X3D_NurbsPatchSurface, TAG_X3D_NurbsPositionInterpolator, TAG_X3D_NurbsSet, TAG_X3D_NurbsSurfaceInterpolator, TAG_X3D_NurbsSweptSurface, TAG_X3D_NurbsSwungSurface, TAG_X3D_NurbsTextureCoordinate, TAG_X3D_NurbsTrimmedSurface, TAG_X3D_OrientationInterpolator, TAG_X3D_PixelTexture, TAG_X3D_PlaneSensor, TAG_X3D_PointLight, TAG_X3D_PointSet, TAG_X3D_Polyline2D, TAG_X3D_Polypoint2D, TAG_X3D_PositionInterpolator, TAG_X3D_PositionInterpolator2D, TAG_X3D_ProximitySensor, TAG_X3D_ReceiverPdu, TAG_X3D_Rectangle2D, TAG_X3D_ScalarInterpolator, TAG_X3D_Script, TAG_X3D_Shape, TAG_X3D_SignalPdu, TAG_X3D_Sound, TAG_X3D_Sphere, TAG_X3D_SphereSensor, TAG_X3D_SpotLight, TAG_X3D_StaticGroup, TAG_X3D_StringSensor, TAG_X3D_Switch, TAG_X3D_Text, TAG_X3D_TextureBackground, TAG_X3D_TextureCoordinate, TAG_X3D_TextureCoordinateGenerator, TAG_X3D_TextureTransform, TAG_X3D_TimeSensor, TAG_X3D_TimeTrigger, TAG_X3D_TouchSensor, TAG_X3D_Transform, TAG_X3D_TransmitterPdu, TAG_X3D_TriangleFanSet, TAG_X3D_TriangleSet, TAG_X3D_TriangleSet2D, TAG_X3D_TriangleStripSet, TAG_X3D_Viewpoint, TAG_X3D_VisibilitySensor, TAG_X3D_WorldInfo
16143 : };
16144 :
16145 : #define SF3DNode_X3D_Count 60
16146 : static const u32 SF3DNode_X3D_TypeToTag[60] = {
16147 : TAG_X3D_Anchor, TAG_X3D_Background, TAG_X3D_Billboard, TAG_X3D_BooleanFilter, TAG_X3D_BooleanSequencer, TAG_X3D_BooleanToggle, TAG_X3D_BooleanTrigger, TAG_X3D_Collision, TAG_X3D_ColorInterpolator, TAG_X3D_CoordinateInterpolator, TAG_X3D_CoordinateInterpolator2D, TAG_X3D_CylinderSensor, TAG_X3D_DirectionalLight, TAG_X3D_EspduTransform, TAG_X3D_Fog, TAG_X3D_GeoLocation, TAG_X3D_GeoLOD, TAG_X3D_GeoMetadata, TAG_X3D_GeoPositionInterpolator, TAG_X3D_GeoTouchSensor, TAG_X3D_GeoViewpoint, TAG_X3D_Group, TAG_X3D_HAnimHumanoid, TAG_X3D_Inline, TAG_X3D_IntegerSequencer, TAG_X3D_IntegerTrigger, TAG_X3D_KeySensor, TAG_X3D_LOD, TAG_X3D_NavigationInfo, TAG_X3D_NormalInterpolator, TAG_X3D_NurbsOrientationInterpolator, TAG_X3D_NurbsPositionInterpolator, TAG_X3D_NurbsSet, TAG_X3D_NurbsSurfaceInterpolator, TAG_X3D_OrientationInterpolator, TAG_X3D_PlaneSensor, TAG_X3D_PointLight, TAG_X3D_PositionInterpolator, TAG_X3D_PositionInterpolator2D, TAG_X3D_ProximitySensor, TAG_X3D_ReceiverPdu, TAG_X3D_ScalarInterpolator, TAG_X3D_Script, TAG_X3D_Shape, TAG_X3D_SignalPdu, TAG_X3D_Sound, TAG_X3D_SphereSensor, TAG_X3D_SpotLight, TAG_X3D_StaticGroup, TAG_X3D_StringSensor, TAG_X3D_Switch, TAG_X3D_TextureBackground, TAG_X3D_TimeSensor, TAG_X3D_TimeTrigger, TAG_X3D_TouchSensor, TAG_X3D_Transform, TAG_X3D_TransmitterPdu, TAG_X3D_Viewpoint, TAG_X3D_VisibilitySensor, TAG_X3D_WorldInfo
16148 : };
16149 :
16150 : #define SF2DNode_X3D_Count 34
16151 : static const u32 SF2DNode_X3D_TypeToTag[34] = {
16152 : TAG_X3D_Anchor, TAG_X3D_BooleanFilter, TAG_X3D_BooleanSequencer, TAG_X3D_BooleanToggle, TAG_X3D_BooleanTrigger, TAG_X3D_ColorInterpolator, TAG_X3D_CoordinateInterpolator2D, TAG_X3D_EspduTransform, TAG_X3D_GeoMetadata, TAG_X3D_GeoTouchSensor, TAG_X3D_Group, TAG_X3D_Inline, TAG_X3D_IntegerSequencer, TAG_X3D_IntegerTrigger, TAG_X3D_KeySensor, TAG_X3D_LOD, TAG_X3D_NurbsOrientationInterpolator, TAG_X3D_NurbsPositionInterpolator, TAG_X3D_NurbsSet, TAG_X3D_NurbsSurfaceInterpolator, TAG_X3D_PositionInterpolator2D, TAG_X3D_ReceiverPdu, TAG_X3D_ScalarInterpolator, TAG_X3D_Script, TAG_X3D_Shape, TAG_X3D_SignalPdu, TAG_X3D_StaticGroup, TAG_X3D_StringSensor, TAG_X3D_Switch, TAG_X3D_TimeSensor, TAG_X3D_TimeTrigger, TAG_X3D_TouchSensor, TAG_X3D_TransmitterPdu, TAG_X3D_WorldInfo
16153 : };
16154 :
16155 : #define SFAppearanceNode_X3D_Count 1
16156 : static const u32 SFAppearanceNode_X3D_TypeToTag[1] = {
16157 : TAG_X3D_Appearance
16158 : };
16159 :
16160 : #define SFGeometryNode_X3D_Count 31
16161 : static const u32 SFGeometryNode_X3D_TypeToTag[31] = {
16162 : TAG_X3D_Arc2D, TAG_X3D_ArcClose2D, TAG_X3D_Box, TAG_X3D_Circle2D, TAG_X3D_Cone, TAG_X3D_Cylinder, TAG_X3D_Disk2D, TAG_X3D_ElevationGrid, TAG_X3D_Extrusion, TAG_X3D_GeoElevationGrid, TAG_X3D_IndexedFaceSet, TAG_X3D_IndexedLineSet, TAG_X3D_IndexedTriangleFanSet, TAG_X3D_IndexedTriangleSet, TAG_X3D_IndexedTriangleStripSet, TAG_X3D_LineSet, TAG_X3D_NurbsCurve, TAG_X3D_NurbsPatchSurface, TAG_X3D_NurbsSweptSurface, TAG_X3D_NurbsSwungSurface, TAG_X3D_NurbsTrimmedSurface, TAG_X3D_PointSet, TAG_X3D_Polyline2D, TAG_X3D_Polypoint2D, TAG_X3D_Rectangle2D, TAG_X3D_Sphere, TAG_X3D_Text, TAG_X3D_TriangleFanSet, TAG_X3D_TriangleSet, TAG_X3D_TriangleSet2D, TAG_X3D_TriangleStripSet
16163 : };
16164 :
16165 : #define SFAudioNode_X3D_Count 1
16166 : static const u32 SFAudioNode_X3D_TypeToTag[1] = {
16167 : TAG_X3D_AudioClip
16168 : };
16169 :
16170 : #define SFStreamingNode_X3D_Count 4
16171 : static const u32 SFStreamingNode_X3D_TypeToTag[4] = {
16172 : TAG_X3D_AudioClip, TAG_X3D_Inline, TAG_X3D_LoadSensor, TAG_X3D_MovieTexture
16173 : };
16174 :
16175 : #define SFBackground3DNode_X3D_Count 2
16176 : static const u32 SFBackground3DNode_X3D_TypeToTag[2] = {
16177 : TAG_X3D_Background, TAG_X3D_TextureBackground
16178 : };
16179 :
16180 : #define SFColorNode_X3D_Count 2
16181 : static const u32 SFColorNode_X3D_TypeToTag[2] = {
16182 : TAG_X3D_Color, TAG_X3D_ColorRGBA
16183 : };
16184 :
16185 : #define SFNurbsControlCurveNode_X3D_Count 3
16186 : static const u32 SFNurbsControlCurveNode_X3D_TypeToTag[3] = {
16187 : TAG_X3D_Contour2D, TAG_X3D_ContourPolyline2D, TAG_X3D_NurbsCurve2D
16188 : };
16189 :
16190 : #define SFCoordinateNode_X3D_Count 3
16191 : static const u32 SFCoordinateNode_X3D_TypeToTag[3] = {
16192 : TAG_X3D_Coordinate, TAG_X3D_CoordinateDouble, TAG_X3D_GeoCoordinate
16193 : };
16194 :
16195 : #define SFCoordinate2DNode_X3D_Count 1
16196 : static const u32 SFCoordinate2DNode_X3D_TypeToTag[1] = {
16197 : TAG_X3D_Coordinate2D
16198 : };
16199 :
16200 : #define SFFillPropertiesNode_X3D_Count 1
16201 : static const u32 SFFillPropertiesNode_X3D_TypeToTag[1] = {
16202 : TAG_X3D_FillProperties
16203 : };
16204 :
16205 : #define SFFogNode_X3D_Count 1
16206 : static const u32 SFFogNode_X3D_TypeToTag[1] = {
16207 : TAG_X3D_Fog
16208 : };
16209 :
16210 : #define SFFontStyleNode_X3D_Count 1
16211 : static const u32 SFFontStyleNode_X3D_TypeToTag[1] = {
16212 : TAG_X3D_FontStyle
16213 : };
16214 :
16215 : #define SFGeoOriginNode_X3D_Count 1
16216 : static const u32 SFGeoOriginNode_X3D_TypeToTag[1] = {
16217 : TAG_X3D_GeoOrigin
16218 : };
16219 :
16220 : #define SFViewpointNode_X3D_Count 2
16221 : static const u32 SFViewpointNode_X3D_TypeToTag[2] = {
16222 : TAG_X3D_GeoViewpoint, TAG_X3D_Viewpoint
16223 : };
16224 :
16225 : #define SFTopNode_X3D_Count 1
16226 : static const u32 SFTopNode_X3D_TypeToTag[1] = {
16227 : TAG_X3D_Group
16228 : };
16229 :
16230 : #define SFHAnimDisplacerNode_X3D_Count 1
16231 : static const u32 SFHAnimDisplacerNode_X3D_TypeToTag[1] = {
16232 : TAG_X3D_HAnimDisplacer
16233 : };
16234 :
16235 : #define SFHAnimNode_X3D_Count 3
16236 : static const u32 SFHAnimNode_X3D_TypeToTag[3] = {
16237 : TAG_X3D_HAnimJoint, TAG_X3D_HAnimSegment, TAG_X3D_HAnimSite
16238 : };
16239 :
16240 : #define SFTextureNode_X3D_Count 4
16241 : static const u32 SFTextureNode_X3D_TypeToTag[4] = {
16242 : TAG_X3D_ImageTexture, TAG_X3D_MovieTexture, TAG_X3D_MultiTexture, TAG_X3D_PixelTexture
16243 : };
16244 :
16245 : #define SFX3DLinePropertiesNode_X3D_Count 1
16246 : static const u32 SFX3DLinePropertiesNode_X3D_TypeToTag[1] = {
16247 : TAG_X3D_LineProperties
16248 : };
16249 :
16250 : #define SFMaterialNode_X3D_Count 1
16251 : static const u32 SFMaterialNode_X3D_TypeToTag[1] = {
16252 : TAG_X3D_Material
16253 : };
16254 :
16255 : #define SFMetadataNode_X3D_Count 5
16256 : static const u32 SFMetadataNode_X3D_TypeToTag[5] = {
16257 : TAG_X3D_MetadataDouble, TAG_X3D_MetadataFloat, TAG_X3D_MetadataInteger, TAG_X3D_MetadataSet, TAG_X3D_MetadataString
16258 : };
16259 :
16260 : #define SFTextureCoordinateNode_X3D_Count 4
16261 : static const u32 SFTextureCoordinateNode_X3D_TypeToTag[4] = {
16262 : TAG_X3D_MultiTextureCoordinate, TAG_X3D_NurbsTextureCoordinate, TAG_X3D_TextureCoordinate, TAG_X3D_TextureCoordinateGenerator
16263 : };
16264 :
16265 : #define SFTextureTransformNode_X3D_Count 2
16266 : static const u32 SFTextureTransformNode_X3D_TypeToTag[2] = {
16267 : TAG_X3D_MultiTextureTransform, TAG_X3D_TextureTransform
16268 : };
16269 :
16270 : #define SFNavigationInfoNode_X3D_Count 1
16271 : static const u32 SFNavigationInfoNode_X3D_TypeToTag[1] = {
16272 : TAG_X3D_NavigationInfo
16273 : };
16274 :
16275 : #define SFNormalNode_X3D_Count 1
16276 : static const u32 SFNormalNode_X3D_TypeToTag[1] = {
16277 : TAG_X3D_Normal
16278 : };
16279 :
16280 : #define SFNurbsCurveNode_X3D_Count 1
16281 : static const u32 SFNurbsCurveNode_X3D_TypeToTag[1] = {
16282 : TAG_X3D_NurbsCurve
16283 : };
16284 :
16285 : #define SFNurbsSurfaceNode_X3D_Count 4
16286 : static const u32 SFNurbsSurfaceNode_X3D_TypeToTag[4] = {
16287 : TAG_X3D_NurbsPatchSurface, TAG_X3D_NurbsSweptSurface, TAG_X3D_NurbsSwungSurface, TAG_X3D_NurbsTrimmedSurface
16288 : };
16289 :
16290 :
16291 :
16292 : GF_EXPORT
16293 7129 : Bool gf_x3d_get_node_type(u32 NDT_Tag, u32 NodeTag)
16294 : {
16295 : const u32 *types;
16296 : u32 count, i;
16297 7129 : if (!NodeTag) return 0;
16298 : types = NULL;
16299 7129 : switch (NDT_Tag) {
16300 : case NDT_SFWorldNode:
16301 : types = SFWorldNode_X3D_TypeToTag;
16302 : count = SFWorldNode_X3D_Count;
16303 : break;
16304 221 : case NDT_SF3DNode:
16305 : types = SF3DNode_X3D_TypeToTag;
16306 : count = SF3DNode_X3D_Count;
16307 221 : break;
16308 128 : case NDT_SF2DNode:
16309 : types = SF2DNode_X3D_TypeToTag;
16310 : count = SF2DNode_X3D_Count;
16311 128 : break;
16312 158 : case NDT_SFAppearanceNode:
16313 : types = SFAppearanceNode_X3D_TypeToTag;
16314 : count = SFAppearanceNode_X3D_Count;
16315 158 : break;
16316 160 : case NDT_SFGeometryNode:
16317 : types = SFGeometryNode_X3D_TypeToTag;
16318 : count = SFGeometryNode_X3D_Count;
16319 160 : break;
16320 128 : case NDT_SFAudioNode:
16321 : types = SFAudioNode_X3D_TypeToTag;
16322 : count = SFAudioNode_X3D_Count;
16323 128 : break;
16324 128 : case NDT_SFStreamingNode:
16325 : types = SFStreamingNode_X3D_TypeToTag;
16326 : count = SFStreamingNode_X3D_Count;
16327 128 : break;
16328 128 : case NDT_SFBackground3DNode:
16329 : types = SFBackground3DNode_X3D_TypeToTag;
16330 : count = SFBackground3DNode_X3D_Count;
16331 128 : break;
16332 137 : case NDT_SFColorNode:
16333 : types = SFColorNode_X3D_TypeToTag;
16334 : count = SFColorNode_X3D_Count;
16335 137 : break;
16336 0 : case NDT_SFNurbsControlCurveNode:
16337 : types = SFNurbsControlCurveNode_X3D_TypeToTag;
16338 : count = SFNurbsControlCurveNode_X3D_Count;
16339 0 : break;
16340 147 : case NDT_SFCoordinateNode:
16341 : types = SFCoordinateNode_X3D_TypeToTag;
16342 : count = SFCoordinateNode_X3D_Count;
16343 147 : break;
16344 128 : case NDT_SFCoordinate2DNode:
16345 : types = SFCoordinate2DNode_X3D_TypeToTag;
16346 : count = SFCoordinate2DNode_X3D_Count;
16347 128 : break;
16348 1 : case NDT_SFFillPropertiesNode:
16349 : types = SFFillPropertiesNode_X3D_TypeToTag;
16350 : count = SFFillPropertiesNode_X3D_Count;
16351 1 : break;
16352 128 : case NDT_SFFogNode:
16353 : types = SFFogNode_X3D_TypeToTag;
16354 : count = SFFogNode_X3D_Count;
16355 128 : break;
16356 134 : case NDT_SFFontStyleNode:
16357 : types = SFFontStyleNode_X3D_TypeToTag;
16358 : count = SFFontStyleNode_X3D_Count;
16359 134 : break;
16360 0 : case NDT_SFGeoOriginNode:
16361 : types = SFGeoOriginNode_X3D_TypeToTag;
16362 : count = SFGeoOriginNode_X3D_Count;
16363 0 : break;
16364 128 : case NDT_SFViewpointNode:
16365 : types = SFViewpointNode_X3D_TypeToTag;
16366 : count = SFViewpointNode_X3D_Count;
16367 128 : break;
16368 128 : case NDT_SFTopNode:
16369 : types = SFTopNode_X3D_TypeToTag;
16370 : count = SFTopNode_X3D_Count;
16371 128 : break;
16372 0 : case NDT_SFHAnimDisplacerNode:
16373 : types = SFHAnimDisplacerNode_X3D_TypeToTag;
16374 : count = SFHAnimDisplacerNode_X3D_Count;
16375 0 : break;
16376 0 : case NDT_SFHAnimNode:
16377 : types = SFHAnimNode_X3D_TypeToTag;
16378 : count = SFHAnimNode_X3D_Count;
16379 0 : break;
16380 128 : case NDT_SFTextureNode:
16381 : types = SFTextureNode_X3D_TypeToTag;
16382 : count = SFTextureNode_X3D_Count;
16383 128 : break;
16384 0 : case NDT_SFX3DLinePropertiesNode:
16385 : types = SFX3DLinePropertiesNode_X3D_TypeToTag;
16386 : count = SFX3DLinePropertiesNode_X3D_Count;
16387 0 : break;
16388 154 : case NDT_SFMaterialNode:
16389 : types = SFMaterialNode_X3D_TypeToTag;
16390 : count = SFMaterialNode_X3D_Count;
16391 154 : break;
16392 0 : case NDT_SFMetadataNode:
16393 : types = SFMetadataNode_X3D_TypeToTag;
16394 : count = SFMetadataNode_X3D_Count;
16395 0 : break;
16396 129 : case NDT_SFTextureCoordinateNode:
16397 : types = SFTextureCoordinateNode_X3D_TypeToTag;
16398 : count = SFTextureCoordinateNode_X3D_Count;
16399 129 : break;
16400 128 : case NDT_SFTextureTransformNode:
16401 : types = SFTextureTransformNode_X3D_TypeToTag;
16402 : count = SFTextureTransformNode_X3D_Count;
16403 128 : break;
16404 128 : case NDT_SFNavigationInfoNode:
16405 : types = SFNavigationInfoNode_X3D_TypeToTag;
16406 : count = SFNavigationInfoNode_X3D_Count;
16407 128 : break;
16408 128 : case NDT_SFNormalNode:
16409 : types = SFNormalNode_X3D_TypeToTag;
16410 : count = SFNormalNode_X3D_Count;
16411 128 : break;
16412 0 : case NDT_SFNurbsCurveNode:
16413 : types = SFNurbsCurveNode_X3D_TypeToTag;
16414 : count = SFNurbsCurveNode_X3D_Count;
16415 0 : break;
16416 0 : case NDT_SFNurbsSurfaceNode:
16417 : types = SFNurbsSurfaceNode_X3D_TypeToTag;
16418 : count = SFNurbsSurfaceNode_X3D_Count;
16419 0 : break;
16420 : default:
16421 : return 0;
16422 : }
16423 33055 : for(i=0; i<count; i++) {
16424 30651 : if (types[i]==NodeTag) return 1;
16425 : }
16426 : return 0;
16427 : }
16428 : #endif /*GPAC_DISABLE_X3D*/
16429 :
|