Coverage Report

Created: 2025-10-10 06:44

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gpac/src/scenegraph/x3d_nodes.c
Line
Count
Source
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
static void Anchor_Del(GF_Node *node)
48
0
{
49
0
  X_Anchor *p = (X_Anchor *) node;
50
0
  gf_sg_sfstring_del(p->description);
51
0
  gf_sg_mfstring_del(p->parameter);
52
0
  gf_sg_mfurl_del(p->url);
53
0
  gf_node_unregister((GF_Node *) p->metadata, node);
54
0
  gf_sg_vrml_parent_destroy(node);
55
0
  gf_node_free((GF_Node *)p);
56
0
}
57
58
59
static u32 Anchor_get_field_count(GF_Node *node, u8 dummy)
60
0
{
61
0
  return 7;
62
0
}
63
64
static GF_Err Anchor_get_field(GF_Node *node, GF_FieldInfo *info)
65
0
{
66
0
  switch (info->fieldIndex) {
67
0
  case 0:
68
0
    info->name = "addChildren";
69
0
    info->eventType = GF_SG_EVENT_IN;
70
0
    info->on_event_in = ((X_Anchor *)node)->on_addChildren;
71
0
    info->fieldType = GF_SG_VRML_MFNODE;
72
0
    info->NDTtype = NDT_SF3DNode;
73
0
    info->far_ptr = & ((X_Anchor *)node)->addChildren;
74
0
    return GF_OK;
75
0
  case 1:
76
0
    info->name = "removeChildren";
77
0
    info->eventType = GF_SG_EVENT_IN;
78
0
    info->on_event_in = ((X_Anchor *)node)->on_removeChildren;
79
0
    info->fieldType = GF_SG_VRML_MFNODE;
80
0
    info->NDTtype = NDT_SF3DNode;
81
0
    info->far_ptr = & ((X_Anchor *)node)->removeChildren;
82
0
    return GF_OK;
83
0
  case 2:
84
0
    info->name = "children";
85
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
86
0
    info->fieldType = GF_SG_VRML_MFNODE;
87
0
    info->NDTtype = NDT_SF3DNode;
88
0
    info->far_ptr = & ((X_Anchor *)node)->children;
89
0
    return GF_OK;
90
0
  case 3:
91
0
    info->name = "description";
92
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
93
0
    info->fieldType = GF_SG_VRML_SFSTRING;
94
0
    info->far_ptr = & ((X_Anchor *) node)->description;
95
0
    return GF_OK;
96
0
  case 4:
97
0
    info->name = "parameter";
98
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
99
0
    info->fieldType = GF_SG_VRML_MFSTRING;
100
0
    info->far_ptr = & ((X_Anchor *) node)->parameter;
101
0
    return GF_OK;
102
0
  case 5:
103
0
    info->name = "url";
104
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
105
0
    info->fieldType = GF_SG_VRML_MFURL;
106
0
    info->far_ptr = & ((X_Anchor *) node)->url;
107
0
    return GF_OK;
108
0
  case 6:
109
0
    info->name = "metadata";
110
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
111
0
    info->fieldType = GF_SG_VRML_SFNODE;
112
0
    info->NDTtype = NDT_SFMetadataNode;
113
0
    info->far_ptr = & ((X_Anchor *)node)->metadata;
114
0
    return GF_OK;
115
0
  default:
116
0
    return GF_BAD_PARAM;
117
0
  }
118
0
}
119
120
121
static s32 Anchor_get_field_index_by_name(char *name)
122
0
{
123
0
  if (!strcmp("addChildren", name)) return 0;
124
0
  if (!strcmp("removeChildren", name)) return 1;
125
0
  if (!strcmp("children", name)) return 2;
126
0
  if (!strcmp("description", name)) return 3;
127
0
  if (!strcmp("parameter", name)) return 4;
128
0
  if (!strcmp("url", name)) return 5;
129
0
  if (!strcmp("metadata", name)) return 6;
130
0
  return -1;
131
0
}
132
133
134
static GF_Node *Anchor_Create()
135
0
{
136
0
  X_Anchor *p;
137
0
  GF_SAFEALLOC(p, X_Anchor);
138
0
  if(!p) return NULL;
139
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Anchor);
140
0
  gf_sg_vrml_parent_setup((GF_Node *) p);
141
142
  /*default field values*/
143
0
  return (GF_Node *)p;
144
0
}
145
146
147
/*
148
  Appearance Node deletion
149
*/
150
151
static void Appearance_Del(GF_Node *node)
152
0
{
153
0
  X_Appearance *p = (X_Appearance *) node;
154
0
  gf_node_unregister((GF_Node *) p->material, node);
155
0
  gf_node_unregister((GF_Node *) p->texture, node);
156
0
  gf_node_unregister((GF_Node *) p->textureTransform, node);
157
0
  gf_node_unregister((GF_Node *) p->fillProperties, node);
158
0
  gf_node_unregister((GF_Node *) p->lineProperties, node);
159
0
  gf_node_unregister((GF_Node *) p->metadata, node);
160
0
  gf_node_free((GF_Node *)p);
161
0
}
162
163
164
static u32 Appearance_get_field_count(GF_Node *node, u8 dummy)
165
0
{
166
0
  return 6;
167
0
}
168
169
static GF_Err Appearance_get_field(GF_Node *node, GF_FieldInfo *info)
170
0
{
171
0
  switch (info->fieldIndex) {
172
0
  case 0:
173
0
    info->name = "material";
174
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
175
0
    info->fieldType = GF_SG_VRML_SFNODE;
176
0
    info->NDTtype = NDT_SFMaterialNode;
177
0
    info->far_ptr = & ((X_Appearance *)node)->material;
178
0
    return GF_OK;
179
0
  case 1:
180
0
    info->name = "texture";
181
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
182
0
    info->fieldType = GF_SG_VRML_SFNODE;
183
0
    info->NDTtype = NDT_SFTextureNode;
184
0
    info->far_ptr = & ((X_Appearance *)node)->texture;
185
0
    return GF_OK;
186
0
  case 2:
187
0
    info->name = "textureTransform";
188
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
189
0
    info->fieldType = GF_SG_VRML_SFNODE;
190
0
    info->NDTtype = NDT_SFTextureTransformNode;
191
0
    info->far_ptr = & ((X_Appearance *)node)->textureTransform;
192
0
    return GF_OK;
193
0
  case 3:
194
0
    info->name = "fillProperties";
195
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
196
0
    info->fieldType = GF_SG_VRML_SFNODE;
197
0
    info->NDTtype = NDT_SFFillPropertiesNode;
198
0
    info->far_ptr = & ((X_Appearance *)node)->fillProperties;
199
0
    return GF_OK;
200
0
  case 4:
201
0
    info->name = "lineProperties";
202
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
203
0
    info->fieldType = GF_SG_VRML_SFNODE;
204
0
    info->NDTtype = NDT_SFX3DLinePropertiesNode;
205
0
    info->far_ptr = & ((X_Appearance *)node)->lineProperties;
206
0
    return GF_OK;
207
0
  case 5:
208
0
    info->name = "metadata";
209
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
210
0
    info->fieldType = GF_SG_VRML_SFNODE;
211
0
    info->NDTtype = NDT_SFMetadataNode;
212
0
    info->far_ptr = & ((X_Appearance *)node)->metadata;
213
0
    return GF_OK;
214
0
  default:
215
0
    return GF_BAD_PARAM;
216
0
  }
217
0
}
218
219
220
static s32 Appearance_get_field_index_by_name(char *name)
221
0
{
222
0
  if (!strcmp("material", name)) return 0;
223
0
  if (!strcmp("texture", name)) return 1;
224
0
  if (!strcmp("textureTransform", name)) return 2;
225
0
  if (!strcmp("fillProperties", name)) return 3;
226
0
  if (!strcmp("lineProperties", name)) return 4;
227
0
  if (!strcmp("metadata", name)) return 5;
228
0
  return -1;
229
0
}
230
231
232
static GF_Node *Appearance_Create()
233
0
{
234
0
  X_Appearance *p;
235
0
  GF_SAFEALLOC(p, X_Appearance);
236
0
  if(!p) return NULL;
237
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Appearance);
238
239
  /*default field values*/
240
0
  return (GF_Node *)p;
241
0
}
242
243
244
/*
245
  Arc2D Node deletion
246
*/
247
248
static void Arc2D_Del(GF_Node *node)
249
0
{
250
0
  X_Arc2D *p = (X_Arc2D *) node;
251
0
  gf_node_unregister((GF_Node *) p->metadata, node);
252
0
  gf_node_free((GF_Node *)p);
253
0
}
254
255
256
static u32 Arc2D_get_field_count(GF_Node *node, u8 dummy)
257
0
{
258
0
  return 4;
259
0
}
260
261
static GF_Err Arc2D_get_field(GF_Node *node, GF_FieldInfo *info)
262
0
{
263
0
  switch (info->fieldIndex) {
264
0
  case 0:
265
0
    info->name = "endAngle";
266
0
    info->eventType = GF_SG_EVENT_FIELD;
267
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
268
0
    info->far_ptr = & ((X_Arc2D *) node)->endAngle;
269
0
    return GF_OK;
270
0
  case 1:
271
0
    info->name = "radius";
272
0
    info->eventType = GF_SG_EVENT_FIELD;
273
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
274
0
    info->far_ptr = & ((X_Arc2D *) node)->radius;
275
0
    return GF_OK;
276
0
  case 2:
277
0
    info->name = "startAngle";
278
0
    info->eventType = GF_SG_EVENT_FIELD;
279
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
280
0
    info->far_ptr = & ((X_Arc2D *) node)->startAngle;
281
0
    return GF_OK;
282
0
  case 3:
283
0
    info->name = "metadata";
284
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
285
0
    info->fieldType = GF_SG_VRML_SFNODE;
286
0
    info->NDTtype = NDT_SFMetadataNode;
287
0
    info->far_ptr = & ((X_Arc2D *)node)->metadata;
288
0
    return GF_OK;
289
0
  default:
290
0
    return GF_BAD_PARAM;
291
0
  }
292
0
}
293
294
295
static s32 Arc2D_get_field_index_by_name(char *name)
296
0
{
297
0
  if (!strcmp("endAngle", name)) return 0;
298
0
  if (!strcmp("radius", name)) return 1;
299
0
  if (!strcmp("startAngle", name)) return 2;
300
0
  if (!strcmp("metadata", name)) return 3;
301
0
  return -1;
302
0
}
303
304
305
static GF_Node *Arc2D_Create()
306
0
{
307
0
  X_Arc2D *p;
308
0
  GF_SAFEALLOC(p, X_Arc2D);
309
0
  if(!p) return NULL;
310
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Arc2D);
311
312
  /*default field values*/
313
0
  p->endAngle = FLT2FIX(1.5707963);
314
0
  p->radius = FLT2FIX(1);
315
0
  p->startAngle = FLT2FIX(0);
316
0
  return (GF_Node *)p;
317
0
}
318
319
320
/*
321
  ArcClose2D Node deletion
322
*/
323
324
static void ArcClose2D_Del(GF_Node *node)
325
0
{
326
0
  X_ArcClose2D *p = (X_ArcClose2D *) node;
327
0
  gf_sg_sfstring_del(p->closureType);
328
0
  gf_node_unregister((GF_Node *) p->metadata, node);
329
0
  gf_node_free((GF_Node *)p);
330
0
}
331
332
333
static u32 ArcClose2D_get_field_count(GF_Node *node, u8 dummy)
334
0
{
335
0
  return 5;
336
0
}
337
338
static GF_Err ArcClose2D_get_field(GF_Node *node, GF_FieldInfo *info)
339
0
{
340
0
  switch (info->fieldIndex) {
341
0
  case 0:
342
0
    info->name = "closureType";
343
0
    info->eventType = GF_SG_EVENT_FIELD;
344
0
    info->fieldType = GF_SG_VRML_SFSTRING;
345
0
    info->far_ptr = & ((X_ArcClose2D *) node)->closureType;
346
0
    return GF_OK;
347
0
  case 1:
348
0
    info->name = "endAngle";
349
0
    info->eventType = GF_SG_EVENT_FIELD;
350
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
351
0
    info->far_ptr = & ((X_ArcClose2D *) node)->endAngle;
352
0
    return GF_OK;
353
0
  case 2:
354
0
    info->name = "radius";
355
0
    info->eventType = GF_SG_EVENT_FIELD;
356
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
357
0
    info->far_ptr = & ((X_ArcClose2D *) node)->radius;
358
0
    return GF_OK;
359
0
  case 3:
360
0
    info->name = "startAngle";
361
0
    info->eventType = GF_SG_EVENT_FIELD;
362
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
363
0
    info->far_ptr = & ((X_ArcClose2D *) node)->startAngle;
364
0
    return GF_OK;
365
0
  case 4:
366
0
    info->name = "metadata";
367
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
368
0
    info->fieldType = GF_SG_VRML_SFNODE;
369
0
    info->NDTtype = NDT_SFMetadataNode;
370
0
    info->far_ptr = & ((X_ArcClose2D *)node)->metadata;
371
0
    return GF_OK;
372
0
  default:
373
0
    return GF_BAD_PARAM;
374
0
  }
375
0
}
376
377
378
static s32 ArcClose2D_get_field_index_by_name(char *name)
379
0
{
380
0
  if (!strcmp("closureType", name)) return 0;
381
0
  if (!strcmp("endAngle", name)) return 1;
382
0
  if (!strcmp("radius", name)) return 2;
383
0
  if (!strcmp("startAngle", name)) return 3;
384
0
  if (!strcmp("metadata", name)) return 4;
385
0
  return -1;
386
0
}
387
388
389
static GF_Node *ArcClose2D_Create()
390
0
{
391
0
  X_ArcClose2D *p;
392
0
  GF_SAFEALLOC(p, X_ArcClose2D);
393
0
  if(!p) return NULL;
394
0
  gf_node_setup((GF_Node *)p, TAG_X3D_ArcClose2D);
395
396
  /*default field values*/
397
0
  p->closureType.buffer = (char*) gf_malloc(sizeof(char) * 4);
398
0
  strcpy(p->closureType.buffer, "PIE");
399
0
  p->endAngle = FLT2FIX(1.5707963);
400
0
  p->radius = FLT2FIX(1);
401
0
  p->startAngle = FLT2FIX(0);
402
0
  return (GF_Node *)p;
403
0
}
404
405
406
/*
407
  AudioClip Node deletion
408
*/
409
410
static void AudioClip_Del(GF_Node *node)
411
0
{
412
0
  X_AudioClip *p = (X_AudioClip *) node;
413
0
  gf_sg_sfstring_del(p->description);
414
0
  gf_sg_mfurl_del(p->url);
415
0
  gf_node_unregister((GF_Node *) p->metadata, node);
416
0
  gf_node_free((GF_Node *)p);
417
0
}
418
419
420
static u32 AudioClip_get_field_count(GF_Node *node, u8 dummy)
421
0
{
422
0
  return 13;
423
0
}
424
425
static GF_Err AudioClip_get_field(GF_Node *node, GF_FieldInfo *info)
426
0
{
427
0
  switch (info->fieldIndex) {
428
0
  case 0:
429
0
    info->name = "description";
430
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
431
0
    info->fieldType = GF_SG_VRML_SFSTRING;
432
0
    info->far_ptr = & ((X_AudioClip *) node)->description;
433
0
    return GF_OK;
434
0
  case 1:
435
0
    info->name = "loop";
436
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
437
0
    info->fieldType = GF_SG_VRML_SFBOOL;
438
0
    info->far_ptr = & ((X_AudioClip *) node)->loop;
439
0
    return GF_OK;
440
0
  case 2:
441
0
    info->name = "pitch";
442
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
443
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
444
0
    info->far_ptr = & ((X_AudioClip *) node)->pitch;
445
0
    return GF_OK;
446
0
  case 3:
447
0
    info->name = "startTime";
448
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
449
0
    info->fieldType = GF_SG_VRML_SFTIME;
450
0
    info->far_ptr = & ((X_AudioClip *) node)->startTime;
451
0
    return GF_OK;
452
0
  case 4:
453
0
    info->name = "stopTime";
454
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
455
0
    info->fieldType = GF_SG_VRML_SFTIME;
456
0
    info->far_ptr = & ((X_AudioClip *) node)->stopTime;
457
0
    return GF_OK;
458
0
  case 5:
459
0
    info->name = "url";
460
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
461
0
    info->fieldType = GF_SG_VRML_MFURL;
462
0
    info->far_ptr = & ((X_AudioClip *) node)->url;
463
0
    return GF_OK;
464
0
  case 6:
465
0
    info->name = "duration_changed";
466
0
    info->eventType = GF_SG_EVENT_OUT;
467
0
    info->fieldType = GF_SG_VRML_SFTIME;
468
0
    info->far_ptr = & ((X_AudioClip *) node)->duration_changed;
469
0
    return GF_OK;
470
0
  case 7:
471
0
    info->name = "isActive";
472
0
    info->eventType = GF_SG_EVENT_OUT;
473
0
    info->fieldType = GF_SG_VRML_SFBOOL;
474
0
    info->far_ptr = & ((X_AudioClip *) node)->isActive;
475
0
    return GF_OK;
476
0
  case 8:
477
0
    info->name = "metadata";
478
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
479
0
    info->fieldType = GF_SG_VRML_SFNODE;
480
0
    info->NDTtype = NDT_SFMetadataNode;
481
0
    info->far_ptr = & ((X_AudioClip *)node)->metadata;
482
0
    return GF_OK;
483
0
  case 9:
484
0
    info->name = "pauseTime";
485
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
486
0
    info->fieldType = GF_SG_VRML_SFTIME;
487
0
    info->far_ptr = & ((X_AudioClip *) node)->pauseTime;
488
0
    return GF_OK;
489
0
  case 10:
490
0
    info->name = "resumeTime";
491
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
492
0
    info->fieldType = GF_SG_VRML_SFTIME;
493
0
    info->far_ptr = & ((X_AudioClip *) node)->resumeTime;
494
0
    return GF_OK;
495
0
  case 11:
496
0
    info->name = "elapsedTime";
497
0
    info->eventType = GF_SG_EVENT_OUT;
498
0
    info->fieldType = GF_SG_VRML_SFTIME;
499
0
    info->far_ptr = & ((X_AudioClip *) node)->elapsedTime;
500
0
    return GF_OK;
501
0
  case 12:
502
0
    info->name = "isPaused";
503
0
    info->eventType = GF_SG_EVENT_OUT;
504
0
    info->fieldType = GF_SG_VRML_SFBOOL;
505
0
    info->far_ptr = & ((X_AudioClip *) node)->isPaused;
506
0
    return GF_OK;
507
0
  default:
508
0
    return GF_BAD_PARAM;
509
0
  }
510
0
}
511
512
513
static s32 AudioClip_get_field_index_by_name(char *name)
514
0
{
515
0
  if (!strcmp("description", name)) return 0;
516
0
  if (!strcmp("loop", name)) return 1;
517
0
  if (!strcmp("pitch", name)) return 2;
518
0
  if (!strcmp("startTime", name)) return 3;
519
0
  if (!strcmp("stopTime", name)) return 4;
520
0
  if (!strcmp("url", name)) return 5;
521
0
  if (!strcmp("duration_changed", name)) return 6;
522
0
  if (!strcmp("isActive", name)) return 7;
523
0
  if (!strcmp("metadata", name)) return 8;
524
0
  if (!strcmp("pauseTime", name)) return 9;
525
0
  if (!strcmp("resumeTime", name)) return 10;
526
0
  if (!strcmp("elapsedTime", name)) return 11;
527
0
  if (!strcmp("isPaused", name)) return 12;
528
0
  return -1;
529
0
}
530
531
532
static GF_Node *AudioClip_Create()
533
0
{
534
0
  X_AudioClip *p;
535
0
  GF_SAFEALLOC(p, X_AudioClip);
536
0
  if(!p) return NULL;
537
0
  gf_node_setup((GF_Node *)p, TAG_X3D_AudioClip);
538
539
  /*default field values*/
540
0
  p->pitch = FLT2FIX(1.0);
541
0
  p->startTime = 0;
542
0
  p->stopTime = 0;
543
0
  p->pauseTime = 0;
544
0
  p->resumeTime = 0;
545
0
  return (GF_Node *)p;
546
0
}
547
548
549
/*
550
  Background Node deletion
551
*/
552
553
static void Background_Del(GF_Node *node)
554
0
{
555
0
  X_Background *p = (X_Background *) node;
556
0
  gf_sg_mffloat_del(p->groundAngle);
557
0
  gf_sg_mfcolor_del(p->groundColor);
558
0
  gf_sg_mfurl_del(p->backUrl);
559
0
  gf_sg_mfurl_del(p->bottomUrl);
560
0
  gf_sg_mfurl_del(p->frontUrl);
561
0
  gf_sg_mfurl_del(p->leftUrl);
562
0
  gf_sg_mfurl_del(p->rightUrl);
563
0
  gf_sg_mfurl_del(p->topUrl);
564
0
  gf_sg_mffloat_del(p->skyAngle);
565
0
  gf_sg_mfcolor_del(p->skyColor);
566
0
  gf_node_unregister((GF_Node *) p->metadata, node);
567
0
  gf_node_free((GF_Node *)p);
568
0
}
569
570
571
static u32 Background_get_field_count(GF_Node *node, u8 dummy)
572
0
{
573
0
  return 14;
574
0
}
575
576
static GF_Err Background_get_field(GF_Node *node, GF_FieldInfo *info)
577
0
{
578
0
  switch (info->fieldIndex) {
579
0
  case 0:
580
0
    info->name = "set_bind";
581
0
    info->eventType = GF_SG_EVENT_IN;
582
0
    info->on_event_in = ((X_Background *)node)->on_set_bind;
583
0
    info->fieldType = GF_SG_VRML_SFBOOL;
584
0
    info->far_ptr = & ((X_Background *) node)->set_bind;
585
0
    return GF_OK;
586
0
  case 1:
587
0
    info->name = "groundAngle";
588
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
589
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
590
0
    info->far_ptr = & ((X_Background *) node)->groundAngle;
591
0
    return GF_OK;
592
0
  case 2:
593
0
    info->name = "groundColor";
594
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
595
0
    info->fieldType = GF_SG_VRML_MFCOLOR;
596
0
    info->far_ptr = & ((X_Background *) node)->groundColor;
597
0
    return GF_OK;
598
0
  case 3:
599
0
    info->name = "backUrl";
600
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
601
0
    info->fieldType = GF_SG_VRML_MFURL;
602
0
    info->far_ptr = & ((X_Background *) node)->backUrl;
603
0
    return GF_OK;
604
0
  case 4:
605
0
    info->name = "bottomUrl";
606
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
607
0
    info->fieldType = GF_SG_VRML_MFURL;
608
0
    info->far_ptr = & ((X_Background *) node)->bottomUrl;
609
0
    return GF_OK;
610
0
  case 5:
611
0
    info->name = "frontUrl";
612
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
613
0
    info->fieldType = GF_SG_VRML_MFURL;
614
0
    info->far_ptr = & ((X_Background *) node)->frontUrl;
615
0
    return GF_OK;
616
0
  case 6:
617
0
    info->name = "leftUrl";
618
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
619
0
    info->fieldType = GF_SG_VRML_MFURL;
620
0
    info->far_ptr = & ((X_Background *) node)->leftUrl;
621
0
    return GF_OK;
622
0
  case 7:
623
0
    info->name = "rightUrl";
624
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
625
0
    info->fieldType = GF_SG_VRML_MFURL;
626
0
    info->far_ptr = & ((X_Background *) node)->rightUrl;
627
0
    return GF_OK;
628
0
  case 8:
629
0
    info->name = "topUrl";
630
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
631
0
    info->fieldType = GF_SG_VRML_MFURL;
632
0
    info->far_ptr = & ((X_Background *) node)->topUrl;
633
0
    return GF_OK;
634
0
  case 9:
635
0
    info->name = "skyAngle";
636
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
637
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
638
0
    info->far_ptr = & ((X_Background *) node)->skyAngle;
639
0
    return GF_OK;
640
0
  case 10:
641
0
    info->name = "skyColor";
642
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
643
0
    info->fieldType = GF_SG_VRML_MFCOLOR;
644
0
    info->far_ptr = & ((X_Background *) node)->skyColor;
645
0
    return GF_OK;
646
0
  case 11:
647
0
    info->name = "isBound";
648
0
    info->eventType = GF_SG_EVENT_OUT;
649
0
    info->fieldType = GF_SG_VRML_SFBOOL;
650
0
    info->far_ptr = & ((X_Background *) node)->isBound;
651
0
    return GF_OK;
652
0
  case 12:
653
0
    info->name = "metadata";
654
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
655
0
    info->fieldType = GF_SG_VRML_SFNODE;
656
0
    info->NDTtype = NDT_SFMetadataNode;
657
0
    info->far_ptr = & ((X_Background *)node)->metadata;
658
0
    return GF_OK;
659
0
  case 13:
660
0
    info->name = "bindTime";
661
0
    info->eventType = GF_SG_EVENT_OUT;
662
0
    info->fieldType = GF_SG_VRML_SFTIME;
663
0
    info->far_ptr = & ((X_Background *) node)->bindTime;
664
0
    return GF_OK;
665
0
  default:
666
0
    return GF_BAD_PARAM;
667
0
  }
668
0
}
669
670
671
static s32 Background_get_field_index_by_name(char *name)
672
0
{
673
0
  if (!strcmp("set_bind", name)) return 0;
674
0
  if (!strcmp("groundAngle", name)) return 1;
675
0
  if (!strcmp("groundColor", name)) return 2;
676
0
  if (!strcmp("backUrl", name)) return 3;
677
0
  if (!strcmp("bottomUrl", name)) return 4;
678
0
  if (!strcmp("frontUrl", name)) return 5;
679
0
  if (!strcmp("leftUrl", name)) return 6;
680
0
  if (!strcmp("rightUrl", name)) return 7;
681
0
  if (!strcmp("topUrl", name)) return 8;
682
0
  if (!strcmp("skyAngle", name)) return 9;
683
0
  if (!strcmp("skyColor", name)) return 10;
684
0
  if (!strcmp("isBound", name)) return 11;
685
0
  if (!strcmp("metadata", name)) return 12;
686
0
  if (!strcmp("bindTime", name)) return 13;
687
0
  return -1;
688
0
}
689
690
691
static GF_Node *Background_Create()
692
0
{
693
0
  X_Background *p;
694
0
  GF_SAFEALLOC(p, X_Background);
695
0
  if(!p) return NULL;
696
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Background);
697
698
  /*default field values*/
699
0
  p->skyColor.vals = (SFColor*)gf_malloc(sizeof(SFColor)*1);
700
0
  p->skyColor.count = 1;
701
0
  p->skyColor.vals[0].red = FLT2FIX(0);
702
0
  p->skyColor.vals[0].green = FLT2FIX(0);
703
0
  p->skyColor.vals[0].blue = FLT2FIX(0);
704
0
  return (GF_Node *)p;
705
0
}
706
707
708
/*
709
  Billboard Node deletion
710
*/
711
712
static void Billboard_Del(GF_Node *node)
713
0
{
714
0
  X_Billboard *p = (X_Billboard *) node;
715
0
  gf_node_unregister((GF_Node *) p->metadata, node);
716
0
  gf_sg_vrml_parent_destroy(node);
717
0
  gf_node_free((GF_Node *)p);
718
0
}
719
720
721
static u32 Billboard_get_field_count(GF_Node *node, u8 dummy)
722
0
{
723
0
  return 5;
724
0
}
725
726
static GF_Err Billboard_get_field(GF_Node *node, GF_FieldInfo *info)
727
0
{
728
0
  switch (info->fieldIndex) {
729
0
  case 0:
730
0
    info->name = "addChildren";
731
0
    info->eventType = GF_SG_EVENT_IN;
732
0
    info->on_event_in = ((X_Billboard *)node)->on_addChildren;
733
0
    info->fieldType = GF_SG_VRML_MFNODE;
734
0
    info->NDTtype = NDT_SF3DNode;
735
0
    info->far_ptr = & ((X_Billboard *)node)->addChildren;
736
0
    return GF_OK;
737
0
  case 1:
738
0
    info->name = "removeChildren";
739
0
    info->eventType = GF_SG_EVENT_IN;
740
0
    info->on_event_in = ((X_Billboard *)node)->on_removeChildren;
741
0
    info->fieldType = GF_SG_VRML_MFNODE;
742
0
    info->NDTtype = NDT_SF3DNode;
743
0
    info->far_ptr = & ((X_Billboard *)node)->removeChildren;
744
0
    return GF_OK;
745
0
  case 2:
746
0
    info->name = "children";
747
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
748
0
    info->fieldType = GF_SG_VRML_MFNODE;
749
0
    info->NDTtype = NDT_SF3DNode;
750
0
    info->far_ptr = & ((X_Billboard *)node)->children;
751
0
    return GF_OK;
752
0
  case 3:
753
0
    info->name = "axisOfRotation";
754
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
755
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
756
0
    info->far_ptr = & ((X_Billboard *) node)->axisOfRotation;
757
0
    return GF_OK;
758
0
  case 4:
759
0
    info->name = "metadata";
760
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
761
0
    info->fieldType = GF_SG_VRML_SFNODE;
762
0
    info->NDTtype = NDT_SFMetadataNode;
763
0
    info->far_ptr = & ((X_Billboard *)node)->metadata;
764
0
    return GF_OK;
765
0
  default:
766
0
    return GF_BAD_PARAM;
767
0
  }
768
0
}
769
770
771
static s32 Billboard_get_field_index_by_name(char *name)
772
0
{
773
0
  if (!strcmp("addChildren", name)) return 0;
774
0
  if (!strcmp("removeChildren", name)) return 1;
775
0
  if (!strcmp("children", name)) return 2;
776
0
  if (!strcmp("axisOfRotation", name)) return 3;
777
0
  if (!strcmp("metadata", name)) return 4;
778
0
  return -1;
779
0
}
780
781
782
static GF_Node *Billboard_Create()
783
0
{
784
0
  X_Billboard *p;
785
0
  GF_SAFEALLOC(p, X_Billboard);
786
0
  if(!p) return NULL;
787
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Billboard);
788
0
  gf_sg_vrml_parent_setup((GF_Node *) p);
789
790
  /*default field values*/
791
0
  p->axisOfRotation.x = FLT2FIX(0);
792
0
  p->axisOfRotation.y = FLT2FIX(1);
793
0
  p->axisOfRotation.z = FLT2FIX(0);
794
0
  return (GF_Node *)p;
795
0
}
796
797
798
/*
799
  BooleanFilter Node deletion
800
*/
801
802
static void BooleanFilter_Del(GF_Node *node)
803
0
{
804
0
  X_BooleanFilter *p = (X_BooleanFilter *) node;
805
0
  gf_node_unregister((GF_Node *) p->metadata, node);
806
0
  gf_node_free((GF_Node *)p);
807
0
}
808
809
810
static u32 BooleanFilter_get_field_count(GF_Node *node, u8 dummy)
811
0
{
812
0
  return 5;
813
0
}
814
815
static GF_Err BooleanFilter_get_field(GF_Node *node, GF_FieldInfo *info)
816
0
{
817
0
  switch (info->fieldIndex) {
818
0
  case 0:
819
0
    info->name = "set_boolean";
820
0
    info->eventType = GF_SG_EVENT_IN;
821
0
    info->on_event_in = ((X_BooleanFilter *)node)->on_set_boolean;
822
0
    info->fieldType = GF_SG_VRML_SFBOOL;
823
0
    info->far_ptr = & ((X_BooleanFilter *) node)->set_boolean;
824
0
    return GF_OK;
825
0
  case 1:
826
0
    info->name = "inputFalse";
827
0
    info->eventType = GF_SG_EVENT_OUT;
828
0
    info->fieldType = GF_SG_VRML_SFBOOL;
829
0
    info->far_ptr = & ((X_BooleanFilter *) node)->inputFalse;
830
0
    return GF_OK;
831
0
  case 2:
832
0
    info->name = "inputNegate";
833
0
    info->eventType = GF_SG_EVENT_OUT;
834
0
    info->fieldType = GF_SG_VRML_SFBOOL;
835
0
    info->far_ptr = & ((X_BooleanFilter *) node)->inputNegate;
836
0
    return GF_OK;
837
0
  case 3:
838
0
    info->name = "inputTrue";
839
0
    info->eventType = GF_SG_EVENT_OUT;
840
0
    info->fieldType = GF_SG_VRML_SFBOOL;
841
0
    info->far_ptr = & ((X_BooleanFilter *) node)->inputTrue;
842
0
    return GF_OK;
843
0
  case 4:
844
0
    info->name = "metadata";
845
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
846
0
    info->fieldType = GF_SG_VRML_SFNODE;
847
0
    info->NDTtype = NDT_SFMetadataNode;
848
0
    info->far_ptr = & ((X_BooleanFilter *)node)->metadata;
849
0
    return GF_OK;
850
0
  default:
851
0
    return GF_BAD_PARAM;
852
0
  }
853
0
}
854
855
856
static s32 BooleanFilter_get_field_index_by_name(char *name)
857
0
{
858
0
  if (!strcmp("set_boolean", name)) return 0;
859
0
  if (!strcmp("inputFalse", name)) return 1;
860
0
  if (!strcmp("inputNegate", name)) return 2;
861
0
  if (!strcmp("inputTrue", name)) return 3;
862
0
  if (!strcmp("metadata", name)) return 4;
863
0
  return -1;
864
0
}
865
866
867
static GF_Node *BooleanFilter_Create()
868
0
{
869
0
  X_BooleanFilter *p;
870
0
  GF_SAFEALLOC(p, X_BooleanFilter);
871
0
  if(!p) return NULL;
872
0
  gf_node_setup((GF_Node *)p, TAG_X3D_BooleanFilter);
873
874
  /*default field values*/
875
0
  return (GF_Node *)p;
876
0
}
877
878
879
/*
880
  BooleanSequencer Node deletion
881
*/
882
883
static void BooleanSequencer_Del(GF_Node *node)
884
0
{
885
0
  X_BooleanSequencer *p = (X_BooleanSequencer *) node;
886
0
  gf_sg_mffloat_del(p->key);
887
0
  gf_sg_mfbool_del(p->keyValue);
888
0
  gf_node_unregister((GF_Node *) p->metadata, node);
889
0
  gf_node_free((GF_Node *)p);
890
0
}
891
892
893
static u32 BooleanSequencer_get_field_count(GF_Node *node, u8 dummy)
894
0
{
895
0
  return 7;
896
0
}
897
898
static GF_Err BooleanSequencer_get_field(GF_Node *node, GF_FieldInfo *info)
899
0
{
900
0
  switch (info->fieldIndex) {
901
0
  case 0:
902
0
    info->name = "next";
903
0
    info->eventType = GF_SG_EVENT_IN;
904
0
    info->on_event_in = ((X_BooleanSequencer *)node)->on_next;
905
0
    info->fieldType = GF_SG_VRML_SFBOOL;
906
0
    info->far_ptr = & ((X_BooleanSequencer *) node)->next;
907
0
    return GF_OK;
908
0
  case 1:
909
0
    info->name = "previous";
910
0
    info->eventType = GF_SG_EVENT_IN;
911
0
    info->on_event_in = ((X_BooleanSequencer *)node)->on_previous;
912
0
    info->fieldType = GF_SG_VRML_SFBOOL;
913
0
    info->far_ptr = & ((X_BooleanSequencer *) node)->previous;
914
0
    return GF_OK;
915
0
  case 2:
916
0
    info->name = "set_fraction";
917
0
    info->eventType = GF_SG_EVENT_IN;
918
0
    info->on_event_in = ((X_BooleanSequencer *)node)->on_set_fraction;
919
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
920
0
    info->far_ptr = & ((X_BooleanSequencer *) node)->set_fraction;
921
0
    return GF_OK;
922
0
  case 3:
923
0
    info->name = "key";
924
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
925
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
926
0
    info->far_ptr = & ((X_BooleanSequencer *) node)->key;
927
0
    return GF_OK;
928
0
  case 4:
929
0
    info->name = "keyValue";
930
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
931
0
    info->fieldType = GF_SG_VRML_MFBOOL;
932
0
    info->far_ptr = & ((X_BooleanSequencer *) node)->keyValue;
933
0
    return GF_OK;
934
0
  case 5:
935
0
    info->name = "value_changed";
936
0
    info->eventType = GF_SG_EVENT_OUT;
937
0
    info->fieldType = GF_SG_VRML_SFBOOL;
938
0
    info->far_ptr = & ((X_BooleanSequencer *) node)->value_changed;
939
0
    return GF_OK;
940
0
  case 6:
941
0
    info->name = "metadata";
942
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
943
0
    info->fieldType = GF_SG_VRML_SFNODE;
944
0
    info->NDTtype = NDT_SFMetadataNode;
945
0
    info->far_ptr = & ((X_BooleanSequencer *)node)->metadata;
946
0
    return GF_OK;
947
0
  default:
948
0
    return GF_BAD_PARAM;
949
0
  }
950
0
}
951
952
953
static s32 BooleanSequencer_get_field_index_by_name(char *name)
954
0
{
955
0
  if (!strcmp("next", name)) return 0;
956
0
  if (!strcmp("previous", name)) return 1;
957
0
  if (!strcmp("set_fraction", name)) return 2;
958
0
  if (!strcmp("key", name)) return 3;
959
0
  if (!strcmp("keyValue", name)) return 4;
960
0
  if (!strcmp("value_changed", name)) return 5;
961
0
  if (!strcmp("metadata", name)) return 6;
962
0
  return -1;
963
0
}
964
965
966
static GF_Node *BooleanSequencer_Create()
967
0
{
968
0
  X_BooleanSequencer *p;
969
0
  GF_SAFEALLOC(p, X_BooleanSequencer);
970
0
  if(!p) return NULL;
971
0
  gf_node_setup((GF_Node *)p, TAG_X3D_BooleanSequencer);
972
973
  /*default field values*/
974
0
  return (GF_Node *)p;
975
0
}
976
977
978
/*
979
  BooleanToggle Node deletion
980
*/
981
982
static void BooleanToggle_Del(GF_Node *node)
983
0
{
984
0
  X_BooleanToggle *p = (X_BooleanToggle *) node;
985
0
  gf_node_unregister((GF_Node *) p->metadata, node);
986
0
  gf_node_free((GF_Node *)p);
987
0
}
988
989
990
static u32 BooleanToggle_get_field_count(GF_Node *node, u8 dummy)
991
0
{
992
0
  return 3;
993
0
}
994
995
static GF_Err BooleanToggle_get_field(GF_Node *node, GF_FieldInfo *info)
996
0
{
997
0
  switch (info->fieldIndex) {
998
0
  case 0:
999
0
    info->name = "set_boolean";
1000
0
    info->eventType = GF_SG_EVENT_IN;
1001
0
    info->on_event_in = ((X_BooleanToggle *)node)->on_set_boolean;
1002
0
    info->fieldType = GF_SG_VRML_SFBOOL;
1003
0
    info->far_ptr = & ((X_BooleanToggle *) node)->set_boolean;
1004
0
    return GF_OK;
1005
0
  case 1:
1006
0
    info->name = "toggle";
1007
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1008
0
    info->fieldType = GF_SG_VRML_SFBOOL;
1009
0
    info->far_ptr = & ((X_BooleanToggle *) node)->toggle;
1010
0
    return GF_OK;
1011
0
  case 2:
1012
0
    info->name = "metadata";
1013
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1014
0
    info->fieldType = GF_SG_VRML_SFNODE;
1015
0
    info->NDTtype = NDT_SFMetadataNode;
1016
0
    info->far_ptr = & ((X_BooleanToggle *)node)->metadata;
1017
0
    return GF_OK;
1018
0
  default:
1019
0
    return GF_BAD_PARAM;
1020
0
  }
1021
0
}
1022
1023
1024
static s32 BooleanToggle_get_field_index_by_name(char *name)
1025
0
{
1026
0
  if (!strcmp("set_boolean", name)) return 0;
1027
0
  if (!strcmp("toggle", name)) return 1;
1028
0
  if (!strcmp("metadata", name)) return 2;
1029
0
  return -1;
1030
0
}
1031
1032
1033
static GF_Node *BooleanToggle_Create()
1034
0
{
1035
0
  X_BooleanToggle *p;
1036
0
  GF_SAFEALLOC(p, X_BooleanToggle);
1037
0
  if(!p) return NULL;
1038
0
  gf_node_setup((GF_Node *)p, TAG_X3D_BooleanToggle);
1039
1040
  /*default field values*/
1041
0
  return (GF_Node *)p;
1042
0
}
1043
1044
1045
/*
1046
  BooleanTrigger Node deletion
1047
*/
1048
1049
static void BooleanTrigger_Del(GF_Node *node)
1050
0
{
1051
0
  X_BooleanTrigger *p = (X_BooleanTrigger *) node;
1052
0
  gf_node_unregister((GF_Node *) p->metadata, node);
1053
0
  gf_node_free((GF_Node *)p);
1054
0
}
1055
1056
1057
static u32 BooleanTrigger_get_field_count(GF_Node *node, u8 dummy)
1058
0
{
1059
0
  return 3;
1060
0
}
1061
1062
static GF_Err BooleanTrigger_get_field(GF_Node *node, GF_FieldInfo *info)
1063
0
{
1064
0
  switch (info->fieldIndex) {
1065
0
  case 0:
1066
0
    info->name = "set_triggerTime";
1067
0
    info->eventType = GF_SG_EVENT_IN;
1068
0
    info->on_event_in = ((X_BooleanTrigger *)node)->on_set_triggerTime;
1069
0
    info->fieldType = GF_SG_VRML_SFTIME;
1070
0
    info->far_ptr = & ((X_BooleanTrigger *) node)->set_triggerTime;
1071
0
    return GF_OK;
1072
0
  case 1:
1073
0
    info->name = "triggerTrue";
1074
0
    info->eventType = GF_SG_EVENT_OUT;
1075
0
    info->fieldType = GF_SG_VRML_SFBOOL;
1076
0
    info->far_ptr = & ((X_BooleanTrigger *) node)->triggerTrue;
1077
0
    return GF_OK;
1078
0
  case 2:
1079
0
    info->name = "metadata";
1080
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1081
0
    info->fieldType = GF_SG_VRML_SFNODE;
1082
0
    info->NDTtype = NDT_SFMetadataNode;
1083
0
    info->far_ptr = & ((X_BooleanTrigger *)node)->metadata;
1084
0
    return GF_OK;
1085
0
  default:
1086
0
    return GF_BAD_PARAM;
1087
0
  }
1088
0
}
1089
1090
1091
static s32 BooleanTrigger_get_field_index_by_name(char *name)
1092
0
{
1093
0
  if (!strcmp("set_triggerTime", name)) return 0;
1094
0
  if (!strcmp("triggerTrue", name)) return 1;
1095
0
  if (!strcmp("metadata", name)) return 2;
1096
0
  return -1;
1097
0
}
1098
1099
1100
static GF_Node *BooleanTrigger_Create()
1101
0
{
1102
0
  X_BooleanTrigger *p;
1103
0
  GF_SAFEALLOC(p, X_BooleanTrigger);
1104
0
  if(!p) return NULL;
1105
0
  gf_node_setup((GF_Node *)p, TAG_X3D_BooleanTrigger);
1106
1107
  /*default field values*/
1108
0
  return (GF_Node *)p;
1109
0
}
1110
1111
1112
/*
1113
  Box Node deletion
1114
*/
1115
1116
static void Box_Del(GF_Node *node)
1117
0
{
1118
0
  X_Box *p = (X_Box *) node;
1119
0
  gf_node_unregister((GF_Node *) p->metadata, node);
1120
0
  gf_node_free((GF_Node *)p);
1121
0
}
1122
1123
1124
static u32 Box_get_field_count(GF_Node *node, u8 dummy)
1125
0
{
1126
0
  return 2;
1127
0
}
1128
1129
static GF_Err Box_get_field(GF_Node *node, GF_FieldInfo *info)
1130
0
{
1131
0
  switch (info->fieldIndex) {
1132
0
  case 0:
1133
0
    info->name = "size";
1134
0
    info->eventType = GF_SG_EVENT_FIELD;
1135
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
1136
0
    info->far_ptr = & ((X_Box *) node)->size;
1137
0
    return GF_OK;
1138
0
  case 1:
1139
0
    info->name = "metadata";
1140
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1141
0
    info->fieldType = GF_SG_VRML_SFNODE;
1142
0
    info->NDTtype = NDT_SFMetadataNode;
1143
0
    info->far_ptr = & ((X_Box *)node)->metadata;
1144
0
    return GF_OK;
1145
0
  default:
1146
0
    return GF_BAD_PARAM;
1147
0
  }
1148
0
}
1149
1150
1151
static s32 Box_get_field_index_by_name(char *name)
1152
0
{
1153
0
  if (!strcmp("size", name)) return 0;
1154
0
  if (!strcmp("metadata", name)) return 1;
1155
0
  return -1;
1156
0
}
1157
1158
1159
static GF_Node *Box_Create()
1160
0
{
1161
0
  X_Box *p;
1162
0
  GF_SAFEALLOC(p, X_Box);
1163
0
  if(!p) return NULL;
1164
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Box);
1165
1166
  /*default field values*/
1167
0
  p->size.x = FLT2FIX(2);
1168
0
  p->size.y = FLT2FIX(2);
1169
0
  p->size.z = FLT2FIX(2);
1170
0
  return (GF_Node *)p;
1171
0
}
1172
1173
1174
/*
1175
  Circle2D Node deletion
1176
*/
1177
1178
static void Circle2D_Del(GF_Node *node)
1179
0
{
1180
0
  X_Circle2D *p = (X_Circle2D *) node;
1181
0
  gf_node_unregister((GF_Node *) p->metadata, node);
1182
0
  gf_node_free((GF_Node *)p);
1183
0
}
1184
1185
1186
static u32 Circle2D_get_field_count(GF_Node *node, u8 dummy)
1187
0
{
1188
0
  return 2;
1189
0
}
1190
1191
static GF_Err Circle2D_get_field(GF_Node *node, GF_FieldInfo *info)
1192
0
{
1193
0
  switch (info->fieldIndex) {
1194
0
  case 0:
1195
0
    info->name = "radius";
1196
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1197
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
1198
0
    info->far_ptr = & ((X_Circle2D *) node)->radius;
1199
0
    return GF_OK;
1200
0
  case 1:
1201
0
    info->name = "metadata";
1202
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1203
0
    info->fieldType = GF_SG_VRML_SFNODE;
1204
0
    info->NDTtype = NDT_SFMetadataNode;
1205
0
    info->far_ptr = & ((X_Circle2D *)node)->metadata;
1206
0
    return GF_OK;
1207
0
  default:
1208
0
    return GF_BAD_PARAM;
1209
0
  }
1210
0
}
1211
1212
1213
static s32 Circle2D_get_field_index_by_name(char *name)
1214
0
{
1215
0
  if (!strcmp("radius", name)) return 0;
1216
0
  if (!strcmp("metadata", name)) return 1;
1217
0
  return -1;
1218
0
}
1219
1220
1221
static GF_Node *Circle2D_Create()
1222
0
{
1223
0
  X_Circle2D *p;
1224
0
  GF_SAFEALLOC(p, X_Circle2D);
1225
0
  if(!p) return NULL;
1226
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Circle2D);
1227
1228
  /*default field values*/
1229
0
  p->radius = FLT2FIX(1);
1230
0
  return (GF_Node *)p;
1231
0
}
1232
1233
1234
/*
1235
  Collision Node deletion
1236
*/
1237
1238
static void Collision_Del(GF_Node *node)
1239
0
{
1240
0
  X_Collision *p = (X_Collision *) node;
1241
0
  gf_node_unregister((GF_Node *) p->proxy, node);
1242
0
  gf_node_unregister((GF_Node *) p->metadata, node);
1243
0
  gf_sg_vrml_parent_destroy(node);
1244
0
  gf_node_free((GF_Node *)p);
1245
0
}
1246
1247
1248
static u32 Collision_get_field_count(GF_Node *node, u8 dummy)
1249
0
{
1250
0
  return 8;
1251
0
}
1252
1253
static GF_Err Collision_get_field(GF_Node *node, GF_FieldInfo *info)
1254
0
{
1255
0
  switch (info->fieldIndex) {
1256
0
  case 0:
1257
0
    info->name = "addChildren";
1258
0
    info->eventType = GF_SG_EVENT_IN;
1259
0
    info->on_event_in = ((X_Collision *)node)->on_addChildren;
1260
0
    info->fieldType = GF_SG_VRML_MFNODE;
1261
0
    info->NDTtype = NDT_SF3DNode;
1262
0
    info->far_ptr = & ((X_Collision *)node)->addChildren;
1263
0
    return GF_OK;
1264
0
  case 1:
1265
0
    info->name = "removeChildren";
1266
0
    info->eventType = GF_SG_EVENT_IN;
1267
0
    info->on_event_in = ((X_Collision *)node)->on_removeChildren;
1268
0
    info->fieldType = GF_SG_VRML_MFNODE;
1269
0
    info->NDTtype = NDT_SF3DNode;
1270
0
    info->far_ptr = & ((X_Collision *)node)->removeChildren;
1271
0
    return GF_OK;
1272
0
  case 2:
1273
0
    info->name = "children";
1274
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1275
0
    info->fieldType = GF_SG_VRML_MFNODE;
1276
0
    info->NDTtype = NDT_SF3DNode;
1277
0
    info->far_ptr = & ((X_Collision *)node)->children;
1278
0
    return GF_OK;
1279
0
  case 3:
1280
0
    info->name = "enabled";
1281
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1282
0
    info->fieldType = GF_SG_VRML_SFBOOL;
1283
0
    info->far_ptr = & ((X_Collision *) node)->enabled;
1284
0
    return GF_OK;
1285
0
  case 4:
1286
0
    info->name = "proxy";
1287
0
    info->eventType = GF_SG_EVENT_FIELD;
1288
0
    info->fieldType = GF_SG_VRML_SFNODE;
1289
0
    info->NDTtype = NDT_SF3DNode;
1290
0
    info->far_ptr = & ((X_Collision *)node)->proxy;
1291
0
    return GF_OK;
1292
0
  case 5:
1293
0
    info->name = "collideTime";
1294
0
    info->eventType = GF_SG_EVENT_OUT;
1295
0
    info->fieldType = GF_SG_VRML_SFTIME;
1296
0
    info->far_ptr = & ((X_Collision *) node)->collideTime;
1297
0
    return GF_OK;
1298
0
  case 6:
1299
0
    info->name = "isActive";
1300
0
    info->eventType = GF_SG_EVENT_OUT;
1301
0
    info->fieldType = GF_SG_VRML_SFBOOL;
1302
0
    info->far_ptr = & ((X_Collision *) node)->isActive;
1303
0
    return GF_OK;
1304
0
  case 7:
1305
0
    info->name = "metadata";
1306
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1307
0
    info->fieldType = GF_SG_VRML_SFNODE;
1308
0
    info->NDTtype = NDT_SFMetadataNode;
1309
0
    info->far_ptr = & ((X_Collision *)node)->metadata;
1310
0
    return GF_OK;
1311
0
  default:
1312
0
    return GF_BAD_PARAM;
1313
0
  }
1314
0
}
1315
1316
1317
static s32 Collision_get_field_index_by_name(char *name)
1318
0
{
1319
0
  if (!strcmp("addChildren", name)) return 0;
1320
0
  if (!strcmp("removeChildren", name)) return 1;
1321
0
  if (!strcmp("children", name)) return 2;
1322
0
  if (!strcmp("enabled", name)) return 3;
1323
0
  if (!strcmp("proxy", name)) return 4;
1324
0
  if (!strcmp("collideTime", name)) return 5;
1325
0
  if (!strcmp("isActive", name)) return 6;
1326
0
  if (!strcmp("metadata", name)) return 7;
1327
0
  return -1;
1328
0
}
1329
1330
1331
static GF_Node *Collision_Create()
1332
0
{
1333
0
  X_Collision *p;
1334
0
  GF_SAFEALLOC(p, X_Collision);
1335
0
  if(!p) return NULL;
1336
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Collision);
1337
0
  gf_sg_vrml_parent_setup((GF_Node *) p);
1338
1339
  /*default field values*/
1340
0
  p->enabled = 1;
1341
0
  return (GF_Node *)p;
1342
0
}
1343
1344
1345
/*
1346
  Color Node deletion
1347
*/
1348
1349
static void Color_Del(GF_Node *node)
1350
0
{
1351
0
  X_Color *p = (X_Color *) node;
1352
0
  gf_sg_mfcolor_del(p->color);
1353
0
  gf_node_unregister((GF_Node *) p->metadata, node);
1354
0
  gf_node_free((GF_Node *)p);
1355
0
}
1356
1357
1358
static u32 Color_get_field_count(GF_Node *node, u8 dummy)
1359
0
{
1360
0
  return 2;
1361
0
}
1362
1363
static GF_Err Color_get_field(GF_Node *node, GF_FieldInfo *info)
1364
0
{
1365
0
  switch (info->fieldIndex) {
1366
0
  case 0:
1367
0
    info->name = "color";
1368
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1369
0
    info->fieldType = GF_SG_VRML_MFCOLOR;
1370
0
    info->far_ptr = & ((X_Color *) node)->color;
1371
0
    return GF_OK;
1372
0
  case 1:
1373
0
    info->name = "metadata";
1374
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1375
0
    info->fieldType = GF_SG_VRML_SFNODE;
1376
0
    info->NDTtype = NDT_SFMetadataNode;
1377
0
    info->far_ptr = & ((X_Color *)node)->metadata;
1378
0
    return GF_OK;
1379
0
  default:
1380
0
    return GF_BAD_PARAM;
1381
0
  }
1382
0
}
1383
1384
1385
static s32 Color_get_field_index_by_name(char *name)
1386
0
{
1387
0
  if (!strcmp("color", name)) return 0;
1388
0
  if (!strcmp("metadata", name)) return 1;
1389
0
  return -1;
1390
0
}
1391
1392
1393
static GF_Node *Color_Create()
1394
0
{
1395
0
  X_Color *p;
1396
0
  GF_SAFEALLOC(p, X_Color);
1397
0
  if(!p) return NULL;
1398
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Color);
1399
1400
  /*default field values*/
1401
0
  return (GF_Node *)p;
1402
0
}
1403
1404
1405
/*
1406
  ColorInterpolator Node deletion
1407
*/
1408
1409
static void ColorInterpolator_Del(GF_Node *node)
1410
0
{
1411
0
  X_ColorInterpolator *p = (X_ColorInterpolator *) node;
1412
0
  gf_sg_mffloat_del(p->key);
1413
0
  gf_sg_mfcolor_del(p->keyValue);
1414
0
  gf_node_unregister((GF_Node *) p->metadata, node);
1415
0
  gf_node_free((GF_Node *)p);
1416
0
}
1417
1418
1419
static u32 ColorInterpolator_get_field_count(GF_Node *node, u8 dummy)
1420
0
{
1421
0
  return 5;
1422
0
}
1423
1424
static GF_Err ColorInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
1425
0
{
1426
0
  switch (info->fieldIndex) {
1427
0
  case 0:
1428
0
    info->name = "set_fraction";
1429
0
    info->eventType = GF_SG_EVENT_IN;
1430
0
    info->on_event_in = ((X_ColorInterpolator *)node)->on_set_fraction;
1431
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
1432
0
    info->far_ptr = & ((X_ColorInterpolator *) node)->set_fraction;
1433
0
    return GF_OK;
1434
0
  case 1:
1435
0
    info->name = "key";
1436
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1437
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
1438
0
    info->far_ptr = & ((X_ColorInterpolator *) node)->key;
1439
0
    return GF_OK;
1440
0
  case 2:
1441
0
    info->name = "keyValue";
1442
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1443
0
    info->fieldType = GF_SG_VRML_MFCOLOR;
1444
0
    info->far_ptr = & ((X_ColorInterpolator *) node)->keyValue;
1445
0
    return GF_OK;
1446
0
  case 3:
1447
0
    info->name = "value_changed";
1448
0
    info->eventType = GF_SG_EVENT_OUT;
1449
0
    info->fieldType = GF_SG_VRML_SFCOLOR;
1450
0
    info->far_ptr = & ((X_ColorInterpolator *) node)->value_changed;
1451
0
    return GF_OK;
1452
0
  case 4:
1453
0
    info->name = "metadata";
1454
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1455
0
    info->fieldType = GF_SG_VRML_SFNODE;
1456
0
    info->NDTtype = NDT_SFMetadataNode;
1457
0
    info->far_ptr = & ((X_ColorInterpolator *)node)->metadata;
1458
0
    return GF_OK;
1459
0
  default:
1460
0
    return GF_BAD_PARAM;
1461
0
  }
1462
0
}
1463
1464
1465
static s32 ColorInterpolator_get_field_index_by_name(char *name)
1466
0
{
1467
0
  if (!strcmp("set_fraction", name)) return 0;
1468
0
  if (!strcmp("key", name)) return 1;
1469
0
  if (!strcmp("keyValue", name)) return 2;
1470
0
  if (!strcmp("value_changed", name)) return 3;
1471
0
  if (!strcmp("metadata", name)) return 4;
1472
0
  return -1;
1473
0
}
1474
1475
1476
static GF_Node *ColorInterpolator_Create()
1477
0
{
1478
0
  X_ColorInterpolator *p;
1479
0
  GF_SAFEALLOC(p, X_ColorInterpolator);
1480
0
  if(!p) return NULL;
1481
0
  gf_node_setup((GF_Node *)p, TAG_X3D_ColorInterpolator);
1482
1483
  /*default field values*/
1484
0
  return (GF_Node *)p;
1485
0
}
1486
1487
1488
/*
1489
  ColorRGBA Node deletion
1490
*/
1491
1492
static void ColorRGBA_Del(GF_Node *node)
1493
0
{
1494
0
  X_ColorRGBA *p = (X_ColorRGBA *) node;
1495
0
  gf_sg_mfcolorrgba_del(p->color);
1496
0
  gf_node_unregister((GF_Node *) p->metadata, node);
1497
0
  gf_node_free((GF_Node *)p);
1498
0
}
1499
1500
1501
static u32 ColorRGBA_get_field_count(GF_Node *node, u8 dummy)
1502
0
{
1503
0
  return 2;
1504
0
}
1505
1506
static GF_Err ColorRGBA_get_field(GF_Node *node, GF_FieldInfo *info)
1507
0
{
1508
0
  switch (info->fieldIndex) {
1509
0
  case 0:
1510
0
    info->name = "color";
1511
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1512
0
    info->fieldType = GF_SG_VRML_MFCOLORRGBA;
1513
0
    info->far_ptr = & ((X_ColorRGBA *) node)->color;
1514
0
    return GF_OK;
1515
0
  case 1:
1516
0
    info->name = "metadata";
1517
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1518
0
    info->fieldType = GF_SG_VRML_SFNODE;
1519
0
    info->NDTtype = NDT_SFMetadataNode;
1520
0
    info->far_ptr = & ((X_ColorRGBA *)node)->metadata;
1521
0
    return GF_OK;
1522
0
  default:
1523
0
    return GF_BAD_PARAM;
1524
0
  }
1525
0
}
1526
1527
1528
static s32 ColorRGBA_get_field_index_by_name(char *name)
1529
0
{
1530
0
  if (!strcmp("color", name)) return 0;
1531
0
  if (!strcmp("metadata", name)) return 1;
1532
0
  return -1;
1533
0
}
1534
1535
1536
static GF_Node *ColorRGBA_Create()
1537
0
{
1538
0
  X_ColorRGBA *p;
1539
0
  GF_SAFEALLOC(p, X_ColorRGBA);
1540
0
  if(!p) return NULL;
1541
0
  gf_node_setup((GF_Node *)p, TAG_X3D_ColorRGBA);
1542
1543
  /*default field values*/
1544
0
  return (GF_Node *)p;
1545
0
}
1546
1547
1548
/*
1549
  Cone Node deletion
1550
*/
1551
1552
static void Cone_Del(GF_Node *node)
1553
0
{
1554
0
  X_Cone *p = (X_Cone *) node;
1555
0
  gf_node_unregister((GF_Node *) p->metadata, node);
1556
0
  gf_node_free((GF_Node *)p);
1557
0
}
1558
1559
1560
static u32 Cone_get_field_count(GF_Node *node, u8 dummy)
1561
0
{
1562
0
  return 5;
1563
0
}
1564
1565
static GF_Err Cone_get_field(GF_Node *node, GF_FieldInfo *info)
1566
0
{
1567
0
  switch (info->fieldIndex) {
1568
0
  case 0:
1569
0
    info->name = "bottomRadius";
1570
0
    info->eventType = GF_SG_EVENT_FIELD;
1571
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
1572
0
    info->far_ptr = & ((X_Cone *) node)->bottomRadius;
1573
0
    return GF_OK;
1574
0
  case 1:
1575
0
    info->name = "height";
1576
0
    info->eventType = GF_SG_EVENT_FIELD;
1577
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
1578
0
    info->far_ptr = & ((X_Cone *) node)->height;
1579
0
    return GF_OK;
1580
0
  case 2:
1581
0
    info->name = "side";
1582
0
    info->eventType = GF_SG_EVENT_FIELD;
1583
0
    info->fieldType = GF_SG_VRML_SFBOOL;
1584
0
    info->far_ptr = & ((X_Cone *) node)->side;
1585
0
    return GF_OK;
1586
0
  case 3:
1587
0
    info->name = "bottom";
1588
0
    info->eventType = GF_SG_EVENT_FIELD;
1589
0
    info->fieldType = GF_SG_VRML_SFBOOL;
1590
0
    info->far_ptr = & ((X_Cone *) node)->bottom;
1591
0
    return GF_OK;
1592
0
  case 4:
1593
0
    info->name = "metadata";
1594
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1595
0
    info->fieldType = GF_SG_VRML_SFNODE;
1596
0
    info->NDTtype = NDT_SFMetadataNode;
1597
0
    info->far_ptr = & ((X_Cone *)node)->metadata;
1598
0
    return GF_OK;
1599
0
  default:
1600
0
    return GF_BAD_PARAM;
1601
0
  }
1602
0
}
1603
1604
1605
static s32 Cone_get_field_index_by_name(char *name)
1606
0
{
1607
0
  if (!strcmp("bottomRadius", name)) return 0;
1608
0
  if (!strcmp("height", name)) return 1;
1609
0
  if (!strcmp("side", name)) return 2;
1610
0
  if (!strcmp("bottom", name)) return 3;
1611
0
  if (!strcmp("metadata", name)) return 4;
1612
0
  return -1;
1613
0
}
1614
1615
1616
static GF_Node *Cone_Create()
1617
0
{
1618
0
  X_Cone *p;
1619
0
  GF_SAFEALLOC(p, X_Cone);
1620
0
  if(!p) return NULL;
1621
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Cone);
1622
1623
  /*default field values*/
1624
0
  p->bottomRadius = FLT2FIX(1);
1625
0
  p->height = FLT2FIX(2);
1626
0
  p->side = 1;
1627
0
  p->bottom = 1;
1628
0
  return (GF_Node *)p;
1629
0
}
1630
1631
1632
/*
1633
  Contour2D Node deletion
1634
*/
1635
1636
static void Contour2D_Del(GF_Node *node)
1637
0
{
1638
0
  X_Contour2D *p = (X_Contour2D *) node;
1639
0
  gf_node_unregister((GF_Node *) p->metadata, node);
1640
0
  gf_sg_vrml_parent_destroy(node);
1641
0
  gf_node_free((GF_Node *)p);
1642
0
}
1643
1644
1645
static u32 Contour2D_get_field_count(GF_Node *node, u8 dummy)
1646
0
{
1647
0
  return 4;
1648
0
}
1649
1650
static GF_Err Contour2D_get_field(GF_Node *node, GF_FieldInfo *info)
1651
0
{
1652
0
  switch (info->fieldIndex) {
1653
0
  case 0:
1654
0
    info->name = "addChildren";
1655
0
    info->eventType = GF_SG_EVENT_IN;
1656
0
    info->on_event_in = ((X_Contour2D *)node)->on_addChildren;
1657
0
    info->fieldType = GF_SG_VRML_MFNODE;
1658
0
    info->NDTtype = NDT_SFNurbsControlCurveNode;
1659
0
    info->far_ptr = & ((X_Contour2D *)node)->addChildren;
1660
0
    return GF_OK;
1661
0
  case 1:
1662
0
    info->name = "removeChildren";
1663
0
    info->eventType = GF_SG_EVENT_IN;
1664
0
    info->on_event_in = ((X_Contour2D *)node)->on_removeChildren;
1665
0
    info->fieldType = GF_SG_VRML_MFNODE;
1666
0
    info->NDTtype = NDT_SFNurbsControlCurveNode;
1667
0
    info->far_ptr = & ((X_Contour2D *)node)->removeChildren;
1668
0
    return GF_OK;
1669
0
  case 2:
1670
0
    info->name = "children";
1671
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1672
0
    info->fieldType = GF_SG_VRML_MFNODE;
1673
0
    info->NDTtype = NDT_SFNurbsControlCurveNode;
1674
0
    info->far_ptr = & ((X_Contour2D *)node)->children;
1675
0
    return GF_OK;
1676
0
  case 3:
1677
0
    info->name = "metadata";
1678
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1679
0
    info->fieldType = GF_SG_VRML_SFNODE;
1680
0
    info->NDTtype = NDT_SFMetadataNode;
1681
0
    info->far_ptr = & ((X_Contour2D *)node)->metadata;
1682
0
    return GF_OK;
1683
0
  default:
1684
0
    return GF_BAD_PARAM;
1685
0
  }
1686
0
}
1687
1688
1689
static s32 Contour2D_get_field_index_by_name(char *name)
1690
0
{
1691
0
  if (!strcmp("addChildren", name)) return 0;
1692
0
  if (!strcmp("removeChildren", name)) return 1;
1693
0
  if (!strcmp("children", name)) return 2;
1694
0
  if (!strcmp("metadata", name)) return 3;
1695
0
  return -1;
1696
0
}
1697
1698
1699
static GF_Node *Contour2D_Create()
1700
0
{
1701
0
  X_Contour2D *p;
1702
0
  GF_SAFEALLOC(p, X_Contour2D);
1703
0
  if(!p) return NULL;
1704
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Contour2D);
1705
0
  gf_sg_vrml_parent_setup((GF_Node *) p);
1706
1707
  /*default field values*/
1708
0
  return (GF_Node *)p;
1709
0
}
1710
1711
1712
/*
1713
  ContourPolyline2D Node deletion
1714
*/
1715
1716
static void ContourPolyline2D_Del(GF_Node *node)
1717
0
{
1718
0
  X_ContourPolyline2D *p = (X_ContourPolyline2D *) node;
1719
0
  gf_sg_mfvec2f_del(p->point);
1720
0
  gf_node_unregister((GF_Node *) p->metadata, node);
1721
0
  gf_node_free((GF_Node *)p);
1722
0
}
1723
1724
1725
static u32 ContourPolyline2D_get_field_count(GF_Node *node, u8 dummy)
1726
0
{
1727
0
  return 2;
1728
0
}
1729
1730
static GF_Err ContourPolyline2D_get_field(GF_Node *node, GF_FieldInfo *info)
1731
0
{
1732
0
  switch (info->fieldIndex) {
1733
0
  case 0:
1734
0
    info->name = "point";
1735
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1736
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
1737
0
    info->far_ptr = & ((X_ContourPolyline2D *) node)->point;
1738
0
    return GF_OK;
1739
0
  case 1:
1740
0
    info->name = "metadata";
1741
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1742
0
    info->fieldType = GF_SG_VRML_SFNODE;
1743
0
    info->NDTtype = NDT_SFMetadataNode;
1744
0
    info->far_ptr = & ((X_ContourPolyline2D *)node)->metadata;
1745
0
    return GF_OK;
1746
0
  default:
1747
0
    return GF_BAD_PARAM;
1748
0
  }
1749
0
}
1750
1751
1752
static s32 ContourPolyline2D_get_field_index_by_name(char *name)
1753
0
{
1754
0
  if (!strcmp("point", name)) return 0;
1755
0
  if (!strcmp("metadata", name)) return 1;
1756
0
  return -1;
1757
0
}
1758
1759
1760
static GF_Node *ContourPolyline2D_Create()
1761
0
{
1762
0
  X_ContourPolyline2D *p;
1763
0
  GF_SAFEALLOC(p, X_ContourPolyline2D);
1764
0
  if(!p) return NULL;
1765
0
  gf_node_setup((GF_Node *)p, TAG_X3D_ContourPolyline2D);
1766
1767
  /*default field values*/
1768
0
  return (GF_Node *)p;
1769
0
}
1770
1771
1772
/*
1773
  Coordinate Node deletion
1774
*/
1775
1776
static void Coordinate_Del(GF_Node *node)
1777
0
{
1778
0
  X_Coordinate *p = (X_Coordinate *) node;
1779
0
  gf_sg_mfvec3f_del(p->point);
1780
0
  gf_node_unregister((GF_Node *) p->metadata, node);
1781
0
  gf_node_free((GF_Node *)p);
1782
0
}
1783
1784
1785
static u32 Coordinate_get_field_count(GF_Node *node, u8 dummy)
1786
0
{
1787
0
  return 2;
1788
0
}
1789
1790
static GF_Err Coordinate_get_field(GF_Node *node, GF_FieldInfo *info)
1791
0
{
1792
0
  switch (info->fieldIndex) {
1793
0
  case 0:
1794
0
    info->name = "point";
1795
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1796
0
    info->fieldType = GF_SG_VRML_MFVEC3F;
1797
0
    info->far_ptr = & ((X_Coordinate *) node)->point;
1798
0
    return GF_OK;
1799
0
  case 1:
1800
0
    info->name = "metadata";
1801
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1802
0
    info->fieldType = GF_SG_VRML_SFNODE;
1803
0
    info->NDTtype = NDT_SFMetadataNode;
1804
0
    info->far_ptr = & ((X_Coordinate *)node)->metadata;
1805
0
    return GF_OK;
1806
0
  default:
1807
0
    return GF_BAD_PARAM;
1808
0
  }
1809
0
}
1810
1811
1812
static s32 Coordinate_get_field_index_by_name(char *name)
1813
0
{
1814
0
  if (!strcmp("point", name)) return 0;
1815
0
  if (!strcmp("metadata", name)) return 1;
1816
0
  return -1;
1817
0
}
1818
1819
1820
static GF_Node *Coordinate_Create()
1821
0
{
1822
0
  X_Coordinate *p;
1823
0
  GF_SAFEALLOC(p, X_Coordinate);
1824
0
  if(!p) return NULL;
1825
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Coordinate);
1826
1827
  /*default field values*/
1828
0
  return (GF_Node *)p;
1829
0
}
1830
1831
1832
/*
1833
  CoordinateDouble Node deletion
1834
*/
1835
1836
static void CoordinateDouble_Del(GF_Node *node)
1837
0
{
1838
0
  X_CoordinateDouble *p = (X_CoordinateDouble *) node;
1839
0
  gf_sg_mfvec3d_del(p->point);
1840
0
  gf_node_unregister((GF_Node *) p->metadata, node);
1841
0
  gf_node_free((GF_Node *)p);
1842
0
}
1843
1844
1845
static u32 CoordinateDouble_get_field_count(GF_Node *node, u8 dummy)
1846
0
{
1847
0
  return 2;
1848
0
}
1849
1850
static GF_Err CoordinateDouble_get_field(GF_Node *node, GF_FieldInfo *info)
1851
0
{
1852
0
  switch (info->fieldIndex) {
1853
0
  case 0:
1854
0
    info->name = "point";
1855
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1856
0
    info->fieldType = GF_SG_VRML_MFVEC3D;
1857
0
    info->far_ptr = & ((X_CoordinateDouble *) node)->point;
1858
0
    return GF_OK;
1859
0
  case 1:
1860
0
    info->name = "metadata";
1861
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1862
0
    info->fieldType = GF_SG_VRML_SFNODE;
1863
0
    info->NDTtype = NDT_SFMetadataNode;
1864
0
    info->far_ptr = & ((X_CoordinateDouble *)node)->metadata;
1865
0
    return GF_OK;
1866
0
  default:
1867
0
    return GF_BAD_PARAM;
1868
0
  }
1869
0
}
1870
1871
1872
static s32 CoordinateDouble_get_field_index_by_name(char *name)
1873
0
{
1874
0
  if (!strcmp("point", name)) return 0;
1875
0
  if (!strcmp("metadata", name)) return 1;
1876
0
  return -1;
1877
0
}
1878
1879
1880
static GF_Node *CoordinateDouble_Create()
1881
0
{
1882
0
  X_CoordinateDouble *p;
1883
0
  GF_SAFEALLOC(p, X_CoordinateDouble);
1884
0
  if(!p) return NULL;
1885
0
  gf_node_setup((GF_Node *)p, TAG_X3D_CoordinateDouble);
1886
1887
  /*default field values*/
1888
0
  return (GF_Node *)p;
1889
0
}
1890
1891
1892
/*
1893
  Coordinate2D Node deletion
1894
*/
1895
1896
static void Coordinate2D_Del(GF_Node *node)
1897
0
{
1898
0
  X_Coordinate2D *p = (X_Coordinate2D *) node;
1899
0
  gf_sg_mfvec2f_del(p->point);
1900
0
  gf_node_unregister((GF_Node *) p->metadata, node);
1901
0
  gf_node_free((GF_Node *)p);
1902
0
}
1903
1904
1905
static u32 Coordinate2D_get_field_count(GF_Node *node, u8 dummy)
1906
0
{
1907
0
  return 2;
1908
0
}
1909
1910
static GF_Err Coordinate2D_get_field(GF_Node *node, GF_FieldInfo *info)
1911
0
{
1912
0
  switch (info->fieldIndex) {
1913
0
  case 0:
1914
0
    info->name = "point";
1915
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1916
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
1917
0
    info->far_ptr = & ((X_Coordinate2D *) node)->point;
1918
0
    return GF_OK;
1919
0
  case 1:
1920
0
    info->name = "metadata";
1921
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1922
0
    info->fieldType = GF_SG_VRML_SFNODE;
1923
0
    info->NDTtype = NDT_SFMetadataNode;
1924
0
    info->far_ptr = & ((X_Coordinate2D *)node)->metadata;
1925
0
    return GF_OK;
1926
0
  default:
1927
0
    return GF_BAD_PARAM;
1928
0
  }
1929
0
}
1930
1931
1932
static s32 Coordinate2D_get_field_index_by_name(char *name)
1933
0
{
1934
0
  if (!strcmp("point", name)) return 0;
1935
0
  if (!strcmp("metadata", name)) return 1;
1936
0
  return -1;
1937
0
}
1938
1939
1940
static GF_Node *Coordinate2D_Create()
1941
0
{
1942
0
  X_Coordinate2D *p;
1943
0
  GF_SAFEALLOC(p, X_Coordinate2D);
1944
0
  if(!p) return NULL;
1945
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Coordinate2D);
1946
1947
  /*default field values*/
1948
0
  return (GF_Node *)p;
1949
0
}
1950
1951
1952
/*
1953
  CoordinateInterpolator Node deletion
1954
*/
1955
1956
static void CoordinateInterpolator_Del(GF_Node *node)
1957
0
{
1958
0
  X_CoordinateInterpolator *p = (X_CoordinateInterpolator *) node;
1959
0
  gf_sg_mffloat_del(p->key);
1960
0
  gf_sg_mfvec3f_del(p->keyValue);
1961
0
  gf_sg_mfvec3f_del(p->value_changed);
1962
0
  gf_node_unregister((GF_Node *) p->metadata, node);
1963
0
  gf_node_free((GF_Node *)p);
1964
0
}
1965
1966
1967
static u32 CoordinateInterpolator_get_field_count(GF_Node *node, u8 dummy)
1968
0
{
1969
0
  return 5;
1970
0
}
1971
1972
static GF_Err CoordinateInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
1973
0
{
1974
0
  switch (info->fieldIndex) {
1975
0
  case 0:
1976
0
    info->name = "set_fraction";
1977
0
    info->eventType = GF_SG_EVENT_IN;
1978
0
    info->on_event_in = ((X_CoordinateInterpolator *)node)->on_set_fraction;
1979
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
1980
0
    info->far_ptr = & ((X_CoordinateInterpolator *) node)->set_fraction;
1981
0
    return GF_OK;
1982
0
  case 1:
1983
0
    info->name = "key";
1984
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1985
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
1986
0
    info->far_ptr = & ((X_CoordinateInterpolator *) node)->key;
1987
0
    return GF_OK;
1988
0
  case 2:
1989
0
    info->name = "keyValue";
1990
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
1991
0
    info->fieldType = GF_SG_VRML_MFVEC3F;
1992
0
    info->far_ptr = & ((X_CoordinateInterpolator *) node)->keyValue;
1993
0
    return GF_OK;
1994
0
  case 3:
1995
0
    info->name = "value_changed";
1996
0
    info->eventType = GF_SG_EVENT_OUT;
1997
0
    info->fieldType = GF_SG_VRML_MFVEC3F;
1998
0
    info->far_ptr = & ((X_CoordinateInterpolator *) node)->value_changed;
1999
0
    return GF_OK;
2000
0
  case 4:
2001
0
    info->name = "metadata";
2002
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2003
0
    info->fieldType = GF_SG_VRML_SFNODE;
2004
0
    info->NDTtype = NDT_SFMetadataNode;
2005
0
    info->far_ptr = & ((X_CoordinateInterpolator *)node)->metadata;
2006
0
    return GF_OK;
2007
0
  default:
2008
0
    return GF_BAD_PARAM;
2009
0
  }
2010
0
}
2011
2012
2013
static s32 CoordinateInterpolator_get_field_index_by_name(char *name)
2014
0
{
2015
0
  if (!strcmp("set_fraction", name)) return 0;
2016
0
  if (!strcmp("key", name)) return 1;
2017
0
  if (!strcmp("keyValue", name)) return 2;
2018
0
  if (!strcmp("value_changed", name)) return 3;
2019
0
  if (!strcmp("metadata", name)) return 4;
2020
0
  return -1;
2021
0
}
2022
2023
2024
static GF_Node *CoordinateInterpolator_Create()
2025
0
{
2026
0
  X_CoordinateInterpolator *p;
2027
0
  GF_SAFEALLOC(p, X_CoordinateInterpolator);
2028
0
  if(!p) return NULL;
2029
0
  gf_node_setup((GF_Node *)p, TAG_X3D_CoordinateInterpolator);
2030
2031
  /*default field values*/
2032
0
  return (GF_Node *)p;
2033
0
}
2034
2035
2036
/*
2037
  CoordinateInterpolator2D Node deletion
2038
*/
2039
2040
static void CoordinateInterpolator2D_Del(GF_Node *node)
2041
0
{
2042
0
  X_CoordinateInterpolator2D *p = (X_CoordinateInterpolator2D *) node;
2043
0
  gf_sg_mffloat_del(p->key);
2044
0
  gf_sg_mfvec2f_del(p->keyValue);
2045
0
  gf_sg_mfvec2f_del(p->value_changed);
2046
0
  gf_node_unregister((GF_Node *) p->metadata, node);
2047
0
  gf_node_free((GF_Node *)p);
2048
0
}
2049
2050
2051
static u32 CoordinateInterpolator2D_get_field_count(GF_Node *node, u8 dummy)
2052
0
{
2053
0
  return 5;
2054
0
}
2055
2056
static GF_Err CoordinateInterpolator2D_get_field(GF_Node *node, GF_FieldInfo *info)
2057
0
{
2058
0
  switch (info->fieldIndex) {
2059
0
  case 0:
2060
0
    info->name = "set_fraction";
2061
0
    info->eventType = GF_SG_EVENT_IN;
2062
0
    info->on_event_in = ((X_CoordinateInterpolator2D *)node)->on_set_fraction;
2063
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2064
0
    info->far_ptr = & ((X_CoordinateInterpolator2D *) node)->set_fraction;
2065
0
    return GF_OK;
2066
0
  case 1:
2067
0
    info->name = "key";
2068
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2069
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
2070
0
    info->far_ptr = & ((X_CoordinateInterpolator2D *) node)->key;
2071
0
    return GF_OK;
2072
0
  case 2:
2073
0
    info->name = "keyValue";
2074
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2075
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
2076
0
    info->far_ptr = & ((X_CoordinateInterpolator2D *) node)->keyValue;
2077
0
    return GF_OK;
2078
0
  case 3:
2079
0
    info->name = "value_changed";
2080
0
    info->eventType = GF_SG_EVENT_OUT;
2081
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
2082
0
    info->far_ptr = & ((X_CoordinateInterpolator2D *) node)->value_changed;
2083
0
    return GF_OK;
2084
0
  case 4:
2085
0
    info->name = "metadata";
2086
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2087
0
    info->fieldType = GF_SG_VRML_SFNODE;
2088
0
    info->NDTtype = NDT_SFMetadataNode;
2089
0
    info->far_ptr = & ((X_CoordinateInterpolator2D *)node)->metadata;
2090
0
    return GF_OK;
2091
0
  default:
2092
0
    return GF_BAD_PARAM;
2093
0
  }
2094
0
}
2095
2096
2097
static s32 CoordinateInterpolator2D_get_field_index_by_name(char *name)
2098
0
{
2099
0
  if (!strcmp("set_fraction", name)) return 0;
2100
0
  if (!strcmp("key", name)) return 1;
2101
0
  if (!strcmp("keyValue", name)) return 2;
2102
0
  if (!strcmp("value_changed", name)) return 3;
2103
0
  if (!strcmp("metadata", name)) return 4;
2104
0
  return -1;
2105
0
}
2106
2107
2108
static GF_Node *CoordinateInterpolator2D_Create()
2109
0
{
2110
0
  X_CoordinateInterpolator2D *p;
2111
0
  GF_SAFEALLOC(p, X_CoordinateInterpolator2D);
2112
0
  if(!p) return NULL;
2113
0
  gf_node_setup((GF_Node *)p, TAG_X3D_CoordinateInterpolator2D);
2114
2115
  /*default field values*/
2116
0
  return (GF_Node *)p;
2117
0
}
2118
2119
2120
/*
2121
  Cylinder Node deletion
2122
*/
2123
2124
static void Cylinder_Del(GF_Node *node)
2125
0
{
2126
0
  X_Cylinder *p = (X_Cylinder *) node;
2127
0
  gf_node_unregister((GF_Node *) p->metadata, node);
2128
0
  gf_node_free((GF_Node *)p);
2129
0
}
2130
2131
2132
static u32 Cylinder_get_field_count(GF_Node *node, u8 dummy)
2133
0
{
2134
0
  return 6;
2135
0
}
2136
2137
static GF_Err Cylinder_get_field(GF_Node *node, GF_FieldInfo *info)
2138
0
{
2139
0
  switch (info->fieldIndex) {
2140
0
  case 0:
2141
0
    info->name = "bottom";
2142
0
    info->eventType = GF_SG_EVENT_FIELD;
2143
0
    info->fieldType = GF_SG_VRML_SFBOOL;
2144
0
    info->far_ptr = & ((X_Cylinder *) node)->bottom;
2145
0
    return GF_OK;
2146
0
  case 1:
2147
0
    info->name = "height";
2148
0
    info->eventType = GF_SG_EVENT_FIELD;
2149
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2150
0
    info->far_ptr = & ((X_Cylinder *) node)->height;
2151
0
    return GF_OK;
2152
0
  case 2:
2153
0
    info->name = "radius";
2154
0
    info->eventType = GF_SG_EVENT_FIELD;
2155
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2156
0
    info->far_ptr = & ((X_Cylinder *) node)->radius;
2157
0
    return GF_OK;
2158
0
  case 3:
2159
0
    info->name = "side";
2160
0
    info->eventType = GF_SG_EVENT_FIELD;
2161
0
    info->fieldType = GF_SG_VRML_SFBOOL;
2162
0
    info->far_ptr = & ((X_Cylinder *) node)->side;
2163
0
    return GF_OK;
2164
0
  case 4:
2165
0
    info->name = "top";
2166
0
    info->eventType = GF_SG_EVENT_FIELD;
2167
0
    info->fieldType = GF_SG_VRML_SFBOOL;
2168
0
    info->far_ptr = & ((X_Cylinder *) node)->top;
2169
0
    return GF_OK;
2170
0
  case 5:
2171
0
    info->name = "metadata";
2172
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2173
0
    info->fieldType = GF_SG_VRML_SFNODE;
2174
0
    info->NDTtype = NDT_SFMetadataNode;
2175
0
    info->far_ptr = & ((X_Cylinder *)node)->metadata;
2176
0
    return GF_OK;
2177
0
  default:
2178
0
    return GF_BAD_PARAM;
2179
0
  }
2180
0
}
2181
2182
2183
static s32 Cylinder_get_field_index_by_name(char *name)
2184
0
{
2185
0
  if (!strcmp("bottom", name)) return 0;
2186
0
  if (!strcmp("height", name)) return 1;
2187
0
  if (!strcmp("radius", name)) return 2;
2188
0
  if (!strcmp("side", name)) return 3;
2189
0
  if (!strcmp("top", name)) return 4;
2190
0
  if (!strcmp("metadata", name)) return 5;
2191
0
  return -1;
2192
0
}
2193
2194
2195
static GF_Node *Cylinder_Create()
2196
0
{
2197
0
  X_Cylinder *p;
2198
0
  GF_SAFEALLOC(p, X_Cylinder);
2199
0
  if(!p) return NULL;
2200
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Cylinder);
2201
2202
  /*default field values*/
2203
0
  p->bottom = 1;
2204
0
  p->height = FLT2FIX(2);
2205
0
  p->radius = FLT2FIX(1);
2206
0
  p->side = 1;
2207
0
  p->top = 1;
2208
0
  return (GF_Node *)p;
2209
0
}
2210
2211
2212
/*
2213
  CylinderSensor Node deletion
2214
*/
2215
2216
static void CylinderSensor_Del(GF_Node *node)
2217
0
{
2218
0
  X_CylinderSensor *p = (X_CylinderSensor *) node;
2219
0
  gf_node_unregister((GF_Node *) p->metadata, node);
2220
0
  gf_sg_sfstring_del(p->description);
2221
0
  gf_node_free((GF_Node *)p);
2222
0
}
2223
2224
2225
static u32 CylinderSensor_get_field_count(GF_Node *node, u8 dummy)
2226
0
{
2227
0
  return 12;
2228
0
}
2229
2230
static GF_Err CylinderSensor_get_field(GF_Node *node, GF_FieldInfo *info)
2231
0
{
2232
0
  switch (info->fieldIndex) {
2233
0
  case 0:
2234
0
    info->name = "autoOffset";
2235
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2236
0
    info->fieldType = GF_SG_VRML_SFBOOL;
2237
0
    info->far_ptr = & ((X_CylinderSensor *) node)->autoOffset;
2238
0
    return GF_OK;
2239
0
  case 1:
2240
0
    info->name = "diskAngle";
2241
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2242
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2243
0
    info->far_ptr = & ((X_CylinderSensor *) node)->diskAngle;
2244
0
    return GF_OK;
2245
0
  case 2:
2246
0
    info->name = "enabled";
2247
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2248
0
    info->fieldType = GF_SG_VRML_SFBOOL;
2249
0
    info->far_ptr = & ((X_CylinderSensor *) node)->enabled;
2250
0
    return GF_OK;
2251
0
  case 3:
2252
0
    info->name = "maxAngle";
2253
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2254
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2255
0
    info->far_ptr = & ((X_CylinderSensor *) node)->maxAngle;
2256
0
    return GF_OK;
2257
0
  case 4:
2258
0
    info->name = "minAngle";
2259
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2260
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2261
0
    info->far_ptr = & ((X_CylinderSensor *) node)->minAngle;
2262
0
    return GF_OK;
2263
0
  case 5:
2264
0
    info->name = "offset";
2265
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2266
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2267
0
    info->far_ptr = & ((X_CylinderSensor *) node)->offset;
2268
0
    return GF_OK;
2269
0
  case 6:
2270
0
    info->name = "isActive";
2271
0
    info->eventType = GF_SG_EVENT_OUT;
2272
0
    info->fieldType = GF_SG_VRML_SFBOOL;
2273
0
    info->far_ptr = & ((X_CylinderSensor *) node)->isActive;
2274
0
    return GF_OK;
2275
0
  case 7:
2276
0
    info->name = "rotation_changed";
2277
0
    info->eventType = GF_SG_EVENT_OUT;
2278
0
    info->fieldType = GF_SG_VRML_SFROTATION;
2279
0
    info->far_ptr = & ((X_CylinderSensor *) node)->rotation_changed;
2280
0
    return GF_OK;
2281
0
  case 8:
2282
0
    info->name = "trackPoint_changed";
2283
0
    info->eventType = GF_SG_EVENT_OUT;
2284
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
2285
0
    info->far_ptr = & ((X_CylinderSensor *) node)->trackPoint_changed;
2286
0
    return GF_OK;
2287
0
  case 9:
2288
0
    info->name = "metadata";
2289
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2290
0
    info->fieldType = GF_SG_VRML_SFNODE;
2291
0
    info->NDTtype = NDT_SFMetadataNode;
2292
0
    info->far_ptr = & ((X_CylinderSensor *)node)->metadata;
2293
0
    return GF_OK;
2294
0
  case 10:
2295
0
    info->name = "description";
2296
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2297
0
    info->fieldType = GF_SG_VRML_SFSTRING;
2298
0
    info->far_ptr = & ((X_CylinderSensor *) node)->description;
2299
0
    return GF_OK;
2300
0
  case 11:
2301
0
    info->name = "isOver";
2302
0
    info->eventType = GF_SG_EVENT_OUT;
2303
0
    info->fieldType = GF_SG_VRML_SFBOOL;
2304
0
    info->far_ptr = & ((X_CylinderSensor *) node)->isOver;
2305
0
    return GF_OK;
2306
0
  default:
2307
0
    return GF_BAD_PARAM;
2308
0
  }
2309
0
}
2310
2311
2312
static s32 CylinderSensor_get_field_index_by_name(char *name)
2313
0
{
2314
0
  if (!strcmp("autoOffset", name)) return 0;
2315
0
  if (!strcmp("diskAngle", name)) return 1;
2316
0
  if (!strcmp("enabled", name)) return 2;
2317
0
  if (!strcmp("maxAngle", name)) return 3;
2318
0
  if (!strcmp("minAngle", name)) return 4;
2319
0
  if (!strcmp("offset", name)) return 5;
2320
0
  if (!strcmp("isActive", name)) return 6;
2321
0
  if (!strcmp("rotation_changed", name)) return 7;
2322
0
  if (!strcmp("trackPoint_changed", name)) return 8;
2323
0
  if (!strcmp("metadata", name)) return 9;
2324
0
  if (!strcmp("description", name)) return 10;
2325
0
  if (!strcmp("isOver", name)) return 11;
2326
0
  return -1;
2327
0
}
2328
2329
2330
static GF_Node *CylinderSensor_Create()
2331
0
{
2332
0
  X_CylinderSensor *p;
2333
0
  GF_SAFEALLOC(p, X_CylinderSensor);
2334
0
  if(!p) return NULL;
2335
0
  gf_node_setup((GF_Node *)p, TAG_X3D_CylinderSensor);
2336
2337
  /*default field values*/
2338
0
  p->autoOffset = 1;
2339
0
  p->diskAngle = FLT2FIX(0.2617);
2340
0
  p->enabled = 1;
2341
0
  p->maxAngle = FLT2FIX(-1);
2342
0
  p->minAngle = FLT2FIX(0);
2343
0
  p->offset = FLT2FIX(0);
2344
0
  return (GF_Node *)p;
2345
0
}
2346
2347
2348
/*
2349
  DirectionalLight Node deletion
2350
*/
2351
2352
static void DirectionalLight_Del(GF_Node *node)
2353
0
{
2354
0
  X_DirectionalLight *p = (X_DirectionalLight *) node;
2355
0
  gf_node_unregister((GF_Node *) p->metadata, node);
2356
0
  gf_node_free((GF_Node *)p);
2357
0
}
2358
2359
2360
static u32 DirectionalLight_get_field_count(GF_Node *node, u8 dummy)
2361
0
{
2362
0
  return 6;
2363
0
}
2364
2365
static GF_Err DirectionalLight_get_field(GF_Node *node, GF_FieldInfo *info)
2366
0
{
2367
0
  switch (info->fieldIndex) {
2368
0
  case 0:
2369
0
    info->name = "ambientIntensity";
2370
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2371
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2372
0
    info->far_ptr = & ((X_DirectionalLight *) node)->ambientIntensity;
2373
0
    return GF_OK;
2374
0
  case 1:
2375
0
    info->name = "color";
2376
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2377
0
    info->fieldType = GF_SG_VRML_SFCOLOR;
2378
0
    info->far_ptr = & ((X_DirectionalLight *) node)->color;
2379
0
    return GF_OK;
2380
0
  case 2:
2381
0
    info->name = "direction";
2382
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2383
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
2384
0
    info->far_ptr = & ((X_DirectionalLight *) node)->direction;
2385
0
    return GF_OK;
2386
0
  case 3:
2387
0
    info->name = "intensity";
2388
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2389
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2390
0
    info->far_ptr = & ((X_DirectionalLight *) node)->intensity;
2391
0
    return GF_OK;
2392
0
  case 4:
2393
0
    info->name = "on";
2394
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2395
0
    info->fieldType = GF_SG_VRML_SFBOOL;
2396
0
    info->far_ptr = & ((X_DirectionalLight *) node)->on;
2397
0
    return GF_OK;
2398
0
  case 5:
2399
0
    info->name = "metadata";
2400
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2401
0
    info->fieldType = GF_SG_VRML_SFNODE;
2402
0
    info->NDTtype = NDT_SFMetadataNode;
2403
0
    info->far_ptr = & ((X_DirectionalLight *)node)->metadata;
2404
0
    return GF_OK;
2405
0
  default:
2406
0
    return GF_BAD_PARAM;
2407
0
  }
2408
0
}
2409
2410
2411
static s32 DirectionalLight_get_field_index_by_name(char *name)
2412
0
{
2413
0
  if (!strcmp("ambientIntensity", name)) return 0;
2414
0
  if (!strcmp("color", name)) return 1;
2415
0
  if (!strcmp("direction", name)) return 2;
2416
0
  if (!strcmp("intensity", name)) return 3;
2417
0
  if (!strcmp("on", name)) return 4;
2418
0
  if (!strcmp("metadata", name)) return 5;
2419
0
  return -1;
2420
0
}
2421
2422
2423
static GF_Node *DirectionalLight_Create()
2424
0
{
2425
0
  X_DirectionalLight *p;
2426
0
  GF_SAFEALLOC(p, X_DirectionalLight);
2427
0
  if(!p) return NULL;
2428
0
  gf_node_setup((GF_Node *)p, TAG_X3D_DirectionalLight);
2429
2430
  /*default field values*/
2431
0
  p->ambientIntensity = FLT2FIX(0);
2432
0
  p->color.red = FLT2FIX(1);
2433
0
  p->color.green = FLT2FIX(1);
2434
0
  p->color.blue = FLT2FIX(1);
2435
0
  p->direction.x = FLT2FIX(0);
2436
0
  p->direction.y = FLT2FIX(0);
2437
0
  p->direction.z = FLT2FIX(-1);
2438
0
  p->intensity = FLT2FIX(1);
2439
0
  p->on = 1;
2440
0
  return (GF_Node *)p;
2441
0
}
2442
2443
2444
/*
2445
  Disk2D Node deletion
2446
*/
2447
2448
static void Disk2D_Del(GF_Node *node)
2449
0
{
2450
0
  X_Disk2D *p = (X_Disk2D *) node;
2451
0
  gf_node_unregister((GF_Node *) p->metadata, node);
2452
0
  gf_node_free((GF_Node *)p);
2453
0
}
2454
2455
2456
static u32 Disk2D_get_field_count(GF_Node *node, u8 dummy)
2457
0
{
2458
0
  return 3;
2459
0
}
2460
2461
static GF_Err Disk2D_get_field(GF_Node *node, GF_FieldInfo *info)
2462
0
{
2463
0
  switch (info->fieldIndex) {
2464
0
  case 0:
2465
0
    info->name = "innerRadius";
2466
0
    info->eventType = GF_SG_EVENT_FIELD;
2467
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2468
0
    info->far_ptr = & ((X_Disk2D *) node)->innerRadius;
2469
0
    return GF_OK;
2470
0
  case 1:
2471
0
    info->name = "outerRadius";
2472
0
    info->eventType = GF_SG_EVENT_FIELD;
2473
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2474
0
    info->far_ptr = & ((X_Disk2D *) node)->outerRadius;
2475
0
    return GF_OK;
2476
0
  case 2:
2477
0
    info->name = "metadata";
2478
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2479
0
    info->fieldType = GF_SG_VRML_SFNODE;
2480
0
    info->NDTtype = NDT_SFMetadataNode;
2481
0
    info->far_ptr = & ((X_Disk2D *)node)->metadata;
2482
0
    return GF_OK;
2483
0
  default:
2484
0
    return GF_BAD_PARAM;
2485
0
  }
2486
0
}
2487
2488
2489
static s32 Disk2D_get_field_index_by_name(char *name)
2490
0
{
2491
0
  if (!strcmp("innerRadius", name)) return 0;
2492
0
  if (!strcmp("outerRadius", name)) return 1;
2493
0
  if (!strcmp("metadata", name)) return 2;
2494
0
  return -1;
2495
0
}
2496
2497
2498
static GF_Node *Disk2D_Create()
2499
0
{
2500
0
  X_Disk2D *p;
2501
0
  GF_SAFEALLOC(p, X_Disk2D);
2502
0
  if(!p) return NULL;
2503
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Disk2D);
2504
2505
  /*default field values*/
2506
0
  p->innerRadius = FLT2FIX(0);
2507
0
  p->outerRadius = FLT2FIX(1);
2508
0
  return (GF_Node *)p;
2509
0
}
2510
2511
2512
/*
2513
  ElevationGrid Node deletion
2514
*/
2515
2516
static void ElevationGrid_Del(GF_Node *node)
2517
0
{
2518
0
  X_ElevationGrid *p = (X_ElevationGrid *) node;
2519
0
  gf_sg_mffloat_del(p->set_height);
2520
0
  gf_node_unregister((GF_Node *) p->color, node);
2521
0
  gf_node_unregister((GF_Node *) p->normal, node);
2522
0
  gf_node_unregister((GF_Node *) p->texCoord, node);
2523
0
  gf_sg_mffloat_del(p->height);
2524
0
  gf_node_unregister((GF_Node *) p->metadata, node);
2525
0
  gf_node_free((GF_Node *)p);
2526
0
}
2527
2528
2529
static u32 ElevationGrid_get_field_count(GF_Node *node, u8 dummy)
2530
0
{
2531
0
  return 15;
2532
0
}
2533
2534
static GF_Err ElevationGrid_get_field(GF_Node *node, GF_FieldInfo *info)
2535
0
{
2536
0
  switch (info->fieldIndex) {
2537
0
  case 0:
2538
0
    info->name = "set_height";
2539
0
    info->eventType = GF_SG_EVENT_IN;
2540
0
    info->on_event_in = ((X_ElevationGrid *)node)->on_set_height;
2541
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
2542
0
    info->far_ptr = & ((X_ElevationGrid *) node)->set_height;
2543
0
    return GF_OK;
2544
0
  case 1:
2545
0
    info->name = "color";
2546
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2547
0
    info->fieldType = GF_SG_VRML_SFNODE;
2548
0
    info->NDTtype = NDT_SFColorNode;
2549
0
    info->far_ptr = & ((X_ElevationGrid *)node)->color;
2550
0
    return GF_OK;
2551
0
  case 2:
2552
0
    info->name = "normal";
2553
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2554
0
    info->fieldType = GF_SG_VRML_SFNODE;
2555
0
    info->NDTtype = NDT_SFNormalNode;
2556
0
    info->far_ptr = & ((X_ElevationGrid *)node)->normal;
2557
0
    return GF_OK;
2558
0
  case 3:
2559
0
    info->name = "texCoord";
2560
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2561
0
    info->fieldType = GF_SG_VRML_SFNODE;
2562
0
    info->NDTtype = NDT_SFTextureCoordinateNode;
2563
0
    info->far_ptr = & ((X_ElevationGrid *)node)->texCoord;
2564
0
    return GF_OK;
2565
0
  case 4:
2566
0
    info->name = "height";
2567
0
    info->eventType = GF_SG_EVENT_FIELD;
2568
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
2569
0
    info->far_ptr = & ((X_ElevationGrid *) node)->height;
2570
0
    return GF_OK;
2571
0
  case 5:
2572
0
    info->name = "ccw";
2573
0
    info->eventType = GF_SG_EVENT_FIELD;
2574
0
    info->fieldType = GF_SG_VRML_SFBOOL;
2575
0
    info->far_ptr = & ((X_ElevationGrid *) node)->ccw;
2576
0
    return GF_OK;
2577
0
  case 6:
2578
0
    info->name = "colorPerVertex";
2579
0
    info->eventType = GF_SG_EVENT_FIELD;
2580
0
    info->fieldType = GF_SG_VRML_SFBOOL;
2581
0
    info->far_ptr = & ((X_ElevationGrid *) node)->colorPerVertex;
2582
0
    return GF_OK;
2583
0
  case 7:
2584
0
    info->name = "creaseAngle";
2585
0
    info->eventType = GF_SG_EVENT_FIELD;
2586
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2587
0
    info->far_ptr = & ((X_ElevationGrid *) node)->creaseAngle;
2588
0
    return GF_OK;
2589
0
  case 8:
2590
0
    info->name = "normalPerVertex";
2591
0
    info->eventType = GF_SG_EVENT_FIELD;
2592
0
    info->fieldType = GF_SG_VRML_SFBOOL;
2593
0
    info->far_ptr = & ((X_ElevationGrid *) node)->normalPerVertex;
2594
0
    return GF_OK;
2595
0
  case 9:
2596
0
    info->name = "solid";
2597
0
    info->eventType = GF_SG_EVENT_FIELD;
2598
0
    info->fieldType = GF_SG_VRML_SFBOOL;
2599
0
    info->far_ptr = & ((X_ElevationGrid *) node)->solid;
2600
0
    return GF_OK;
2601
0
  case 10:
2602
0
    info->name = "xDimension";
2603
0
    info->eventType = GF_SG_EVENT_FIELD;
2604
0
    info->fieldType = GF_SG_VRML_SFINT32;
2605
0
    info->far_ptr = & ((X_ElevationGrid *) node)->xDimension;
2606
0
    return GF_OK;
2607
0
  case 11:
2608
0
    info->name = "xSpacing";
2609
0
    info->eventType = GF_SG_EVENT_FIELD;
2610
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2611
0
    info->far_ptr = & ((X_ElevationGrid *) node)->xSpacing;
2612
0
    return GF_OK;
2613
0
  case 12:
2614
0
    info->name = "zDimension";
2615
0
    info->eventType = GF_SG_EVENT_FIELD;
2616
0
    info->fieldType = GF_SG_VRML_SFINT32;
2617
0
    info->far_ptr = & ((X_ElevationGrid *) node)->zDimension;
2618
0
    return GF_OK;
2619
0
  case 13:
2620
0
    info->name = "zSpacing";
2621
0
    info->eventType = GF_SG_EVENT_FIELD;
2622
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2623
0
    info->far_ptr = & ((X_ElevationGrid *) node)->zSpacing;
2624
0
    return GF_OK;
2625
0
  case 14:
2626
0
    info->name = "metadata";
2627
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2628
0
    info->fieldType = GF_SG_VRML_SFNODE;
2629
0
    info->NDTtype = NDT_SFMetadataNode;
2630
0
    info->far_ptr = & ((X_ElevationGrid *)node)->metadata;
2631
0
    return GF_OK;
2632
0
  default:
2633
0
    return GF_BAD_PARAM;
2634
0
  }
2635
0
}
2636
2637
2638
static s32 ElevationGrid_get_field_index_by_name(char *name)
2639
0
{
2640
0
  if (!strcmp("set_height", name)) return 0;
2641
0
  if (!strcmp("color", name)) return 1;
2642
0
  if (!strcmp("normal", name)) return 2;
2643
0
  if (!strcmp("texCoord", name)) return 3;
2644
0
  if (!strcmp("height", name)) return 4;
2645
0
  if (!strcmp("ccw", name)) return 5;
2646
0
  if (!strcmp("colorPerVertex", name)) return 6;
2647
0
  if (!strcmp("creaseAngle", name)) return 7;
2648
0
  if (!strcmp("normalPerVertex", name)) return 8;
2649
0
  if (!strcmp("solid", name)) return 9;
2650
0
  if (!strcmp("xDimension", name)) return 10;
2651
0
  if (!strcmp("xSpacing", name)) return 11;
2652
0
  if (!strcmp("zDimension", name)) return 12;
2653
0
  if (!strcmp("zSpacing", name)) return 13;
2654
0
  if (!strcmp("metadata", name)) return 14;
2655
0
  return -1;
2656
0
}
2657
2658
2659
static GF_Node *ElevationGrid_Create()
2660
0
{
2661
0
  X_ElevationGrid *p;
2662
0
  GF_SAFEALLOC(p, X_ElevationGrid);
2663
0
  if(!p) return NULL;
2664
0
  gf_node_setup((GF_Node *)p, TAG_X3D_ElevationGrid);
2665
2666
  /*default field values*/
2667
0
  p->ccw = 1;
2668
0
  p->colorPerVertex = 1;
2669
0
  p->creaseAngle = FLT2FIX(0.0);
2670
0
  p->normalPerVertex = 1;
2671
0
  p->solid = 1;
2672
0
  p->xDimension = 0;
2673
0
  p->xSpacing = FLT2FIX(1.0);
2674
0
  p->zDimension = 0;
2675
0
  p->zSpacing = FLT2FIX(1.0);
2676
0
  return (GF_Node *)p;
2677
0
}
2678
2679
2680
/*
2681
  EspduTransform Node deletion
2682
*/
2683
2684
static void EspduTransform_Del(GF_Node *node)
2685
0
{
2686
0
  X_EspduTransform *p = (X_EspduTransform *) node;
2687
0
  gf_sg_sfstring_del(p->address);
2688
0
  gf_sg_mfint32_del(p->articulationParameterDesignatorArray);
2689
0
  gf_sg_mfint32_del(p->articulationParameterChangeIndicatorArray);
2690
0
  gf_sg_mfint32_del(p->articulationParameterIdPartAttachedToArray);
2691
0
  gf_sg_mfint32_del(p->articulationParameterTypeArray);
2692
0
  gf_sg_mffloat_del(p->articulationParameterArray);
2693
0
  gf_sg_sfstring_del(p->marking);
2694
0
  gf_sg_sfstring_del(p->multicastRelayHost);
2695
0
  gf_sg_sfstring_del(p->networkMode);
2696
0
  gf_node_unregister((GF_Node *) p->metadata, node);
2697
0
  gf_sg_vrml_parent_destroy(node);
2698
0
  gf_node_free((GF_Node *)p);
2699
0
}
2700
2701
2702
static u32 EspduTransform_get_field_count(GF_Node *node, u8 dummy)
2703
0
{
2704
0
  return 86;
2705
0
}
2706
2707
static GF_Err EspduTransform_get_field(GF_Node *node, GF_FieldInfo *info)
2708
0
{
2709
0
  switch (info->fieldIndex) {
2710
0
  case 0:
2711
0
    info->name = "addChildren";
2712
0
    info->eventType = GF_SG_EVENT_IN;
2713
0
    info->on_event_in = ((X_EspduTransform *)node)->on_addChildren;
2714
0
    info->fieldType = GF_SG_VRML_MFNODE;
2715
0
    info->NDTtype = NDT_SF3DNode;
2716
0
    info->far_ptr = & ((X_EspduTransform *)node)->addChildren;
2717
0
    return GF_OK;
2718
0
  case 1:
2719
0
    info->name = "removeChildren";
2720
0
    info->eventType = GF_SG_EVENT_IN;
2721
0
    info->on_event_in = ((X_EspduTransform *)node)->on_removeChildren;
2722
0
    info->fieldType = GF_SG_VRML_MFNODE;
2723
0
    info->NDTtype = NDT_SF3DNode;
2724
0
    info->far_ptr = & ((X_EspduTransform *)node)->removeChildren;
2725
0
    return GF_OK;
2726
0
  case 2:
2727
0
    info->name = "set_articulationParameterValue0";
2728
0
    info->eventType = GF_SG_EVENT_IN;
2729
0
    info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue0;
2730
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2731
0
    info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue0;
2732
0
    return GF_OK;
2733
0
  case 3:
2734
0
    info->name = "set_articulationParameterValue1";
2735
0
    info->eventType = GF_SG_EVENT_IN;
2736
0
    info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue1;
2737
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2738
0
    info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue1;
2739
0
    return GF_OK;
2740
0
  case 4:
2741
0
    info->name = "set_articulationParameterValue2";
2742
0
    info->eventType = GF_SG_EVENT_IN;
2743
0
    info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue2;
2744
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2745
0
    info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue2;
2746
0
    return GF_OK;
2747
0
  case 5:
2748
0
    info->name = "set_articulationParameterValue3";
2749
0
    info->eventType = GF_SG_EVENT_IN;
2750
0
    info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue3;
2751
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2752
0
    info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue3;
2753
0
    return GF_OK;
2754
0
  case 6:
2755
0
    info->name = "set_articulationParameterValue4";
2756
0
    info->eventType = GF_SG_EVENT_IN;
2757
0
    info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue4;
2758
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2759
0
    info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue4;
2760
0
    return GF_OK;
2761
0
  case 7:
2762
0
    info->name = "set_articulationParameterValue5";
2763
0
    info->eventType = GF_SG_EVENT_IN;
2764
0
    info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue5;
2765
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2766
0
    info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue5;
2767
0
    return GF_OK;
2768
0
  case 8:
2769
0
    info->name = "set_articulationParameterValue6";
2770
0
    info->eventType = GF_SG_EVENT_IN;
2771
0
    info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue6;
2772
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2773
0
    info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue6;
2774
0
    return GF_OK;
2775
0
  case 9:
2776
0
    info->name = "set_articulationParameterValue7";
2777
0
    info->eventType = GF_SG_EVENT_IN;
2778
0
    info->on_event_in = ((X_EspduTransform *)node)->on_set_articulationParameterValue7;
2779
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2780
0
    info->far_ptr = & ((X_EspduTransform *) node)->set_articulationParameterValue7;
2781
0
    return GF_OK;
2782
0
  case 10:
2783
0
    info->name = "address";
2784
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2785
0
    info->fieldType = GF_SG_VRML_SFSTRING;
2786
0
    info->far_ptr = & ((X_EspduTransform *) node)->address;
2787
0
    return GF_OK;
2788
0
  case 11:
2789
0
    info->name = "applicationID";
2790
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2791
0
    info->fieldType = GF_SG_VRML_SFINT32;
2792
0
    info->far_ptr = & ((X_EspduTransform *) node)->applicationID;
2793
0
    return GF_OK;
2794
0
  case 12:
2795
0
    info->name = "articulationParameterCount";
2796
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2797
0
    info->fieldType = GF_SG_VRML_SFINT32;
2798
0
    info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterCount;
2799
0
    return GF_OK;
2800
0
  case 13:
2801
0
    info->name = "articulationParameterDesignatorArray";
2802
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2803
0
    info->fieldType = GF_SG_VRML_MFINT32;
2804
0
    info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterDesignatorArray;
2805
0
    return GF_OK;
2806
0
  case 14:
2807
0
    info->name = "articulationParameterChangeIndicatorArray";
2808
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2809
0
    info->fieldType = GF_SG_VRML_MFINT32;
2810
0
    info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterChangeIndicatorArray;
2811
0
    return GF_OK;
2812
0
  case 15:
2813
0
    info->name = "articulationParameterIdPartAttachedToArray";
2814
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2815
0
    info->fieldType = GF_SG_VRML_MFINT32;
2816
0
    info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterIdPartAttachedToArray;
2817
0
    return GF_OK;
2818
0
  case 16:
2819
0
    info->name = "articulationParameterTypeArray";
2820
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2821
0
    info->fieldType = GF_SG_VRML_MFINT32;
2822
0
    info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterTypeArray;
2823
0
    return GF_OK;
2824
0
  case 17:
2825
0
    info->name = "articulationParameterArray";
2826
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2827
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
2828
0
    info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterArray;
2829
0
    return GF_OK;
2830
0
  case 18:
2831
0
    info->name = "center";
2832
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2833
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
2834
0
    info->far_ptr = & ((X_EspduTransform *) node)->center;
2835
0
    return GF_OK;
2836
0
  case 19:
2837
0
    info->name = "children";
2838
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2839
0
    info->fieldType = GF_SG_VRML_MFNODE;
2840
0
    info->NDTtype = NDT_SF3DNode;
2841
0
    info->far_ptr = & ((X_EspduTransform *)node)->children;
2842
0
    return GF_OK;
2843
0
  case 20:
2844
0
    info->name = "collisionType";
2845
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2846
0
    info->fieldType = GF_SG_VRML_SFINT32;
2847
0
    info->far_ptr = & ((X_EspduTransform *) node)->collisionType;
2848
0
    return GF_OK;
2849
0
  case 21:
2850
0
    info->name = "deadReckoning";
2851
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2852
0
    info->fieldType = GF_SG_VRML_SFINT32;
2853
0
    info->far_ptr = & ((X_EspduTransform *) node)->deadReckoning;
2854
0
    return GF_OK;
2855
0
  case 22:
2856
0
    info->name = "detonationLocation";
2857
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2858
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
2859
0
    info->far_ptr = & ((X_EspduTransform *) node)->detonationLocation;
2860
0
    return GF_OK;
2861
0
  case 23:
2862
0
    info->name = "detonationRelativeLocation";
2863
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2864
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
2865
0
    info->far_ptr = & ((X_EspduTransform *) node)->detonationRelativeLocation;
2866
0
    return GF_OK;
2867
0
  case 24:
2868
0
    info->name = "detonationResult";
2869
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2870
0
    info->fieldType = GF_SG_VRML_SFINT32;
2871
0
    info->far_ptr = & ((X_EspduTransform *) node)->detonationResult;
2872
0
    return GF_OK;
2873
0
  case 25:
2874
0
    info->name = "entityCategory";
2875
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2876
0
    info->fieldType = GF_SG_VRML_SFINT32;
2877
0
    info->far_ptr = & ((X_EspduTransform *) node)->entityCategory;
2878
0
    return GF_OK;
2879
0
  case 26:
2880
0
    info->name = "entityCountry";
2881
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2882
0
    info->fieldType = GF_SG_VRML_SFINT32;
2883
0
    info->far_ptr = & ((X_EspduTransform *) node)->entityCountry;
2884
0
    return GF_OK;
2885
0
  case 27:
2886
0
    info->name = "entityDomain";
2887
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2888
0
    info->fieldType = GF_SG_VRML_SFINT32;
2889
0
    info->far_ptr = & ((X_EspduTransform *) node)->entityDomain;
2890
0
    return GF_OK;
2891
0
  case 28:
2892
0
    info->name = "entityExtra";
2893
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2894
0
    info->fieldType = GF_SG_VRML_SFINT32;
2895
0
    info->far_ptr = & ((X_EspduTransform *) node)->entityExtra;
2896
0
    return GF_OK;
2897
0
  case 29:
2898
0
    info->name = "entityID";
2899
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2900
0
    info->fieldType = GF_SG_VRML_SFINT32;
2901
0
    info->far_ptr = & ((X_EspduTransform *) node)->entityID;
2902
0
    return GF_OK;
2903
0
  case 30:
2904
0
    info->name = "entityKind";
2905
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2906
0
    info->fieldType = GF_SG_VRML_SFINT32;
2907
0
    info->far_ptr = & ((X_EspduTransform *) node)->entityKind;
2908
0
    return GF_OK;
2909
0
  case 31:
2910
0
    info->name = "entitySpecific";
2911
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2912
0
    info->fieldType = GF_SG_VRML_SFINT32;
2913
0
    info->far_ptr = & ((X_EspduTransform *) node)->entitySpecific;
2914
0
    return GF_OK;
2915
0
  case 32:
2916
0
    info->name = "entitySubCategory";
2917
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2918
0
    info->fieldType = GF_SG_VRML_SFINT32;
2919
0
    info->far_ptr = & ((X_EspduTransform *) node)->entitySubCategory;
2920
0
    return GF_OK;
2921
0
  case 33:
2922
0
    info->name = "eventApplicationID";
2923
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2924
0
    info->fieldType = GF_SG_VRML_SFINT32;
2925
0
    info->far_ptr = & ((X_EspduTransform *) node)->eventApplicationID;
2926
0
    return GF_OK;
2927
0
  case 34:
2928
0
    info->name = "eventEntityID";
2929
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2930
0
    info->fieldType = GF_SG_VRML_SFINT32;
2931
0
    info->far_ptr = & ((X_EspduTransform *) node)->eventEntityID;
2932
0
    return GF_OK;
2933
0
  case 35:
2934
0
    info->name = "eventNumber";
2935
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2936
0
    info->fieldType = GF_SG_VRML_SFINT32;
2937
0
    info->far_ptr = & ((X_EspduTransform *) node)->eventNumber;
2938
0
    return GF_OK;
2939
0
  case 36:
2940
0
    info->name = "eventSiteID";
2941
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2942
0
    info->fieldType = GF_SG_VRML_SFINT32;
2943
0
    info->far_ptr = & ((X_EspduTransform *) node)->eventSiteID;
2944
0
    return GF_OK;
2945
0
  case 37:
2946
0
    info->name = "fired1";
2947
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2948
0
    info->fieldType = GF_SG_VRML_SFBOOL;
2949
0
    info->far_ptr = & ((X_EspduTransform *) node)->fired1;
2950
0
    return GF_OK;
2951
0
  case 38:
2952
0
    info->name = "fired2";
2953
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2954
0
    info->fieldType = GF_SG_VRML_SFBOOL;
2955
0
    info->far_ptr = & ((X_EspduTransform *) node)->fired2;
2956
0
    return GF_OK;
2957
0
  case 39:
2958
0
    info->name = "fireMissionIndex";
2959
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2960
0
    info->fieldType = GF_SG_VRML_SFINT32;
2961
0
    info->far_ptr = & ((X_EspduTransform *) node)->fireMissionIndex;
2962
0
    return GF_OK;
2963
0
  case 40:
2964
0
    info->name = "firingRange";
2965
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2966
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
2967
0
    info->far_ptr = & ((X_EspduTransform *) node)->firingRange;
2968
0
    return GF_OK;
2969
0
  case 41:
2970
0
    info->name = "firingRate";
2971
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2972
0
    info->fieldType = GF_SG_VRML_SFINT32;
2973
0
    info->far_ptr = & ((X_EspduTransform *) node)->firingRate;
2974
0
    return GF_OK;
2975
0
  case 42:
2976
0
    info->name = "forceID";
2977
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2978
0
    info->fieldType = GF_SG_VRML_SFINT32;
2979
0
    info->far_ptr = & ((X_EspduTransform *) node)->forceID;
2980
0
    return GF_OK;
2981
0
  case 43:
2982
0
    info->name = "fuse";
2983
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2984
0
    info->fieldType = GF_SG_VRML_SFINT32;
2985
0
    info->far_ptr = & ((X_EspduTransform *) node)->fuse;
2986
0
    return GF_OK;
2987
0
  case 44:
2988
0
    info->name = "linearVelocity";
2989
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2990
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
2991
0
    info->far_ptr = & ((X_EspduTransform *) node)->linearVelocity;
2992
0
    return GF_OK;
2993
0
  case 45:
2994
0
    info->name = "linearAcceleration";
2995
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
2996
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
2997
0
    info->far_ptr = & ((X_EspduTransform *) node)->linearAcceleration;
2998
0
    return GF_OK;
2999
0
  case 46:
3000
0
    info->name = "marking";
3001
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3002
0
    info->fieldType = GF_SG_VRML_SFSTRING;
3003
0
    info->far_ptr = & ((X_EspduTransform *) node)->marking;
3004
0
    return GF_OK;
3005
0
  case 47:
3006
0
    info->name = "multicastRelayHost";
3007
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3008
0
    info->fieldType = GF_SG_VRML_SFSTRING;
3009
0
    info->far_ptr = & ((X_EspduTransform *) node)->multicastRelayHost;
3010
0
    return GF_OK;
3011
0
  case 48:
3012
0
    info->name = "multicastRelayPort";
3013
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3014
0
    info->fieldType = GF_SG_VRML_SFINT32;
3015
0
    info->far_ptr = & ((X_EspduTransform *) node)->multicastRelayPort;
3016
0
    return GF_OK;
3017
0
  case 49:
3018
0
    info->name = "munitionApplicationID";
3019
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3020
0
    info->fieldType = GF_SG_VRML_SFINT32;
3021
0
    info->far_ptr = & ((X_EspduTransform *) node)->munitionApplicationID;
3022
0
    return GF_OK;
3023
0
  case 50:
3024
0
    info->name = "munitionEndPoint";
3025
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3026
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
3027
0
    info->far_ptr = & ((X_EspduTransform *) node)->munitionEndPoint;
3028
0
    return GF_OK;
3029
0
  case 51:
3030
0
    info->name = "munitionEntityID";
3031
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3032
0
    info->fieldType = GF_SG_VRML_SFINT32;
3033
0
    info->far_ptr = & ((X_EspduTransform *) node)->munitionEntityID;
3034
0
    return GF_OK;
3035
0
  case 52:
3036
0
    info->name = "munitionQuantity";
3037
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3038
0
    info->fieldType = GF_SG_VRML_SFINT32;
3039
0
    info->far_ptr = & ((X_EspduTransform *) node)->munitionQuantity;
3040
0
    return GF_OK;
3041
0
  case 53:
3042
0
    info->name = "munitionSiteID";
3043
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3044
0
    info->fieldType = GF_SG_VRML_SFINT32;
3045
0
    info->far_ptr = & ((X_EspduTransform *) node)->munitionSiteID;
3046
0
    return GF_OK;
3047
0
  case 54:
3048
0
    info->name = "munitionStartPoint";
3049
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3050
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
3051
0
    info->far_ptr = & ((X_EspduTransform *) node)->munitionStartPoint;
3052
0
    return GF_OK;
3053
0
  case 55:
3054
0
    info->name = "networkMode";
3055
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3056
0
    info->fieldType = GF_SG_VRML_SFSTRING;
3057
0
    info->far_ptr = & ((X_EspduTransform *) node)->networkMode;
3058
0
    return GF_OK;
3059
0
  case 56:
3060
0
    info->name = "port";
3061
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3062
0
    info->fieldType = GF_SG_VRML_SFINT32;
3063
0
    info->far_ptr = & ((X_EspduTransform *) node)->port;
3064
0
    return GF_OK;
3065
0
  case 57:
3066
0
    info->name = "readInterval";
3067
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3068
0
    info->fieldType = GF_SG_VRML_SFTIME;
3069
0
    info->far_ptr = & ((X_EspduTransform *) node)->readInterval;
3070
0
    return GF_OK;
3071
0
  case 58:
3072
0
    info->name = "rotation";
3073
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3074
0
    info->fieldType = GF_SG_VRML_SFROTATION;
3075
0
    info->far_ptr = & ((X_EspduTransform *) node)->rotation;
3076
0
    return GF_OK;
3077
0
  case 59:
3078
0
    info->name = "scale";
3079
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3080
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
3081
0
    info->far_ptr = & ((X_EspduTransform *) node)->scale;
3082
0
    return GF_OK;
3083
0
  case 60:
3084
0
    info->name = "scaleOrientation";
3085
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3086
0
    info->fieldType = GF_SG_VRML_SFROTATION;
3087
0
    info->far_ptr = & ((X_EspduTransform *) node)->scaleOrientation;
3088
0
    return GF_OK;
3089
0
  case 61:
3090
0
    info->name = "siteID";
3091
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3092
0
    info->fieldType = GF_SG_VRML_SFINT32;
3093
0
    info->far_ptr = & ((X_EspduTransform *) node)->siteID;
3094
0
    return GF_OK;
3095
0
  case 62:
3096
0
    info->name = "translation";
3097
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3098
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
3099
0
    info->far_ptr = & ((X_EspduTransform *) node)->translation;
3100
0
    return GF_OK;
3101
0
  case 63:
3102
0
    info->name = "warhead";
3103
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3104
0
    info->fieldType = GF_SG_VRML_SFINT32;
3105
0
    info->far_ptr = & ((X_EspduTransform *) node)->warhead;
3106
0
    return GF_OK;
3107
0
  case 64:
3108
0
    info->name = "writeInterval";
3109
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3110
0
    info->fieldType = GF_SG_VRML_SFTIME;
3111
0
    info->far_ptr = & ((X_EspduTransform *) node)->writeInterval;
3112
0
    return GF_OK;
3113
0
  case 65:
3114
0
    info->name = "rtpHeaderExpected";
3115
0
    info->eventType = GF_SG_EVENT_FIELD;
3116
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3117
0
    info->far_ptr = & ((X_EspduTransform *) node)->rtpHeaderExpected;
3118
0
    return GF_OK;
3119
0
  case 66:
3120
0
    info->name = "articulationParameterValue0_changed";
3121
0
    info->eventType = GF_SG_EVENT_OUT;
3122
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
3123
0
    info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue0_changed;
3124
0
    return GF_OK;
3125
0
  case 67:
3126
0
    info->name = "articulationParameterValue1_changed";
3127
0
    info->eventType = GF_SG_EVENT_OUT;
3128
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
3129
0
    info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue1_changed;
3130
0
    return GF_OK;
3131
0
  case 68:
3132
0
    info->name = "articulationParameterValue2_changed";
3133
0
    info->eventType = GF_SG_EVENT_OUT;
3134
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
3135
0
    info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue2_changed;
3136
0
    return GF_OK;
3137
0
  case 69:
3138
0
    info->name = "articulationParameterValue3_changed";
3139
0
    info->eventType = GF_SG_EVENT_OUT;
3140
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
3141
0
    info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue3_changed;
3142
0
    return GF_OK;
3143
0
  case 70:
3144
0
    info->name = "articulationParameterValue4_changed";
3145
0
    info->eventType = GF_SG_EVENT_OUT;
3146
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
3147
0
    info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue4_changed;
3148
0
    return GF_OK;
3149
0
  case 71:
3150
0
    info->name = "articulationParameterValue5_changed";
3151
0
    info->eventType = GF_SG_EVENT_OUT;
3152
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
3153
0
    info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue5_changed;
3154
0
    return GF_OK;
3155
0
  case 72:
3156
0
    info->name = "articulationParameterValue6_changed";
3157
0
    info->eventType = GF_SG_EVENT_OUT;
3158
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
3159
0
    info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue6_changed;
3160
0
    return GF_OK;
3161
0
  case 73:
3162
0
    info->name = "articulationParameterValue7_changed";
3163
0
    info->eventType = GF_SG_EVENT_OUT;
3164
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
3165
0
    info->far_ptr = & ((X_EspduTransform *) node)->articulationParameterValue7_changed;
3166
0
    return GF_OK;
3167
0
  case 74:
3168
0
    info->name = "collideTime";
3169
0
    info->eventType = GF_SG_EVENT_OUT;
3170
0
    info->fieldType = GF_SG_VRML_SFTIME;
3171
0
    info->far_ptr = & ((X_EspduTransform *) node)->collideTime;
3172
0
    return GF_OK;
3173
0
  case 75:
3174
0
    info->name = "detonateTime";
3175
0
    info->eventType = GF_SG_EVENT_OUT;
3176
0
    info->fieldType = GF_SG_VRML_SFTIME;
3177
0
    info->far_ptr = & ((X_EspduTransform *) node)->detonateTime;
3178
0
    return GF_OK;
3179
0
  case 76:
3180
0
    info->name = "firedTime";
3181
0
    info->eventType = GF_SG_EVENT_OUT;
3182
0
    info->fieldType = GF_SG_VRML_SFTIME;
3183
0
    info->far_ptr = & ((X_EspduTransform *) node)->firedTime;
3184
0
    return GF_OK;
3185
0
  case 77:
3186
0
    info->name = "isActive";
3187
0
    info->eventType = GF_SG_EVENT_OUT;
3188
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3189
0
    info->far_ptr = & ((X_EspduTransform *) node)->isActive;
3190
0
    return GF_OK;
3191
0
  case 78:
3192
0
    info->name = "isCollided";
3193
0
    info->eventType = GF_SG_EVENT_OUT;
3194
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3195
0
    info->far_ptr = & ((X_EspduTransform *) node)->isCollided;
3196
0
    return GF_OK;
3197
0
  case 79:
3198
0
    info->name = "isDetonated";
3199
0
    info->eventType = GF_SG_EVENT_OUT;
3200
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3201
0
    info->far_ptr = & ((X_EspduTransform *) node)->isDetonated;
3202
0
    return GF_OK;
3203
0
  case 80:
3204
0
    info->name = "isNetworkReader";
3205
0
    info->eventType = GF_SG_EVENT_OUT;
3206
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3207
0
    info->far_ptr = & ((X_EspduTransform *) node)->isNetworkReader;
3208
0
    return GF_OK;
3209
0
  case 81:
3210
0
    info->name = "isNetworkWriter";
3211
0
    info->eventType = GF_SG_EVENT_OUT;
3212
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3213
0
    info->far_ptr = & ((X_EspduTransform *) node)->isNetworkWriter;
3214
0
    return GF_OK;
3215
0
  case 82:
3216
0
    info->name = "isRtpHeaderHeard";
3217
0
    info->eventType = GF_SG_EVENT_OUT;
3218
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3219
0
    info->far_ptr = & ((X_EspduTransform *) node)->isRtpHeaderHeard;
3220
0
    return GF_OK;
3221
0
  case 83:
3222
0
    info->name = "isStandAlone";
3223
0
    info->eventType = GF_SG_EVENT_OUT;
3224
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3225
0
    info->far_ptr = & ((X_EspduTransform *) node)->isStandAlone;
3226
0
    return GF_OK;
3227
0
  case 84:
3228
0
    info->name = "timestamp";
3229
0
    info->eventType = GF_SG_EVENT_OUT;
3230
0
    info->fieldType = GF_SG_VRML_SFTIME;
3231
0
    info->far_ptr = & ((X_EspduTransform *) node)->timestamp;
3232
0
    return GF_OK;
3233
0
  case 85:
3234
0
    info->name = "metadata";
3235
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3236
0
    info->fieldType = GF_SG_VRML_SFNODE;
3237
0
    info->NDTtype = NDT_SFMetadataNode;
3238
0
    info->far_ptr = & ((X_EspduTransform *)node)->metadata;
3239
0
    return GF_OK;
3240
0
  default:
3241
0
    return GF_BAD_PARAM;
3242
0
  }
3243
0
}
3244
3245
3246
static s32 EspduTransform_get_field_index_by_name(char *name)
3247
0
{
3248
0
  if (!strcmp("addChildren", name)) return 0;
3249
0
  if (!strcmp("removeChildren", name)) return 1;
3250
0
  if (!strcmp("set_articulationParameterValue0", name)) return 2;
3251
0
  if (!strcmp("set_articulationParameterValue1", name)) return 3;
3252
0
  if (!strcmp("set_articulationParameterValue2", name)) return 4;
3253
0
  if (!strcmp("set_articulationParameterValue3", name)) return 5;
3254
0
  if (!strcmp("set_articulationParameterValue4", name)) return 6;
3255
0
  if (!strcmp("set_articulationParameterValue5", name)) return 7;
3256
0
  if (!strcmp("set_articulationParameterValue6", name)) return 8;
3257
0
  if (!strcmp("set_articulationParameterValue7", name)) return 9;
3258
0
  if (!strcmp("address", name)) return 10;
3259
0
  if (!strcmp("applicationID", name)) return 11;
3260
0
  if (!strcmp("articulationParameterCount", name)) return 12;
3261
0
  if (!strcmp("articulationParameterDesignatorArray", name)) return 13;
3262
0
  if (!strcmp("articulationParameterChangeIndicatorArray", name)) return 14;
3263
0
  if (!strcmp("articulationParameterIdPartAttachedToArray", name)) return 15;
3264
0
  if (!strcmp("articulationParameterTypeArray", name)) return 16;
3265
0
  if (!strcmp("articulationParameterArray", name)) return 17;
3266
0
  if (!strcmp("center", name)) return 18;
3267
0
  if (!strcmp("children", name)) return 19;
3268
0
  if (!strcmp("collisionType", name)) return 20;
3269
0
  if (!strcmp("deadReckoning", name)) return 21;
3270
0
  if (!strcmp("detonationLocation", name)) return 22;
3271
0
  if (!strcmp("detonationRelativeLocation", name)) return 23;
3272
0
  if (!strcmp("detonationResult", name)) return 24;
3273
0
  if (!strcmp("entityCategory", name)) return 25;
3274
0
  if (!strcmp("entityCountry", name)) return 26;
3275
0
  if (!strcmp("entityDomain", name)) return 27;
3276
0
  if (!strcmp("entityExtra", name)) return 28;
3277
0
  if (!strcmp("entityID", name)) return 29;
3278
0
  if (!strcmp("entityKind", name)) return 30;
3279
0
  if (!strcmp("entitySpecific", name)) return 31;
3280
0
  if (!strcmp("entitySubCategory", name)) return 32;
3281
0
  if (!strcmp("eventApplicationID", name)) return 33;
3282
0
  if (!strcmp("eventEntityID", name)) return 34;
3283
0
  if (!strcmp("eventNumber", name)) return 35;
3284
0
  if (!strcmp("eventSiteID", name)) return 36;
3285
0
  if (!strcmp("fired1", name)) return 37;
3286
0
  if (!strcmp("fired2", name)) return 38;
3287
0
  if (!strcmp("fireMissionIndex", name)) return 39;
3288
0
  if (!strcmp("firingRange", name)) return 40;
3289
0
  if (!strcmp("firingRate", name)) return 41;
3290
0
  if (!strcmp("forceID", name)) return 42;
3291
0
  if (!strcmp("fuse", name)) return 43;
3292
0
  if (!strcmp("linearVelocity", name)) return 44;
3293
0
  if (!strcmp("linearAcceleration", name)) return 45;
3294
0
  if (!strcmp("marking", name)) return 46;
3295
0
  if (!strcmp("multicastRelayHost", name)) return 47;
3296
0
  if (!strcmp("multicastRelayPort", name)) return 48;
3297
0
  if (!strcmp("munitionApplicationID", name)) return 49;
3298
0
  if (!strcmp("munitionEndPoint", name)) return 50;
3299
0
  if (!strcmp("munitionEntityID", name)) return 51;
3300
0
  if (!strcmp("munitionQuantity", name)) return 52;
3301
0
  if (!strcmp("munitionSiteID", name)) return 53;
3302
0
  if (!strcmp("munitionStartPoint", name)) return 54;
3303
0
  if (!strcmp("networkMode", name)) return 55;
3304
0
  if (!strcmp("port", name)) return 56;
3305
0
  if (!strcmp("readInterval", name)) return 57;
3306
0
  if (!strcmp("rotation", name)) return 58;
3307
0
  if (!strcmp("scale", name)) return 59;
3308
0
  if (!strcmp("scaleOrientation", name)) return 60;
3309
0
  if (!strcmp("siteID", name)) return 61;
3310
0
  if (!strcmp("translation", name)) return 62;
3311
0
  if (!strcmp("warhead", name)) return 63;
3312
0
  if (!strcmp("writeInterval", name)) return 64;
3313
0
  if (!strcmp("rtpHeaderExpected", name)) return 65;
3314
0
  if (!strcmp("articulationParameterValue0_changed", name)) return 66;
3315
0
  if (!strcmp("articulationParameterValue1_changed", name)) return 67;
3316
0
  if (!strcmp("articulationParameterValue2_changed", name)) return 68;
3317
0
  if (!strcmp("articulationParameterValue3_changed", name)) return 69;
3318
0
  if (!strcmp("articulationParameterValue4_changed", name)) return 70;
3319
0
  if (!strcmp("articulationParameterValue5_changed", name)) return 71;
3320
0
  if (!strcmp("articulationParameterValue6_changed", name)) return 72;
3321
0
  if (!strcmp("articulationParameterValue7_changed", name)) return 73;
3322
0
  if (!strcmp("collideTime", name)) return 74;
3323
0
  if (!strcmp("detonateTime", name)) return 75;
3324
0
  if (!strcmp("firedTime", name)) return 76;
3325
0
  if (!strcmp("isActive", name)) return 77;
3326
0
  if (!strcmp("isCollided", name)) return 78;
3327
0
  if (!strcmp("isDetonated", name)) return 79;
3328
0
  if (!strcmp("isNetworkReader", name)) return 80;
3329
0
  if (!strcmp("isNetworkWriter", name)) return 81;
3330
0
  if (!strcmp("isRtpHeaderHeard", name)) return 82;
3331
0
  if (!strcmp("isStandAlone", name)) return 83;
3332
0
  if (!strcmp("timestamp", name)) return 84;
3333
0
  if (!strcmp("metadata", name)) return 85;
3334
0
  return -1;
3335
0
}
3336
3337
3338
static GF_Node *EspduTransform_Create()
3339
0
{
3340
0
  X_EspduTransform *p;
3341
0
  GF_SAFEALLOC(p, X_EspduTransform);
3342
0
  if(!p) return NULL;
3343
0
  gf_node_setup((GF_Node *)p, TAG_X3D_EspduTransform);
3344
0
  gf_sg_vrml_parent_setup((GF_Node *) p);
3345
3346
  /*default field values*/
3347
0
  p->address.buffer = (char*) gf_malloc(sizeof(char) * 10);
3348
0
  strcpy(p->address.buffer, "localhost");
3349
0
  p->applicationID = 1;
3350
0
  p->articulationParameterCount = 0;
3351
0
  p->center.x = FLT2FIX(0);
3352
0
  p->center.y = FLT2FIX(0);
3353
0
  p->center.z = FLT2FIX(0);
3354
0
  p->collisionType = 0;
3355
0
  p->deadReckoning = 0;
3356
0
  p->detonationLocation.x = FLT2FIX(0);
3357
0
  p->detonationLocation.y = FLT2FIX(0);
3358
0
  p->detonationLocation.z = FLT2FIX(0);
3359
0
  p->detonationRelativeLocation.x = FLT2FIX(0);
3360
0
  p->detonationRelativeLocation.y = FLT2FIX(0);
3361
0
  p->detonationRelativeLocation.z = FLT2FIX(0);
3362
0
  p->detonationResult = 0;
3363
0
  p->entityCategory = 0;
3364
0
  p->entityCountry = 0;
3365
0
  p->entityDomain = 0;
3366
0
  p->entityExtra = 0;
3367
0
  p->entityID = 0;
3368
0
  p->entityKind = 0;
3369
0
  p->entitySpecific = 0;
3370
0
  p->entitySubCategory = 0;
3371
0
  p->eventApplicationID = 1;
3372
0
  p->eventEntityID = 0;
3373
0
  p->eventNumber = 0;
3374
0
  p->eventSiteID = 0;
3375
0
  p->fireMissionIndex = 0;
3376
0
  p->firingRange = FLT2FIX(0.0);
3377
0
  p->firingRate = 0;
3378
0
  p->forceID = 0;
3379
0
  p->fuse = 0;
3380
0
  p->linearVelocity.x = FLT2FIX(0);
3381
0
  p->linearVelocity.y = FLT2FIX(0);
3382
0
  p->linearVelocity.z = FLT2FIX(0);
3383
0
  p->linearAcceleration.x = FLT2FIX(0);
3384
0
  p->linearAcceleration.y = FLT2FIX(0);
3385
0
  p->linearAcceleration.z = FLT2FIX(0);
3386
0
  p->multicastRelayPort = 0;
3387
0
  p->munitionApplicationID = 1;
3388
0
  p->munitionEndPoint.x = FLT2FIX(0);
3389
0
  p->munitionEndPoint.y = FLT2FIX(0);
3390
0
  p->munitionEndPoint.z = FLT2FIX(0);
3391
0
  p->munitionEntityID = 0;
3392
0
  p->munitionQuantity = 0;
3393
0
  p->munitionSiteID = 0;
3394
0
  p->munitionStartPoint.x = FLT2FIX(0);
3395
0
  p->munitionStartPoint.y = FLT2FIX(0);
3396
0
  p->munitionStartPoint.z = FLT2FIX(0);
3397
0
  p->networkMode.buffer = (char*) gf_malloc(sizeof(char) * 11);
3398
0
  strcpy(p->networkMode.buffer, "standAlone");
3399
0
  p->port = 0;
3400
0
  p->readInterval = 0.1;
3401
0
  p->rotation.x = FLT2FIX(0);
3402
0
  p->rotation.y = FLT2FIX(0);
3403
0
  p->rotation.z = FLT2FIX(1);
3404
0
  p->rotation.q = FLT2FIX(0);
3405
0
  p->scale.x = FLT2FIX(1);
3406
0
  p->scale.y = FLT2FIX(1);
3407
0
  p->scale.z = FLT2FIX(1);
3408
0
  p->scaleOrientation.x = FLT2FIX(0);
3409
0
  p->scaleOrientation.y = FLT2FIX(0);
3410
0
  p->scaleOrientation.z = FLT2FIX(1);
3411
0
  p->scaleOrientation.q = FLT2FIX(0);
3412
0
  p->siteID = 0;
3413
0
  p->translation.x = FLT2FIX(0);
3414
0
  p->translation.y = FLT2FIX(0);
3415
0
  p->translation.z = FLT2FIX(0);
3416
0
  p->warhead = 0;
3417
0
  p->writeInterval = 1.0;
3418
0
  return (GF_Node *)p;
3419
0
}
3420
3421
3422
/*
3423
  Extrusion Node deletion
3424
*/
3425
3426
static void Extrusion_Del(GF_Node *node)
3427
0
{
3428
0
  X_Extrusion *p = (X_Extrusion *) node;
3429
0
  gf_sg_mfvec2f_del(p->set_crossSection);
3430
0
  gf_sg_mfrotation_del(p->set_orientation);
3431
0
  gf_sg_mfvec2f_del(p->set_scale);
3432
0
  gf_sg_mfvec3f_del(p->set_spine);
3433
0
  gf_sg_mfvec2f_del(p->crossSection);
3434
0
  gf_sg_mfrotation_del(p->orientation);
3435
0
  gf_sg_mfvec2f_del(p->scale);
3436
0
  gf_sg_mfvec3f_del(p->spine);
3437
0
  gf_node_unregister((GF_Node *) p->metadata, node);
3438
0
  gf_node_free((GF_Node *)p);
3439
0
}
3440
3441
3442
static u32 Extrusion_get_field_count(GF_Node *node, u8 dummy)
3443
0
{
3444
0
  return 15;
3445
0
}
3446
3447
static GF_Err Extrusion_get_field(GF_Node *node, GF_FieldInfo *info)
3448
0
{
3449
0
  switch (info->fieldIndex) {
3450
0
  case 0:
3451
0
    info->name = "set_crossSection";
3452
0
    info->eventType = GF_SG_EVENT_IN;
3453
0
    info->on_event_in = ((X_Extrusion *)node)->on_set_crossSection;
3454
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
3455
0
    info->far_ptr = & ((X_Extrusion *) node)->set_crossSection;
3456
0
    return GF_OK;
3457
0
  case 1:
3458
0
    info->name = "set_orientation";
3459
0
    info->eventType = GF_SG_EVENT_IN;
3460
0
    info->on_event_in = ((X_Extrusion *)node)->on_set_orientation;
3461
0
    info->fieldType = GF_SG_VRML_MFROTATION;
3462
0
    info->far_ptr = & ((X_Extrusion *) node)->set_orientation;
3463
0
    return GF_OK;
3464
0
  case 2:
3465
0
    info->name = "set_scale";
3466
0
    info->eventType = GF_SG_EVENT_IN;
3467
0
    info->on_event_in = ((X_Extrusion *)node)->on_set_scale;
3468
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
3469
0
    info->far_ptr = & ((X_Extrusion *) node)->set_scale;
3470
0
    return GF_OK;
3471
0
  case 3:
3472
0
    info->name = "set_spine";
3473
0
    info->eventType = GF_SG_EVENT_IN;
3474
0
    info->on_event_in = ((X_Extrusion *)node)->on_set_spine;
3475
0
    info->fieldType = GF_SG_VRML_MFVEC3F;
3476
0
    info->far_ptr = & ((X_Extrusion *) node)->set_spine;
3477
0
    return GF_OK;
3478
0
  case 4:
3479
0
    info->name = "beginCap";
3480
0
    info->eventType = GF_SG_EVENT_FIELD;
3481
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3482
0
    info->far_ptr = & ((X_Extrusion *) node)->beginCap;
3483
0
    return GF_OK;
3484
0
  case 5:
3485
0
    info->name = "ccw";
3486
0
    info->eventType = GF_SG_EVENT_FIELD;
3487
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3488
0
    info->far_ptr = & ((X_Extrusion *) node)->ccw;
3489
0
    return GF_OK;
3490
0
  case 6:
3491
0
    info->name = "convex";
3492
0
    info->eventType = GF_SG_EVENT_FIELD;
3493
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3494
0
    info->far_ptr = & ((X_Extrusion *) node)->convex;
3495
0
    return GF_OK;
3496
0
  case 7:
3497
0
    info->name = "creaseAngle";
3498
0
    info->eventType = GF_SG_EVENT_FIELD;
3499
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
3500
0
    info->far_ptr = & ((X_Extrusion *) node)->creaseAngle;
3501
0
    return GF_OK;
3502
0
  case 8:
3503
0
    info->name = "crossSection";
3504
0
    info->eventType = GF_SG_EVENT_FIELD;
3505
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
3506
0
    info->far_ptr = & ((X_Extrusion *) node)->crossSection;
3507
0
    return GF_OK;
3508
0
  case 9:
3509
0
    info->name = "endCap";
3510
0
    info->eventType = GF_SG_EVENT_FIELD;
3511
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3512
0
    info->far_ptr = & ((X_Extrusion *) node)->endCap;
3513
0
    return GF_OK;
3514
0
  case 10:
3515
0
    info->name = "orientation";
3516
0
    info->eventType = GF_SG_EVENT_FIELD;
3517
0
    info->fieldType = GF_SG_VRML_MFROTATION;
3518
0
    info->far_ptr = & ((X_Extrusion *) node)->orientation;
3519
0
    return GF_OK;
3520
0
  case 11:
3521
0
    info->name = "scale";
3522
0
    info->eventType = GF_SG_EVENT_FIELD;
3523
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
3524
0
    info->far_ptr = & ((X_Extrusion *) node)->scale;
3525
0
    return GF_OK;
3526
0
  case 12:
3527
0
    info->name = "solid";
3528
0
    info->eventType = GF_SG_EVENT_FIELD;
3529
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3530
0
    info->far_ptr = & ((X_Extrusion *) node)->solid;
3531
0
    return GF_OK;
3532
0
  case 13:
3533
0
    info->name = "spine";
3534
0
    info->eventType = GF_SG_EVENT_FIELD;
3535
0
    info->fieldType = GF_SG_VRML_MFVEC3F;
3536
0
    info->far_ptr = & ((X_Extrusion *) node)->spine;
3537
0
    return GF_OK;
3538
0
  case 14:
3539
0
    info->name = "metadata";
3540
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3541
0
    info->fieldType = GF_SG_VRML_SFNODE;
3542
0
    info->NDTtype = NDT_SFMetadataNode;
3543
0
    info->far_ptr = & ((X_Extrusion *)node)->metadata;
3544
0
    return GF_OK;
3545
0
  default:
3546
0
    return GF_BAD_PARAM;
3547
0
  }
3548
0
}
3549
3550
3551
static s32 Extrusion_get_field_index_by_name(char *name)
3552
0
{
3553
0
  if (!strcmp("set_crossSection", name)) return 0;
3554
0
  if (!strcmp("set_orientation", name)) return 1;
3555
0
  if (!strcmp("set_scale", name)) return 2;
3556
0
  if (!strcmp("set_spine", name)) return 3;
3557
0
  if (!strcmp("beginCap", name)) return 4;
3558
0
  if (!strcmp("ccw", name)) return 5;
3559
0
  if (!strcmp("convex", name)) return 6;
3560
0
  if (!strcmp("creaseAngle", name)) return 7;
3561
0
  if (!strcmp("crossSection", name)) return 8;
3562
0
  if (!strcmp("endCap", name)) return 9;
3563
0
  if (!strcmp("orientation", name)) return 10;
3564
0
  if (!strcmp("scale", name)) return 11;
3565
0
  if (!strcmp("solid", name)) return 12;
3566
0
  if (!strcmp("spine", name)) return 13;
3567
0
  if (!strcmp("metadata", name)) return 14;
3568
0
  return -1;
3569
0
}
3570
3571
3572
static GF_Node *Extrusion_Create()
3573
0
{
3574
0
  X_Extrusion *p;
3575
0
  GF_SAFEALLOC(p, X_Extrusion);
3576
0
  if(!p) return NULL;
3577
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Extrusion);
3578
3579
  /*default field values*/
3580
0
  p->beginCap = 1;
3581
0
  p->ccw = 1;
3582
0
  p->convex = 1;
3583
0
  p->creaseAngle = FLT2FIX(0.0);
3584
0
  p->crossSection.vals = (SFVec2f*) gf_malloc(sizeof(SFVec2f)*5);
3585
0
  p->crossSection.count = 5;
3586
0
  p->crossSection.vals[0].x = FLT2FIX(1);
3587
0
  p->crossSection.vals[0].y = FLT2FIX(1);
3588
0
  p->crossSection.vals[1].x = FLT2FIX(1);
3589
0
  p->crossSection.vals[1].y = FLT2FIX(-1);
3590
0
  p->crossSection.vals[2].x = FLT2FIX(-1);
3591
0
  p->crossSection.vals[2].y = FLT2FIX(-1);
3592
0
  p->crossSection.vals[3].x = FLT2FIX(-1);
3593
0
  p->crossSection.vals[3].y = FLT2FIX(1);
3594
0
  p->crossSection.vals[4].x = FLT2FIX(1);
3595
0
  p->crossSection.vals[4].y = FLT2FIX(1);
3596
0
  p->endCap = 1;
3597
0
  p->orientation.vals = (GF_Vec4*)gf_malloc(sizeof(GF_Vec4)*1);
3598
0
  p->orientation.count = 1;
3599
0
  p->orientation.vals[0].x = FLT2FIX(0);
3600
0
  p->orientation.vals[0].y = FLT2FIX(0);
3601
0
  p->orientation.vals[0].z = FLT2FIX(1);
3602
0
  p->orientation.vals[0].q = FLT2FIX(0);
3603
0
  p->scale.vals = (SFVec2f*) gf_malloc(sizeof(SFVec2f)*1);
3604
0
  p->scale.count = 1;
3605
0
  p->scale.vals[0].x = FLT2FIX(1);
3606
0
  p->scale.vals[0].y = FLT2FIX(1);
3607
0
  p->solid = 1;
3608
0
  p->spine.vals = (SFVec3f*)gf_malloc(sizeof(SFVec3f)*2);
3609
0
  p->spine.count = 2;
3610
0
  p->spine.vals[0].x = FLT2FIX(0);
3611
0
  p->spine.vals[0].y = FLT2FIX(0);
3612
0
  p->spine.vals[0].z = FLT2FIX(0);
3613
0
  p->spine.vals[1].x = FLT2FIX(0);
3614
0
  p->spine.vals[1].y = FLT2FIX(1);
3615
0
  p->spine.vals[1].z = FLT2FIX(0);
3616
0
  return (GF_Node *)p;
3617
0
}
3618
3619
3620
/*
3621
  FillProperties Node deletion
3622
*/
3623
3624
static void FillProperties_Del(GF_Node *node)
3625
0
{
3626
0
  X_FillProperties *p = (X_FillProperties *) node;
3627
0
  gf_node_free((GF_Node *)p);
3628
0
}
3629
3630
3631
static u32 FillProperties_get_field_count(GF_Node *node, u8 dummy)
3632
0
{
3633
0
  return 4;
3634
0
}
3635
3636
static GF_Err FillProperties_get_field(GF_Node *node, GF_FieldInfo *info)
3637
0
{
3638
0
  switch (info->fieldIndex) {
3639
0
  case 0:
3640
0
    info->name = "filled";
3641
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3642
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3643
0
    info->far_ptr = & ((X_FillProperties *) node)->filled;
3644
0
    return GF_OK;
3645
0
  case 1:
3646
0
    info->name = "hatchColor";
3647
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3648
0
    info->fieldType = GF_SG_VRML_SFCOLOR;
3649
0
    info->far_ptr = & ((X_FillProperties *) node)->hatchColor;
3650
0
    return GF_OK;
3651
0
  case 2:
3652
0
    info->name = "hatched";
3653
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3654
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3655
0
    info->far_ptr = & ((X_FillProperties *) node)->hatched;
3656
0
    return GF_OK;
3657
0
  case 3:
3658
0
    info->name = "hatchStyle";
3659
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3660
0
    info->fieldType = GF_SG_VRML_SFINT32;
3661
0
    info->far_ptr = & ((X_FillProperties *) node)->hatchStyle;
3662
0
    return GF_OK;
3663
0
  default:
3664
0
    return GF_BAD_PARAM;
3665
0
  }
3666
0
}
3667
3668
3669
static s32 FillProperties_get_field_index_by_name(char *name)
3670
0
{
3671
0
  if (!strcmp("filled", name)) return 0;
3672
0
  if (!strcmp("hatchColor", name)) return 1;
3673
0
  if (!strcmp("hatched", name)) return 2;
3674
0
  if (!strcmp("hatchStyle", name)) return 3;
3675
0
  return -1;
3676
0
}
3677
3678
3679
static GF_Node *FillProperties_Create()
3680
0
{
3681
0
  X_FillProperties *p;
3682
0
  GF_SAFEALLOC(p, X_FillProperties);
3683
0
  if(!p) return NULL;
3684
0
  gf_node_setup((GF_Node *)p, TAG_X3D_FillProperties);
3685
3686
  /*default field values*/
3687
0
  p->filled = 1;
3688
0
  p->hatchColor.red = FLT2FIX(1);
3689
0
  p->hatchColor.green = FLT2FIX(1);
3690
0
  p->hatchColor.blue = FLT2FIX(1);
3691
0
  p->hatched = 1;
3692
0
  p->hatchStyle = 1;
3693
0
  return (GF_Node *)p;
3694
0
}
3695
3696
3697
/*
3698
  Fog Node deletion
3699
*/
3700
3701
static void Fog_Del(GF_Node *node)
3702
0
{
3703
0
  X_Fog *p = (X_Fog *) node;
3704
0
  gf_sg_sfstring_del(p->fogType);
3705
0
  gf_node_unregister((GF_Node *) p->metadata, node);
3706
0
  gf_node_free((GF_Node *)p);
3707
0
}
3708
3709
3710
static u32 Fog_get_field_count(GF_Node *node, u8 dummy)
3711
0
{
3712
0
  return 7;
3713
0
}
3714
3715
static GF_Err Fog_get_field(GF_Node *node, GF_FieldInfo *info)
3716
0
{
3717
0
  switch (info->fieldIndex) {
3718
0
  case 0:
3719
0
    info->name = "color";
3720
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3721
0
    info->fieldType = GF_SG_VRML_SFCOLOR;
3722
0
    info->far_ptr = & ((X_Fog *) node)->color;
3723
0
    return GF_OK;
3724
0
  case 1:
3725
0
    info->name = "fogType";
3726
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3727
0
    info->fieldType = GF_SG_VRML_SFSTRING;
3728
0
    info->far_ptr = & ((X_Fog *) node)->fogType;
3729
0
    return GF_OK;
3730
0
  case 2:
3731
0
    info->name = "visibilityRange";
3732
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3733
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
3734
0
    info->far_ptr = & ((X_Fog *) node)->visibilityRange;
3735
0
    return GF_OK;
3736
0
  case 3:
3737
0
    info->name = "set_bind";
3738
0
    info->eventType = GF_SG_EVENT_IN;
3739
0
    info->on_event_in = ((X_Fog *)node)->on_set_bind;
3740
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3741
0
    info->far_ptr = & ((X_Fog *) node)->set_bind;
3742
0
    return GF_OK;
3743
0
  case 4:
3744
0
    info->name = "isBound";
3745
0
    info->eventType = GF_SG_EVENT_OUT;
3746
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3747
0
    info->far_ptr = & ((X_Fog *) node)->isBound;
3748
0
    return GF_OK;
3749
0
  case 5:
3750
0
    info->name = "metadata";
3751
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3752
0
    info->fieldType = GF_SG_VRML_SFNODE;
3753
0
    info->NDTtype = NDT_SFMetadataNode;
3754
0
    info->far_ptr = & ((X_Fog *)node)->metadata;
3755
0
    return GF_OK;
3756
0
  case 6:
3757
0
    info->name = "bindTime";
3758
0
    info->eventType = GF_SG_EVENT_OUT;
3759
0
    info->fieldType = GF_SG_VRML_SFTIME;
3760
0
    info->far_ptr = & ((X_Fog *) node)->bindTime;
3761
0
    return GF_OK;
3762
0
  default:
3763
0
    return GF_BAD_PARAM;
3764
0
  }
3765
0
}
3766
3767
3768
static s32 Fog_get_field_index_by_name(char *name)
3769
0
{
3770
0
  if (!strcmp("color", name)) return 0;
3771
0
  if (!strcmp("fogType", name)) return 1;
3772
0
  if (!strcmp("visibilityRange", name)) return 2;
3773
0
  if (!strcmp("set_bind", name)) return 3;
3774
0
  if (!strcmp("isBound", name)) return 4;
3775
0
  if (!strcmp("metadata", name)) return 5;
3776
0
  if (!strcmp("bindTime", name)) return 6;
3777
0
  return -1;
3778
0
}
3779
3780
3781
static GF_Node *Fog_Create()
3782
0
{
3783
0
  X_Fog *p;
3784
0
  GF_SAFEALLOC(p, X_Fog);
3785
0
  if(!p) return NULL;
3786
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Fog);
3787
3788
  /*default field values*/
3789
0
  p->color.red = FLT2FIX(1);
3790
0
  p->color.green = FLT2FIX(1);
3791
0
  p->color.blue = FLT2FIX(1);
3792
0
  p->fogType.buffer = (char*) gf_malloc(sizeof(char) * 7);
3793
0
  strcpy(p->fogType.buffer, "LINEAR");
3794
0
  p->visibilityRange = FLT2FIX(0);
3795
0
  return (GF_Node *)p;
3796
0
}
3797
3798
3799
/*
3800
  FontStyle Node deletion
3801
*/
3802
3803
static void FontStyle_Del(GF_Node *node)
3804
0
{
3805
0
  X_FontStyle *p = (X_FontStyle *) node;
3806
0
  gf_sg_mfstring_del(p->family);
3807
0
  gf_sg_mfstring_del(p->justify);
3808
0
  gf_sg_sfstring_del(p->language);
3809
0
  gf_sg_sfstring_del(p->style);
3810
0
  gf_node_unregister((GF_Node *) p->metadata, node);
3811
0
  gf_node_free((GF_Node *)p);
3812
0
}
3813
3814
3815
static u32 FontStyle_get_field_count(GF_Node *node, u8 dummy)
3816
0
{
3817
0
  return 10;
3818
0
}
3819
3820
static GF_Err FontStyle_get_field(GF_Node *node, GF_FieldInfo *info)
3821
0
{
3822
0
  switch (info->fieldIndex) {
3823
0
  case 0:
3824
0
    info->name = "family";
3825
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3826
0
    info->fieldType = GF_SG_VRML_MFSTRING;
3827
0
    info->far_ptr = & ((X_FontStyle *) node)->family;
3828
0
    return GF_OK;
3829
0
  case 1:
3830
0
    info->name = "horizontal";
3831
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3832
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3833
0
    info->far_ptr = & ((X_FontStyle *) node)->horizontal;
3834
0
    return GF_OK;
3835
0
  case 2:
3836
0
    info->name = "justify";
3837
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3838
0
    info->fieldType = GF_SG_VRML_MFSTRING;
3839
0
    info->far_ptr = & ((X_FontStyle *) node)->justify;
3840
0
    return GF_OK;
3841
0
  case 3:
3842
0
    info->name = "language";
3843
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3844
0
    info->fieldType = GF_SG_VRML_SFSTRING;
3845
0
    info->far_ptr = & ((X_FontStyle *) node)->language;
3846
0
    return GF_OK;
3847
0
  case 4:
3848
0
    info->name = "leftToRight";
3849
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3850
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3851
0
    info->far_ptr = & ((X_FontStyle *) node)->leftToRight;
3852
0
    return GF_OK;
3853
0
  case 5:
3854
0
    info->name = "size";
3855
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3856
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
3857
0
    info->far_ptr = & ((X_FontStyle *) node)->size;
3858
0
    return GF_OK;
3859
0
  case 6:
3860
0
    info->name = "spacing";
3861
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3862
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
3863
0
    info->far_ptr = & ((X_FontStyle *) node)->spacing;
3864
0
    return GF_OK;
3865
0
  case 7:
3866
0
    info->name = "style";
3867
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3868
0
    info->fieldType = GF_SG_VRML_SFSTRING;
3869
0
    info->far_ptr = & ((X_FontStyle *) node)->style;
3870
0
    return GF_OK;
3871
0
  case 8:
3872
0
    info->name = "topToBottom";
3873
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3874
0
    info->fieldType = GF_SG_VRML_SFBOOL;
3875
0
    info->far_ptr = & ((X_FontStyle *) node)->topToBottom;
3876
0
    return GF_OK;
3877
0
  case 9:
3878
0
    info->name = "metadata";
3879
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3880
0
    info->fieldType = GF_SG_VRML_SFNODE;
3881
0
    info->NDTtype = NDT_SFMetadataNode;
3882
0
    info->far_ptr = & ((X_FontStyle *)node)->metadata;
3883
0
    return GF_OK;
3884
0
  default:
3885
0
    return GF_BAD_PARAM;
3886
0
  }
3887
0
}
3888
3889
3890
static s32 FontStyle_get_field_index_by_name(char *name)
3891
0
{
3892
0
  if (!strcmp("family", name)) return 0;
3893
0
  if (!strcmp("horizontal", name)) return 1;
3894
0
  if (!strcmp("justify", name)) return 2;
3895
0
  if (!strcmp("language", name)) return 3;
3896
0
  if (!strcmp("leftToRight", name)) return 4;
3897
0
  if (!strcmp("size", name)) return 5;
3898
0
  if (!strcmp("spacing", name)) return 6;
3899
0
  if (!strcmp("style", name)) return 7;
3900
0
  if (!strcmp("topToBottom", name)) return 8;
3901
0
  if (!strcmp("metadata", name)) return 9;
3902
0
  return -1;
3903
0
}
3904
3905
3906
static GF_Node *FontStyle_Create()
3907
0
{
3908
0
  X_FontStyle *p;
3909
0
  GF_SAFEALLOC(p, X_FontStyle);
3910
0
  if(!p) return NULL;
3911
0
  gf_node_setup((GF_Node *)p, TAG_X3D_FontStyle);
3912
3913
  /*default field values*/
3914
0
  p->family.vals = (char**)gf_malloc(sizeof(SFString)*1);
3915
0
  p->family.count = 1;
3916
0
  p->family.vals[0] = (char*)gf_malloc(sizeof(char) * 6);
3917
0
  strcpy(p->family.vals[0], "SERIF");
3918
0
  p->horizontal = 1;
3919
0
  p->justify.vals = (char**)gf_malloc(sizeof(SFString)*1);
3920
0
  p->justify.count = 1;
3921
0
  p->justify.vals[0] = (char*)gf_malloc(sizeof(char) * 6);
3922
0
  strcpy(p->justify.vals[0], "BEGIN");
3923
0
  p->leftToRight = 1;
3924
0
  p->size = FLT2FIX(1.0);
3925
0
  p->spacing = FLT2FIX(1.0);
3926
0
  p->style.buffer = (char*) gf_malloc(sizeof(char) * 6);
3927
0
  strcpy(p->style.buffer, "PLAIN");
3928
0
  p->topToBottom = 1;
3929
0
  return (GF_Node *)p;
3930
0
}
3931
3932
3933
/*
3934
  GeoCoordinate Node deletion
3935
*/
3936
3937
static void GeoCoordinate_Del(GF_Node *node)
3938
0
{
3939
0
  X_GeoCoordinate *p = (X_GeoCoordinate *) node;
3940
0
  gf_sg_mfvec3d_del(p->point);
3941
0
  gf_node_unregister((GF_Node *) p->geoOrigin, node);
3942
0
  gf_sg_mfstring_del(p->geoSystem);
3943
0
  gf_node_unregister((GF_Node *) p->metadata, node);
3944
0
  gf_node_free((GF_Node *)p);
3945
0
}
3946
3947
3948
static u32 GeoCoordinate_get_field_count(GF_Node *node, u8 dummy)
3949
0
{
3950
0
  return 4;
3951
0
}
3952
3953
static GF_Err GeoCoordinate_get_field(GF_Node *node, GF_FieldInfo *info)
3954
0
{
3955
0
  switch (info->fieldIndex) {
3956
0
  case 0:
3957
0
    info->name = "point";
3958
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3959
0
    info->fieldType = GF_SG_VRML_MFVEC3D;
3960
0
    info->far_ptr = & ((X_GeoCoordinate *) node)->point;
3961
0
    return GF_OK;
3962
0
  case 1:
3963
0
    info->name = "geoOrigin";
3964
0
    info->eventType = GF_SG_EVENT_FIELD;
3965
0
    info->fieldType = GF_SG_VRML_SFNODE;
3966
0
    info->NDTtype = NDT_SFGeoOriginNode;
3967
0
    info->far_ptr = & ((X_GeoCoordinate *)node)->geoOrigin;
3968
0
    return GF_OK;
3969
0
  case 2:
3970
0
    info->name = "geoSystem";
3971
0
    info->eventType = GF_SG_EVENT_FIELD;
3972
0
    info->fieldType = GF_SG_VRML_MFSTRING;
3973
0
    info->far_ptr = & ((X_GeoCoordinate *) node)->geoSystem;
3974
0
    return GF_OK;
3975
0
  case 3:
3976
0
    info->name = "metadata";
3977
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
3978
0
    info->fieldType = GF_SG_VRML_SFNODE;
3979
0
    info->NDTtype = NDT_SFMetadataNode;
3980
0
    info->far_ptr = & ((X_GeoCoordinate *)node)->metadata;
3981
0
    return GF_OK;
3982
0
  default:
3983
0
    return GF_BAD_PARAM;
3984
0
  }
3985
0
}
3986
3987
3988
static s32 GeoCoordinate_get_field_index_by_name(char *name)
3989
0
{
3990
0
  if (!strcmp("point", name)) return 0;
3991
0
  if (!strcmp("geoOrigin", name)) return 1;
3992
0
  if (!strcmp("geoSystem", name)) return 2;
3993
0
  if (!strcmp("metadata", name)) return 3;
3994
0
  return -1;
3995
0
}
3996
3997
3998
static GF_Node *GeoCoordinate_Create()
3999
0
{
4000
0
  X_GeoCoordinate *p;
4001
0
  GF_SAFEALLOC(p, X_GeoCoordinate);
4002
0
  if(!p) return NULL;
4003
0
  gf_node_setup((GF_Node *)p, TAG_X3D_GeoCoordinate);
4004
4005
  /*default field values*/
4006
0
  p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
4007
0
  p->geoSystem.count = 2;
4008
0
  p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
4009
0
  strcpy(p->geoSystem.vals[0], "GD");
4010
0
  p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
4011
0
  strcpy(p->geoSystem.vals[1], "WE");
4012
0
  return (GF_Node *)p;
4013
0
}
4014
4015
4016
/*
4017
  GeoElevationGrid Node deletion
4018
*/
4019
4020
static void GeoElevationGrid_Del(GF_Node *node)
4021
0
{
4022
0
  X_GeoElevationGrid *p = (X_GeoElevationGrid *) node;
4023
0
  gf_sg_mfdouble_del(p->set_height);
4024
0
  gf_node_unregister((GF_Node *) p->color, node);
4025
0
  gf_node_unregister((GF_Node *) p->normal, node);
4026
0
  gf_node_unregister((GF_Node *) p->texCoord, node);
4027
0
  gf_sg_sfstring_del(p->geoGridOrigin);
4028
0
  gf_node_unregister((GF_Node *) p->geoOrigin, node);
4029
0
  gf_sg_mfstring_del(p->geoSystem);
4030
0
  gf_sg_mfdouble_del(p->height);
4031
0
  gf_node_unregister((GF_Node *) p->metadata, node);
4032
0
  gf_node_free((GF_Node *)p);
4033
0
}
4034
4035
4036
static u32 GeoElevationGrid_get_field_count(GF_Node *node, u8 dummy)
4037
0
{
4038
0
  return 19;
4039
0
}
4040
4041
static GF_Err GeoElevationGrid_get_field(GF_Node *node, GF_FieldInfo *info)
4042
0
{
4043
0
  switch (info->fieldIndex) {
4044
0
  case 0:
4045
0
    info->name = "set_height";
4046
0
    info->eventType = GF_SG_EVENT_IN;
4047
0
    info->on_event_in = ((X_GeoElevationGrid *)node)->on_set_height;
4048
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
4049
0
    info->far_ptr = & ((X_GeoElevationGrid *) node)->set_height;
4050
0
    return GF_OK;
4051
0
  case 1:
4052
0
    info->name = "color";
4053
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4054
0
    info->fieldType = GF_SG_VRML_SFNODE;
4055
0
    info->NDTtype = NDT_SFColorNode;
4056
0
    info->far_ptr = & ((X_GeoElevationGrid *)node)->color;
4057
0
    return GF_OK;
4058
0
  case 2:
4059
0
    info->name = "normal";
4060
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4061
0
    info->fieldType = GF_SG_VRML_SFNODE;
4062
0
    info->NDTtype = NDT_SFNormalNode;
4063
0
    info->far_ptr = & ((X_GeoElevationGrid *)node)->normal;
4064
0
    return GF_OK;
4065
0
  case 3:
4066
0
    info->name = "texCoord";
4067
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4068
0
    info->fieldType = GF_SG_VRML_SFNODE;
4069
0
    info->NDTtype = NDT_SFTextureCoordinateNode;
4070
0
    info->far_ptr = & ((X_GeoElevationGrid *)node)->texCoord;
4071
0
    return GF_OK;
4072
0
  case 4:
4073
0
    info->name = "yScale";
4074
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4075
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
4076
0
    info->far_ptr = & ((X_GeoElevationGrid *) node)->yScale;
4077
0
    return GF_OK;
4078
0
  case 5:
4079
0
    info->name = "ccw";
4080
0
    info->eventType = GF_SG_EVENT_FIELD;
4081
0
    info->fieldType = GF_SG_VRML_SFBOOL;
4082
0
    info->far_ptr = & ((X_GeoElevationGrid *) node)->ccw;
4083
0
    return GF_OK;
4084
0
  case 6:
4085
0
    info->name = "colorPerVertex";
4086
0
    info->eventType = GF_SG_EVENT_FIELD;
4087
0
    info->fieldType = GF_SG_VRML_SFBOOL;
4088
0
    info->far_ptr = & ((X_GeoElevationGrid *) node)->colorPerVertex;
4089
0
    return GF_OK;
4090
0
  case 7:
4091
0
    info->name = "creaseAngle";
4092
0
    info->eventType = GF_SG_EVENT_FIELD;
4093
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
4094
0
    info->far_ptr = & ((X_GeoElevationGrid *) node)->creaseAngle;
4095
0
    return GF_OK;
4096
0
  case 8:
4097
0
    info->name = "geoGridOrigin";
4098
0
    info->eventType = GF_SG_EVENT_FIELD;
4099
0
    info->fieldType = GF_SG_VRML_SFSTRING;
4100
0
    info->far_ptr = & ((X_GeoElevationGrid *) node)->geoGridOrigin;
4101
0
    return GF_OK;
4102
0
  case 9:
4103
0
    info->name = "geoOrigin";
4104
0
    info->eventType = GF_SG_EVENT_FIELD;
4105
0
    info->fieldType = GF_SG_VRML_SFNODE;
4106
0
    info->NDTtype = NDT_SFGeoOriginNode;
4107
0
    info->far_ptr = & ((X_GeoElevationGrid *)node)->geoOrigin;
4108
0
    return GF_OK;
4109
0
  case 10:
4110
0
    info->name = "geoSystem";
4111
0
    info->eventType = GF_SG_EVENT_FIELD;
4112
0
    info->fieldType = GF_SG_VRML_MFSTRING;
4113
0
    info->far_ptr = & ((X_GeoElevationGrid *) node)->geoSystem;
4114
0
    return GF_OK;
4115
0
  case 11:
4116
0
    info->name = "height";
4117
0
    info->eventType = GF_SG_EVENT_FIELD;
4118
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
4119
0
    info->far_ptr = & ((X_GeoElevationGrid *) node)->height;
4120
0
    return GF_OK;
4121
0
  case 12:
4122
0
    info->name = "normalPerVertex";
4123
0
    info->eventType = GF_SG_EVENT_FIELD;
4124
0
    info->fieldType = GF_SG_VRML_SFBOOL;
4125
0
    info->far_ptr = & ((X_GeoElevationGrid *) node)->normalPerVertex;
4126
0
    return GF_OK;
4127
0
  case 13:
4128
0
    info->name = "solid";
4129
0
    info->eventType = GF_SG_EVENT_FIELD;
4130
0
    info->fieldType = GF_SG_VRML_SFBOOL;
4131
0
    info->far_ptr = & ((X_GeoElevationGrid *) node)->solid;
4132
0
    return GF_OK;
4133
0
  case 14:
4134
0
    info->name = "xDimension";
4135
0
    info->eventType = GF_SG_EVENT_FIELD;
4136
0
    info->fieldType = GF_SG_VRML_SFINT32;
4137
0
    info->far_ptr = & ((X_GeoElevationGrid *) node)->xDimension;
4138
0
    return GF_OK;
4139
0
  case 15:
4140
0
    info->name = "xSpacing";
4141
0
    info->eventType = GF_SG_EVENT_FIELD;
4142
0
    info->fieldType = GF_SG_VRML_SFDOUBLE;
4143
0
    info->far_ptr = & ((X_GeoElevationGrid *) node)->xSpacing;
4144
0
    return GF_OK;
4145
0
  case 16:
4146
0
    info->name = "zDimension";
4147
0
    info->eventType = GF_SG_EVENT_FIELD;
4148
0
    info->fieldType = GF_SG_VRML_SFINT32;
4149
0
    info->far_ptr = & ((X_GeoElevationGrid *) node)->zDimension;
4150
0
    return GF_OK;
4151
0
  case 17:
4152
0
    info->name = "zSpacing";
4153
0
    info->eventType = GF_SG_EVENT_FIELD;
4154
0
    info->fieldType = GF_SG_VRML_SFDOUBLE;
4155
0
    info->far_ptr = & ((X_GeoElevationGrid *) node)->zSpacing;
4156
0
    return GF_OK;
4157
0
  case 18:
4158
0
    info->name = "metadata";
4159
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4160
0
    info->fieldType = GF_SG_VRML_SFNODE;
4161
0
    info->NDTtype = NDT_SFMetadataNode;
4162
0
    info->far_ptr = & ((X_GeoElevationGrid *)node)->metadata;
4163
0
    return GF_OK;
4164
0
  default:
4165
0
    return GF_BAD_PARAM;
4166
0
  }
4167
0
}
4168
4169
4170
static s32 GeoElevationGrid_get_field_index_by_name(char *name)
4171
0
{
4172
0
  if (!strcmp("set_height", name)) return 0;
4173
0
  if (!strcmp("color", name)) return 1;
4174
0
  if (!strcmp("normal", name)) return 2;
4175
0
  if (!strcmp("texCoord", name)) return 3;
4176
0
  if (!strcmp("yScale", name)) return 4;
4177
0
  if (!strcmp("ccw", name)) return 5;
4178
0
  if (!strcmp("colorPerVertex", name)) return 6;
4179
0
  if (!strcmp("creaseAngle", name)) return 7;
4180
0
  if (!strcmp("geoGridOrigin", name)) return 8;
4181
0
  if (!strcmp("geoOrigin", name)) return 9;
4182
0
  if (!strcmp("geoSystem", name)) return 10;
4183
0
  if (!strcmp("height", name)) return 11;
4184
0
  if (!strcmp("normalPerVertex", name)) return 12;
4185
0
  if (!strcmp("solid", name)) return 13;
4186
0
  if (!strcmp("xDimension", name)) return 14;
4187
0
  if (!strcmp("xSpacing", name)) return 15;
4188
0
  if (!strcmp("zDimension", name)) return 16;
4189
0
  if (!strcmp("zSpacing", name)) return 17;
4190
0
  if (!strcmp("metadata", name)) return 18;
4191
0
  return -1;
4192
0
}
4193
4194
4195
static GF_Node *GeoElevationGrid_Create()
4196
0
{
4197
0
  X_GeoElevationGrid *p;
4198
0
  GF_SAFEALLOC(p, X_GeoElevationGrid);
4199
0
  if(!p) return NULL;
4200
0
  gf_node_setup((GF_Node *)p, TAG_X3D_GeoElevationGrid);
4201
4202
  /*default field values*/
4203
0
  p->yScale = FLT2FIX(1.0);
4204
0
  p->ccw = 1;
4205
0
  p->colorPerVertex = 1;
4206
0
  p->creaseAngle = FLT2FIX(0.0);
4207
0
  p->geoGridOrigin.buffer = (char*) gf_malloc(sizeof(char) * 6);
4208
0
  strcpy(p->geoGridOrigin.buffer, "0 0 0");
4209
0
  p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
4210
0
  p->geoSystem.count = 2;
4211
0
  p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
4212
0
  strcpy(p->geoSystem.vals[0], "GD");
4213
0
  p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
4214
0
  strcpy(p->geoSystem.vals[1], "WE");
4215
0
  p->normalPerVertex = 1;
4216
0
  p->solid = 1;
4217
0
  p->xDimension = 0;
4218
0
  p->xSpacing = (SFDouble) 1.0;
4219
0
  p->zDimension = 0;
4220
0
  p->zSpacing = (SFDouble) 1.0;
4221
0
  return (GF_Node *)p;
4222
0
}
4223
4224
4225
/*
4226
  GeoLocation Node deletion
4227
*/
4228
4229
static void GeoLocation_Del(GF_Node *node)
4230
0
{
4231
0
  X_GeoLocation *p = (X_GeoLocation *) node;
4232
0
  gf_node_unregister((GF_Node *) p->geoOrigin, node);
4233
0
  gf_sg_mfstring_del(p->geoSystem);
4234
0
  gf_node_unregister((GF_Node *) p->metadata, node);
4235
0
  gf_sg_vrml_parent_destroy(node);
4236
0
  gf_node_free((GF_Node *)p);
4237
0
}
4238
4239
4240
static u32 GeoLocation_get_field_count(GF_Node *node, u8 dummy)
4241
0
{
4242
0
  return 7;
4243
0
}
4244
4245
static GF_Err GeoLocation_get_field(GF_Node *node, GF_FieldInfo *info)
4246
0
{
4247
0
  switch (info->fieldIndex) {
4248
0
  case 0:
4249
0
    info->name = "addChildren";
4250
0
    info->eventType = GF_SG_EVENT_IN;
4251
0
    info->on_event_in = ((X_GeoLocation *)node)->on_addChildren;
4252
0
    info->fieldType = GF_SG_VRML_MFNODE;
4253
0
    info->NDTtype = NDT_SF3DNode;
4254
0
    info->far_ptr = & ((X_GeoLocation *)node)->addChildren;
4255
0
    return GF_OK;
4256
0
  case 1:
4257
0
    info->name = "removeChildren";
4258
0
    info->eventType = GF_SG_EVENT_IN;
4259
0
    info->on_event_in = ((X_GeoLocation *)node)->on_removeChildren;
4260
0
    info->fieldType = GF_SG_VRML_MFNODE;
4261
0
    info->NDTtype = NDT_SF3DNode;
4262
0
    info->far_ptr = & ((X_GeoLocation *)node)->removeChildren;
4263
0
    return GF_OK;
4264
0
  case 2:
4265
0
    info->name = "children";
4266
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4267
0
    info->fieldType = GF_SG_VRML_MFNODE;
4268
0
    info->NDTtype = NDT_SF3DNode;
4269
0
    info->far_ptr = & ((X_GeoLocation *)node)->children;
4270
0
    return GF_OK;
4271
0
  case 3:
4272
0
    info->name = "geoCoords";
4273
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4274
0
    info->fieldType = GF_SG_VRML_SFVEC3D;
4275
0
    info->far_ptr = & ((X_GeoLocation *) node)->geoCoords;
4276
0
    return GF_OK;
4277
0
  case 4:
4278
0
    info->name = "geoOrigin";
4279
0
    info->eventType = GF_SG_EVENT_FIELD;
4280
0
    info->fieldType = GF_SG_VRML_SFNODE;
4281
0
    info->NDTtype = NDT_SFGeoOriginNode;
4282
0
    info->far_ptr = & ((X_GeoLocation *)node)->geoOrigin;
4283
0
    return GF_OK;
4284
0
  case 5:
4285
0
    info->name = "geoSystem";
4286
0
    info->eventType = GF_SG_EVENT_FIELD;
4287
0
    info->fieldType = GF_SG_VRML_MFSTRING;
4288
0
    info->far_ptr = & ((X_GeoLocation *) node)->geoSystem;
4289
0
    return GF_OK;
4290
0
  case 6:
4291
0
    info->name = "metadata";
4292
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4293
0
    info->fieldType = GF_SG_VRML_SFNODE;
4294
0
    info->NDTtype = NDT_SFMetadataNode;
4295
0
    info->far_ptr = & ((X_GeoLocation *)node)->metadata;
4296
0
    return GF_OK;
4297
0
  default:
4298
0
    return GF_BAD_PARAM;
4299
0
  }
4300
0
}
4301
4302
4303
static s32 GeoLocation_get_field_index_by_name(char *name)
4304
0
{
4305
0
  if (!strcmp("addChildren", name)) return 0;
4306
0
  if (!strcmp("removeChildren", name)) return 1;
4307
0
  if (!strcmp("children", name)) return 2;
4308
0
  if (!strcmp("geoCoords", name)) return 3;
4309
0
  if (!strcmp("geoOrigin", name)) return 4;
4310
0
  if (!strcmp("geoSystem", name)) return 5;
4311
0
  if (!strcmp("metadata", name)) return 6;
4312
0
  return -1;
4313
0
}
4314
4315
4316
static GF_Node *GeoLocation_Create()
4317
0
{
4318
0
  X_GeoLocation *p;
4319
0
  GF_SAFEALLOC(p, X_GeoLocation);
4320
0
  if(!p) return NULL;
4321
0
  gf_node_setup((GF_Node *)p, TAG_X3D_GeoLocation);
4322
0
  gf_sg_vrml_parent_setup((GF_Node *) p);
4323
4324
  /*default field values*/
4325
0
  p->geoCoords.x = (SFDouble) 0;
4326
0
  p->geoCoords.y = (SFDouble) 0;
4327
0
  p->geoCoords.z = (SFDouble) 0;
4328
0
  p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
4329
0
  p->geoSystem.count = 2;
4330
0
  p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
4331
0
  strcpy(p->geoSystem.vals[0], "GD");
4332
0
  p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
4333
0
  strcpy(p->geoSystem.vals[1], "WE");
4334
0
  return (GF_Node *)p;
4335
0
}
4336
4337
4338
/*
4339
  GeoLOD Node deletion
4340
*/
4341
4342
static void GeoLOD_Del(GF_Node *node)
4343
0
{
4344
0
  X_GeoLOD *p = (X_GeoLOD *) node;
4345
0
  gf_sg_mfurl_del(p->child1Url);
4346
0
  gf_sg_mfurl_del(p->child2Url);
4347
0
  gf_sg_mfurl_del(p->child3Url);
4348
0
  gf_sg_mfurl_del(p->child4Url);
4349
0
  gf_node_unregister((GF_Node *) p->geoOrigin, node);
4350
0
  gf_sg_mfstring_del(p->geoSystem);
4351
0
  gf_sg_mfurl_del(p->rootUrl);
4352
0
  gf_node_unregister_children(node, p->rootNode);
4353
0
  gf_node_unregister_children(node, p->children);
4354
0
  gf_node_unregister((GF_Node *) p->metadata, node);
4355
0
  gf_node_free((GF_Node *)p);
4356
0
}
4357
4358
4359
static u32 GeoLOD_get_field_count(GF_Node *node, u8 dummy)
4360
0
{
4361
0
  return 12;
4362
0
}
4363
4364
static GF_Err GeoLOD_get_field(GF_Node *node, GF_FieldInfo *info)
4365
0
{
4366
0
  switch (info->fieldIndex) {
4367
0
  case 0:
4368
0
    info->name = "center";
4369
0
    info->eventType = GF_SG_EVENT_FIELD;
4370
0
    info->fieldType = GF_SG_VRML_SFVEC3D;
4371
0
    info->far_ptr = & ((X_GeoLOD *) node)->center;
4372
0
    return GF_OK;
4373
0
  case 1:
4374
0
    info->name = "child1Url";
4375
0
    info->eventType = GF_SG_EVENT_FIELD;
4376
0
    info->fieldType = GF_SG_VRML_MFURL;
4377
0
    info->far_ptr = & ((X_GeoLOD *) node)->child1Url;
4378
0
    return GF_OK;
4379
0
  case 2:
4380
0
    info->name = "child2Url";
4381
0
    info->eventType = GF_SG_EVENT_FIELD;
4382
0
    info->fieldType = GF_SG_VRML_MFURL;
4383
0
    info->far_ptr = & ((X_GeoLOD *) node)->child2Url;
4384
0
    return GF_OK;
4385
0
  case 3:
4386
0
    info->name = "child3Url";
4387
0
    info->eventType = GF_SG_EVENT_FIELD;
4388
0
    info->fieldType = GF_SG_VRML_MFURL;
4389
0
    info->far_ptr = & ((X_GeoLOD *) node)->child3Url;
4390
0
    return GF_OK;
4391
0
  case 4:
4392
0
    info->name = "child4Url";
4393
0
    info->eventType = GF_SG_EVENT_FIELD;
4394
0
    info->fieldType = GF_SG_VRML_MFURL;
4395
0
    info->far_ptr = & ((X_GeoLOD *) node)->child4Url;
4396
0
    return GF_OK;
4397
0
  case 5:
4398
0
    info->name = "geoOrigin";
4399
0
    info->eventType = GF_SG_EVENT_FIELD;
4400
0
    info->fieldType = GF_SG_VRML_SFNODE;
4401
0
    info->NDTtype = NDT_SFGeoOriginNode;
4402
0
    info->far_ptr = & ((X_GeoLOD *)node)->geoOrigin;
4403
0
    return GF_OK;
4404
0
  case 6:
4405
0
    info->name = "geoSystem";
4406
0
    info->eventType = GF_SG_EVENT_FIELD;
4407
0
    info->fieldType = GF_SG_VRML_MFSTRING;
4408
0
    info->far_ptr = & ((X_GeoLOD *) node)->geoSystem;
4409
0
    return GF_OK;
4410
0
  case 7:
4411
0
    info->name = "range";
4412
0
    info->eventType = GF_SG_EVENT_FIELD;
4413
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
4414
0
    info->far_ptr = & ((X_GeoLOD *) node)->range;
4415
0
    return GF_OK;
4416
0
  case 8:
4417
0
    info->name = "rootUrl";
4418
0
    info->eventType = GF_SG_EVENT_FIELD;
4419
0
    info->fieldType = GF_SG_VRML_MFURL;
4420
0
    info->far_ptr = & ((X_GeoLOD *) node)->rootUrl;
4421
0
    return GF_OK;
4422
0
  case 9:
4423
0
    info->name = "rootNode";
4424
0
    info->eventType = GF_SG_EVENT_FIELD;
4425
0
    info->fieldType = GF_SG_VRML_MFNODE;
4426
0
    info->NDTtype = NDT_SF3DNode;
4427
0
    info->far_ptr = & ((X_GeoLOD *)node)->rootNode;
4428
0
    return GF_OK;
4429
0
  case 10:
4430
0
    info->name = "children";
4431
0
    info->eventType = GF_SG_EVENT_OUT;
4432
0
    info->fieldType = GF_SG_VRML_MFNODE;
4433
0
    info->NDTtype = NDT_SF3DNode;
4434
0
    info->far_ptr = & ((X_GeoLOD *)node)->children;
4435
0
    return GF_OK;
4436
0
  case 11:
4437
0
    info->name = "metadata";
4438
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4439
0
    info->fieldType = GF_SG_VRML_SFNODE;
4440
0
    info->NDTtype = NDT_SFMetadataNode;
4441
0
    info->far_ptr = & ((X_GeoLOD *)node)->metadata;
4442
0
    return GF_OK;
4443
0
  default:
4444
0
    return GF_BAD_PARAM;
4445
0
  }
4446
0
}
4447
4448
4449
static s32 GeoLOD_get_field_index_by_name(char *name)
4450
0
{
4451
0
  if (!strcmp("center", name)) return 0;
4452
0
  if (!strcmp("child1Url", name)) return 1;
4453
0
  if (!strcmp("child2Url", name)) return 2;
4454
0
  if (!strcmp("child3Url", name)) return 3;
4455
0
  if (!strcmp("child4Url", name)) return 4;
4456
0
  if (!strcmp("geoOrigin", name)) return 5;
4457
0
  if (!strcmp("geoSystem", name)) return 6;
4458
0
  if (!strcmp("range", name)) return 7;
4459
0
  if (!strcmp("rootUrl", name)) return 8;
4460
0
  if (!strcmp("rootNode", name)) return 9;
4461
0
  if (!strcmp("children", name)) return 10;
4462
0
  if (!strcmp("metadata", name)) return 11;
4463
0
  return -1;
4464
0
}
4465
4466
4467
static GF_Node *GeoLOD_Create()
4468
0
{
4469
0
  X_GeoLOD *p;
4470
0
  GF_SAFEALLOC(p, X_GeoLOD);
4471
0
  if(!p) return NULL;
4472
0
  gf_node_setup((GF_Node *)p, TAG_X3D_GeoLOD);
4473
4474
  /*default field values*/
4475
0
  p->center.x = (SFDouble) 0;
4476
0
  p->center.y = (SFDouble) 0;
4477
0
  p->center.z = (SFDouble) 0;
4478
0
  p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
4479
0
  p->geoSystem.count = 2;
4480
0
  p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
4481
0
  strcpy(p->geoSystem.vals[0], "GD");
4482
0
  p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
4483
0
  strcpy(p->geoSystem.vals[1], "WE");
4484
0
  p->range = FLT2FIX(10);
4485
0
  return (GF_Node *)p;
4486
0
}
4487
4488
4489
/*
4490
  GeoMetadata Node deletion
4491
*/
4492
4493
static void GeoMetadata_Del(GF_Node *node)
4494
0
{
4495
0
  X_GeoMetadata *p = (X_GeoMetadata *) node;
4496
0
  gf_node_unregister_children(node, p->data);
4497
0
  gf_sg_mfstring_del(p->summary);
4498
0
  gf_sg_mfurl_del(p->url);
4499
0
  gf_node_unregister((GF_Node *) p->metadata, node);
4500
0
  gf_node_free((GF_Node *)p);
4501
0
}
4502
4503
4504
static u32 GeoMetadata_get_field_count(GF_Node *node, u8 dummy)
4505
0
{
4506
0
  return 4;
4507
0
}
4508
4509
static GF_Err GeoMetadata_get_field(GF_Node *node, GF_FieldInfo *info)
4510
0
{
4511
0
  switch (info->fieldIndex) {
4512
0
  case 0:
4513
0
    info->name = "data";
4514
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4515
0
    info->fieldType = GF_SG_VRML_MFNODE;
4516
0
    info->NDTtype = NDT_SF3DNode;
4517
0
    info->far_ptr = & ((X_GeoMetadata *)node)->data;
4518
0
    return GF_OK;
4519
0
  case 1:
4520
0
    info->name = "summary";
4521
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4522
0
    info->fieldType = GF_SG_VRML_MFSTRING;
4523
0
    info->far_ptr = & ((X_GeoMetadata *) node)->summary;
4524
0
    return GF_OK;
4525
0
  case 2:
4526
0
    info->name = "url";
4527
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4528
0
    info->fieldType = GF_SG_VRML_MFURL;
4529
0
    info->far_ptr = & ((X_GeoMetadata *) node)->url;
4530
0
    return GF_OK;
4531
0
  case 3:
4532
0
    info->name = "metadata";
4533
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4534
0
    info->fieldType = GF_SG_VRML_SFNODE;
4535
0
    info->NDTtype = NDT_SFMetadataNode;
4536
0
    info->far_ptr = & ((X_GeoMetadata *)node)->metadata;
4537
0
    return GF_OK;
4538
0
  default:
4539
0
    return GF_BAD_PARAM;
4540
0
  }
4541
0
}
4542
4543
4544
static s32 GeoMetadata_get_field_index_by_name(char *name)
4545
0
{
4546
0
  if (!strcmp("data", name)) return 0;
4547
0
  if (!strcmp("summary", name)) return 1;
4548
0
  if (!strcmp("url", name)) return 2;
4549
0
  if (!strcmp("metadata", name)) return 3;
4550
0
  return -1;
4551
0
}
4552
4553
4554
static GF_Node *GeoMetadata_Create()
4555
0
{
4556
0
  X_GeoMetadata *p;
4557
0
  GF_SAFEALLOC(p, X_GeoMetadata);
4558
0
  if(!p) return NULL;
4559
0
  gf_node_setup((GF_Node *)p, TAG_X3D_GeoMetadata);
4560
4561
  /*default field values*/
4562
0
  return (GF_Node *)p;
4563
0
}
4564
4565
4566
/*
4567
  GeoOrigin Node deletion
4568
*/
4569
4570
static void GeoOrigin_Del(GF_Node *node)
4571
0
{
4572
0
  X_GeoOrigin *p = (X_GeoOrigin *) node;
4573
0
  gf_sg_mfstring_del(p->geoSystem);
4574
0
  gf_node_unregister((GF_Node *) p->metadata, node);
4575
0
  gf_node_free((GF_Node *)p);
4576
0
}
4577
4578
4579
static u32 GeoOrigin_get_field_count(GF_Node *node, u8 dummy)
4580
0
{
4581
0
  return 4;
4582
0
}
4583
4584
static GF_Err GeoOrigin_get_field(GF_Node *node, GF_FieldInfo *info)
4585
0
{
4586
0
  switch (info->fieldIndex) {
4587
0
  case 0:
4588
0
    info->name = "geoCoords";
4589
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4590
0
    info->fieldType = GF_SG_VRML_SFVEC3D;
4591
0
    info->far_ptr = & ((X_GeoOrigin *) node)->geoCoords;
4592
0
    return GF_OK;
4593
0
  case 1:
4594
0
    info->name = "geoSystem";
4595
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4596
0
    info->fieldType = GF_SG_VRML_MFSTRING;
4597
0
    info->far_ptr = & ((X_GeoOrigin *) node)->geoSystem;
4598
0
    return GF_OK;
4599
0
  case 2:
4600
0
    info->name = "rotateYUp";
4601
0
    info->eventType = GF_SG_EVENT_FIELD;
4602
0
    info->fieldType = GF_SG_VRML_SFBOOL;
4603
0
    info->far_ptr = & ((X_GeoOrigin *) node)->rotateYUp;
4604
0
    return GF_OK;
4605
0
  case 3:
4606
0
    info->name = "metadata";
4607
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4608
0
    info->fieldType = GF_SG_VRML_SFNODE;
4609
0
    info->NDTtype = NDT_SFMetadataNode;
4610
0
    info->far_ptr = & ((X_GeoOrigin *)node)->metadata;
4611
0
    return GF_OK;
4612
0
  default:
4613
0
    return GF_BAD_PARAM;
4614
0
  }
4615
0
}
4616
4617
4618
static s32 GeoOrigin_get_field_index_by_name(char *name)
4619
0
{
4620
0
  if (!strcmp("geoCoords", name)) return 0;
4621
0
  if (!strcmp("geoSystem", name)) return 1;
4622
0
  if (!strcmp("rotateYUp", name)) return 2;
4623
0
  if (!strcmp("metadata", name)) return 3;
4624
0
  return -1;
4625
0
}
4626
4627
4628
static GF_Node *GeoOrigin_Create()
4629
0
{
4630
0
  X_GeoOrigin *p;
4631
0
  GF_SAFEALLOC(p, X_GeoOrigin);
4632
0
  if(!p) return NULL;
4633
0
  gf_node_setup((GF_Node *)p, TAG_X3D_GeoOrigin);
4634
4635
  /*default field values*/
4636
0
  p->geoCoords.x = (SFDouble) 0;
4637
0
  p->geoCoords.y = (SFDouble) 0;
4638
0
  p->geoCoords.z = (SFDouble) 0;
4639
0
  p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
4640
0
  p->geoSystem.count = 2;
4641
0
  p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
4642
0
  strcpy(p->geoSystem.vals[0], "GD");
4643
0
  p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
4644
0
  strcpy(p->geoSystem.vals[1], "WE");
4645
0
  return (GF_Node *)p;
4646
0
}
4647
4648
4649
/*
4650
  GeoPositionInterpolator Node deletion
4651
*/
4652
4653
static void GeoPositionInterpolator_Del(GF_Node *node)
4654
0
{
4655
0
  X_GeoPositionInterpolator *p = (X_GeoPositionInterpolator *) node;
4656
0
  gf_sg_mffloat_del(p->key);
4657
0
  gf_sg_mfvec3d_del(p->keyValue);
4658
0
  gf_node_unregister((GF_Node *) p->geoOrigin, node);
4659
0
  gf_sg_mfstring_del(p->geoSystem);
4660
0
  gf_node_unregister((GF_Node *) p->metadata, node);
4661
0
  gf_node_free((GF_Node *)p);
4662
0
}
4663
4664
4665
static u32 GeoPositionInterpolator_get_field_count(GF_Node *node, u8 dummy)
4666
0
{
4667
0
  return 8;
4668
0
}
4669
4670
static GF_Err GeoPositionInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
4671
0
{
4672
0
  switch (info->fieldIndex) {
4673
0
  case 0:
4674
0
    info->name = "set_fraction";
4675
0
    info->eventType = GF_SG_EVENT_IN;
4676
0
    info->on_event_in = ((X_GeoPositionInterpolator *)node)->on_set_fraction;
4677
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
4678
0
    info->far_ptr = & ((X_GeoPositionInterpolator *) node)->set_fraction;
4679
0
    return GF_OK;
4680
0
  case 1:
4681
0
    info->name = "key";
4682
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4683
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
4684
0
    info->far_ptr = & ((X_GeoPositionInterpolator *) node)->key;
4685
0
    return GF_OK;
4686
0
  case 2:
4687
0
    info->name = "keyValue";
4688
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4689
0
    info->fieldType = GF_SG_VRML_MFVEC3D;
4690
0
    info->far_ptr = & ((X_GeoPositionInterpolator *) node)->keyValue;
4691
0
    return GF_OK;
4692
0
  case 3:
4693
0
    info->name = "geoOrigin";
4694
0
    info->eventType = GF_SG_EVENT_FIELD;
4695
0
    info->fieldType = GF_SG_VRML_SFNODE;
4696
0
    info->NDTtype = NDT_SFGeoOriginNode;
4697
0
    info->far_ptr = & ((X_GeoPositionInterpolator *)node)->geoOrigin;
4698
0
    return GF_OK;
4699
0
  case 4:
4700
0
    info->name = "geoSystem";
4701
0
    info->eventType = GF_SG_EVENT_FIELD;
4702
0
    info->fieldType = GF_SG_VRML_MFSTRING;
4703
0
    info->far_ptr = & ((X_GeoPositionInterpolator *) node)->geoSystem;
4704
0
    return GF_OK;
4705
0
  case 5:
4706
0
    info->name = "geovalue_changed";
4707
0
    info->eventType = GF_SG_EVENT_OUT;
4708
0
    info->fieldType = GF_SG_VRML_SFVEC3D;
4709
0
    info->far_ptr = & ((X_GeoPositionInterpolator *) node)->geovalue_changed;
4710
0
    return GF_OK;
4711
0
  case 6:
4712
0
    info->name = "value_changed";
4713
0
    info->eventType = GF_SG_EVENT_OUT;
4714
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
4715
0
    info->far_ptr = & ((X_GeoPositionInterpolator *) node)->value_changed;
4716
0
    return GF_OK;
4717
0
  case 7:
4718
0
    info->name = "metadata";
4719
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4720
0
    info->fieldType = GF_SG_VRML_SFNODE;
4721
0
    info->NDTtype = NDT_SFMetadataNode;
4722
0
    info->far_ptr = & ((X_GeoPositionInterpolator *)node)->metadata;
4723
0
    return GF_OK;
4724
0
  default:
4725
0
    return GF_BAD_PARAM;
4726
0
  }
4727
0
}
4728
4729
4730
static s32 GeoPositionInterpolator_get_field_index_by_name(char *name)
4731
0
{
4732
0
  if (!strcmp("set_fraction", name)) return 0;
4733
0
  if (!strcmp("key", name)) return 1;
4734
0
  if (!strcmp("keyValue", name)) return 2;
4735
0
  if (!strcmp("geoOrigin", name)) return 3;
4736
0
  if (!strcmp("geoSystem", name)) return 4;
4737
0
  if (!strcmp("geovalue_changed", name)) return 5;
4738
0
  if (!strcmp("value_changed", name)) return 6;
4739
0
  if (!strcmp("metadata", name)) return 7;
4740
0
  return -1;
4741
0
}
4742
4743
4744
static GF_Node *GeoPositionInterpolator_Create()
4745
0
{
4746
0
  X_GeoPositionInterpolator *p;
4747
0
  GF_SAFEALLOC(p, X_GeoPositionInterpolator);
4748
0
  if(!p) return NULL;
4749
0
  gf_node_setup((GF_Node *)p, TAG_X3D_GeoPositionInterpolator);
4750
4751
  /*default field values*/
4752
0
  p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
4753
0
  p->geoSystem.count = 2;
4754
0
  p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
4755
0
  strcpy(p->geoSystem.vals[0], "GD");
4756
0
  p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
4757
0
  strcpy(p->geoSystem.vals[1], "WE");
4758
0
  return (GF_Node *)p;
4759
0
}
4760
4761
4762
/*
4763
  GeoTouchSensor Node deletion
4764
*/
4765
4766
static void GeoTouchSensor_Del(GF_Node *node)
4767
0
{
4768
0
  X_GeoTouchSensor *p = (X_GeoTouchSensor *) node;
4769
0
  gf_node_unregister((GF_Node *) p->geoOrigin, node);
4770
0
  gf_sg_mfstring_del(p->geoSystem);
4771
0
  gf_node_unregister((GF_Node *) p->metadata, node);
4772
0
  gf_node_free((GF_Node *)p);
4773
0
}
4774
4775
4776
static u32 GeoTouchSensor_get_field_count(GF_Node *node, u8 dummy)
4777
0
{
4778
0
  return 11;
4779
0
}
4780
4781
static GF_Err GeoTouchSensor_get_field(GF_Node *node, GF_FieldInfo *info)
4782
0
{
4783
0
  switch (info->fieldIndex) {
4784
0
  case 0:
4785
0
    info->name = "enabled";
4786
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4787
0
    info->fieldType = GF_SG_VRML_SFBOOL;
4788
0
    info->far_ptr = & ((X_GeoTouchSensor *) node)->enabled;
4789
0
    return GF_OK;
4790
0
  case 1:
4791
0
    info->name = "geoOrigin";
4792
0
    info->eventType = GF_SG_EVENT_FIELD;
4793
0
    info->fieldType = GF_SG_VRML_SFNODE;
4794
0
    info->NDTtype = NDT_SFGeoOriginNode;
4795
0
    info->far_ptr = & ((X_GeoTouchSensor *)node)->geoOrigin;
4796
0
    return GF_OK;
4797
0
  case 2:
4798
0
    info->name = "geoSystem";
4799
0
    info->eventType = GF_SG_EVENT_FIELD;
4800
0
    info->fieldType = GF_SG_VRML_MFSTRING;
4801
0
    info->far_ptr = & ((X_GeoTouchSensor *) node)->geoSystem;
4802
0
    return GF_OK;
4803
0
  case 3:
4804
0
    info->name = "hitNormal_changed";
4805
0
    info->eventType = GF_SG_EVENT_OUT;
4806
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
4807
0
    info->far_ptr = & ((X_GeoTouchSensor *) node)->hitNormal_changed;
4808
0
    return GF_OK;
4809
0
  case 4:
4810
0
    info->name = "hitPoint_changed";
4811
0
    info->eventType = GF_SG_EVENT_OUT;
4812
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
4813
0
    info->far_ptr = & ((X_GeoTouchSensor *) node)->hitPoint_changed;
4814
0
    return GF_OK;
4815
0
  case 5:
4816
0
    info->name = "hitTexCoord_changed";
4817
0
    info->eventType = GF_SG_EVENT_OUT;
4818
0
    info->fieldType = GF_SG_VRML_SFVEC2F;
4819
0
    info->far_ptr = & ((X_GeoTouchSensor *) node)->hitTexCoord_changed;
4820
0
    return GF_OK;
4821
0
  case 6:
4822
0
    info->name = "hitGeoCoord_changed";
4823
0
    info->eventType = GF_SG_EVENT_OUT;
4824
0
    info->fieldType = GF_SG_VRML_SFVEC3D;
4825
0
    info->far_ptr = & ((X_GeoTouchSensor *) node)->hitGeoCoord_changed;
4826
0
    return GF_OK;
4827
0
  case 7:
4828
0
    info->name = "isActive";
4829
0
    info->eventType = GF_SG_EVENT_OUT;
4830
0
    info->fieldType = GF_SG_VRML_SFBOOL;
4831
0
    info->far_ptr = & ((X_GeoTouchSensor *) node)->isActive;
4832
0
    return GF_OK;
4833
0
  case 8:
4834
0
    info->name = "isOver";
4835
0
    info->eventType = GF_SG_EVENT_OUT;
4836
0
    info->fieldType = GF_SG_VRML_SFBOOL;
4837
0
    info->far_ptr = & ((X_GeoTouchSensor *) node)->isOver;
4838
0
    return GF_OK;
4839
0
  case 9:
4840
0
    info->name = "touchTime";
4841
0
    info->eventType = GF_SG_EVENT_OUT;
4842
0
    info->fieldType = GF_SG_VRML_SFTIME;
4843
0
    info->far_ptr = & ((X_GeoTouchSensor *) node)->touchTime;
4844
0
    return GF_OK;
4845
0
  case 10:
4846
0
    info->name = "metadata";
4847
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4848
0
    info->fieldType = GF_SG_VRML_SFNODE;
4849
0
    info->NDTtype = NDT_SFMetadataNode;
4850
0
    info->far_ptr = & ((X_GeoTouchSensor *)node)->metadata;
4851
0
    return GF_OK;
4852
0
  default:
4853
0
    return GF_BAD_PARAM;
4854
0
  }
4855
0
}
4856
4857
4858
static s32 GeoTouchSensor_get_field_index_by_name(char *name)
4859
0
{
4860
0
  if (!strcmp("enabled", name)) return 0;
4861
0
  if (!strcmp("geoOrigin", name)) return 1;
4862
0
  if (!strcmp("geoSystem", name)) return 2;
4863
0
  if (!strcmp("hitNormal_changed", name)) return 3;
4864
0
  if (!strcmp("hitPoint_changed", name)) return 4;
4865
0
  if (!strcmp("hitTexCoord_changed", name)) return 5;
4866
0
  if (!strcmp("hitGeoCoord_changed", name)) return 6;
4867
0
  if (!strcmp("isActive", name)) return 7;
4868
0
  if (!strcmp("isOver", name)) return 8;
4869
0
  if (!strcmp("touchTime", name)) return 9;
4870
0
  if (!strcmp("metadata", name)) return 10;
4871
0
  return -1;
4872
0
}
4873
4874
4875
static GF_Node *GeoTouchSensor_Create()
4876
0
{
4877
0
  X_GeoTouchSensor *p;
4878
0
  GF_SAFEALLOC(p, X_GeoTouchSensor);
4879
0
  if(!p) return NULL;
4880
0
  gf_node_setup((GF_Node *)p, TAG_X3D_GeoTouchSensor);
4881
4882
  /*default field values*/
4883
0
  p->enabled = 1;
4884
0
  p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
4885
0
  p->geoSystem.count = 2;
4886
0
  p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
4887
0
  strcpy(p->geoSystem.vals[0], "GD");
4888
0
  p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
4889
0
  strcpy(p->geoSystem.vals[1], "WE");
4890
0
  return (GF_Node *)p;
4891
0
}
4892
4893
4894
/*
4895
  GeoViewpoint Node deletion
4896
*/
4897
4898
static void GeoViewpoint_Del(GF_Node *node)
4899
0
{
4900
0
  X_GeoViewpoint *p = (X_GeoViewpoint *) node;
4901
0
  gf_sg_sfstring_del(p->set_orientation);
4902
0
  gf_sg_sfstring_del(p->set_position);
4903
0
  gf_sg_sfstring_del(p->description);
4904
0
  gf_sg_mfstring_del(p->navType);
4905
0
  gf_node_unregister((GF_Node *) p->geoOrigin, node);
4906
0
  gf_sg_mfstring_del(p->geoSystem);
4907
0
  gf_node_unregister((GF_Node *) p->metadata, node);
4908
0
  gf_node_free((GF_Node *)p);
4909
0
}
4910
4911
4912
static u32 GeoViewpoint_get_field_count(GF_Node *node, u8 dummy)
4913
0
{
4914
0
  return 16;
4915
0
}
4916
4917
static GF_Err GeoViewpoint_get_field(GF_Node *node, GF_FieldInfo *info)
4918
0
{
4919
0
  switch (info->fieldIndex) {
4920
0
  case 0:
4921
0
    info->name = "set_bind";
4922
0
    info->eventType = GF_SG_EVENT_IN;
4923
0
    info->on_event_in = ((X_GeoViewpoint *)node)->on_set_bind;
4924
0
    info->fieldType = GF_SG_VRML_SFBOOL;
4925
0
    info->far_ptr = & ((X_GeoViewpoint *) node)->set_bind;
4926
0
    return GF_OK;
4927
0
  case 1:
4928
0
    info->name = "set_orientation";
4929
0
    info->eventType = GF_SG_EVENT_IN;
4930
0
    info->on_event_in = ((X_GeoViewpoint *)node)->on_set_orientation;
4931
0
    info->fieldType = GF_SG_VRML_SFSTRING;
4932
0
    info->far_ptr = & ((X_GeoViewpoint *) node)->set_orientation;
4933
0
    return GF_OK;
4934
0
  case 2:
4935
0
    info->name = "set_position";
4936
0
    info->eventType = GF_SG_EVENT_IN;
4937
0
    info->on_event_in = ((X_GeoViewpoint *)node)->on_set_position;
4938
0
    info->fieldType = GF_SG_VRML_SFSTRING;
4939
0
    info->far_ptr = & ((X_GeoViewpoint *) node)->set_position;
4940
0
    return GF_OK;
4941
0
  case 3:
4942
0
    info->name = "description";
4943
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4944
0
    info->fieldType = GF_SG_VRML_SFSTRING;
4945
0
    info->far_ptr = & ((X_GeoViewpoint *) node)->description;
4946
0
    return GF_OK;
4947
0
  case 4:
4948
0
    info->name = "fieldOfView";
4949
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4950
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
4951
0
    info->far_ptr = & ((X_GeoViewpoint *) node)->fieldOfView;
4952
0
    return GF_OK;
4953
0
  case 5:
4954
0
    info->name = "headlight";
4955
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4956
0
    info->fieldType = GF_SG_VRML_SFBOOL;
4957
0
    info->far_ptr = & ((X_GeoViewpoint *) node)->headlight;
4958
0
    return GF_OK;
4959
0
  case 6:
4960
0
    info->name = "jump";
4961
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4962
0
    info->fieldType = GF_SG_VRML_SFBOOL;
4963
0
    info->far_ptr = & ((X_GeoViewpoint *) node)->jump;
4964
0
    return GF_OK;
4965
0
  case 7:
4966
0
    info->name = "navType";
4967
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
4968
0
    info->fieldType = GF_SG_VRML_MFSTRING;
4969
0
    info->far_ptr = & ((X_GeoViewpoint *) node)->navType;
4970
0
    return GF_OK;
4971
0
  case 8:
4972
0
    info->name = "bindTime";
4973
0
    info->eventType = GF_SG_EVENT_OUT;
4974
0
    info->fieldType = GF_SG_VRML_SFTIME;
4975
0
    info->far_ptr = & ((X_GeoViewpoint *) node)->bindTime;
4976
0
    return GF_OK;
4977
0
  case 9:
4978
0
    info->name = "isBound";
4979
0
    info->eventType = GF_SG_EVENT_OUT;
4980
0
    info->fieldType = GF_SG_VRML_SFBOOL;
4981
0
    info->far_ptr = & ((X_GeoViewpoint *) node)->isBound;
4982
0
    return GF_OK;
4983
0
  case 10:
4984
0
    info->name = "geoOrigin";
4985
0
    info->eventType = GF_SG_EVENT_FIELD;
4986
0
    info->fieldType = GF_SG_VRML_SFNODE;
4987
0
    info->NDTtype = NDT_SFGeoOriginNode;
4988
0
    info->far_ptr = & ((X_GeoViewpoint *)node)->geoOrigin;
4989
0
    return GF_OK;
4990
0
  case 11:
4991
0
    info->name = "geoSystem";
4992
0
    info->eventType = GF_SG_EVENT_FIELD;
4993
0
    info->fieldType = GF_SG_VRML_MFSTRING;
4994
0
    info->far_ptr = & ((X_GeoViewpoint *) node)->geoSystem;
4995
0
    return GF_OK;
4996
0
  case 12:
4997
0
    info->name = "orientation";
4998
0
    info->eventType = GF_SG_EVENT_FIELD;
4999
0
    info->fieldType = GF_SG_VRML_SFROTATION;
5000
0
    info->far_ptr = & ((X_GeoViewpoint *) node)->orientation;
5001
0
    return GF_OK;
5002
0
  case 13:
5003
0
    info->name = "position";
5004
0
    info->eventType = GF_SG_EVENT_FIELD;
5005
0
    info->fieldType = GF_SG_VRML_SFVEC3D;
5006
0
    info->far_ptr = & ((X_GeoViewpoint *) node)->position;
5007
0
    return GF_OK;
5008
0
  case 14:
5009
0
    info->name = "speedFactor";
5010
0
    info->eventType = GF_SG_EVENT_FIELD;
5011
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
5012
0
    info->far_ptr = & ((X_GeoViewpoint *) node)->speedFactor;
5013
0
    return GF_OK;
5014
0
  case 15:
5015
0
    info->name = "metadata";
5016
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5017
0
    info->fieldType = GF_SG_VRML_SFNODE;
5018
0
    info->NDTtype = NDT_SFMetadataNode;
5019
0
    info->far_ptr = & ((X_GeoViewpoint *)node)->metadata;
5020
0
    return GF_OK;
5021
0
  default:
5022
0
    return GF_BAD_PARAM;
5023
0
  }
5024
0
}
5025
5026
5027
static s32 GeoViewpoint_get_field_index_by_name(char *name)
5028
0
{
5029
0
  if (!strcmp("set_bind", name)) return 0;
5030
0
  if (!strcmp("set_orientation", name)) return 1;
5031
0
  if (!strcmp("set_position", name)) return 2;
5032
0
  if (!strcmp("description", name)) return 3;
5033
0
  if (!strcmp("fieldOfView", name)) return 4;
5034
0
  if (!strcmp("headlight", name)) return 5;
5035
0
  if (!strcmp("jump", name)) return 6;
5036
0
  if (!strcmp("navType", name)) return 7;
5037
0
  if (!strcmp("bindTime", name)) return 8;
5038
0
  if (!strcmp("isBound", name)) return 9;
5039
0
  if (!strcmp("geoOrigin", name)) return 10;
5040
0
  if (!strcmp("geoSystem", name)) return 11;
5041
0
  if (!strcmp("orientation", name)) return 12;
5042
0
  if (!strcmp("position", name)) return 13;
5043
0
  if (!strcmp("speedFactor", name)) return 14;
5044
0
  if (!strcmp("metadata", name)) return 15;
5045
0
  return -1;
5046
0
}
5047
5048
5049
static GF_Node *GeoViewpoint_Create()
5050
0
{
5051
0
  X_GeoViewpoint *p;
5052
0
  GF_SAFEALLOC(p, X_GeoViewpoint);
5053
0
  if(!p) return NULL;
5054
0
  gf_node_setup((GF_Node *)p, TAG_X3D_GeoViewpoint);
5055
5056
  /*default field values*/
5057
0
  p->fieldOfView = FLT2FIX(0.785398);
5058
0
  p->headlight = 1;
5059
0
  p->jump = 1;
5060
0
  p->navType.vals = (char**)gf_malloc(sizeof(SFString)*2);
5061
0
  p->navType.count = 2;
5062
0
  p->navType.vals[0] = (char*)gf_malloc(sizeof(char) * 8);
5063
0
  strcpy(p->navType.vals[0], "EXAMINE");
5064
0
  p->navType.vals[1] = (char*)gf_malloc(sizeof(char) * 4);
5065
0
  strcpy(p->navType.vals[1], "ANY");
5066
0
  p->geoSystem.vals = (char**)gf_malloc(sizeof(SFString)*2);
5067
0
  p->geoSystem.count = 2;
5068
0
  p->geoSystem.vals[0] = (char*)gf_malloc(sizeof(char) * 3);
5069
0
  strcpy(p->geoSystem.vals[0], "GD");
5070
0
  p->geoSystem.vals[1] = (char*)gf_malloc(sizeof(char) * 3);
5071
0
  strcpy(p->geoSystem.vals[1], "WE");
5072
0
  p->orientation.x = FLT2FIX(0);
5073
0
  p->orientation.y = FLT2FIX(0);
5074
0
  p->orientation.z = FLT2FIX(1);
5075
0
  p->orientation.q = FLT2FIX(0);
5076
0
  p->position.x = (SFDouble) 0;
5077
0
  p->position.y = (SFDouble) 0;
5078
0
  p->position.z = (SFDouble) 100000;
5079
0
  p->speedFactor = FLT2FIX(1.0);
5080
0
  return (GF_Node *)p;
5081
0
}
5082
5083
5084
/*
5085
  Group Node deletion
5086
*/
5087
5088
static void Group_Del(GF_Node *node)
5089
0
{
5090
0
  X_Group *p = (X_Group *) node;
5091
0
  gf_node_unregister((GF_Node *) p->metadata, node);
5092
0
  gf_sg_vrml_parent_destroy(node);
5093
0
  gf_node_free((GF_Node *)p);
5094
0
}
5095
5096
5097
static u32 Group_get_field_count(GF_Node *node, u8 dummy)
5098
0
{
5099
0
  return 4;
5100
0
}
5101
5102
static GF_Err Group_get_field(GF_Node *node, GF_FieldInfo *info)
5103
0
{
5104
0
  switch (info->fieldIndex) {
5105
0
  case 0:
5106
0
    info->name = "addChildren";
5107
0
    info->eventType = GF_SG_EVENT_IN;
5108
0
    info->on_event_in = ((X_Group *)node)->on_addChildren;
5109
0
    info->fieldType = GF_SG_VRML_MFNODE;
5110
0
    info->NDTtype = NDT_SF3DNode;
5111
0
    info->far_ptr = & ((X_Group *)node)->addChildren;
5112
0
    return GF_OK;
5113
0
  case 1:
5114
0
    info->name = "removeChildren";
5115
0
    info->eventType = GF_SG_EVENT_IN;
5116
0
    info->on_event_in = ((X_Group *)node)->on_removeChildren;
5117
0
    info->fieldType = GF_SG_VRML_MFNODE;
5118
0
    info->NDTtype = NDT_SF3DNode;
5119
0
    info->far_ptr = & ((X_Group *)node)->removeChildren;
5120
0
    return GF_OK;
5121
0
  case 2:
5122
0
    info->name = "children";
5123
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5124
0
    info->fieldType = GF_SG_VRML_MFNODE;
5125
0
    info->NDTtype = NDT_SF3DNode;
5126
0
    info->far_ptr = & ((X_Group *)node)->children;
5127
0
    return GF_OK;
5128
0
  case 3:
5129
0
    info->name = "metadata";
5130
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5131
0
    info->fieldType = GF_SG_VRML_SFNODE;
5132
0
    info->NDTtype = NDT_SFMetadataNode;
5133
0
    info->far_ptr = & ((X_Group *)node)->metadata;
5134
0
    return GF_OK;
5135
0
  default:
5136
0
    return GF_BAD_PARAM;
5137
0
  }
5138
0
}
5139
5140
5141
static s32 Group_get_field_index_by_name(char *name)
5142
0
{
5143
0
  if (!strcmp("addChildren", name)) return 0;
5144
0
  if (!strcmp("removeChildren", name)) return 1;
5145
0
  if (!strcmp("children", name)) return 2;
5146
0
  if (!strcmp("metadata", name)) return 3;
5147
0
  return -1;
5148
0
}
5149
5150
5151
static GF_Node *Group_Create()
5152
0
{
5153
0
  X_Group *p;
5154
0
  GF_SAFEALLOC(p, X_Group);
5155
0
  if(!p) return NULL;
5156
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Group);
5157
0
  gf_sg_vrml_parent_setup((GF_Node *) p);
5158
5159
  /*default field values*/
5160
0
  return (GF_Node *)p;
5161
0
}
5162
5163
5164
/*
5165
  HAnimDisplacer Node deletion
5166
*/
5167
5168
static void HAnimDisplacer_Del(GF_Node *node)
5169
0
{
5170
0
  X_HAnimDisplacer *p = (X_HAnimDisplacer *) node;
5171
0
  gf_sg_mfint32_del(p->coordIndex);
5172
0
  gf_sg_mfvec3f_del(p->displacements);
5173
0
  gf_sg_sfstring_del(p->name);
5174
0
  gf_node_unregister((GF_Node *) p->metadata, node);
5175
0
  gf_node_free((GF_Node *)p);
5176
0
}
5177
5178
5179
static u32 HAnimDisplacer_get_field_count(GF_Node *node, u8 dummy)
5180
0
{
5181
0
  return 5;
5182
0
}
5183
5184
static GF_Err HAnimDisplacer_get_field(GF_Node *node, GF_FieldInfo *info)
5185
0
{
5186
0
  switch (info->fieldIndex) {
5187
0
  case 0:
5188
0
    info->name = "coordIndex";
5189
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5190
0
    info->fieldType = GF_SG_VRML_MFINT32;
5191
0
    info->far_ptr = & ((X_HAnimDisplacer *) node)->coordIndex;
5192
0
    return GF_OK;
5193
0
  case 1:
5194
0
    info->name = "displacements";
5195
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5196
0
    info->fieldType = GF_SG_VRML_MFVEC3F;
5197
0
    info->far_ptr = & ((X_HAnimDisplacer *) node)->displacements;
5198
0
    return GF_OK;
5199
0
  case 2:
5200
0
    info->name = "name";
5201
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5202
0
    info->fieldType = GF_SG_VRML_SFSTRING;
5203
0
    info->far_ptr = & ((X_HAnimDisplacer *) node)->name;
5204
0
    return GF_OK;
5205
0
  case 3:
5206
0
    info->name = "weight";
5207
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5208
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
5209
0
    info->far_ptr = & ((X_HAnimDisplacer *) node)->weight;
5210
0
    return GF_OK;
5211
0
  case 4:
5212
0
    info->name = "metadata";
5213
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5214
0
    info->fieldType = GF_SG_VRML_SFNODE;
5215
0
    info->NDTtype = NDT_SFMetadataNode;
5216
0
    info->far_ptr = & ((X_HAnimDisplacer *)node)->metadata;
5217
0
    return GF_OK;
5218
0
  default:
5219
0
    return GF_BAD_PARAM;
5220
0
  }
5221
0
}
5222
5223
5224
static s32 HAnimDisplacer_get_field_index_by_name(char *name)
5225
0
{
5226
0
  if (!strcmp("coordIndex", name)) return 0;
5227
0
  if (!strcmp("displacements", name)) return 1;
5228
0
  if (!strcmp("name", name)) return 2;
5229
0
  if (!strcmp("weight", name)) return 3;
5230
0
  if (!strcmp("metadata", name)) return 4;
5231
0
  return -1;
5232
0
}
5233
5234
5235
static GF_Node *HAnimDisplacer_Create()
5236
0
{
5237
0
  X_HAnimDisplacer *p;
5238
0
  GF_SAFEALLOC(p, X_HAnimDisplacer);
5239
0
  if(!p) return NULL;
5240
0
  gf_node_setup((GF_Node *)p, TAG_X3D_HAnimDisplacer);
5241
5242
  /*default field values*/
5243
0
  p->weight = FLT2FIX(0.0);
5244
0
  return (GF_Node *)p;
5245
0
}
5246
5247
5248
/*
5249
  HAnimHumanoid Node deletion
5250
*/
5251
5252
static void HAnimHumanoid_Del(GF_Node *node)
5253
0
{
5254
0
  X_HAnimHumanoid *p = (X_HAnimHumanoid *) node;
5255
0
  gf_sg_mfstring_del(p->info);
5256
0
  gf_node_unregister_children(node, p->joints);
5257
0
  gf_sg_sfstring_del(p->name);
5258
0
  gf_node_unregister_children(node, p->segments);
5259
0
  gf_node_unregister_children(node, p->sites);
5260
0
  gf_node_unregister_children(node, p->skeleton);
5261
0
  gf_node_unregister_children(node, p->skin);
5262
0
  gf_node_unregister((GF_Node *) p->skinCoord, node);
5263
0
  gf_node_unregister((GF_Node *) p->skinNormal, node);
5264
0
  gf_sg_sfstring_del(p->version);
5265
0
  gf_node_unregister_children(node, p->viewpoints);
5266
0
  gf_node_unregister((GF_Node *) p->metadata, node);
5267
0
  gf_node_free((GF_Node *)p);
5268
0
}
5269
5270
5271
static u32 HAnimHumanoid_get_field_count(GF_Node *node, u8 dummy)
5272
0
{
5273
0
  return 17;
5274
0
}
5275
5276
static GF_Err HAnimHumanoid_get_field(GF_Node *node, GF_FieldInfo *info)
5277
0
{
5278
0
  switch (info->fieldIndex) {
5279
0
  case 0:
5280
0
    info->name = "center";
5281
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5282
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
5283
0
    info->far_ptr = & ((X_HAnimHumanoid *) node)->center;
5284
0
    return GF_OK;
5285
0
  case 1:
5286
0
    info->name = "info";
5287
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5288
0
    info->fieldType = GF_SG_VRML_MFSTRING;
5289
0
    info->far_ptr = & ((X_HAnimHumanoid *) node)->info;
5290
0
    return GF_OK;
5291
0
  case 2:
5292
0
    info->name = "joints";
5293
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5294
0
    info->fieldType = GF_SG_VRML_MFNODE;
5295
0
    info->NDTtype = NDT_SFHAnimNode;
5296
0
    info->far_ptr = & ((X_HAnimHumanoid *)node)->joints;
5297
0
    return GF_OK;
5298
0
  case 3:
5299
0
    info->name = "name";
5300
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5301
0
    info->fieldType = GF_SG_VRML_SFSTRING;
5302
0
    info->far_ptr = & ((X_HAnimHumanoid *) node)->name;
5303
0
    return GF_OK;
5304
0
  case 4:
5305
0
    info->name = "rotation";
5306
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5307
0
    info->fieldType = GF_SG_VRML_SFROTATION;
5308
0
    info->far_ptr = & ((X_HAnimHumanoid *) node)->rotation;
5309
0
    return GF_OK;
5310
0
  case 5:
5311
0
    info->name = "scale";
5312
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5313
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
5314
0
    info->far_ptr = & ((X_HAnimHumanoid *) node)->scale;
5315
0
    return GF_OK;
5316
0
  case 6:
5317
0
    info->name = "scaleOrientation";
5318
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5319
0
    info->fieldType = GF_SG_VRML_SFROTATION;
5320
0
    info->far_ptr = & ((X_HAnimHumanoid *) node)->scaleOrientation;
5321
0
    return GF_OK;
5322
0
  case 7:
5323
0
    info->name = "segments";
5324
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5325
0
    info->fieldType = GF_SG_VRML_MFNODE;
5326
0
    info->NDTtype = NDT_SFHAnimNode;
5327
0
    info->far_ptr = & ((X_HAnimHumanoid *)node)->segments;
5328
0
    return GF_OK;
5329
0
  case 8:
5330
0
    info->name = "sites";
5331
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5332
0
    info->fieldType = GF_SG_VRML_MFNODE;
5333
0
    info->NDTtype = NDT_SFHAnimNode;
5334
0
    info->far_ptr = & ((X_HAnimHumanoid *)node)->sites;
5335
0
    return GF_OK;
5336
0
  case 9:
5337
0
    info->name = "skeleton";
5338
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5339
0
    info->fieldType = GF_SG_VRML_MFNODE;
5340
0
    info->NDTtype = NDT_SFHAnimNode;
5341
0
    info->far_ptr = & ((X_HAnimHumanoid *)node)->skeleton;
5342
0
    return GF_OK;
5343
0
  case 10:
5344
0
    info->name = "skin";
5345
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5346
0
    info->fieldType = GF_SG_VRML_MFNODE;
5347
0
    info->NDTtype = NDT_SF3DNode;
5348
0
    info->far_ptr = & ((X_HAnimHumanoid *)node)->skin;
5349
0
    return GF_OK;
5350
0
  case 11:
5351
0
    info->name = "skinCoord";
5352
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5353
0
    info->fieldType = GF_SG_VRML_SFNODE;
5354
0
    info->NDTtype = NDT_SFCoordinateNode;
5355
0
    info->far_ptr = & ((X_HAnimHumanoid *)node)->skinCoord;
5356
0
    return GF_OK;
5357
0
  case 12:
5358
0
    info->name = "skinNormal";
5359
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5360
0
    info->fieldType = GF_SG_VRML_SFNODE;
5361
0
    info->NDTtype = NDT_SFNormalNode;
5362
0
    info->far_ptr = & ((X_HAnimHumanoid *)node)->skinNormal;
5363
0
    return GF_OK;
5364
0
  case 13:
5365
0
    info->name = "translation";
5366
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5367
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
5368
0
    info->far_ptr = & ((X_HAnimHumanoid *) node)->translation;
5369
0
    return GF_OK;
5370
0
  case 14:
5371
0
    info->name = "version";
5372
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5373
0
    info->fieldType = GF_SG_VRML_SFSTRING;
5374
0
    info->far_ptr = & ((X_HAnimHumanoid *) node)->version;
5375
0
    return GF_OK;
5376
0
  case 15:
5377
0
    info->name = "viewpoints";
5378
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5379
0
    info->fieldType = GF_SG_VRML_MFNODE;
5380
0
    info->NDTtype = NDT_SFViewpointNode;
5381
0
    info->far_ptr = & ((X_HAnimHumanoid *)node)->viewpoints;
5382
0
    return GF_OK;
5383
0
  case 16:
5384
0
    info->name = "metadata";
5385
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5386
0
    info->fieldType = GF_SG_VRML_SFNODE;
5387
0
    info->NDTtype = NDT_SFMetadataNode;
5388
0
    info->far_ptr = & ((X_HAnimHumanoid *)node)->metadata;
5389
0
    return GF_OK;
5390
0
  default:
5391
0
    return GF_BAD_PARAM;
5392
0
  }
5393
0
}
5394
5395
5396
static s32 HAnimHumanoid_get_field_index_by_name(char *name)
5397
0
{
5398
0
  if (!strcmp("center", name)) return 0;
5399
0
  if (!strcmp("info", name)) return 1;
5400
0
  if (!strcmp("joints", name)) return 2;
5401
0
  if (!strcmp("name", name)) return 3;
5402
0
  if (!strcmp("rotation", name)) return 4;
5403
0
  if (!strcmp("scale", name)) return 5;
5404
0
  if (!strcmp("scaleOrientation", name)) return 6;
5405
0
  if (!strcmp("segments", name)) return 7;
5406
0
  if (!strcmp("sites", name)) return 8;
5407
0
  if (!strcmp("skeleton", name)) return 9;
5408
0
  if (!strcmp("skin", name)) return 10;
5409
0
  if (!strcmp("skinCoord", name)) return 11;
5410
0
  if (!strcmp("skinNormal", name)) return 12;
5411
0
  if (!strcmp("translation", name)) return 13;
5412
0
  if (!strcmp("version", name)) return 14;
5413
0
  if (!strcmp("viewpoints", name)) return 15;
5414
0
  if (!strcmp("metadata", name)) return 16;
5415
0
  return -1;
5416
0
}
5417
5418
5419
static GF_Node *HAnimHumanoid_Create()
5420
0
{
5421
0
  X_HAnimHumanoid *p;
5422
0
  GF_SAFEALLOC(p, X_HAnimHumanoid);
5423
0
  if(!p) return NULL;
5424
0
  gf_node_setup((GF_Node *)p, TAG_X3D_HAnimHumanoid);
5425
5426
  /*default field values*/
5427
0
  p->center.x = FLT2FIX(0);
5428
0
  p->center.y = FLT2FIX(0);
5429
0
  p->center.z = FLT2FIX(0);
5430
0
  p->rotation.x = FLT2FIX(0);
5431
0
  p->rotation.y = FLT2FIX(0);
5432
0
  p->rotation.z = FLT2FIX(1);
5433
0
  p->rotation.q = FLT2FIX(0);
5434
0
  p->scale.x = FLT2FIX(1);
5435
0
  p->scale.y = FLT2FIX(1);
5436
0
  p->scale.z = FLT2FIX(1);
5437
0
  p->scaleOrientation.x = FLT2FIX(0);
5438
0
  p->scaleOrientation.y = FLT2FIX(0);
5439
0
  p->scaleOrientation.z = FLT2FIX(1);
5440
0
  p->scaleOrientation.q = FLT2FIX(0);
5441
0
  p->translation.x = FLT2FIX(0);
5442
0
  p->translation.y = FLT2FIX(0);
5443
0
  p->translation.z = FLT2FIX(0);
5444
0
  return (GF_Node *)p;
5445
0
}
5446
5447
5448
/*
5449
  HAnimJoint Node deletion
5450
*/
5451
5452
static void HAnimJoint_Del(GF_Node *node)
5453
0
{
5454
0
  X_HAnimJoint *p = (X_HAnimJoint *) node;
5455
0
  gf_node_unregister_children(node, p->displacers);
5456
0
  gf_sg_mffloat_del(p->llimit);
5457
0
  gf_sg_sfstring_del(p->name);
5458
0
  gf_sg_mfint32_del(p->skinCoordIndex);
5459
0
  gf_sg_mffloat_del(p->skinCoordWeight);
5460
0
  gf_sg_mffloat_del(p->stiffness);
5461
0
  gf_sg_mffloat_del(p->ulimit);
5462
0
  gf_node_unregister((GF_Node *) p->metadata, node);
5463
0
  gf_sg_vrml_parent_destroy(node);
5464
0
  gf_node_free((GF_Node *)p);
5465
0
}
5466
5467
5468
static u32 HAnimJoint_get_field_count(GF_Node *node, u8 dummy)
5469
0
{
5470
0
  return 17;
5471
0
}
5472
5473
static GF_Err HAnimJoint_get_field(GF_Node *node, GF_FieldInfo *info)
5474
0
{
5475
0
  switch (info->fieldIndex) {
5476
0
  case 0:
5477
0
    info->name = "addChildren";
5478
0
    info->eventType = GF_SG_EVENT_IN;
5479
0
    info->on_event_in = ((X_HAnimJoint *)node)->on_addChildren;
5480
0
    info->fieldType = GF_SG_VRML_MFNODE;
5481
0
    info->NDTtype = NDT_SFHAnimNode;
5482
0
    info->far_ptr = & ((X_HAnimJoint *)node)->addChildren;
5483
0
    return GF_OK;
5484
0
  case 1:
5485
0
    info->name = "removeChildren";
5486
0
    info->eventType = GF_SG_EVENT_IN;
5487
0
    info->on_event_in = ((X_HAnimJoint *)node)->on_removeChildren;
5488
0
    info->fieldType = GF_SG_VRML_MFNODE;
5489
0
    info->NDTtype = NDT_SFHAnimNode;
5490
0
    info->far_ptr = & ((X_HAnimJoint *)node)->removeChildren;
5491
0
    return GF_OK;
5492
0
  case 2:
5493
0
    info->name = "children";
5494
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5495
0
    info->fieldType = GF_SG_VRML_MFNODE;
5496
0
    info->NDTtype = NDT_SFHAnimNode;
5497
0
    info->far_ptr = & ((X_HAnimJoint *)node)->children;
5498
0
    return GF_OK;
5499
0
  case 3:
5500
0
    info->name = "center";
5501
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5502
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
5503
0
    info->far_ptr = & ((X_HAnimJoint *) node)->center;
5504
0
    return GF_OK;
5505
0
  case 4:
5506
0
    info->name = "displacers";
5507
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5508
0
    info->fieldType = GF_SG_VRML_MFNODE;
5509
0
    info->NDTtype = NDT_SFHAnimDisplacerNode;
5510
0
    info->far_ptr = & ((X_HAnimJoint *)node)->displacers;
5511
0
    return GF_OK;
5512
0
  case 5:
5513
0
    info->name = "limitOrientation";
5514
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5515
0
    info->fieldType = GF_SG_VRML_SFROTATION;
5516
0
    info->far_ptr = & ((X_HAnimJoint *) node)->limitOrientation;
5517
0
    return GF_OK;
5518
0
  case 6:
5519
0
    info->name = "llimit";
5520
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5521
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
5522
0
    info->far_ptr = & ((X_HAnimJoint *) node)->llimit;
5523
0
    return GF_OK;
5524
0
  case 7:
5525
0
    info->name = "name";
5526
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5527
0
    info->fieldType = GF_SG_VRML_SFSTRING;
5528
0
    info->far_ptr = & ((X_HAnimJoint *) node)->name;
5529
0
    return GF_OK;
5530
0
  case 8:
5531
0
    info->name = "rotation";
5532
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5533
0
    info->fieldType = GF_SG_VRML_SFROTATION;
5534
0
    info->far_ptr = & ((X_HAnimJoint *) node)->rotation;
5535
0
    return GF_OK;
5536
0
  case 9:
5537
0
    info->name = "scale";
5538
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5539
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
5540
0
    info->far_ptr = & ((X_HAnimJoint *) node)->scale;
5541
0
    return GF_OK;
5542
0
  case 10:
5543
0
    info->name = "scaleOrientation";
5544
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5545
0
    info->fieldType = GF_SG_VRML_SFROTATION;
5546
0
    info->far_ptr = & ((X_HAnimJoint *) node)->scaleOrientation;
5547
0
    return GF_OK;
5548
0
  case 11:
5549
0
    info->name = "skinCoordIndex";
5550
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5551
0
    info->fieldType = GF_SG_VRML_MFINT32;
5552
0
    info->far_ptr = & ((X_HAnimJoint *) node)->skinCoordIndex;
5553
0
    return GF_OK;
5554
0
  case 12:
5555
0
    info->name = "skinCoordWeight";
5556
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5557
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
5558
0
    info->far_ptr = & ((X_HAnimJoint *) node)->skinCoordWeight;
5559
0
    return GF_OK;
5560
0
  case 13:
5561
0
    info->name = "stiffness";
5562
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5563
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
5564
0
    info->far_ptr = & ((X_HAnimJoint *) node)->stiffness;
5565
0
    return GF_OK;
5566
0
  case 14:
5567
0
    info->name = "translation";
5568
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5569
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
5570
0
    info->far_ptr = & ((X_HAnimJoint *) node)->translation;
5571
0
    return GF_OK;
5572
0
  case 15:
5573
0
    info->name = "ulimit";
5574
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5575
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
5576
0
    info->far_ptr = & ((X_HAnimJoint *) node)->ulimit;
5577
0
    return GF_OK;
5578
0
  case 16:
5579
0
    info->name = "metadata";
5580
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5581
0
    info->fieldType = GF_SG_VRML_SFNODE;
5582
0
    info->NDTtype = NDT_SFMetadataNode;
5583
0
    info->far_ptr = & ((X_HAnimJoint *)node)->metadata;
5584
0
    return GF_OK;
5585
0
  default:
5586
0
    return GF_BAD_PARAM;
5587
0
  }
5588
0
}
5589
5590
5591
static s32 HAnimJoint_get_field_index_by_name(char *name)
5592
0
{
5593
0
  if (!strcmp("addChildren", name)) return 0;
5594
0
  if (!strcmp("removeChildren", name)) return 1;
5595
0
  if (!strcmp("children", name)) return 2;
5596
0
  if (!strcmp("center", name)) return 3;
5597
0
  if (!strcmp("displacers", name)) return 4;
5598
0
  if (!strcmp("limitOrientation", name)) return 5;
5599
0
  if (!strcmp("llimit", name)) return 6;
5600
0
  if (!strcmp("name", name)) return 7;
5601
0
  if (!strcmp("rotation", name)) return 8;
5602
0
  if (!strcmp("scale", name)) return 9;
5603
0
  if (!strcmp("scaleOrientation", name)) return 10;
5604
0
  if (!strcmp("skinCoordIndex", name)) return 11;
5605
0
  if (!strcmp("skinCoordWeight", name)) return 12;
5606
0
  if (!strcmp("stiffness", name)) return 13;
5607
0
  if (!strcmp("translation", name)) return 14;
5608
0
  if (!strcmp("ulimit", name)) return 15;
5609
0
  if (!strcmp("metadata", name)) return 16;
5610
0
  return -1;
5611
0
}
5612
5613
5614
static GF_Node *HAnimJoint_Create()
5615
0
{
5616
0
  X_HAnimJoint *p;
5617
0
  GF_SAFEALLOC(p, X_HAnimJoint);
5618
0
  if(!p) return NULL;
5619
0
  gf_node_setup((GF_Node *)p, TAG_X3D_HAnimJoint);
5620
0
  gf_sg_vrml_parent_setup((GF_Node *) p);
5621
5622
  /*default field values*/
5623
0
  p->center.x = FLT2FIX(0);
5624
0
  p->center.y = FLT2FIX(0);
5625
0
  p->center.z = FLT2FIX(0);
5626
0
  p->limitOrientation.x = FLT2FIX(0);
5627
0
  p->limitOrientation.y = FLT2FIX(0);
5628
0
  p->limitOrientation.z = FLT2FIX(1);
5629
0
  p->limitOrientation.q = FLT2FIX(0);
5630
0
  p->rotation.x = FLT2FIX(0);
5631
0
  p->rotation.y = FLT2FIX(0);
5632
0
  p->rotation.z = FLT2FIX(1);
5633
0
  p->rotation.q = FLT2FIX(0);
5634
0
  p->scale.x = FLT2FIX(1);
5635
0
  p->scale.y = FLT2FIX(1);
5636
0
  p->scale.z = FLT2FIX(1);
5637
0
  p->scaleOrientation.x = FLT2FIX(0);
5638
0
  p->scaleOrientation.y = FLT2FIX(0);
5639
0
  p->scaleOrientation.z = FLT2FIX(1);
5640
0
  p->scaleOrientation.q = FLT2FIX(0);
5641
0
  p->stiffness.vals = (SFFloat *)gf_malloc(sizeof(SFFloat)*3);
5642
0
  p->stiffness.count = 3;
5643
0
  p->stiffness.vals[0] = FLT2FIX(0);
5644
0
  p->stiffness.vals[1] = FLT2FIX(0);
5645
0
  p->stiffness.vals[2] = FLT2FIX(0);
5646
0
  p->translation.x = FLT2FIX(0);
5647
0
  p->translation.y = FLT2FIX(0);
5648
0
  p->translation.z = FLT2FIX(0);
5649
0
  return (GF_Node *)p;
5650
0
}
5651
5652
5653
/*
5654
  HAnimSegment Node deletion
5655
*/
5656
5657
static void HAnimSegment_Del(GF_Node *node)
5658
0
{
5659
0
  X_HAnimSegment *p = (X_HAnimSegment *) node;
5660
0
  gf_node_unregister((GF_Node *) p->coord, node);
5661
0
  gf_node_unregister_children(node, p->displacers);
5662
0
  gf_sg_mffloat_del(p->momentsOfInertia);
5663
0
  gf_sg_sfstring_del(p->name);
5664
0
  gf_node_unregister((GF_Node *) p->metadata, node);
5665
0
  gf_sg_vrml_parent_destroy(node);
5666
0
  gf_node_free((GF_Node *)p);
5667
0
}
5668
5669
5670
static u32 HAnimSegment_get_field_count(GF_Node *node, u8 dummy)
5671
0
{
5672
0
  return 10;
5673
0
}
5674
5675
static GF_Err HAnimSegment_get_field(GF_Node *node, GF_FieldInfo *info)
5676
0
{
5677
0
  switch (info->fieldIndex) {
5678
0
  case 0:
5679
0
    info->name = "addChildren";
5680
0
    info->eventType = GF_SG_EVENT_IN;
5681
0
    info->on_event_in = ((X_HAnimSegment *)node)->on_addChildren;
5682
0
    info->fieldType = GF_SG_VRML_MFNODE;
5683
0
    info->NDTtype = NDT_SF3DNode;
5684
0
    info->far_ptr = & ((X_HAnimSegment *)node)->addChildren;
5685
0
    return GF_OK;
5686
0
  case 1:
5687
0
    info->name = "removeChildren";
5688
0
    info->eventType = GF_SG_EVENT_IN;
5689
0
    info->on_event_in = ((X_HAnimSegment *)node)->on_removeChildren;
5690
0
    info->fieldType = GF_SG_VRML_MFNODE;
5691
0
    info->NDTtype = NDT_SF3DNode;
5692
0
    info->far_ptr = & ((X_HAnimSegment *)node)->removeChildren;
5693
0
    return GF_OK;
5694
0
  case 2:
5695
0
    info->name = "children";
5696
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5697
0
    info->fieldType = GF_SG_VRML_MFNODE;
5698
0
    info->NDTtype = NDT_SF3DNode;
5699
0
    info->far_ptr = & ((X_HAnimSegment *)node)->children;
5700
0
    return GF_OK;
5701
0
  case 3:
5702
0
    info->name = "centerOfMass";
5703
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5704
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
5705
0
    info->far_ptr = & ((X_HAnimSegment *) node)->centerOfMass;
5706
0
    return GF_OK;
5707
0
  case 4:
5708
0
    info->name = "coord";
5709
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5710
0
    info->fieldType = GF_SG_VRML_SFNODE;
5711
0
    info->NDTtype = NDT_SFCoordinateNode;
5712
0
    info->far_ptr = & ((X_HAnimSegment *)node)->coord;
5713
0
    return GF_OK;
5714
0
  case 5:
5715
0
    info->name = "displacers";
5716
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5717
0
    info->fieldType = GF_SG_VRML_MFNODE;
5718
0
    info->NDTtype = NDT_SFHAnimDisplacerNode;
5719
0
    info->far_ptr = & ((X_HAnimSegment *)node)->displacers;
5720
0
    return GF_OK;
5721
0
  case 6:
5722
0
    info->name = "mass";
5723
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5724
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
5725
0
    info->far_ptr = & ((X_HAnimSegment *) node)->mass;
5726
0
    return GF_OK;
5727
0
  case 7:
5728
0
    info->name = "momentsOfInertia";
5729
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5730
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
5731
0
    info->far_ptr = & ((X_HAnimSegment *) node)->momentsOfInertia;
5732
0
    return GF_OK;
5733
0
  case 8:
5734
0
    info->name = "name";
5735
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5736
0
    info->fieldType = GF_SG_VRML_SFSTRING;
5737
0
    info->far_ptr = & ((X_HAnimSegment *) node)->name;
5738
0
    return GF_OK;
5739
0
  case 9:
5740
0
    info->name = "metadata";
5741
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5742
0
    info->fieldType = GF_SG_VRML_SFNODE;
5743
0
    info->NDTtype = NDT_SFMetadataNode;
5744
0
    info->far_ptr = & ((X_HAnimSegment *)node)->metadata;
5745
0
    return GF_OK;
5746
0
  default:
5747
0
    return GF_BAD_PARAM;
5748
0
  }
5749
0
}
5750
5751
5752
static s32 HAnimSegment_get_field_index_by_name(char *name)
5753
0
{
5754
0
  if (!strcmp("addChildren", name)) return 0;
5755
0
  if (!strcmp("removeChildren", name)) return 1;
5756
0
  if (!strcmp("children", name)) return 2;
5757
0
  if (!strcmp("centerOfMass", name)) return 3;
5758
0
  if (!strcmp("coord", name)) return 4;
5759
0
  if (!strcmp("displacers", name)) return 5;
5760
0
  if (!strcmp("mass", name)) return 6;
5761
0
  if (!strcmp("momentsOfInertia", name)) return 7;
5762
0
  if (!strcmp("name", name)) return 8;
5763
0
  if (!strcmp("metadata", name)) return 9;
5764
0
  return -1;
5765
0
}
5766
5767
5768
static GF_Node *HAnimSegment_Create()
5769
0
{
5770
0
  X_HAnimSegment *p;
5771
0
  GF_SAFEALLOC(p, X_HAnimSegment);
5772
0
  if(!p) return NULL;
5773
0
  gf_node_setup((GF_Node *)p, TAG_X3D_HAnimSegment);
5774
0
  gf_sg_vrml_parent_setup((GF_Node *) p);
5775
5776
  /*default field values*/
5777
0
  p->centerOfMass.x = FLT2FIX(0);
5778
0
  p->centerOfMass.y = FLT2FIX(0);
5779
0
  p->centerOfMass.z = FLT2FIX(0);
5780
0
  p->mass = FLT2FIX(0);
5781
0
  p->momentsOfInertia.vals = (SFFloat *)gf_malloc(sizeof(SFFloat)*9);
5782
0
  p->momentsOfInertia.count = 9;
5783
0
  p->momentsOfInertia.vals[0] = FLT2FIX(0);
5784
0
  p->momentsOfInertia.vals[1] = FLT2FIX(0);
5785
0
  p->momentsOfInertia.vals[2] = FLT2FIX(0);
5786
0
  p->momentsOfInertia.vals[3] = FLT2FIX(0);
5787
0
  p->momentsOfInertia.vals[4] = FLT2FIX(0);
5788
0
  p->momentsOfInertia.vals[5] = FLT2FIX(0);
5789
0
  p->momentsOfInertia.vals[6] = FLT2FIX(0);
5790
0
  p->momentsOfInertia.vals[7] = FLT2FIX(0);
5791
0
  p->momentsOfInertia.vals[8] = FLT2FIX(0);
5792
0
  return (GF_Node *)p;
5793
0
}
5794
5795
5796
/*
5797
  HAnimSite Node deletion
5798
*/
5799
5800
static void HAnimSite_Del(GF_Node *node)
5801
0
{
5802
0
  X_HAnimSite *p = (X_HAnimSite *) node;
5803
0
  gf_sg_sfstring_del(p->name);
5804
0
  gf_node_unregister((GF_Node *) p->metadata, node);
5805
0
  gf_sg_vrml_parent_destroy(node);
5806
0
  gf_node_free((GF_Node *)p);
5807
0
}
5808
5809
5810
static u32 HAnimSite_get_field_count(GF_Node *node, u8 dummy)
5811
0
{
5812
0
  return 10;
5813
0
}
5814
5815
static GF_Err HAnimSite_get_field(GF_Node *node, GF_FieldInfo *info)
5816
0
{
5817
0
  switch (info->fieldIndex) {
5818
0
  case 0:
5819
0
    info->name = "addChildren";
5820
0
    info->eventType = GF_SG_EVENT_IN;
5821
0
    info->on_event_in = ((X_HAnimSite *)node)->on_addChildren;
5822
0
    info->fieldType = GF_SG_VRML_MFNODE;
5823
0
    info->NDTtype = NDT_SF3DNode;
5824
0
    info->far_ptr = & ((X_HAnimSite *)node)->addChildren;
5825
0
    return GF_OK;
5826
0
  case 1:
5827
0
    info->name = "removeChildren";
5828
0
    info->eventType = GF_SG_EVENT_IN;
5829
0
    info->on_event_in = ((X_HAnimSite *)node)->on_removeChildren;
5830
0
    info->fieldType = GF_SG_VRML_MFNODE;
5831
0
    info->NDTtype = NDT_SF3DNode;
5832
0
    info->far_ptr = & ((X_HAnimSite *)node)->removeChildren;
5833
0
    return GF_OK;
5834
0
  case 2:
5835
0
    info->name = "children";
5836
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5837
0
    info->fieldType = GF_SG_VRML_MFNODE;
5838
0
    info->NDTtype = NDT_SF3DNode;
5839
0
    info->far_ptr = & ((X_HAnimSite *)node)->children;
5840
0
    return GF_OK;
5841
0
  case 3:
5842
0
    info->name = "center";
5843
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5844
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
5845
0
    info->far_ptr = & ((X_HAnimSite *) node)->center;
5846
0
    return GF_OK;
5847
0
  case 4:
5848
0
    info->name = "name";
5849
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5850
0
    info->fieldType = GF_SG_VRML_SFSTRING;
5851
0
    info->far_ptr = & ((X_HAnimSite *) node)->name;
5852
0
    return GF_OK;
5853
0
  case 5:
5854
0
    info->name = "rotation";
5855
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5856
0
    info->fieldType = GF_SG_VRML_SFROTATION;
5857
0
    info->far_ptr = & ((X_HAnimSite *) node)->rotation;
5858
0
    return GF_OK;
5859
0
  case 6:
5860
0
    info->name = "scale";
5861
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5862
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
5863
0
    info->far_ptr = & ((X_HAnimSite *) node)->scale;
5864
0
    return GF_OK;
5865
0
  case 7:
5866
0
    info->name = "scaleOrientation";
5867
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5868
0
    info->fieldType = GF_SG_VRML_SFROTATION;
5869
0
    info->far_ptr = & ((X_HAnimSite *) node)->scaleOrientation;
5870
0
    return GF_OK;
5871
0
  case 8:
5872
0
    info->name = "translation";
5873
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5874
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
5875
0
    info->far_ptr = & ((X_HAnimSite *) node)->translation;
5876
0
    return GF_OK;
5877
0
  case 9:
5878
0
    info->name = "metadata";
5879
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5880
0
    info->fieldType = GF_SG_VRML_SFNODE;
5881
0
    info->NDTtype = NDT_SFMetadataNode;
5882
0
    info->far_ptr = & ((X_HAnimSite *)node)->metadata;
5883
0
    return GF_OK;
5884
0
  default:
5885
0
    return GF_BAD_PARAM;
5886
0
  }
5887
0
}
5888
5889
5890
static s32 HAnimSite_get_field_index_by_name(char *name)
5891
0
{
5892
0
  if (!strcmp("addChildren", name)) return 0;
5893
0
  if (!strcmp("removeChildren", name)) return 1;
5894
0
  if (!strcmp("children", name)) return 2;
5895
0
  if (!strcmp("center", name)) return 3;
5896
0
  if (!strcmp("name", name)) return 4;
5897
0
  if (!strcmp("rotation", name)) return 5;
5898
0
  if (!strcmp("scale", name)) return 6;
5899
0
  if (!strcmp("scaleOrientation", name)) return 7;
5900
0
  if (!strcmp("translation", name)) return 8;
5901
0
  if (!strcmp("metadata", name)) return 9;
5902
0
  return -1;
5903
0
}
5904
5905
5906
static GF_Node *HAnimSite_Create()
5907
0
{
5908
0
  X_HAnimSite *p;
5909
0
  GF_SAFEALLOC(p, X_HAnimSite);
5910
0
  if(!p) return NULL;
5911
0
  gf_node_setup((GF_Node *)p, TAG_X3D_HAnimSite);
5912
0
  gf_sg_vrml_parent_setup((GF_Node *) p);
5913
5914
  /*default field values*/
5915
0
  p->center.x = FLT2FIX(0);
5916
0
  p->center.y = FLT2FIX(0);
5917
0
  p->center.z = FLT2FIX(0);
5918
0
  p->rotation.x = FLT2FIX(0);
5919
0
  p->rotation.y = FLT2FIX(0);
5920
0
  p->rotation.z = FLT2FIX(1);
5921
0
  p->rotation.q = FLT2FIX(0);
5922
0
  p->scale.x = FLT2FIX(1);
5923
0
  p->scale.y = FLT2FIX(1);
5924
0
  p->scale.z = FLT2FIX(1);
5925
0
  p->scaleOrientation.x = FLT2FIX(0);
5926
0
  p->scaleOrientation.y = FLT2FIX(0);
5927
0
  p->scaleOrientation.z = FLT2FIX(1);
5928
0
  p->scaleOrientation.q = FLT2FIX(0);
5929
0
  p->translation.x = FLT2FIX(0);
5930
0
  p->translation.y = FLT2FIX(0);
5931
0
  p->translation.z = FLT2FIX(0);
5932
0
  return (GF_Node *)p;
5933
0
}
5934
5935
5936
/*
5937
  ImageTexture Node deletion
5938
*/
5939
5940
static void ImageTexture_Del(GF_Node *node)
5941
0
{
5942
0
  X_ImageTexture *p = (X_ImageTexture *) node;
5943
0
  gf_sg_mfurl_del(p->url);
5944
0
  gf_node_unregister((GF_Node *) p->metadata, node);
5945
0
  gf_node_free((GF_Node *)p);
5946
0
}
5947
5948
5949
static u32 ImageTexture_get_field_count(GF_Node *node, u8 dummy)
5950
0
{
5951
0
  return 4;
5952
0
}
5953
5954
static GF_Err ImageTexture_get_field(GF_Node *node, GF_FieldInfo *info)
5955
0
{
5956
0
  switch (info->fieldIndex) {
5957
0
  case 0:
5958
0
    info->name = "url";
5959
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5960
0
    info->fieldType = GF_SG_VRML_MFURL;
5961
0
    info->far_ptr = & ((X_ImageTexture *) node)->url;
5962
0
    return GF_OK;
5963
0
  case 1:
5964
0
    info->name = "repeatS";
5965
0
    info->eventType = GF_SG_EVENT_FIELD;
5966
0
    info->fieldType = GF_SG_VRML_SFBOOL;
5967
0
    info->far_ptr = & ((X_ImageTexture *) node)->repeatS;
5968
0
    return GF_OK;
5969
0
  case 2:
5970
0
    info->name = "repeatT";
5971
0
    info->eventType = GF_SG_EVENT_FIELD;
5972
0
    info->fieldType = GF_SG_VRML_SFBOOL;
5973
0
    info->far_ptr = & ((X_ImageTexture *) node)->repeatT;
5974
0
    return GF_OK;
5975
0
  case 3:
5976
0
    info->name = "metadata";
5977
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
5978
0
    info->fieldType = GF_SG_VRML_SFNODE;
5979
0
    info->NDTtype = NDT_SFMetadataNode;
5980
0
    info->far_ptr = & ((X_ImageTexture *)node)->metadata;
5981
0
    return GF_OK;
5982
0
  default:
5983
0
    return GF_BAD_PARAM;
5984
0
  }
5985
0
}
5986
5987
5988
static s32 ImageTexture_get_field_index_by_name(char *name)
5989
0
{
5990
0
  if (!strcmp("url", name)) return 0;
5991
0
  if (!strcmp("repeatS", name)) return 1;
5992
0
  if (!strcmp("repeatT", name)) return 2;
5993
0
  if (!strcmp("metadata", name)) return 3;
5994
0
  return -1;
5995
0
}
5996
5997
5998
static GF_Node *ImageTexture_Create()
5999
0
{
6000
0
  X_ImageTexture *p;
6001
0
  GF_SAFEALLOC(p, X_ImageTexture);
6002
0
  if(!p) return NULL;
6003
0
  gf_node_setup((GF_Node *)p, TAG_X3D_ImageTexture);
6004
6005
  /*default field values*/
6006
0
  p->repeatS = 1;
6007
0
  p->repeatT = 1;
6008
0
  return (GF_Node *)p;
6009
0
}
6010
6011
6012
/*
6013
  IndexedFaceSet Node deletion
6014
*/
6015
6016
static void IndexedFaceSet_Del(GF_Node *node)
6017
0
{
6018
0
  X_IndexedFaceSet *p = (X_IndexedFaceSet *) node;
6019
0
  gf_sg_mfint32_del(p->set_colorIndex);
6020
0
  gf_sg_mfint32_del(p->set_coordIndex);
6021
0
  gf_sg_mfint32_del(p->set_normalIndex);
6022
0
  gf_sg_mfint32_del(p->set_texCoordIndex);
6023
0
  gf_node_unregister((GF_Node *) p->color, node);
6024
0
  gf_node_unregister((GF_Node *) p->coord, node);
6025
0
  gf_node_unregister((GF_Node *) p->normal, node);
6026
0
  gf_node_unregister((GF_Node *) p->texCoord, node);
6027
0
  gf_sg_mfint32_del(p->colorIndex);
6028
0
  gf_sg_mfint32_del(p->coordIndex);
6029
0
  gf_sg_mfint32_del(p->normalIndex);
6030
0
  gf_sg_mfint32_del(p->texCoordIndex);
6031
0
  gf_node_unregister((GF_Node *) p->metadata, node);
6032
0
  gf_node_free((GF_Node *)p);
6033
0
}
6034
6035
6036
static u32 IndexedFaceSet_get_field_count(GF_Node *node, u8 dummy)
6037
0
{
6038
0
  return 19;
6039
0
}
6040
6041
static GF_Err IndexedFaceSet_get_field(GF_Node *node, GF_FieldInfo *info)
6042
0
{
6043
0
  switch (info->fieldIndex) {
6044
0
  case 0:
6045
0
    info->name = "set_colorIndex";
6046
0
    info->eventType = GF_SG_EVENT_IN;
6047
0
    info->on_event_in = ((X_IndexedFaceSet *)node)->on_set_colorIndex;
6048
0
    info->fieldType = GF_SG_VRML_MFINT32;
6049
0
    info->far_ptr = & ((X_IndexedFaceSet *) node)->set_colorIndex;
6050
0
    return GF_OK;
6051
0
  case 1:
6052
0
    info->name = "set_coordIndex";
6053
0
    info->eventType = GF_SG_EVENT_IN;
6054
0
    info->on_event_in = ((X_IndexedFaceSet *)node)->on_set_coordIndex;
6055
0
    info->fieldType = GF_SG_VRML_MFINT32;
6056
0
    info->far_ptr = & ((X_IndexedFaceSet *) node)->set_coordIndex;
6057
0
    return GF_OK;
6058
0
  case 2:
6059
0
    info->name = "set_normalIndex";
6060
0
    info->eventType = GF_SG_EVENT_IN;
6061
0
    info->on_event_in = ((X_IndexedFaceSet *)node)->on_set_normalIndex;
6062
0
    info->fieldType = GF_SG_VRML_MFINT32;
6063
0
    info->far_ptr = & ((X_IndexedFaceSet *) node)->set_normalIndex;
6064
0
    return GF_OK;
6065
0
  case 3:
6066
0
    info->name = "set_texCoordIndex";
6067
0
    info->eventType = GF_SG_EVENT_IN;
6068
0
    info->on_event_in = ((X_IndexedFaceSet *)node)->on_set_texCoordIndex;
6069
0
    info->fieldType = GF_SG_VRML_MFINT32;
6070
0
    info->far_ptr = & ((X_IndexedFaceSet *) node)->set_texCoordIndex;
6071
0
    return GF_OK;
6072
0
  case 4:
6073
0
    info->name = "color";
6074
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6075
0
    info->fieldType = GF_SG_VRML_SFNODE;
6076
0
    info->NDTtype = NDT_SFColorNode;
6077
0
    info->far_ptr = & ((X_IndexedFaceSet *)node)->color;
6078
0
    return GF_OK;
6079
0
  case 5:
6080
0
    info->name = "coord";
6081
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6082
0
    info->fieldType = GF_SG_VRML_SFNODE;
6083
0
    info->NDTtype = NDT_SFCoordinateNode;
6084
0
    info->far_ptr = & ((X_IndexedFaceSet *)node)->coord;
6085
0
    return GF_OK;
6086
0
  case 6:
6087
0
    info->name = "normal";
6088
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6089
0
    info->fieldType = GF_SG_VRML_SFNODE;
6090
0
    info->NDTtype = NDT_SFNormalNode;
6091
0
    info->far_ptr = & ((X_IndexedFaceSet *)node)->normal;
6092
0
    return GF_OK;
6093
0
  case 7:
6094
0
    info->name = "texCoord";
6095
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6096
0
    info->fieldType = GF_SG_VRML_SFNODE;
6097
0
    info->NDTtype = NDT_SFTextureCoordinateNode;
6098
0
    info->far_ptr = & ((X_IndexedFaceSet *)node)->texCoord;
6099
0
    return GF_OK;
6100
0
  case 8:
6101
0
    info->name = "ccw";
6102
0
    info->eventType = GF_SG_EVENT_FIELD;
6103
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6104
0
    info->far_ptr = & ((X_IndexedFaceSet *) node)->ccw;
6105
0
    return GF_OK;
6106
0
  case 9:
6107
0
    info->name = "colorIndex";
6108
0
    info->eventType = GF_SG_EVENT_FIELD;
6109
0
    info->fieldType = GF_SG_VRML_MFINT32;
6110
0
    info->far_ptr = & ((X_IndexedFaceSet *) node)->colorIndex;
6111
0
    return GF_OK;
6112
0
  case 10:
6113
0
    info->name = "colorPerVertex";
6114
0
    info->eventType = GF_SG_EVENT_FIELD;
6115
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6116
0
    info->far_ptr = & ((X_IndexedFaceSet *) node)->colorPerVertex;
6117
0
    return GF_OK;
6118
0
  case 11:
6119
0
    info->name = "convex";
6120
0
    info->eventType = GF_SG_EVENT_FIELD;
6121
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6122
0
    info->far_ptr = & ((X_IndexedFaceSet *) node)->convex;
6123
0
    return GF_OK;
6124
0
  case 12:
6125
0
    info->name = "coordIndex";
6126
0
    info->eventType = GF_SG_EVENT_FIELD;
6127
0
    info->fieldType = GF_SG_VRML_MFINT32;
6128
0
    info->far_ptr = & ((X_IndexedFaceSet *) node)->coordIndex;
6129
0
    return GF_OK;
6130
0
  case 13:
6131
0
    info->name = "creaseAngle";
6132
0
    info->eventType = GF_SG_EVENT_FIELD;
6133
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
6134
0
    info->far_ptr = & ((X_IndexedFaceSet *) node)->creaseAngle;
6135
0
    return GF_OK;
6136
0
  case 14:
6137
0
    info->name = "normalIndex";
6138
0
    info->eventType = GF_SG_EVENT_FIELD;
6139
0
    info->fieldType = GF_SG_VRML_MFINT32;
6140
0
    info->far_ptr = & ((X_IndexedFaceSet *) node)->normalIndex;
6141
0
    return GF_OK;
6142
0
  case 15:
6143
0
    info->name = "normalPerVertex";
6144
0
    info->eventType = GF_SG_EVENT_FIELD;
6145
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6146
0
    info->far_ptr = & ((X_IndexedFaceSet *) node)->normalPerVertex;
6147
0
    return GF_OK;
6148
0
  case 16:
6149
0
    info->name = "solid";
6150
0
    info->eventType = GF_SG_EVENT_FIELD;
6151
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6152
0
    info->far_ptr = & ((X_IndexedFaceSet *) node)->solid;
6153
0
    return GF_OK;
6154
0
  case 17:
6155
0
    info->name = "texCoordIndex";
6156
0
    info->eventType = GF_SG_EVENT_FIELD;
6157
0
    info->fieldType = GF_SG_VRML_MFINT32;
6158
0
    info->far_ptr = & ((X_IndexedFaceSet *) node)->texCoordIndex;
6159
0
    return GF_OK;
6160
0
  case 18:
6161
0
    info->name = "metadata";
6162
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6163
0
    info->fieldType = GF_SG_VRML_SFNODE;
6164
0
    info->NDTtype = NDT_SFMetadataNode;
6165
0
    info->far_ptr = & ((X_IndexedFaceSet *)node)->metadata;
6166
0
    return GF_OK;
6167
0
  default:
6168
0
    return GF_BAD_PARAM;
6169
0
  }
6170
0
}
6171
6172
6173
static s32 IndexedFaceSet_get_field_index_by_name(char *name)
6174
0
{
6175
0
  if (!strcmp("set_colorIndex", name)) return 0;
6176
0
  if (!strcmp("set_coordIndex", name)) return 1;
6177
0
  if (!strcmp("set_normalIndex", name)) return 2;
6178
0
  if (!strcmp("set_texCoordIndex", name)) return 3;
6179
0
  if (!strcmp("color", name)) return 4;
6180
0
  if (!strcmp("coord", name)) return 5;
6181
0
  if (!strcmp("normal", name)) return 6;
6182
0
  if (!strcmp("texCoord", name)) return 7;
6183
0
  if (!strcmp("ccw", name)) return 8;
6184
0
  if (!strcmp("colorIndex", name)) return 9;
6185
0
  if (!strcmp("colorPerVertex", name)) return 10;
6186
0
  if (!strcmp("convex", name)) return 11;
6187
0
  if (!strcmp("coordIndex", name)) return 12;
6188
0
  if (!strcmp("creaseAngle", name)) return 13;
6189
0
  if (!strcmp("normalIndex", name)) return 14;
6190
0
  if (!strcmp("normalPerVertex", name)) return 15;
6191
0
  if (!strcmp("solid", name)) return 16;
6192
0
  if (!strcmp("texCoordIndex", name)) return 17;
6193
0
  if (!strcmp("metadata", name)) return 18;
6194
0
  return -1;
6195
0
}
6196
6197
6198
static GF_Node *IndexedFaceSet_Create()
6199
0
{
6200
0
  X_IndexedFaceSet *p;
6201
0
  GF_SAFEALLOC(p, X_IndexedFaceSet);
6202
0
  if(!p) return NULL;
6203
0
  gf_node_setup((GF_Node *)p, TAG_X3D_IndexedFaceSet);
6204
6205
  /*default field values*/
6206
0
  p->ccw = 1;
6207
0
  p->colorPerVertex = 1;
6208
0
  p->convex = 1;
6209
0
  p->creaseAngle = FLT2FIX(0.0);
6210
0
  p->normalPerVertex = 1;
6211
0
  p->solid = 1;
6212
0
  return (GF_Node *)p;
6213
0
}
6214
6215
6216
/*
6217
  IndexedLineSet Node deletion
6218
*/
6219
6220
static void IndexedLineSet_Del(GF_Node *node)
6221
0
{
6222
0
  X_IndexedLineSet *p = (X_IndexedLineSet *) node;
6223
0
  gf_sg_mfint32_del(p->set_colorIndex);
6224
0
  gf_sg_mfint32_del(p->set_coordIndex);
6225
0
  gf_node_unregister((GF_Node *) p->color, node);
6226
0
  gf_node_unregister((GF_Node *) p->coord, node);
6227
0
  gf_sg_mfint32_del(p->colorIndex);
6228
0
  gf_sg_mfint32_del(p->coordIndex);
6229
0
  gf_node_unregister((GF_Node *) p->metadata, node);
6230
0
  gf_node_free((GF_Node *)p);
6231
0
}
6232
6233
6234
static u32 IndexedLineSet_get_field_count(GF_Node *node, u8 dummy)
6235
0
{
6236
0
  return 8;
6237
0
}
6238
6239
static GF_Err IndexedLineSet_get_field(GF_Node *node, GF_FieldInfo *info)
6240
0
{
6241
0
  switch (info->fieldIndex) {
6242
0
  case 0:
6243
0
    info->name = "set_colorIndex";
6244
0
    info->eventType = GF_SG_EVENT_IN;
6245
0
    info->on_event_in = ((X_IndexedLineSet *)node)->on_set_colorIndex;
6246
0
    info->fieldType = GF_SG_VRML_MFINT32;
6247
0
    info->far_ptr = & ((X_IndexedLineSet *) node)->set_colorIndex;
6248
0
    return GF_OK;
6249
0
  case 1:
6250
0
    info->name = "set_coordIndex";
6251
0
    info->eventType = GF_SG_EVENT_IN;
6252
0
    info->on_event_in = ((X_IndexedLineSet *)node)->on_set_coordIndex;
6253
0
    info->fieldType = GF_SG_VRML_MFINT32;
6254
0
    info->far_ptr = & ((X_IndexedLineSet *) node)->set_coordIndex;
6255
0
    return GF_OK;
6256
0
  case 2:
6257
0
    info->name = "color";
6258
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6259
0
    info->fieldType = GF_SG_VRML_SFNODE;
6260
0
    info->NDTtype = NDT_SFColorNode;
6261
0
    info->far_ptr = & ((X_IndexedLineSet *)node)->color;
6262
0
    return GF_OK;
6263
0
  case 3:
6264
0
    info->name = "coord";
6265
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6266
0
    info->fieldType = GF_SG_VRML_SFNODE;
6267
0
    info->NDTtype = NDT_SFCoordinateNode;
6268
0
    info->far_ptr = & ((X_IndexedLineSet *)node)->coord;
6269
0
    return GF_OK;
6270
0
  case 4:
6271
0
    info->name = "colorIndex";
6272
0
    info->eventType = GF_SG_EVENT_FIELD;
6273
0
    info->fieldType = GF_SG_VRML_MFINT32;
6274
0
    info->far_ptr = & ((X_IndexedLineSet *) node)->colorIndex;
6275
0
    return GF_OK;
6276
0
  case 5:
6277
0
    info->name = "colorPerVertex";
6278
0
    info->eventType = GF_SG_EVENT_FIELD;
6279
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6280
0
    info->far_ptr = & ((X_IndexedLineSet *) node)->colorPerVertex;
6281
0
    return GF_OK;
6282
0
  case 6:
6283
0
    info->name = "coordIndex";
6284
0
    info->eventType = GF_SG_EVENT_FIELD;
6285
0
    info->fieldType = GF_SG_VRML_MFINT32;
6286
0
    info->far_ptr = & ((X_IndexedLineSet *) node)->coordIndex;
6287
0
    return GF_OK;
6288
0
  case 7:
6289
0
    info->name = "metadata";
6290
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6291
0
    info->fieldType = GF_SG_VRML_SFNODE;
6292
0
    info->NDTtype = NDT_SFMetadataNode;
6293
0
    info->far_ptr = & ((X_IndexedLineSet *)node)->metadata;
6294
0
    return GF_OK;
6295
0
  default:
6296
0
    return GF_BAD_PARAM;
6297
0
  }
6298
0
}
6299
6300
6301
static s32 IndexedLineSet_get_field_index_by_name(char *name)
6302
0
{
6303
0
  if (!strcmp("set_colorIndex", name)) return 0;
6304
0
  if (!strcmp("set_coordIndex", name)) return 1;
6305
0
  if (!strcmp("color", name)) return 2;
6306
0
  if (!strcmp("coord", name)) return 3;
6307
0
  if (!strcmp("colorIndex", name)) return 4;
6308
0
  if (!strcmp("colorPerVertex", name)) return 5;
6309
0
  if (!strcmp("coordIndex", name)) return 6;
6310
0
  if (!strcmp("metadata", name)) return 7;
6311
0
  return -1;
6312
0
}
6313
6314
6315
static GF_Node *IndexedLineSet_Create()
6316
0
{
6317
0
  X_IndexedLineSet *p;
6318
0
  GF_SAFEALLOC(p, X_IndexedLineSet);
6319
0
  if(!p) return NULL;
6320
0
  gf_node_setup((GF_Node *)p, TAG_X3D_IndexedLineSet);
6321
6322
  /*default field values*/
6323
0
  p->colorPerVertex = 1;
6324
0
  return (GF_Node *)p;
6325
0
}
6326
6327
6328
/*
6329
  IndexedTriangleFanSet Node deletion
6330
*/
6331
6332
static void IndexedTriangleFanSet_Del(GF_Node *node)
6333
0
{
6334
0
  X_IndexedTriangleFanSet *p = (X_IndexedTriangleFanSet *) node;
6335
0
  gf_sg_mfint32_del(p->set_index);
6336
0
  gf_node_unregister((GF_Node *) p->color, node);
6337
0
  gf_node_unregister((GF_Node *) p->coord, node);
6338
0
  gf_node_unregister((GF_Node *) p->normal, node);
6339
0
  gf_node_unregister((GF_Node *) p->texCoord, node);
6340
0
  gf_sg_mfint32_del(p->index);
6341
0
  gf_node_unregister((GF_Node *) p->metadata, node);
6342
0
  gf_node_free((GF_Node *)p);
6343
0
}
6344
6345
6346
static u32 IndexedTriangleFanSet_get_field_count(GF_Node *node, u8 dummy)
6347
0
{
6348
0
  return 11;
6349
0
}
6350
6351
static GF_Err IndexedTriangleFanSet_get_field(GF_Node *node, GF_FieldInfo *info)
6352
0
{
6353
0
  switch (info->fieldIndex) {
6354
0
  case 0:
6355
0
    info->name = "set_index";
6356
0
    info->eventType = GF_SG_EVENT_IN;
6357
0
    info->on_event_in = ((X_IndexedTriangleFanSet *)node)->on_set_index;
6358
0
    info->fieldType = GF_SG_VRML_MFINT32;
6359
0
    info->far_ptr = & ((X_IndexedTriangleFanSet *) node)->set_index;
6360
0
    return GF_OK;
6361
0
  case 1:
6362
0
    info->name = "color";
6363
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6364
0
    info->fieldType = GF_SG_VRML_SFNODE;
6365
0
    info->NDTtype = NDT_SFColorNode;
6366
0
    info->far_ptr = & ((X_IndexedTriangleFanSet *)node)->color;
6367
0
    return GF_OK;
6368
0
  case 2:
6369
0
    info->name = "coord";
6370
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6371
0
    info->fieldType = GF_SG_VRML_SFNODE;
6372
0
    info->NDTtype = NDT_SFCoordinateNode;
6373
0
    info->far_ptr = & ((X_IndexedTriangleFanSet *)node)->coord;
6374
0
    return GF_OK;
6375
0
  case 3:
6376
0
    info->name = "normal";
6377
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6378
0
    info->fieldType = GF_SG_VRML_SFNODE;
6379
0
    info->NDTtype = NDT_SFNormalNode;
6380
0
    info->far_ptr = & ((X_IndexedTriangleFanSet *)node)->normal;
6381
0
    return GF_OK;
6382
0
  case 4:
6383
0
    info->name = "texCoord";
6384
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6385
0
    info->fieldType = GF_SG_VRML_SFNODE;
6386
0
    info->NDTtype = NDT_SFTextureCoordinateNode;
6387
0
    info->far_ptr = & ((X_IndexedTriangleFanSet *)node)->texCoord;
6388
0
    return GF_OK;
6389
0
  case 5:
6390
0
    info->name = "ccw";
6391
0
    info->eventType = GF_SG_EVENT_FIELD;
6392
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6393
0
    info->far_ptr = & ((X_IndexedTriangleFanSet *) node)->ccw;
6394
0
    return GF_OK;
6395
0
  case 6:
6396
0
    info->name = "colorPerVertex";
6397
0
    info->eventType = GF_SG_EVENT_FIELD;
6398
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6399
0
    info->far_ptr = & ((X_IndexedTriangleFanSet *) node)->colorPerVertex;
6400
0
    return GF_OK;
6401
0
  case 7:
6402
0
    info->name = "normalPerVertex";
6403
0
    info->eventType = GF_SG_EVENT_FIELD;
6404
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6405
0
    info->far_ptr = & ((X_IndexedTriangleFanSet *) node)->normalPerVertex;
6406
0
    return GF_OK;
6407
0
  case 8:
6408
0
    info->name = "solid";
6409
0
    info->eventType = GF_SG_EVENT_FIELD;
6410
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6411
0
    info->far_ptr = & ((X_IndexedTriangleFanSet *) node)->solid;
6412
0
    return GF_OK;
6413
0
  case 9:
6414
0
    info->name = "index";
6415
0
    info->eventType = GF_SG_EVENT_FIELD;
6416
0
    info->fieldType = GF_SG_VRML_MFINT32;
6417
0
    info->far_ptr = & ((X_IndexedTriangleFanSet *) node)->index;
6418
0
    return GF_OK;
6419
0
  case 10:
6420
0
    info->name = "metadata";
6421
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6422
0
    info->fieldType = GF_SG_VRML_SFNODE;
6423
0
    info->NDTtype = NDT_SFMetadataNode;
6424
0
    info->far_ptr = & ((X_IndexedTriangleFanSet *)node)->metadata;
6425
0
    return GF_OK;
6426
0
  default:
6427
0
    return GF_BAD_PARAM;
6428
0
  }
6429
0
}
6430
6431
6432
static s32 IndexedTriangleFanSet_get_field_index_by_name(char *name)
6433
0
{
6434
0
  if (!strcmp("set_index", name)) return 0;
6435
0
  if (!strcmp("color", name)) return 1;
6436
0
  if (!strcmp("coord", name)) return 2;
6437
0
  if (!strcmp("normal", name)) return 3;
6438
0
  if (!strcmp("texCoord", name)) return 4;
6439
0
  if (!strcmp("ccw", name)) return 5;
6440
0
  if (!strcmp("colorPerVertex", name)) return 6;
6441
0
  if (!strcmp("normalPerVertex", name)) return 7;
6442
0
  if (!strcmp("solid", name)) return 8;
6443
0
  if (!strcmp("index", name)) return 9;
6444
0
  if (!strcmp("metadata", name)) return 10;
6445
0
  return -1;
6446
0
}
6447
6448
6449
static GF_Node *IndexedTriangleFanSet_Create()
6450
0
{
6451
0
  X_IndexedTriangleFanSet *p;
6452
0
  GF_SAFEALLOC(p, X_IndexedTriangleFanSet);
6453
0
  if(!p) return NULL;
6454
0
  gf_node_setup((GF_Node *)p, TAG_X3D_IndexedTriangleFanSet);
6455
6456
  /*default field values*/
6457
0
  p->ccw = 1;
6458
0
  p->colorPerVertex = 1;
6459
0
  p->normalPerVertex = 1;
6460
0
  p->solid = 1;
6461
0
  return (GF_Node *)p;
6462
0
}
6463
6464
6465
/*
6466
  IndexedTriangleSet Node deletion
6467
*/
6468
6469
static void IndexedTriangleSet_Del(GF_Node *node)
6470
0
{
6471
0
  X_IndexedTriangleSet *p = (X_IndexedTriangleSet *) node;
6472
0
  gf_sg_mfint32_del(p->set_index);
6473
0
  gf_node_unregister((GF_Node *) p->color, node);
6474
0
  gf_node_unregister((GF_Node *) p->coord, node);
6475
0
  gf_node_unregister((GF_Node *) p->normal, node);
6476
0
  gf_node_unregister((GF_Node *) p->texCoord, node);
6477
0
  gf_sg_mfint32_del(p->index);
6478
0
  gf_node_unregister((GF_Node *) p->metadata, node);
6479
0
  gf_node_free((GF_Node *)p);
6480
0
}
6481
6482
6483
static u32 IndexedTriangleSet_get_field_count(GF_Node *node, u8 dummy)
6484
0
{
6485
0
  return 11;
6486
0
}
6487
6488
static GF_Err IndexedTriangleSet_get_field(GF_Node *node, GF_FieldInfo *info)
6489
0
{
6490
0
  switch (info->fieldIndex) {
6491
0
  case 0:
6492
0
    info->name = "set_index";
6493
0
    info->eventType = GF_SG_EVENT_IN;
6494
0
    info->on_event_in = ((X_IndexedTriangleSet *)node)->on_set_index;
6495
0
    info->fieldType = GF_SG_VRML_MFINT32;
6496
0
    info->far_ptr = & ((X_IndexedTriangleSet *) node)->set_index;
6497
0
    return GF_OK;
6498
0
  case 1:
6499
0
    info->name = "color";
6500
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6501
0
    info->fieldType = GF_SG_VRML_SFNODE;
6502
0
    info->NDTtype = NDT_SFColorNode;
6503
0
    info->far_ptr = & ((X_IndexedTriangleSet *)node)->color;
6504
0
    return GF_OK;
6505
0
  case 2:
6506
0
    info->name = "coord";
6507
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6508
0
    info->fieldType = GF_SG_VRML_SFNODE;
6509
0
    info->NDTtype = NDT_SFCoordinateNode;
6510
0
    info->far_ptr = & ((X_IndexedTriangleSet *)node)->coord;
6511
0
    return GF_OK;
6512
0
  case 3:
6513
0
    info->name = "normal";
6514
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6515
0
    info->fieldType = GF_SG_VRML_SFNODE;
6516
0
    info->NDTtype = NDT_SFNormalNode;
6517
0
    info->far_ptr = & ((X_IndexedTriangleSet *)node)->normal;
6518
0
    return GF_OK;
6519
0
  case 4:
6520
0
    info->name = "texCoord";
6521
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6522
0
    info->fieldType = GF_SG_VRML_SFNODE;
6523
0
    info->NDTtype = NDT_SFTextureCoordinateNode;
6524
0
    info->far_ptr = & ((X_IndexedTriangleSet *)node)->texCoord;
6525
0
    return GF_OK;
6526
0
  case 5:
6527
0
    info->name = "ccw";
6528
0
    info->eventType = GF_SG_EVENT_FIELD;
6529
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6530
0
    info->far_ptr = & ((X_IndexedTriangleSet *) node)->ccw;
6531
0
    return GF_OK;
6532
0
  case 6:
6533
0
    info->name = "colorPerVertex";
6534
0
    info->eventType = GF_SG_EVENT_FIELD;
6535
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6536
0
    info->far_ptr = & ((X_IndexedTriangleSet *) node)->colorPerVertex;
6537
0
    return GF_OK;
6538
0
  case 7:
6539
0
    info->name = "normalPerVertex";
6540
0
    info->eventType = GF_SG_EVENT_FIELD;
6541
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6542
0
    info->far_ptr = & ((X_IndexedTriangleSet *) node)->normalPerVertex;
6543
0
    return GF_OK;
6544
0
  case 8:
6545
0
    info->name = "solid";
6546
0
    info->eventType = GF_SG_EVENT_FIELD;
6547
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6548
0
    info->far_ptr = & ((X_IndexedTriangleSet *) node)->solid;
6549
0
    return GF_OK;
6550
0
  case 9:
6551
0
    info->name = "index";
6552
0
    info->eventType = GF_SG_EVENT_FIELD;
6553
0
    info->fieldType = GF_SG_VRML_MFINT32;
6554
0
    info->far_ptr = & ((X_IndexedTriangleSet *) node)->index;
6555
0
    return GF_OK;
6556
0
  case 10:
6557
0
    info->name = "metadata";
6558
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6559
0
    info->fieldType = GF_SG_VRML_SFNODE;
6560
0
    info->NDTtype = NDT_SFMetadataNode;
6561
0
    info->far_ptr = & ((X_IndexedTriangleSet *)node)->metadata;
6562
0
    return GF_OK;
6563
0
  default:
6564
0
    return GF_BAD_PARAM;
6565
0
  }
6566
0
}
6567
6568
6569
static s32 IndexedTriangleSet_get_field_index_by_name(char *name)
6570
0
{
6571
0
  if (!strcmp("set_index", name)) return 0;
6572
0
  if (!strcmp("color", name)) return 1;
6573
0
  if (!strcmp("coord", name)) return 2;
6574
0
  if (!strcmp("normal", name)) return 3;
6575
0
  if (!strcmp("texCoord", name)) return 4;
6576
0
  if (!strcmp("ccw", name)) return 5;
6577
0
  if (!strcmp("colorPerVertex", name)) return 6;
6578
0
  if (!strcmp("normalPerVertex", name)) return 7;
6579
0
  if (!strcmp("solid", name)) return 8;
6580
0
  if (!strcmp("index", name)) return 9;
6581
0
  if (!strcmp("metadata", name)) return 10;
6582
0
  return -1;
6583
0
}
6584
6585
6586
static GF_Node *IndexedTriangleSet_Create()
6587
0
{
6588
0
  X_IndexedTriangleSet *p;
6589
0
  GF_SAFEALLOC(p, X_IndexedTriangleSet);
6590
0
  if(!p) return NULL;
6591
0
  gf_node_setup((GF_Node *)p, TAG_X3D_IndexedTriangleSet);
6592
6593
  /*default field values*/
6594
0
  p->ccw = 1;
6595
0
  p->colorPerVertex = 1;
6596
0
  p->normalPerVertex = 1;
6597
0
  p->solid = 1;
6598
0
  return (GF_Node *)p;
6599
0
}
6600
6601
6602
/*
6603
  IndexedTriangleStripSet Node deletion
6604
*/
6605
6606
static void IndexedTriangleStripSet_Del(GF_Node *node)
6607
0
{
6608
0
  X_IndexedTriangleStripSet *p = (X_IndexedTriangleStripSet *) node;
6609
0
  gf_sg_mfint32_del(p->set_index);
6610
0
  gf_node_unregister((GF_Node *) p->color, node);
6611
0
  gf_node_unregister((GF_Node *) p->coord, node);
6612
0
  gf_node_unregister((GF_Node *) p->normal, node);
6613
0
  gf_node_unregister((GF_Node *) p->texCoord, node);
6614
0
  gf_sg_mfint32_del(p->index);
6615
0
  gf_node_unregister((GF_Node *) p->metadata, node);
6616
0
  gf_node_free((GF_Node *)p);
6617
0
}
6618
6619
6620
static u32 IndexedTriangleStripSet_get_field_count(GF_Node *node, u8 dummy)
6621
0
{
6622
0
  return 11;
6623
0
}
6624
6625
static GF_Err IndexedTriangleStripSet_get_field(GF_Node *node, GF_FieldInfo *info)
6626
0
{
6627
0
  switch (info->fieldIndex) {
6628
0
  case 0:
6629
0
    info->name = "set_index";
6630
0
    info->eventType = GF_SG_EVENT_IN;
6631
0
    info->on_event_in = ((X_IndexedTriangleStripSet *)node)->on_set_index;
6632
0
    info->fieldType = GF_SG_VRML_MFINT32;
6633
0
    info->far_ptr = & ((X_IndexedTriangleStripSet *) node)->set_index;
6634
0
    return GF_OK;
6635
0
  case 1:
6636
0
    info->name = "color";
6637
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6638
0
    info->fieldType = GF_SG_VRML_SFNODE;
6639
0
    info->NDTtype = NDT_SFColorNode;
6640
0
    info->far_ptr = & ((X_IndexedTriangleStripSet *)node)->color;
6641
0
    return GF_OK;
6642
0
  case 2:
6643
0
    info->name = "coord";
6644
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6645
0
    info->fieldType = GF_SG_VRML_SFNODE;
6646
0
    info->NDTtype = NDT_SFCoordinateNode;
6647
0
    info->far_ptr = & ((X_IndexedTriangleStripSet *)node)->coord;
6648
0
    return GF_OK;
6649
0
  case 3:
6650
0
    info->name = "creaseAngle";
6651
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6652
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
6653
0
    info->far_ptr = & ((X_IndexedTriangleStripSet *) node)->creaseAngle;
6654
0
    return GF_OK;
6655
0
  case 4:
6656
0
    info->name = "normal";
6657
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6658
0
    info->fieldType = GF_SG_VRML_SFNODE;
6659
0
    info->NDTtype = NDT_SFNormalNode;
6660
0
    info->far_ptr = & ((X_IndexedTriangleStripSet *)node)->normal;
6661
0
    return GF_OK;
6662
0
  case 5:
6663
0
    info->name = "texCoord";
6664
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6665
0
    info->fieldType = GF_SG_VRML_SFNODE;
6666
0
    info->NDTtype = NDT_SFTextureCoordinateNode;
6667
0
    info->far_ptr = & ((X_IndexedTriangleStripSet *)node)->texCoord;
6668
0
    return GF_OK;
6669
0
  case 6:
6670
0
    info->name = "ccw";
6671
0
    info->eventType = GF_SG_EVENT_FIELD;
6672
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6673
0
    info->far_ptr = & ((X_IndexedTriangleStripSet *) node)->ccw;
6674
0
    return GF_OK;
6675
0
  case 7:
6676
0
    info->name = "normalPerVertex";
6677
0
    info->eventType = GF_SG_EVENT_FIELD;
6678
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6679
0
    info->far_ptr = & ((X_IndexedTriangleStripSet *) node)->normalPerVertex;
6680
0
    return GF_OK;
6681
0
  case 8:
6682
0
    info->name = "solid";
6683
0
    info->eventType = GF_SG_EVENT_FIELD;
6684
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6685
0
    info->far_ptr = & ((X_IndexedTriangleStripSet *) node)->solid;
6686
0
    return GF_OK;
6687
0
  case 9:
6688
0
    info->name = "index";
6689
0
    info->eventType = GF_SG_EVENT_FIELD;
6690
0
    info->fieldType = GF_SG_VRML_MFINT32;
6691
0
    info->far_ptr = & ((X_IndexedTriangleStripSet *) node)->index;
6692
0
    return GF_OK;
6693
0
  case 10:
6694
0
    info->name = "metadata";
6695
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6696
0
    info->fieldType = GF_SG_VRML_SFNODE;
6697
0
    info->NDTtype = NDT_SFMetadataNode;
6698
0
    info->far_ptr = & ((X_IndexedTriangleStripSet *)node)->metadata;
6699
0
    return GF_OK;
6700
0
  default:
6701
0
    return GF_BAD_PARAM;
6702
0
  }
6703
0
}
6704
6705
6706
static s32 IndexedTriangleStripSet_get_field_index_by_name(char *name)
6707
0
{
6708
0
  if (!strcmp("set_index", name)) return 0;
6709
0
  if (!strcmp("color", name)) return 1;
6710
0
  if (!strcmp("coord", name)) return 2;
6711
0
  if (!strcmp("creaseAngle", name)) return 3;
6712
0
  if (!strcmp("normal", name)) return 4;
6713
0
  if (!strcmp("texCoord", name)) return 5;
6714
0
  if (!strcmp("ccw", name)) return 6;
6715
0
  if (!strcmp("normalPerVertex", name)) return 7;
6716
0
  if (!strcmp("solid", name)) return 8;
6717
0
  if (!strcmp("index", name)) return 9;
6718
0
  if (!strcmp("metadata", name)) return 10;
6719
0
  return -1;
6720
0
}
6721
6722
6723
static GF_Node *IndexedTriangleStripSet_Create()
6724
0
{
6725
0
  X_IndexedTriangleStripSet *p;
6726
0
  GF_SAFEALLOC(p, X_IndexedTriangleStripSet);
6727
0
  if(!p) return NULL;
6728
0
  gf_node_setup((GF_Node *)p, TAG_X3D_IndexedTriangleStripSet);
6729
6730
  /*default field values*/
6731
0
  p->creaseAngle = FLT2FIX(0);
6732
0
  p->ccw = 1;
6733
0
  p->normalPerVertex = 1;
6734
0
  p->solid = 1;
6735
0
  return (GF_Node *)p;
6736
0
}
6737
6738
6739
/*
6740
  Inline Node deletion
6741
*/
6742
6743
static void Inline_Del(GF_Node *node)
6744
0
{
6745
0
  X_Inline *p = (X_Inline *) node;
6746
0
  gf_sg_mfurl_del(p->url);
6747
0
  gf_node_unregister((GF_Node *) p->metadata, node);
6748
0
  gf_node_free((GF_Node *)p);
6749
0
}
6750
6751
6752
static u32 Inline_get_field_count(GF_Node *node, u8 dummy)
6753
0
{
6754
0
  return 3;
6755
0
}
6756
6757
static GF_Err Inline_get_field(GF_Node *node, GF_FieldInfo *info)
6758
0
{
6759
0
  switch (info->fieldIndex) {
6760
0
  case 0:
6761
0
    info->name = "url";
6762
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6763
0
    info->fieldType = GF_SG_VRML_MFURL;
6764
0
    info->far_ptr = & ((X_Inline *) node)->url;
6765
0
    return GF_OK;
6766
0
  case 1:
6767
0
    info->name = "metadata";
6768
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6769
0
    info->fieldType = GF_SG_VRML_SFNODE;
6770
0
    info->NDTtype = NDT_SFMetadataNode;
6771
0
    info->far_ptr = & ((X_Inline *)node)->metadata;
6772
0
    return GF_OK;
6773
0
  case 2:
6774
0
    info->name = "load";
6775
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6776
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6777
0
    info->far_ptr = & ((X_Inline *) node)->load;
6778
0
    return GF_OK;
6779
0
  default:
6780
0
    return GF_BAD_PARAM;
6781
0
  }
6782
0
}
6783
6784
6785
static s32 Inline_get_field_index_by_name(char *name)
6786
0
{
6787
0
  if (!strcmp("url", name)) return 0;
6788
0
  if (!strcmp("metadata", name)) return 1;
6789
0
  if (!strcmp("load", name)) return 2;
6790
0
  return -1;
6791
0
}
6792
6793
6794
static GF_Node *Inline_Create()
6795
0
{
6796
0
  X_Inline *p;
6797
0
  GF_SAFEALLOC(p, X_Inline);
6798
0
  if(!p) return NULL;
6799
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Inline);
6800
6801
  /*default field values*/
6802
0
  p->load = 1;
6803
0
  return (GF_Node *)p;
6804
0
}
6805
6806
6807
/*
6808
  IntegerSequencer Node deletion
6809
*/
6810
6811
static void IntegerSequencer_Del(GF_Node *node)
6812
0
{
6813
0
  X_IntegerSequencer *p = (X_IntegerSequencer *) node;
6814
0
  gf_sg_mffloat_del(p->key);
6815
0
  gf_sg_mfint32_del(p->keyValue);
6816
0
  gf_node_unregister((GF_Node *) p->metadata, node);
6817
0
  gf_node_free((GF_Node *)p);
6818
0
}
6819
6820
6821
static u32 IntegerSequencer_get_field_count(GF_Node *node, u8 dummy)
6822
0
{
6823
0
  return 7;
6824
0
}
6825
6826
static GF_Err IntegerSequencer_get_field(GF_Node *node, GF_FieldInfo *info)
6827
0
{
6828
0
  switch (info->fieldIndex) {
6829
0
  case 0:
6830
0
    info->name = "next";
6831
0
    info->eventType = GF_SG_EVENT_IN;
6832
0
    info->on_event_in = ((X_IntegerSequencer *)node)->on_next;
6833
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6834
0
    info->far_ptr = & ((X_IntegerSequencer *) node)->next;
6835
0
    return GF_OK;
6836
0
  case 1:
6837
0
    info->name = "previous";
6838
0
    info->eventType = GF_SG_EVENT_IN;
6839
0
    info->on_event_in = ((X_IntegerSequencer *)node)->on_previous;
6840
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6841
0
    info->far_ptr = & ((X_IntegerSequencer *) node)->previous;
6842
0
    return GF_OK;
6843
0
  case 2:
6844
0
    info->name = "set_fraction";
6845
0
    info->eventType = GF_SG_EVENT_IN;
6846
0
    info->on_event_in = ((X_IntegerSequencer *)node)->on_set_fraction;
6847
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
6848
0
    info->far_ptr = & ((X_IntegerSequencer *) node)->set_fraction;
6849
0
    return GF_OK;
6850
0
  case 3:
6851
0
    info->name = "key";
6852
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6853
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
6854
0
    info->far_ptr = & ((X_IntegerSequencer *) node)->key;
6855
0
    return GF_OK;
6856
0
  case 4:
6857
0
    info->name = "keyValue";
6858
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6859
0
    info->fieldType = GF_SG_VRML_MFINT32;
6860
0
    info->far_ptr = & ((X_IntegerSequencer *) node)->keyValue;
6861
0
    return GF_OK;
6862
0
  case 5:
6863
0
    info->name = "value_changed";
6864
0
    info->eventType = GF_SG_EVENT_OUT;
6865
0
    info->fieldType = GF_SG_VRML_SFINT32;
6866
0
    info->far_ptr = & ((X_IntegerSequencer *) node)->value_changed;
6867
0
    return GF_OK;
6868
0
  case 6:
6869
0
    info->name = "metadata";
6870
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6871
0
    info->fieldType = GF_SG_VRML_SFNODE;
6872
0
    info->NDTtype = NDT_SFMetadataNode;
6873
0
    info->far_ptr = & ((X_IntegerSequencer *)node)->metadata;
6874
0
    return GF_OK;
6875
0
  default:
6876
0
    return GF_BAD_PARAM;
6877
0
  }
6878
0
}
6879
6880
6881
static s32 IntegerSequencer_get_field_index_by_name(char *name)
6882
0
{
6883
0
  if (!strcmp("next", name)) return 0;
6884
0
  if (!strcmp("previous", name)) return 1;
6885
0
  if (!strcmp("set_fraction", name)) return 2;
6886
0
  if (!strcmp("key", name)) return 3;
6887
0
  if (!strcmp("keyValue", name)) return 4;
6888
0
  if (!strcmp("value_changed", name)) return 5;
6889
0
  if (!strcmp("metadata", name)) return 6;
6890
0
  return -1;
6891
0
}
6892
6893
6894
static GF_Node *IntegerSequencer_Create()
6895
0
{
6896
0
  X_IntegerSequencer *p;
6897
0
  GF_SAFEALLOC(p, X_IntegerSequencer);
6898
0
  if(!p) return NULL;
6899
0
  gf_node_setup((GF_Node *)p, TAG_X3D_IntegerSequencer);
6900
6901
  /*default field values*/
6902
0
  return (GF_Node *)p;
6903
0
}
6904
6905
6906
/*
6907
  IntegerTrigger Node deletion
6908
*/
6909
6910
static void IntegerTrigger_Del(GF_Node *node)
6911
0
{
6912
0
  X_IntegerTrigger *p = (X_IntegerTrigger *) node;
6913
0
  gf_node_unregister((GF_Node *) p->metadata, node);
6914
0
  gf_node_free((GF_Node *)p);
6915
0
}
6916
6917
6918
static u32 IntegerTrigger_get_field_count(GF_Node *node, u8 dummy)
6919
0
{
6920
0
  return 4;
6921
0
}
6922
6923
static GF_Err IntegerTrigger_get_field(GF_Node *node, GF_FieldInfo *info)
6924
0
{
6925
0
  switch (info->fieldIndex) {
6926
0
  case 0:
6927
0
    info->name = "set_boolean";
6928
0
    info->eventType = GF_SG_EVENT_IN;
6929
0
    info->on_event_in = ((X_IntegerTrigger *)node)->on_set_boolean;
6930
0
    info->fieldType = GF_SG_VRML_SFBOOL;
6931
0
    info->far_ptr = & ((X_IntegerTrigger *) node)->set_boolean;
6932
0
    return GF_OK;
6933
0
  case 1:
6934
0
    info->name = "integerKey";
6935
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6936
0
    info->fieldType = GF_SG_VRML_SFINT32;
6937
0
    info->far_ptr = & ((X_IntegerTrigger *) node)->integerKey;
6938
0
    return GF_OK;
6939
0
  case 2:
6940
0
    info->name = "triggerValue";
6941
0
    info->eventType = GF_SG_EVENT_OUT;
6942
0
    info->fieldType = GF_SG_VRML_SFINT32;
6943
0
    info->far_ptr = & ((X_IntegerTrigger *) node)->triggerValue;
6944
0
    return GF_OK;
6945
0
  case 3:
6946
0
    info->name = "metadata";
6947
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
6948
0
    info->fieldType = GF_SG_VRML_SFNODE;
6949
0
    info->NDTtype = NDT_SFMetadataNode;
6950
0
    info->far_ptr = & ((X_IntegerTrigger *)node)->metadata;
6951
0
    return GF_OK;
6952
0
  default:
6953
0
    return GF_BAD_PARAM;
6954
0
  }
6955
0
}
6956
6957
6958
static s32 IntegerTrigger_get_field_index_by_name(char *name)
6959
0
{
6960
0
  if (!strcmp("set_boolean", name)) return 0;
6961
0
  if (!strcmp("integerKey", name)) return 1;
6962
0
  if (!strcmp("triggerValue", name)) return 2;
6963
0
  if (!strcmp("metadata", name)) return 3;
6964
0
  return -1;
6965
0
}
6966
6967
6968
static GF_Node *IntegerTrigger_Create()
6969
0
{
6970
0
  X_IntegerTrigger *p;
6971
0
  GF_SAFEALLOC(p, X_IntegerTrigger);
6972
0
  if(!p) return NULL;
6973
0
  gf_node_setup((GF_Node *)p, TAG_X3D_IntegerTrigger);
6974
6975
  /*default field values*/
6976
0
  p->integerKey = -1;
6977
0
  return (GF_Node *)p;
6978
0
}
6979
6980
6981
/*
6982
  KeySensor Node deletion
6983
*/
6984
6985
static void KeySensor_Del(GF_Node *node)
6986
0
{
6987
0
  X_KeySensor *p = (X_KeySensor *) node;
6988
0
  gf_sg_sfstring_del(p->keyPress);
6989
0
  gf_sg_sfstring_del(p->keyRelease);
6990
0
  gf_node_unregister((GF_Node *) p->metadata, node);
6991
0
  gf_node_free((GF_Node *)p);
6992
0
}
6993
6994
6995
static u32 KeySensor_get_field_count(GF_Node *node, u8 dummy)
6996
0
{
6997
0
  return 10;
6998
0
}
6999
7000
static GF_Err KeySensor_get_field(GF_Node *node, GF_FieldInfo *info)
7001
0
{
7002
0
  switch (info->fieldIndex) {
7003
0
  case 0:
7004
0
    info->name = "enabled";
7005
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7006
0
    info->fieldType = GF_SG_VRML_SFBOOL;
7007
0
    info->far_ptr = & ((X_KeySensor *) node)->enabled;
7008
0
    return GF_OK;
7009
0
  case 1:
7010
0
    info->name = "actionKeyPress";
7011
0
    info->eventType = GF_SG_EVENT_OUT;
7012
0
    info->fieldType = GF_SG_VRML_SFINT32;
7013
0
    info->far_ptr = & ((X_KeySensor *) node)->actionKeyPress;
7014
0
    return GF_OK;
7015
0
  case 2:
7016
0
    info->name = "actionKeyRelease";
7017
0
    info->eventType = GF_SG_EVENT_OUT;
7018
0
    info->fieldType = GF_SG_VRML_SFINT32;
7019
0
    info->far_ptr = & ((X_KeySensor *) node)->actionKeyRelease;
7020
0
    return GF_OK;
7021
0
  case 3:
7022
0
    info->name = "altKey";
7023
0
    info->eventType = GF_SG_EVENT_OUT;
7024
0
    info->fieldType = GF_SG_VRML_SFBOOL;
7025
0
    info->far_ptr = & ((X_KeySensor *) node)->altKey;
7026
0
    return GF_OK;
7027
0
  case 4:
7028
0
    info->name = "controlKey";
7029
0
    info->eventType = GF_SG_EVENT_OUT;
7030
0
    info->fieldType = GF_SG_VRML_SFBOOL;
7031
0
    info->far_ptr = & ((X_KeySensor *) node)->controlKey;
7032
0
    return GF_OK;
7033
0
  case 5:
7034
0
    info->name = "isActive";
7035
0
    info->eventType = GF_SG_EVENT_OUT;
7036
0
    info->fieldType = GF_SG_VRML_SFBOOL;
7037
0
    info->far_ptr = & ((X_KeySensor *) node)->isActive;
7038
0
    return GF_OK;
7039
0
  case 6:
7040
0
    info->name = "keyPress";
7041
0
    info->eventType = GF_SG_EVENT_OUT;
7042
0
    info->fieldType = GF_SG_VRML_SFSTRING;
7043
0
    info->far_ptr = & ((X_KeySensor *) node)->keyPress;
7044
0
    return GF_OK;
7045
0
  case 7:
7046
0
    info->name = "keyRelease";
7047
0
    info->eventType = GF_SG_EVENT_OUT;
7048
0
    info->fieldType = GF_SG_VRML_SFSTRING;
7049
0
    info->far_ptr = & ((X_KeySensor *) node)->keyRelease;
7050
0
    return GF_OK;
7051
0
  case 8:
7052
0
    info->name = "shiftKey";
7053
0
    info->eventType = GF_SG_EVENT_OUT;
7054
0
    info->fieldType = GF_SG_VRML_SFBOOL;
7055
0
    info->far_ptr = & ((X_KeySensor *) node)->shiftKey;
7056
0
    return GF_OK;
7057
0
  case 9:
7058
0
    info->name = "metadata";
7059
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7060
0
    info->fieldType = GF_SG_VRML_SFNODE;
7061
0
    info->NDTtype = NDT_SFMetadataNode;
7062
0
    info->far_ptr = & ((X_KeySensor *)node)->metadata;
7063
0
    return GF_OK;
7064
0
  default:
7065
0
    return GF_BAD_PARAM;
7066
0
  }
7067
0
}
7068
7069
7070
static s32 KeySensor_get_field_index_by_name(char *name)
7071
0
{
7072
0
  if (!strcmp("enabled", name)) return 0;
7073
0
  if (!strcmp("actionKeyPress", name)) return 1;
7074
0
  if (!strcmp("actionKeyRelease", name)) return 2;
7075
0
  if (!strcmp("altKey", name)) return 3;
7076
0
  if (!strcmp("controlKey", name)) return 4;
7077
0
  if (!strcmp("isActive", name)) return 5;
7078
0
  if (!strcmp("keyPress", name)) return 6;
7079
0
  if (!strcmp("keyRelease", name)) return 7;
7080
0
  if (!strcmp("shiftKey", name)) return 8;
7081
0
  if (!strcmp("metadata", name)) return 9;
7082
0
  return -1;
7083
0
}
7084
7085
7086
static GF_Node *KeySensor_Create()
7087
0
{
7088
0
  X_KeySensor *p;
7089
0
  GF_SAFEALLOC(p, X_KeySensor);
7090
0
  if(!p) return NULL;
7091
0
  gf_node_setup((GF_Node *)p, TAG_X3D_KeySensor);
7092
7093
  /*default field values*/
7094
0
  p->enabled = 1;
7095
0
  return (GF_Node *)p;
7096
0
}
7097
7098
7099
/*
7100
  LineProperties Node deletion
7101
*/
7102
7103
static void LineProperties_Del(GF_Node *node)
7104
0
{
7105
0
  X_LineProperties *p = (X_LineProperties *) node;
7106
0
  gf_node_unregister((GF_Node *) p->metadata, node);
7107
0
  gf_node_free((GF_Node *)p);
7108
0
}
7109
7110
7111
static u32 LineProperties_get_field_count(GF_Node *node, u8 dummy)
7112
0
{
7113
0
  return 4;
7114
0
}
7115
7116
static GF_Err LineProperties_get_field(GF_Node *node, GF_FieldInfo *info)
7117
0
{
7118
0
  switch (info->fieldIndex) {
7119
0
  case 0:
7120
0
    info->name = "applied";
7121
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7122
0
    info->fieldType = GF_SG_VRML_SFBOOL;
7123
0
    info->far_ptr = & ((X_LineProperties *) node)->applied;
7124
0
    return GF_OK;
7125
0
  case 1:
7126
0
    info->name = "linetype";
7127
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7128
0
    info->fieldType = GF_SG_VRML_SFINT32;
7129
0
    info->far_ptr = & ((X_LineProperties *) node)->linetype;
7130
0
    return GF_OK;
7131
0
  case 2:
7132
0
    info->name = "linewidthScaleFactor";
7133
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7134
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
7135
0
    info->far_ptr = & ((X_LineProperties *) node)->linewidthScaleFactor;
7136
0
    return GF_OK;
7137
0
  case 3:
7138
0
    info->name = "metadata";
7139
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7140
0
    info->fieldType = GF_SG_VRML_SFNODE;
7141
0
    info->NDTtype = NDT_SFMetadataNode;
7142
0
    info->far_ptr = & ((X_LineProperties *)node)->metadata;
7143
0
    return GF_OK;
7144
0
  default:
7145
0
    return GF_BAD_PARAM;
7146
0
  }
7147
0
}
7148
7149
7150
static s32 LineProperties_get_field_index_by_name(char *name)
7151
0
{
7152
0
  if (!strcmp("applied", name)) return 0;
7153
0
  if (!strcmp("linetype", name)) return 1;
7154
0
  if (!strcmp("linewidthScaleFactor", name)) return 2;
7155
0
  if (!strcmp("metadata", name)) return 3;
7156
0
  return -1;
7157
0
}
7158
7159
7160
static GF_Node *LineProperties_Create()
7161
0
{
7162
0
  X_LineProperties *p;
7163
0
  GF_SAFEALLOC(p, X_LineProperties);
7164
0
  if(!p) return NULL;
7165
0
  gf_node_setup((GF_Node *)p, TAG_X3D_LineProperties);
7166
7167
  /*default field values*/
7168
0
  p->applied = 1;
7169
0
  p->linetype = 1;
7170
0
  p->linewidthScaleFactor = FLT2FIX(0);
7171
0
  return (GF_Node *)p;
7172
0
}
7173
7174
7175
/*
7176
  LineSet Node deletion
7177
*/
7178
7179
static void LineSet_Del(GF_Node *node)
7180
0
{
7181
0
  X_LineSet *p = (X_LineSet *) node;
7182
0
  gf_node_unregister((GF_Node *) p->color, node);
7183
0
  gf_node_unregister((GF_Node *) p->coord, node);
7184
0
  gf_sg_mfint32_del(p->vertexCount);
7185
0
  gf_node_unregister((GF_Node *) p->metadata, node);
7186
0
  gf_node_free((GF_Node *)p);
7187
0
}
7188
7189
7190
static u32 LineSet_get_field_count(GF_Node *node, u8 dummy)
7191
0
{
7192
0
  return 4;
7193
0
}
7194
7195
static GF_Err LineSet_get_field(GF_Node *node, GF_FieldInfo *info)
7196
0
{
7197
0
  switch (info->fieldIndex) {
7198
0
  case 0:
7199
0
    info->name = "color";
7200
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7201
0
    info->fieldType = GF_SG_VRML_SFNODE;
7202
0
    info->NDTtype = NDT_SFColorNode;
7203
0
    info->far_ptr = & ((X_LineSet *)node)->color;
7204
0
    return GF_OK;
7205
0
  case 1:
7206
0
    info->name = "coord";
7207
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7208
0
    info->fieldType = GF_SG_VRML_SFNODE;
7209
0
    info->NDTtype = NDT_SFCoordinateNode;
7210
0
    info->far_ptr = & ((X_LineSet *)node)->coord;
7211
0
    return GF_OK;
7212
0
  case 2:
7213
0
    info->name = "vertexCount";
7214
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7215
0
    info->fieldType = GF_SG_VRML_MFINT32;
7216
0
    info->far_ptr = & ((X_LineSet *) node)->vertexCount;
7217
0
    return GF_OK;
7218
0
  case 3:
7219
0
    info->name = "metadata";
7220
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7221
0
    info->fieldType = GF_SG_VRML_SFNODE;
7222
0
    info->NDTtype = NDT_SFMetadataNode;
7223
0
    info->far_ptr = & ((X_LineSet *)node)->metadata;
7224
0
    return GF_OK;
7225
0
  default:
7226
0
    return GF_BAD_PARAM;
7227
0
  }
7228
0
}
7229
7230
7231
static s32 LineSet_get_field_index_by_name(char *name)
7232
0
{
7233
0
  if (!strcmp("color", name)) return 0;
7234
0
  if (!strcmp("coord", name)) return 1;
7235
0
  if (!strcmp("vertexCount", name)) return 2;
7236
0
  if (!strcmp("metadata", name)) return 3;
7237
0
  return -1;
7238
0
}
7239
7240
7241
static GF_Node *LineSet_Create()
7242
0
{
7243
0
  X_LineSet *p;
7244
0
  GF_SAFEALLOC(p, X_LineSet);
7245
0
  if(!p) return NULL;
7246
0
  gf_node_setup((GF_Node *)p, TAG_X3D_LineSet);
7247
7248
  /*default field values*/
7249
0
  return (GF_Node *)p;
7250
0
}
7251
7252
7253
/*
7254
  LoadSensor Node deletion
7255
*/
7256
7257
static void LoadSensor_Del(GF_Node *node)
7258
0
{
7259
0
  X_LoadSensor *p = (X_LoadSensor *) node;
7260
0
  gf_node_unregister_children(node, p->watchList);
7261
0
  gf_node_unregister((GF_Node *) p->metadata, node);
7262
0
  gf_node_free((GF_Node *)p);
7263
0
}
7264
7265
7266
static u32 LoadSensor_get_field_count(GF_Node *node, u8 dummy)
7267
0
{
7268
0
  return 8;
7269
0
}
7270
7271
static GF_Err LoadSensor_get_field(GF_Node *node, GF_FieldInfo *info)
7272
0
{
7273
0
  switch (info->fieldIndex) {
7274
0
  case 0:
7275
0
    info->name = "enabled";
7276
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7277
0
    info->fieldType = GF_SG_VRML_SFBOOL;
7278
0
    info->far_ptr = & ((X_LoadSensor *) node)->enabled;
7279
0
    return GF_OK;
7280
0
  case 1:
7281
0
    info->name = "timeOut";
7282
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7283
0
    info->fieldType = GF_SG_VRML_SFTIME;
7284
0
    info->far_ptr = & ((X_LoadSensor *) node)->timeOut;
7285
0
    return GF_OK;
7286
0
  case 2:
7287
0
    info->name = "watchList";
7288
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7289
0
    info->fieldType = GF_SG_VRML_MFNODE;
7290
0
    info->NDTtype = NDT_SFStreamingNode;
7291
0
    info->far_ptr = & ((X_LoadSensor *)node)->watchList;
7292
0
    return GF_OK;
7293
0
  case 3:
7294
0
    info->name = "isActive";
7295
0
    info->eventType = GF_SG_EVENT_OUT;
7296
0
    info->fieldType = GF_SG_VRML_SFBOOL;
7297
0
    info->far_ptr = & ((X_LoadSensor *) node)->isActive;
7298
0
    return GF_OK;
7299
0
  case 4:
7300
0
    info->name = "isLoaded";
7301
0
    info->eventType = GF_SG_EVENT_OUT;
7302
0
    info->fieldType = GF_SG_VRML_SFBOOL;
7303
0
    info->far_ptr = & ((X_LoadSensor *) node)->isLoaded;
7304
0
    return GF_OK;
7305
0
  case 5:
7306
0
    info->name = "loadTime";
7307
0
    info->eventType = GF_SG_EVENT_OUT;
7308
0
    info->fieldType = GF_SG_VRML_SFTIME;
7309
0
    info->far_ptr = & ((X_LoadSensor *) node)->loadTime;
7310
0
    return GF_OK;
7311
0
  case 6:
7312
0
    info->name = "progress";
7313
0
    info->eventType = GF_SG_EVENT_OUT;
7314
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
7315
0
    info->far_ptr = & ((X_LoadSensor *) node)->progress;
7316
0
    return GF_OK;
7317
0
  case 7:
7318
0
    info->name = "metadata";
7319
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7320
0
    info->fieldType = GF_SG_VRML_SFNODE;
7321
0
    info->NDTtype = NDT_SFMetadataNode;
7322
0
    info->far_ptr = & ((X_LoadSensor *)node)->metadata;
7323
0
    return GF_OK;
7324
0
  default:
7325
0
    return GF_BAD_PARAM;
7326
0
  }
7327
0
}
7328
7329
7330
static s32 LoadSensor_get_field_index_by_name(char *name)
7331
0
{
7332
0
  if (!strcmp("enabled", name)) return 0;
7333
0
  if (!strcmp("timeOut", name)) return 1;
7334
0
  if (!strcmp("watchList", name)) return 2;
7335
0
  if (!strcmp("isActive", name)) return 3;
7336
0
  if (!strcmp("isLoaded", name)) return 4;
7337
0
  if (!strcmp("loadTime", name)) return 5;
7338
0
  if (!strcmp("progress", name)) return 6;
7339
0
  if (!strcmp("metadata", name)) return 7;
7340
0
  return -1;
7341
0
}
7342
7343
7344
static GF_Node *LoadSensor_Create()
7345
0
{
7346
0
  X_LoadSensor *p;
7347
0
  GF_SAFEALLOC(p, X_LoadSensor);
7348
0
  if(!p) return NULL;
7349
0
  gf_node_setup((GF_Node *)p, TAG_X3D_LoadSensor);
7350
7351
  /*default field values*/
7352
0
  p->enabled = 1;
7353
0
  p->timeOut = 0;
7354
0
  return (GF_Node *)p;
7355
0
}
7356
7357
7358
/*
7359
  LOD Node deletion
7360
*/
7361
7362
static void LOD_Del(GF_Node *node)
7363
0
{
7364
0
  X_LOD *p = (X_LOD *) node;
7365
0
  gf_sg_mffloat_del(p->range);
7366
0
  gf_node_unregister((GF_Node *) p->metadata, node);
7367
0
  gf_sg_vrml_parent_destroy(node);
7368
0
  gf_node_free((GF_Node *)p);
7369
0
}
7370
7371
7372
static u32 LOD_get_field_count(GF_Node *node, u8 dummy)
7373
0
{
7374
0
  return 6;
7375
0
}
7376
7377
static GF_Err LOD_get_field(GF_Node *node, GF_FieldInfo *info)
7378
0
{
7379
0
  switch (info->fieldIndex) {
7380
0
  case 0:
7381
0
    info->name = "addChildren";
7382
0
    info->eventType = GF_SG_EVENT_IN;
7383
0
    info->on_event_in = ((X_LOD *)node)->on_addChildren;
7384
0
    info->fieldType = GF_SG_VRML_MFNODE;
7385
0
    info->NDTtype = NDT_SF3DNode;
7386
0
    info->far_ptr = & ((X_LOD *)node)->addChildren;
7387
0
    return GF_OK;
7388
0
  case 1:
7389
0
    info->name = "removeChildren";
7390
0
    info->eventType = GF_SG_EVENT_IN;
7391
0
    info->on_event_in = ((X_LOD *)node)->on_removeChildren;
7392
0
    info->fieldType = GF_SG_VRML_MFNODE;
7393
0
    info->NDTtype = NDT_SF3DNode;
7394
0
    info->far_ptr = & ((X_LOD *)node)->removeChildren;
7395
0
    return GF_OK;
7396
0
  case 2:
7397
0
    info->name = "children";
7398
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7399
0
    info->fieldType = GF_SG_VRML_MFNODE;
7400
0
    info->NDTtype = NDT_SF3DNode;
7401
0
    info->far_ptr = & ((X_LOD *)node)->children;
7402
0
    return GF_OK;
7403
0
  case 3:
7404
0
    info->name = "center";
7405
0
    info->eventType = GF_SG_EVENT_FIELD;
7406
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
7407
0
    info->far_ptr = & ((X_LOD *) node)->center;
7408
0
    return GF_OK;
7409
0
  case 4:
7410
0
    info->name = "range";
7411
0
    info->eventType = GF_SG_EVENT_FIELD;
7412
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
7413
0
    info->far_ptr = & ((X_LOD *) node)->range;
7414
0
    return GF_OK;
7415
0
  case 5:
7416
0
    info->name = "metadata";
7417
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7418
0
    info->fieldType = GF_SG_VRML_SFNODE;
7419
0
    info->NDTtype = NDT_SFMetadataNode;
7420
0
    info->far_ptr = & ((X_LOD *)node)->metadata;
7421
0
    return GF_OK;
7422
0
  default:
7423
0
    return GF_BAD_PARAM;
7424
0
  }
7425
0
}
7426
7427
7428
static s32 LOD_get_field_index_by_name(char *name)
7429
0
{
7430
0
  if (!strcmp("addChildren", name)) return 0;
7431
0
  if (!strcmp("removeChildren", name)) return 1;
7432
0
  if (!strcmp("children", name)) return 2;
7433
0
  if (!strcmp("center", name)) return 3;
7434
0
  if (!strcmp("range", name)) return 4;
7435
0
  if (!strcmp("metadata", name)) return 5;
7436
0
  return -1;
7437
0
}
7438
7439
7440
static GF_Node *LOD_Create()
7441
0
{
7442
0
  X_LOD *p;
7443
0
  GF_SAFEALLOC(p, X_LOD);
7444
0
  if(!p) return NULL;
7445
0
  gf_node_setup((GF_Node *)p, TAG_X3D_LOD);
7446
0
  gf_sg_vrml_parent_setup((GF_Node *) p);
7447
7448
  /*default field values*/
7449
0
  p->center.x = FLT2FIX(0);
7450
0
  p->center.y = FLT2FIX(0);
7451
0
  p->center.z = FLT2FIX(0);
7452
0
  return (GF_Node *)p;
7453
0
}
7454
7455
7456
/*
7457
  Material Node deletion
7458
*/
7459
7460
static void Material_Del(GF_Node *node)
7461
0
{
7462
0
  X_Material *p = (X_Material *) node;
7463
0
  gf_node_unregister((GF_Node *) p->metadata, node);
7464
0
  gf_node_free((GF_Node *)p);
7465
0
}
7466
7467
7468
static u32 Material_get_field_count(GF_Node *node, u8 dummy)
7469
0
{
7470
0
  return 7;
7471
0
}
7472
7473
static GF_Err Material_get_field(GF_Node *node, GF_FieldInfo *info)
7474
0
{
7475
0
  switch (info->fieldIndex) {
7476
0
  case 0:
7477
0
    info->name = "ambientIntensity";
7478
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7479
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
7480
0
    info->far_ptr = & ((X_Material *) node)->ambientIntensity;
7481
0
    return GF_OK;
7482
0
  case 1:
7483
0
    info->name = "diffuseColor";
7484
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7485
0
    info->fieldType = GF_SG_VRML_SFCOLOR;
7486
0
    info->far_ptr = & ((X_Material *) node)->diffuseColor;
7487
0
    return GF_OK;
7488
0
  case 2:
7489
0
    info->name = "emissiveColor";
7490
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7491
0
    info->fieldType = GF_SG_VRML_SFCOLOR;
7492
0
    info->far_ptr = & ((X_Material *) node)->emissiveColor;
7493
0
    return GF_OK;
7494
0
  case 3:
7495
0
    info->name = "shininess";
7496
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7497
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
7498
0
    info->far_ptr = & ((X_Material *) node)->shininess;
7499
0
    return GF_OK;
7500
0
  case 4:
7501
0
    info->name = "specularColor";
7502
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7503
0
    info->fieldType = GF_SG_VRML_SFCOLOR;
7504
0
    info->far_ptr = & ((X_Material *) node)->specularColor;
7505
0
    return GF_OK;
7506
0
  case 5:
7507
0
    info->name = "transparency";
7508
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7509
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
7510
0
    info->far_ptr = & ((X_Material *) node)->transparency;
7511
0
    return GF_OK;
7512
0
  case 6:
7513
0
    info->name = "metadata";
7514
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7515
0
    info->fieldType = GF_SG_VRML_SFNODE;
7516
0
    info->NDTtype = NDT_SFMetadataNode;
7517
0
    info->far_ptr = & ((X_Material *)node)->metadata;
7518
0
    return GF_OK;
7519
0
  default:
7520
0
    return GF_BAD_PARAM;
7521
0
  }
7522
0
}
7523
7524
7525
static s32 Material_get_field_index_by_name(char *name)
7526
0
{
7527
0
  if (!strcmp("ambientIntensity", name)) return 0;
7528
0
  if (!strcmp("diffuseColor", name)) return 1;
7529
0
  if (!strcmp("emissiveColor", name)) return 2;
7530
0
  if (!strcmp("shininess", name)) return 3;
7531
0
  if (!strcmp("specularColor", name)) return 4;
7532
0
  if (!strcmp("transparency", name)) return 5;
7533
0
  if (!strcmp("metadata", name)) return 6;
7534
0
  return -1;
7535
0
}
7536
7537
7538
static GF_Node *Material_Create()
7539
0
{
7540
0
  X_Material *p;
7541
0
  GF_SAFEALLOC(p, X_Material);
7542
0
  if(!p) return NULL;
7543
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Material);
7544
7545
  /*default field values*/
7546
0
  p->ambientIntensity = FLT2FIX(0.2);
7547
0
  p->diffuseColor.red = FLT2FIX(0.8);
7548
0
  p->diffuseColor.green = FLT2FIX(0.8);
7549
0
  p->diffuseColor.blue = FLT2FIX(0.8);
7550
0
  p->emissiveColor.red = FLT2FIX(0);
7551
0
  p->emissiveColor.green = FLT2FIX(0);
7552
0
  p->emissiveColor.blue = FLT2FIX(0);
7553
0
  p->shininess = FLT2FIX(0.2);
7554
0
  p->specularColor.red = FLT2FIX(0);
7555
0
  p->specularColor.green = FLT2FIX(0);
7556
0
  p->specularColor.blue = FLT2FIX(0);
7557
0
  p->transparency = FLT2FIX(0);
7558
0
  return (GF_Node *)p;
7559
0
}
7560
7561
7562
/*
7563
  MetadataDouble Node deletion
7564
*/
7565
7566
static void MetadataDouble_Del(GF_Node *node)
7567
0
{
7568
0
  X_MetadataDouble *p = (X_MetadataDouble *) node;
7569
0
  gf_sg_sfstring_del(p->name);
7570
0
  gf_sg_sfstring_del(p->reference);
7571
0
  gf_sg_mfdouble_del(p->value);
7572
0
  gf_node_unregister((GF_Node *) p->metadata, node);
7573
0
  gf_node_free((GF_Node *)p);
7574
0
}
7575
7576
7577
static u32 MetadataDouble_get_field_count(GF_Node *node, u8 dummy)
7578
0
{
7579
0
  return 4;
7580
0
}
7581
7582
static GF_Err MetadataDouble_get_field(GF_Node *node, GF_FieldInfo *info)
7583
0
{
7584
0
  switch (info->fieldIndex) {
7585
0
  case 0:
7586
0
    info->name = "name";
7587
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7588
0
    info->fieldType = GF_SG_VRML_SFSTRING;
7589
0
    info->far_ptr = & ((X_MetadataDouble *) node)->name;
7590
0
    return GF_OK;
7591
0
  case 1:
7592
0
    info->name = "reference";
7593
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7594
0
    info->fieldType = GF_SG_VRML_SFSTRING;
7595
0
    info->far_ptr = & ((X_MetadataDouble *) node)->reference;
7596
0
    return GF_OK;
7597
0
  case 2:
7598
0
    info->name = "value";
7599
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7600
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
7601
0
    info->far_ptr = & ((X_MetadataDouble *) node)->value;
7602
0
    return GF_OK;
7603
0
  case 3:
7604
0
    info->name = "metadata";
7605
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7606
0
    info->fieldType = GF_SG_VRML_SFNODE;
7607
0
    info->NDTtype = NDT_SFMetadataNode;
7608
0
    info->far_ptr = & ((X_MetadataDouble *)node)->metadata;
7609
0
    return GF_OK;
7610
0
  default:
7611
0
    return GF_BAD_PARAM;
7612
0
  }
7613
0
}
7614
7615
7616
static s32 MetadataDouble_get_field_index_by_name(char *name)
7617
0
{
7618
0
  if (!strcmp("name", name)) return 0;
7619
0
  if (!strcmp("reference", name)) return 1;
7620
0
  if (!strcmp("value", name)) return 2;
7621
0
  if (!strcmp("metadata", name)) return 3;
7622
0
  return -1;
7623
0
}
7624
7625
7626
static GF_Node *MetadataDouble_Create()
7627
0
{
7628
0
  X_MetadataDouble *p;
7629
0
  GF_SAFEALLOC(p, X_MetadataDouble);
7630
0
  if(!p) return NULL;
7631
0
  gf_node_setup((GF_Node *)p, TAG_X3D_MetadataDouble);
7632
7633
  /*default field values*/
7634
0
  return (GF_Node *)p;
7635
0
}
7636
7637
7638
/*
7639
  MetadataFloat Node deletion
7640
*/
7641
7642
static void MetadataFloat_Del(GF_Node *node)
7643
0
{
7644
0
  X_MetadataFloat *p = (X_MetadataFloat *) node;
7645
0
  gf_sg_sfstring_del(p->name);
7646
0
  gf_sg_sfstring_del(p->reference);
7647
0
  gf_sg_mffloat_del(p->value);
7648
0
  gf_node_unregister((GF_Node *) p->metadata, node);
7649
0
  gf_node_free((GF_Node *)p);
7650
0
}
7651
7652
7653
static u32 MetadataFloat_get_field_count(GF_Node *node, u8 dummy)
7654
0
{
7655
0
  return 4;
7656
0
}
7657
7658
static GF_Err MetadataFloat_get_field(GF_Node *node, GF_FieldInfo *info)
7659
0
{
7660
0
  switch (info->fieldIndex) {
7661
0
  case 0:
7662
0
    info->name = "name";
7663
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7664
0
    info->fieldType = GF_SG_VRML_SFSTRING;
7665
0
    info->far_ptr = & ((X_MetadataFloat *) node)->name;
7666
0
    return GF_OK;
7667
0
  case 1:
7668
0
    info->name = "reference";
7669
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7670
0
    info->fieldType = GF_SG_VRML_SFSTRING;
7671
0
    info->far_ptr = & ((X_MetadataFloat *) node)->reference;
7672
0
    return GF_OK;
7673
0
  case 2:
7674
0
    info->name = "value";
7675
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7676
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
7677
0
    info->far_ptr = & ((X_MetadataFloat *) node)->value;
7678
0
    return GF_OK;
7679
0
  case 3:
7680
0
    info->name = "metadata";
7681
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7682
0
    info->fieldType = GF_SG_VRML_SFNODE;
7683
0
    info->NDTtype = NDT_SFMetadataNode;
7684
0
    info->far_ptr = & ((X_MetadataFloat *)node)->metadata;
7685
0
    return GF_OK;
7686
0
  default:
7687
0
    return GF_BAD_PARAM;
7688
0
  }
7689
0
}
7690
7691
7692
static s32 MetadataFloat_get_field_index_by_name(char *name)
7693
0
{
7694
0
  if (!strcmp("name", name)) return 0;
7695
0
  if (!strcmp("reference", name)) return 1;
7696
0
  if (!strcmp("value", name)) return 2;
7697
0
  if (!strcmp("metadata", name)) return 3;
7698
0
  return -1;
7699
0
}
7700
7701
7702
static GF_Node *MetadataFloat_Create()
7703
0
{
7704
0
  X_MetadataFloat *p;
7705
0
  GF_SAFEALLOC(p, X_MetadataFloat);
7706
0
  if(!p) return NULL;
7707
0
  gf_node_setup((GF_Node *)p, TAG_X3D_MetadataFloat);
7708
7709
  /*default field values*/
7710
0
  return (GF_Node *)p;
7711
0
}
7712
7713
7714
/*
7715
  MetadataInteger Node deletion
7716
*/
7717
7718
static void MetadataInteger_Del(GF_Node *node)
7719
0
{
7720
0
  X_MetadataInteger *p = (X_MetadataInteger *) node;
7721
0
  gf_sg_sfstring_del(p->name);
7722
0
  gf_sg_sfstring_del(p->reference);
7723
0
  gf_sg_mfint32_del(p->value);
7724
0
  gf_node_unregister((GF_Node *) p->metadata, node);
7725
0
  gf_node_free((GF_Node *)p);
7726
0
}
7727
7728
7729
static u32 MetadataInteger_get_field_count(GF_Node *node, u8 dummy)
7730
0
{
7731
0
  return 4;
7732
0
}
7733
7734
static GF_Err MetadataInteger_get_field(GF_Node *node, GF_FieldInfo *info)
7735
0
{
7736
0
  switch (info->fieldIndex) {
7737
0
  case 0:
7738
0
    info->name = "name";
7739
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7740
0
    info->fieldType = GF_SG_VRML_SFSTRING;
7741
0
    info->far_ptr = & ((X_MetadataInteger *) node)->name;
7742
0
    return GF_OK;
7743
0
  case 1:
7744
0
    info->name = "reference";
7745
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7746
0
    info->fieldType = GF_SG_VRML_SFSTRING;
7747
0
    info->far_ptr = & ((X_MetadataInteger *) node)->reference;
7748
0
    return GF_OK;
7749
0
  case 2:
7750
0
    info->name = "value";
7751
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7752
0
    info->fieldType = GF_SG_VRML_MFINT32;
7753
0
    info->far_ptr = & ((X_MetadataInteger *) node)->value;
7754
0
    return GF_OK;
7755
0
  case 3:
7756
0
    info->name = "metadata";
7757
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7758
0
    info->fieldType = GF_SG_VRML_SFNODE;
7759
0
    info->NDTtype = NDT_SFMetadataNode;
7760
0
    info->far_ptr = & ((X_MetadataInteger *)node)->metadata;
7761
0
    return GF_OK;
7762
0
  default:
7763
0
    return GF_BAD_PARAM;
7764
0
  }
7765
0
}
7766
7767
7768
static s32 MetadataInteger_get_field_index_by_name(char *name)
7769
0
{
7770
0
  if (!strcmp("name", name)) return 0;
7771
0
  if (!strcmp("reference", name)) return 1;
7772
0
  if (!strcmp("value", name)) return 2;
7773
0
  if (!strcmp("metadata", name)) return 3;
7774
0
  return -1;
7775
0
}
7776
7777
7778
static GF_Node *MetadataInteger_Create()
7779
0
{
7780
0
  X_MetadataInteger *p;
7781
0
  GF_SAFEALLOC(p, X_MetadataInteger);
7782
0
  if(!p) return NULL;
7783
0
  gf_node_setup((GF_Node *)p, TAG_X3D_MetadataInteger);
7784
7785
  /*default field values*/
7786
0
  return (GF_Node *)p;
7787
0
}
7788
7789
7790
/*
7791
  MetadataSet Node deletion
7792
*/
7793
7794
static void MetadataSet_Del(GF_Node *node)
7795
0
{
7796
0
  X_MetadataSet *p = (X_MetadataSet *) node;
7797
0
  gf_sg_sfstring_del(p->name);
7798
0
  gf_sg_sfstring_del(p->reference);
7799
0
  gf_node_unregister_children(node, p->value);
7800
0
  gf_node_unregister((GF_Node *) p->metadata, node);
7801
0
  gf_node_free((GF_Node *)p);
7802
0
}
7803
7804
7805
static u32 MetadataSet_get_field_count(GF_Node *node, u8 dummy)
7806
0
{
7807
0
  return 4;
7808
0
}
7809
7810
static GF_Err MetadataSet_get_field(GF_Node *node, GF_FieldInfo *info)
7811
0
{
7812
0
  switch (info->fieldIndex) {
7813
0
  case 0:
7814
0
    info->name = "name";
7815
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7816
0
    info->fieldType = GF_SG_VRML_SFSTRING;
7817
0
    info->far_ptr = & ((X_MetadataSet *) node)->name;
7818
0
    return GF_OK;
7819
0
  case 1:
7820
0
    info->name = "reference";
7821
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7822
0
    info->fieldType = GF_SG_VRML_SFSTRING;
7823
0
    info->far_ptr = & ((X_MetadataSet *) node)->reference;
7824
0
    return GF_OK;
7825
0
  case 2:
7826
0
    info->name = "value";
7827
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7828
0
    info->fieldType = GF_SG_VRML_MFNODE;
7829
0
    info->NDTtype = NDT_SFMetadataNode;
7830
0
    info->far_ptr = & ((X_MetadataSet *)node)->value;
7831
0
    return GF_OK;
7832
0
  case 3:
7833
0
    info->name = "metadata";
7834
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7835
0
    info->fieldType = GF_SG_VRML_SFNODE;
7836
0
    info->NDTtype = NDT_SFMetadataNode;
7837
0
    info->far_ptr = & ((X_MetadataSet *)node)->metadata;
7838
0
    return GF_OK;
7839
0
  default:
7840
0
    return GF_BAD_PARAM;
7841
0
  }
7842
0
}
7843
7844
7845
static s32 MetadataSet_get_field_index_by_name(char *name)
7846
0
{
7847
0
  if (!strcmp("name", name)) return 0;
7848
0
  if (!strcmp("reference", name)) return 1;
7849
0
  if (!strcmp("value", name)) return 2;
7850
0
  if (!strcmp("metadata", name)) return 3;
7851
0
  return -1;
7852
0
}
7853
7854
7855
static GF_Node *MetadataSet_Create()
7856
0
{
7857
0
  X_MetadataSet *p;
7858
0
  GF_SAFEALLOC(p, X_MetadataSet);
7859
0
  if(!p) return NULL;
7860
0
  gf_node_setup((GF_Node *)p, TAG_X3D_MetadataSet);
7861
7862
  /*default field values*/
7863
0
  return (GF_Node *)p;
7864
0
}
7865
7866
7867
/*
7868
  MetadataString Node deletion
7869
*/
7870
7871
static void MetadataString_Del(GF_Node *node)
7872
0
{
7873
0
  X_MetadataString *p = (X_MetadataString *) node;
7874
0
  gf_sg_sfstring_del(p->name);
7875
0
  gf_sg_sfstring_del(p->reference);
7876
0
  gf_sg_mfstring_del(p->value);
7877
0
  gf_node_unregister((GF_Node *) p->metadata, node);
7878
0
  gf_node_free((GF_Node *)p);
7879
0
}
7880
7881
7882
static u32 MetadataString_get_field_count(GF_Node *node, u8 dummy)
7883
0
{
7884
0
  return 4;
7885
0
}
7886
7887
static GF_Err MetadataString_get_field(GF_Node *node, GF_FieldInfo *info)
7888
0
{
7889
0
  switch (info->fieldIndex) {
7890
0
  case 0:
7891
0
    info->name = "name";
7892
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7893
0
    info->fieldType = GF_SG_VRML_SFSTRING;
7894
0
    info->far_ptr = & ((X_MetadataString *) node)->name;
7895
0
    return GF_OK;
7896
0
  case 1:
7897
0
    info->name = "reference";
7898
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7899
0
    info->fieldType = GF_SG_VRML_SFSTRING;
7900
0
    info->far_ptr = & ((X_MetadataString *) node)->reference;
7901
0
    return GF_OK;
7902
0
  case 2:
7903
0
    info->name = "value";
7904
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7905
0
    info->fieldType = GF_SG_VRML_MFSTRING;
7906
0
    info->far_ptr = & ((X_MetadataString *) node)->value;
7907
0
    return GF_OK;
7908
0
  case 3:
7909
0
    info->name = "metadata";
7910
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7911
0
    info->fieldType = GF_SG_VRML_SFNODE;
7912
0
    info->NDTtype = NDT_SFMetadataNode;
7913
0
    info->far_ptr = & ((X_MetadataString *)node)->metadata;
7914
0
    return GF_OK;
7915
0
  default:
7916
0
    return GF_BAD_PARAM;
7917
0
  }
7918
0
}
7919
7920
7921
static s32 MetadataString_get_field_index_by_name(char *name)
7922
0
{
7923
0
  if (!strcmp("name", name)) return 0;
7924
0
  if (!strcmp("reference", name)) return 1;
7925
0
  if (!strcmp("value", name)) return 2;
7926
0
  if (!strcmp("metadata", name)) return 3;
7927
0
  return -1;
7928
0
}
7929
7930
7931
static GF_Node *MetadataString_Create()
7932
0
{
7933
0
  X_MetadataString *p;
7934
0
  GF_SAFEALLOC(p, X_MetadataString);
7935
0
  if(!p) return NULL;
7936
0
  gf_node_setup((GF_Node *)p, TAG_X3D_MetadataString);
7937
7938
  /*default field values*/
7939
0
  return (GF_Node *)p;
7940
0
}
7941
7942
7943
/*
7944
  MovieTexture Node deletion
7945
*/
7946
7947
static void MovieTexture_Del(GF_Node *node)
7948
0
{
7949
0
  X_MovieTexture *p = (X_MovieTexture *) node;
7950
0
  gf_sg_mfurl_del(p->url);
7951
0
  gf_node_unregister((GF_Node *) p->metadata, node);
7952
0
  gf_node_free((GF_Node *)p);
7953
0
}
7954
7955
7956
static u32 MovieTexture_get_field_count(GF_Node *node, u8 dummy)
7957
0
{
7958
0
  return 14;
7959
0
}
7960
7961
static GF_Err MovieTexture_get_field(GF_Node *node, GF_FieldInfo *info)
7962
0
{
7963
0
  switch (info->fieldIndex) {
7964
0
  case 0:
7965
0
    info->name = "loop";
7966
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7967
0
    info->fieldType = GF_SG_VRML_SFBOOL;
7968
0
    info->far_ptr = & ((X_MovieTexture *) node)->loop;
7969
0
    return GF_OK;
7970
0
  case 1:
7971
0
    info->name = "speed";
7972
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7973
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
7974
0
    info->far_ptr = & ((X_MovieTexture *) node)->speed;
7975
0
    return GF_OK;
7976
0
  case 2:
7977
0
    info->name = "startTime";
7978
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7979
0
    info->fieldType = GF_SG_VRML_SFTIME;
7980
0
    info->far_ptr = & ((X_MovieTexture *) node)->startTime;
7981
0
    return GF_OK;
7982
0
  case 3:
7983
0
    info->name = "stopTime";
7984
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7985
0
    info->fieldType = GF_SG_VRML_SFTIME;
7986
0
    info->far_ptr = & ((X_MovieTexture *) node)->stopTime;
7987
0
    return GF_OK;
7988
0
  case 4:
7989
0
    info->name = "url";
7990
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
7991
0
    info->fieldType = GF_SG_VRML_MFURL;
7992
0
    info->far_ptr = & ((X_MovieTexture *) node)->url;
7993
0
    return GF_OK;
7994
0
  case 5:
7995
0
    info->name = "repeatS";
7996
0
    info->eventType = GF_SG_EVENT_FIELD;
7997
0
    info->fieldType = GF_SG_VRML_SFBOOL;
7998
0
    info->far_ptr = & ((X_MovieTexture *) node)->repeatS;
7999
0
    return GF_OK;
8000
0
  case 6:
8001
0
    info->name = "repeatT";
8002
0
    info->eventType = GF_SG_EVENT_FIELD;
8003
0
    info->fieldType = GF_SG_VRML_SFBOOL;
8004
0
    info->far_ptr = & ((X_MovieTexture *) node)->repeatT;
8005
0
    return GF_OK;
8006
0
  case 7:
8007
0
    info->name = "duration_changed";
8008
0
    info->eventType = GF_SG_EVENT_OUT;
8009
0
    info->fieldType = GF_SG_VRML_SFTIME;
8010
0
    info->far_ptr = & ((X_MovieTexture *) node)->duration_changed;
8011
0
    return GF_OK;
8012
0
  case 8:
8013
0
    info->name = "isActive";
8014
0
    info->eventType = GF_SG_EVENT_OUT;
8015
0
    info->fieldType = GF_SG_VRML_SFBOOL;
8016
0
    info->far_ptr = & ((X_MovieTexture *) node)->isActive;
8017
0
    return GF_OK;
8018
0
  case 9:
8019
0
    info->name = "metadata";
8020
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8021
0
    info->fieldType = GF_SG_VRML_SFNODE;
8022
0
    info->NDTtype = NDT_SFMetadataNode;
8023
0
    info->far_ptr = & ((X_MovieTexture *)node)->metadata;
8024
0
    return GF_OK;
8025
0
  case 10:
8026
0
    info->name = "resumeTime";
8027
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8028
0
    info->fieldType = GF_SG_VRML_SFTIME;
8029
0
    info->far_ptr = & ((X_MovieTexture *) node)->resumeTime;
8030
0
    return GF_OK;
8031
0
  case 11:
8032
0
    info->name = "pauseTime";
8033
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8034
0
    info->fieldType = GF_SG_VRML_SFTIME;
8035
0
    info->far_ptr = & ((X_MovieTexture *) node)->pauseTime;
8036
0
    return GF_OK;
8037
0
  case 12:
8038
0
    info->name = "elapsedTime";
8039
0
    info->eventType = GF_SG_EVENT_OUT;
8040
0
    info->fieldType = GF_SG_VRML_SFTIME;
8041
0
    info->far_ptr = & ((X_MovieTexture *) node)->elapsedTime;
8042
0
    return GF_OK;
8043
0
  case 13:
8044
0
    info->name = "isPaused";
8045
0
    info->eventType = GF_SG_EVENT_OUT;
8046
0
    info->fieldType = GF_SG_VRML_SFBOOL;
8047
0
    info->far_ptr = & ((X_MovieTexture *) node)->isPaused;
8048
0
    return GF_OK;
8049
0
  default:
8050
0
    return GF_BAD_PARAM;
8051
0
  }
8052
0
}
8053
8054
8055
static s32 MovieTexture_get_field_index_by_name(char *name)
8056
0
{
8057
0
  if (!strcmp("loop", name)) return 0;
8058
0
  if (!strcmp("speed", name)) return 1;
8059
0
  if (!strcmp("startTime", name)) return 2;
8060
0
  if (!strcmp("stopTime", name)) return 3;
8061
0
  if (!strcmp("url", name)) return 4;
8062
0
  if (!strcmp("repeatS", name)) return 5;
8063
0
  if (!strcmp("repeatT", name)) return 6;
8064
0
  if (!strcmp("duration_changed", name)) return 7;
8065
0
  if (!strcmp("isActive", name)) return 8;
8066
0
  if (!strcmp("metadata", name)) return 9;
8067
0
  if (!strcmp("resumeTime", name)) return 10;
8068
0
  if (!strcmp("pauseTime", name)) return 11;
8069
0
  if (!strcmp("elapsedTime", name)) return 12;
8070
0
  if (!strcmp("isPaused", name)) return 13;
8071
0
  return -1;
8072
0
}
8073
8074
8075
static GF_Node *MovieTexture_Create()
8076
0
{
8077
0
  X_MovieTexture *p;
8078
0
  GF_SAFEALLOC(p, X_MovieTexture);
8079
0
  if(!p) return NULL;
8080
0
  gf_node_setup((GF_Node *)p, TAG_X3D_MovieTexture);
8081
8082
  /*default field values*/
8083
0
  p->speed = FLT2FIX(1.0);
8084
0
  p->startTime = 0;
8085
0
  p->stopTime = 0;
8086
0
  p->repeatS = 1;
8087
0
  p->repeatT = 1;
8088
0
  p->resumeTime = 0;
8089
0
  p->pauseTime = 0;
8090
0
  return (GF_Node *)p;
8091
0
}
8092
8093
8094
/*
8095
  MultiTexture Node deletion
8096
*/
8097
8098
static void MultiTexture_Del(GF_Node *node)
8099
0
{
8100
0
  X_MultiTexture *p = (X_MultiTexture *) node;
8101
0
  gf_sg_mfstring_del(p->function);
8102
0
  gf_sg_mfstring_del(p->mode);
8103
0
  gf_sg_mfstring_del(p->source);
8104
0
  gf_node_unregister_children(node, p->texture);
8105
0
  gf_node_unregister((GF_Node *) p->metadata, node);
8106
0
  gf_node_free((GF_Node *)p);
8107
0
}
8108
8109
8110
static u32 MultiTexture_get_field_count(GF_Node *node, u8 dummy)
8111
0
{
8112
0
  return 7;
8113
0
}
8114
8115
static GF_Err MultiTexture_get_field(GF_Node *node, GF_FieldInfo *info)
8116
0
{
8117
0
  switch (info->fieldIndex) {
8118
0
  case 0:
8119
0
    info->name = "alpha";
8120
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8121
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
8122
0
    info->far_ptr = & ((X_MultiTexture *) node)->alpha;
8123
0
    return GF_OK;
8124
0
  case 1:
8125
0
    info->name = "color";
8126
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8127
0
    info->fieldType = GF_SG_VRML_SFCOLOR;
8128
0
    info->far_ptr = & ((X_MultiTexture *) node)->color;
8129
0
    return GF_OK;
8130
0
  case 2:
8131
0
    info->name = "function";
8132
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8133
0
    info->fieldType = GF_SG_VRML_MFSTRING;
8134
0
    info->far_ptr = & ((X_MultiTexture *) node)->function;
8135
0
    return GF_OK;
8136
0
  case 3:
8137
0
    info->name = "mode";
8138
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8139
0
    info->fieldType = GF_SG_VRML_MFSTRING;
8140
0
    info->far_ptr = & ((X_MultiTexture *) node)->mode;
8141
0
    return GF_OK;
8142
0
  case 4:
8143
0
    info->name = "source";
8144
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8145
0
    info->fieldType = GF_SG_VRML_MFSTRING;
8146
0
    info->far_ptr = & ((X_MultiTexture *) node)->source;
8147
0
    return GF_OK;
8148
0
  case 5:
8149
0
    info->name = "texture";
8150
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8151
0
    info->fieldType = GF_SG_VRML_MFNODE;
8152
0
    info->NDTtype = NDT_SFTextureNode;
8153
0
    info->far_ptr = & ((X_MultiTexture *)node)->texture;
8154
0
    return GF_OK;
8155
0
  case 6:
8156
0
    info->name = "metadata";
8157
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8158
0
    info->fieldType = GF_SG_VRML_SFNODE;
8159
0
    info->NDTtype = NDT_SFMetadataNode;
8160
0
    info->far_ptr = & ((X_MultiTexture *)node)->metadata;
8161
0
    return GF_OK;
8162
0
  default:
8163
0
    return GF_BAD_PARAM;
8164
0
  }
8165
0
}
8166
8167
8168
static s32 MultiTexture_get_field_index_by_name(char *name)
8169
0
{
8170
0
  if (!strcmp("alpha", name)) return 0;
8171
0
  if (!strcmp("color", name)) return 1;
8172
0
  if (!strcmp("function", name)) return 2;
8173
0
  if (!strcmp("mode", name)) return 3;
8174
0
  if (!strcmp("source", name)) return 4;
8175
0
  if (!strcmp("texture", name)) return 5;
8176
0
  if (!strcmp("metadata", name)) return 6;
8177
0
  return -1;
8178
0
}
8179
8180
8181
static GF_Node *MultiTexture_Create()
8182
0
{
8183
0
  X_MultiTexture *p;
8184
0
  GF_SAFEALLOC(p, X_MultiTexture);
8185
0
  if(!p) return NULL;
8186
0
  gf_node_setup((GF_Node *)p, TAG_X3D_MultiTexture);
8187
8188
  /*default field values*/
8189
0
  p->alpha = FLT2FIX(1);
8190
0
  p->color.red = FLT2FIX(1);
8191
0
  p->color.green = FLT2FIX(1);
8192
0
  p->color.blue = FLT2FIX(1);
8193
0
  return (GF_Node *)p;
8194
0
}
8195
8196
8197
/*
8198
  MultiTextureCoordinate Node deletion
8199
*/
8200
8201
static void MultiTextureCoordinate_Del(GF_Node *node)
8202
0
{
8203
0
  X_MultiTextureCoordinate *p = (X_MultiTextureCoordinate *) node;
8204
0
  gf_node_unregister_children(node, p->texCoord);
8205
0
  gf_node_unregister((GF_Node *) p->metadata, node);
8206
0
  gf_node_free((GF_Node *)p);
8207
0
}
8208
8209
8210
static u32 MultiTextureCoordinate_get_field_count(GF_Node *node, u8 dummy)
8211
0
{
8212
0
  return 2;
8213
0
}
8214
8215
static GF_Err MultiTextureCoordinate_get_field(GF_Node *node, GF_FieldInfo *info)
8216
0
{
8217
0
  switch (info->fieldIndex) {
8218
0
  case 0:
8219
0
    info->name = "texCoord";
8220
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8221
0
    info->fieldType = GF_SG_VRML_MFNODE;
8222
0
    info->NDTtype = NDT_SFTextureCoordinateNode;
8223
0
    info->far_ptr = & ((X_MultiTextureCoordinate *)node)->texCoord;
8224
0
    return GF_OK;
8225
0
  case 1:
8226
0
    info->name = "metadata";
8227
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8228
0
    info->fieldType = GF_SG_VRML_SFNODE;
8229
0
    info->NDTtype = NDT_SFMetadataNode;
8230
0
    info->far_ptr = & ((X_MultiTextureCoordinate *)node)->metadata;
8231
0
    return GF_OK;
8232
0
  default:
8233
0
    return GF_BAD_PARAM;
8234
0
  }
8235
0
}
8236
8237
8238
static s32 MultiTextureCoordinate_get_field_index_by_name(char *name)
8239
0
{
8240
0
  if (!strcmp("texCoord", name)) return 0;
8241
0
  if (!strcmp("metadata", name)) return 1;
8242
0
  return -1;
8243
0
}
8244
8245
8246
static GF_Node *MultiTextureCoordinate_Create()
8247
0
{
8248
0
  X_MultiTextureCoordinate *p;
8249
0
  GF_SAFEALLOC(p, X_MultiTextureCoordinate);
8250
0
  if(!p) return NULL;
8251
0
  gf_node_setup((GF_Node *)p, TAG_X3D_MultiTextureCoordinate);
8252
8253
  /*default field values*/
8254
0
  return (GF_Node *)p;
8255
0
}
8256
8257
8258
/*
8259
  MultiTextureTransform Node deletion
8260
*/
8261
8262
static void MultiTextureTransform_Del(GF_Node *node)
8263
0
{
8264
0
  X_MultiTextureTransform *p = (X_MultiTextureTransform *) node;
8265
0
  gf_node_unregister_children(node, p->textureTransform);
8266
0
  gf_node_unregister((GF_Node *) p->metadata, node);
8267
0
  gf_node_free((GF_Node *)p);
8268
0
}
8269
8270
8271
static u32 MultiTextureTransform_get_field_count(GF_Node *node, u8 dummy)
8272
0
{
8273
0
  return 2;
8274
0
}
8275
8276
static GF_Err MultiTextureTransform_get_field(GF_Node *node, GF_FieldInfo *info)
8277
0
{
8278
0
  switch (info->fieldIndex) {
8279
0
  case 0:
8280
0
    info->name = "textureTransform";
8281
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8282
0
    info->fieldType = GF_SG_VRML_MFNODE;
8283
0
    info->NDTtype = NDT_SFTextureTransformNode;
8284
0
    info->far_ptr = & ((X_MultiTextureTransform *)node)->textureTransform;
8285
0
    return GF_OK;
8286
0
  case 1:
8287
0
    info->name = "metadata";
8288
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8289
0
    info->fieldType = GF_SG_VRML_SFNODE;
8290
0
    info->NDTtype = NDT_SFMetadataNode;
8291
0
    info->far_ptr = & ((X_MultiTextureTransform *)node)->metadata;
8292
0
    return GF_OK;
8293
0
  default:
8294
0
    return GF_BAD_PARAM;
8295
0
  }
8296
0
}
8297
8298
8299
static s32 MultiTextureTransform_get_field_index_by_name(char *name)
8300
0
{
8301
0
  if (!strcmp("textureTransform", name)) return 0;
8302
0
  if (!strcmp("metadata", name)) return 1;
8303
0
  return -1;
8304
0
}
8305
8306
8307
static GF_Node *MultiTextureTransform_Create()
8308
0
{
8309
0
  X_MultiTextureTransform *p;
8310
0
  GF_SAFEALLOC(p, X_MultiTextureTransform);
8311
0
  if(!p) return NULL;
8312
0
  gf_node_setup((GF_Node *)p, TAG_X3D_MultiTextureTransform);
8313
8314
  /*default field values*/
8315
0
  return (GF_Node *)p;
8316
0
}
8317
8318
8319
/*
8320
  NavigationInfo Node deletion
8321
*/
8322
8323
static void NavigationInfo_Del(GF_Node *node)
8324
0
{
8325
0
  X_NavigationInfo *p = (X_NavigationInfo *) node;
8326
0
  gf_sg_mffloat_del(p->avatarSize);
8327
0
  gf_sg_mfstring_del(p->type);
8328
0
  gf_node_unregister((GF_Node *) p->metadata, node);
8329
0
  gf_sg_mfstring_del(p->transitionType);
8330
0
  gf_node_free((GF_Node *)p);
8331
0
}
8332
8333
8334
static u32 NavigationInfo_get_field_count(GF_Node *node, u8 dummy)
8335
0
{
8336
0
  return 10;
8337
0
}
8338
8339
static GF_Err NavigationInfo_get_field(GF_Node *node, GF_FieldInfo *info)
8340
0
{
8341
0
  switch (info->fieldIndex) {
8342
0
  case 0:
8343
0
    info->name = "set_bind";
8344
0
    info->eventType = GF_SG_EVENT_IN;
8345
0
    info->on_event_in = ((X_NavigationInfo *)node)->on_set_bind;
8346
0
    info->fieldType = GF_SG_VRML_SFBOOL;
8347
0
    info->far_ptr = & ((X_NavigationInfo *) node)->set_bind;
8348
0
    return GF_OK;
8349
0
  case 1:
8350
0
    info->name = "avatarSize";
8351
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8352
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
8353
0
    info->far_ptr = & ((X_NavigationInfo *) node)->avatarSize;
8354
0
    return GF_OK;
8355
0
  case 2:
8356
0
    info->name = "headlight";
8357
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8358
0
    info->fieldType = GF_SG_VRML_SFBOOL;
8359
0
    info->far_ptr = & ((X_NavigationInfo *) node)->headlight;
8360
0
    return GF_OK;
8361
0
  case 3:
8362
0
    info->name = "speed";
8363
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8364
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
8365
0
    info->far_ptr = & ((X_NavigationInfo *) node)->speed;
8366
0
    return GF_OK;
8367
0
  case 4:
8368
0
    info->name = "type";
8369
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8370
0
    info->fieldType = GF_SG_VRML_MFSTRING;
8371
0
    info->far_ptr = & ((X_NavigationInfo *) node)->type;
8372
0
    return GF_OK;
8373
0
  case 5:
8374
0
    info->name = "visibilityLimit";
8375
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8376
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
8377
0
    info->far_ptr = & ((X_NavigationInfo *) node)->visibilityLimit;
8378
0
    return GF_OK;
8379
0
  case 6:
8380
0
    info->name = "isBound";
8381
0
    info->eventType = GF_SG_EVENT_OUT;
8382
0
    info->fieldType = GF_SG_VRML_SFBOOL;
8383
0
    info->far_ptr = & ((X_NavigationInfo *) node)->isBound;
8384
0
    return GF_OK;
8385
0
  case 7:
8386
0
    info->name = "metadata";
8387
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8388
0
    info->fieldType = GF_SG_VRML_SFNODE;
8389
0
    info->NDTtype = NDT_SFMetadataNode;
8390
0
    info->far_ptr = & ((X_NavigationInfo *)node)->metadata;
8391
0
    return GF_OK;
8392
0
  case 8:
8393
0
    info->name = "transitionType";
8394
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8395
0
    info->fieldType = GF_SG_VRML_MFSTRING;
8396
0
    info->far_ptr = & ((X_NavigationInfo *) node)->transitionType;
8397
0
    return GF_OK;
8398
0
  case 9:
8399
0
    info->name = "bindTime";
8400
0
    info->eventType = GF_SG_EVENT_OUT;
8401
0
    info->fieldType = GF_SG_VRML_SFTIME;
8402
0
    info->far_ptr = & ((X_NavigationInfo *) node)->bindTime;
8403
0
    return GF_OK;
8404
0
  default:
8405
0
    return GF_BAD_PARAM;
8406
0
  }
8407
0
}
8408
8409
8410
static s32 NavigationInfo_get_field_index_by_name(char *name)
8411
0
{
8412
0
  if (!strcmp("set_bind", name)) return 0;
8413
0
  if (!strcmp("avatarSize", name)) return 1;
8414
0
  if (!strcmp("headlight", name)) return 2;
8415
0
  if (!strcmp("speed", name)) return 3;
8416
0
  if (!strcmp("type", name)) return 4;
8417
0
  if (!strcmp("visibilityLimit", name)) return 5;
8418
0
  if (!strcmp("isBound", name)) return 6;
8419
0
  if (!strcmp("metadata", name)) return 7;
8420
0
  if (!strcmp("transitionType", name)) return 8;
8421
0
  if (!strcmp("bindTime", name)) return 9;
8422
0
  return -1;
8423
0
}
8424
8425
8426
static GF_Node *NavigationInfo_Create()
8427
0
{
8428
0
  X_NavigationInfo *p;
8429
0
  GF_SAFEALLOC(p, X_NavigationInfo);
8430
0
  if(!p) return NULL;
8431
0
  gf_node_setup((GF_Node *)p, TAG_X3D_NavigationInfo);
8432
8433
  /*default field values*/
8434
0
  p->avatarSize.vals = (SFFloat *)gf_malloc(sizeof(SFFloat)*3);
8435
0
  p->avatarSize.count = 3;
8436
0
  p->avatarSize.vals[0] = FLT2FIX(0.25);
8437
0
  p->avatarSize.vals[1] = FLT2FIX(1.6);
8438
0
  p->avatarSize.vals[2] = FLT2FIX(0.75);
8439
0
  p->headlight = 1;
8440
0
  p->speed = FLT2FIX(1.0);
8441
0
  p->type.vals = (char**)gf_malloc(sizeof(SFString)*2);
8442
0
  p->type.count = 2;
8443
0
  p->type.vals[0] = (char*)gf_malloc(sizeof(char) * 5);
8444
0
  strcpy(p->type.vals[0], "WALK");
8445
0
  p->type.vals[1] = (char*)gf_malloc(sizeof(char) * 4);
8446
0
  strcpy(p->type.vals[1], "ANY");
8447
0
  p->visibilityLimit = FLT2FIX(0.0);
8448
0
  p->transitionType.vals = (char**)gf_malloc(sizeof(SFString)*2);
8449
0
  p->transitionType.count = 2;
8450
0
  p->transitionType.vals[0] = (char*)gf_malloc(sizeof(char) * 5);
8451
0
  strcpy(p->transitionType.vals[0], "WALK");
8452
0
  p->transitionType.vals[1] = (char*)gf_malloc(sizeof(char) * 4);
8453
0
  strcpy(p->transitionType.vals[1], "ANY");
8454
0
  return (GF_Node *)p;
8455
0
}
8456
8457
8458
/*
8459
  Normal Node deletion
8460
*/
8461
8462
static void Normal_Del(GF_Node *node)
8463
0
{
8464
0
  X_Normal *p = (X_Normal *) node;
8465
0
  gf_sg_mfvec3f_del(p->vector);
8466
0
  gf_node_unregister((GF_Node *) p->metadata, node);
8467
0
  gf_node_free((GF_Node *)p);
8468
0
}
8469
8470
8471
static u32 Normal_get_field_count(GF_Node *node, u8 dummy)
8472
0
{
8473
0
  return 2;
8474
0
}
8475
8476
static GF_Err Normal_get_field(GF_Node *node, GF_FieldInfo *info)
8477
0
{
8478
0
  switch (info->fieldIndex) {
8479
0
  case 0:
8480
0
    info->name = "vector";
8481
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8482
0
    info->fieldType = GF_SG_VRML_MFVEC3F;
8483
0
    info->far_ptr = & ((X_Normal *) node)->vector;
8484
0
    return GF_OK;
8485
0
  case 1:
8486
0
    info->name = "metadata";
8487
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8488
0
    info->fieldType = GF_SG_VRML_SFNODE;
8489
0
    info->NDTtype = NDT_SFMetadataNode;
8490
0
    info->far_ptr = & ((X_Normal *)node)->metadata;
8491
0
    return GF_OK;
8492
0
  default:
8493
0
    return GF_BAD_PARAM;
8494
0
  }
8495
0
}
8496
8497
8498
static s32 Normal_get_field_index_by_name(char *name)
8499
0
{
8500
0
  if (!strcmp("vector", name)) return 0;
8501
0
  if (!strcmp("metadata", name)) return 1;
8502
0
  return -1;
8503
0
}
8504
8505
8506
static GF_Node *Normal_Create()
8507
0
{
8508
0
  X_Normal *p;
8509
0
  GF_SAFEALLOC(p, X_Normal);
8510
0
  if(!p) return NULL;
8511
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Normal);
8512
8513
  /*default field values*/
8514
0
  return (GF_Node *)p;
8515
0
}
8516
8517
8518
/*
8519
  NormalInterpolator Node deletion
8520
*/
8521
8522
static void NormalInterpolator_Del(GF_Node *node)
8523
0
{
8524
0
  X_NormalInterpolator *p = (X_NormalInterpolator *) node;
8525
0
  gf_sg_mffloat_del(p->key);
8526
0
  gf_sg_mfvec3f_del(p->keyValue);
8527
0
  gf_sg_mfvec3f_del(p->value_changed);
8528
0
  gf_node_unregister((GF_Node *) p->metadata, node);
8529
0
  gf_node_free((GF_Node *)p);
8530
0
}
8531
8532
8533
static u32 NormalInterpolator_get_field_count(GF_Node *node, u8 dummy)
8534
0
{
8535
0
  return 5;
8536
0
}
8537
8538
static GF_Err NormalInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
8539
0
{
8540
0
  switch (info->fieldIndex) {
8541
0
  case 0:
8542
0
    info->name = "set_fraction";
8543
0
    info->eventType = GF_SG_EVENT_IN;
8544
0
    info->on_event_in = ((X_NormalInterpolator *)node)->on_set_fraction;
8545
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
8546
0
    info->far_ptr = & ((X_NormalInterpolator *) node)->set_fraction;
8547
0
    return GF_OK;
8548
0
  case 1:
8549
0
    info->name = "key";
8550
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8551
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
8552
0
    info->far_ptr = & ((X_NormalInterpolator *) node)->key;
8553
0
    return GF_OK;
8554
0
  case 2:
8555
0
    info->name = "keyValue";
8556
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8557
0
    info->fieldType = GF_SG_VRML_MFVEC3F;
8558
0
    info->far_ptr = & ((X_NormalInterpolator *) node)->keyValue;
8559
0
    return GF_OK;
8560
0
  case 3:
8561
0
    info->name = "value_changed";
8562
0
    info->eventType = GF_SG_EVENT_OUT;
8563
0
    info->fieldType = GF_SG_VRML_MFVEC3F;
8564
0
    info->far_ptr = & ((X_NormalInterpolator *) node)->value_changed;
8565
0
    return GF_OK;
8566
0
  case 4:
8567
0
    info->name = "metadata";
8568
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8569
0
    info->fieldType = GF_SG_VRML_SFNODE;
8570
0
    info->NDTtype = NDT_SFMetadataNode;
8571
0
    info->far_ptr = & ((X_NormalInterpolator *)node)->metadata;
8572
0
    return GF_OK;
8573
0
  default:
8574
0
    return GF_BAD_PARAM;
8575
0
  }
8576
0
}
8577
8578
8579
static s32 NormalInterpolator_get_field_index_by_name(char *name)
8580
0
{
8581
0
  if (!strcmp("set_fraction", name)) return 0;
8582
0
  if (!strcmp("key", name)) return 1;
8583
0
  if (!strcmp("keyValue", name)) return 2;
8584
0
  if (!strcmp("value_changed", name)) return 3;
8585
0
  if (!strcmp("metadata", name)) return 4;
8586
0
  return -1;
8587
0
}
8588
8589
8590
static GF_Node *NormalInterpolator_Create()
8591
0
{
8592
0
  X_NormalInterpolator *p;
8593
0
  GF_SAFEALLOC(p, X_NormalInterpolator);
8594
0
  if(!p) return NULL;
8595
0
  gf_node_setup((GF_Node *)p, TAG_X3D_NormalInterpolator);
8596
8597
  /*default field values*/
8598
0
  return (GF_Node *)p;
8599
0
}
8600
8601
8602
/*
8603
  NurbsCurve Node deletion
8604
*/
8605
8606
static void NurbsCurve_Del(GF_Node *node)
8607
0
{
8608
0
  X_NurbsCurve *p = (X_NurbsCurve *) node;
8609
0
  gf_sg_mfvec3f_del(p->controlPoint);
8610
0
  gf_sg_mfdouble_del(p->weight);
8611
0
  gf_sg_mffloat_del(p->knot);
8612
0
  gf_node_unregister((GF_Node *) p->metadata, node);
8613
0
  gf_node_free((GF_Node *)p);
8614
0
}
8615
8616
8617
static u32 NurbsCurve_get_field_count(GF_Node *node, u8 dummy)
8618
0
{
8619
0
  return 7;
8620
0
}
8621
8622
static GF_Err NurbsCurve_get_field(GF_Node *node, GF_FieldInfo *info)
8623
0
{
8624
0
  switch (info->fieldIndex) {
8625
0
  case 0:
8626
0
    info->name = "controlPoint";
8627
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8628
0
    info->fieldType = GF_SG_VRML_MFVEC3F;
8629
0
    info->far_ptr = & ((X_NurbsCurve *) node)->controlPoint;
8630
0
    return GF_OK;
8631
0
  case 1:
8632
0
    info->name = "tessellation";
8633
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8634
0
    info->fieldType = GF_SG_VRML_SFINT32;
8635
0
    info->far_ptr = & ((X_NurbsCurve *) node)->tessellation;
8636
0
    return GF_OK;
8637
0
  case 2:
8638
0
    info->name = "weight";
8639
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8640
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
8641
0
    info->far_ptr = & ((X_NurbsCurve *) node)->weight;
8642
0
    return GF_OK;
8643
0
  case 3:
8644
0
    info->name = "closed";
8645
0
    info->eventType = GF_SG_EVENT_FIELD;
8646
0
    info->fieldType = GF_SG_VRML_SFBOOL;
8647
0
    info->far_ptr = & ((X_NurbsCurve *) node)->closed;
8648
0
    return GF_OK;
8649
0
  case 4:
8650
0
    info->name = "knot";
8651
0
    info->eventType = GF_SG_EVENT_FIELD;
8652
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
8653
0
    info->far_ptr = & ((X_NurbsCurve *) node)->knot;
8654
0
    return GF_OK;
8655
0
  case 5:
8656
0
    info->name = "order";
8657
0
    info->eventType = GF_SG_EVENT_FIELD;
8658
0
    info->fieldType = GF_SG_VRML_SFINT32;
8659
0
    info->far_ptr = & ((X_NurbsCurve *) node)->order;
8660
0
    return GF_OK;
8661
0
  case 6:
8662
0
    info->name = "metadata";
8663
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8664
0
    info->fieldType = GF_SG_VRML_SFNODE;
8665
0
    info->NDTtype = NDT_SFMetadataNode;
8666
0
    info->far_ptr = & ((X_NurbsCurve *)node)->metadata;
8667
0
    return GF_OK;
8668
0
  default:
8669
0
    return GF_BAD_PARAM;
8670
0
  }
8671
0
}
8672
8673
8674
static s32 NurbsCurve_get_field_index_by_name(char *name)
8675
0
{
8676
0
  if (!strcmp("controlPoint", name)) return 0;
8677
0
  if (!strcmp("tessellation", name)) return 1;
8678
0
  if (!strcmp("weight", name)) return 2;
8679
0
  if (!strcmp("closed", name)) return 3;
8680
0
  if (!strcmp("knot", name)) return 4;
8681
0
  if (!strcmp("order", name)) return 5;
8682
0
  if (!strcmp("metadata", name)) return 6;
8683
0
  return -1;
8684
0
}
8685
8686
8687
static GF_Node *NurbsCurve_Create()
8688
0
{
8689
0
  X_NurbsCurve *p;
8690
0
  GF_SAFEALLOC(p, X_NurbsCurve);
8691
0
  if(!p) return NULL;
8692
0
  gf_node_setup((GF_Node *)p, TAG_X3D_NurbsCurve);
8693
8694
  /*default field values*/
8695
0
  p->tessellation = 0;
8696
0
  p->order = 3;
8697
0
  return (GF_Node *)p;
8698
0
}
8699
8700
8701
/*
8702
  NurbsCurve2D Node deletion
8703
*/
8704
8705
static void NurbsCurve2D_Del(GF_Node *node)
8706
0
{
8707
0
  X_NurbsCurve2D *p = (X_NurbsCurve2D *) node;
8708
0
  gf_sg_mfvec2f_del(p->controlPoint);
8709
0
  gf_sg_mffloat_del(p->weight);
8710
0
  gf_sg_mffloat_del(p->knot);
8711
0
  gf_node_unregister((GF_Node *) p->metadata, node);
8712
0
  gf_node_free((GF_Node *)p);
8713
0
}
8714
8715
8716
static u32 NurbsCurve2D_get_field_count(GF_Node *node, u8 dummy)
8717
0
{
8718
0
  return 7;
8719
0
}
8720
8721
static GF_Err NurbsCurve2D_get_field(GF_Node *node, GF_FieldInfo *info)
8722
0
{
8723
0
  switch (info->fieldIndex) {
8724
0
  case 0:
8725
0
    info->name = "controlPoint";
8726
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8727
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
8728
0
    info->far_ptr = & ((X_NurbsCurve2D *) node)->controlPoint;
8729
0
    return GF_OK;
8730
0
  case 1:
8731
0
    info->name = "tessellation";
8732
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8733
0
    info->fieldType = GF_SG_VRML_SFINT32;
8734
0
    info->far_ptr = & ((X_NurbsCurve2D *) node)->tessellation;
8735
0
    return GF_OK;
8736
0
  case 2:
8737
0
    info->name = "weight";
8738
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8739
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
8740
0
    info->far_ptr = & ((X_NurbsCurve2D *) node)->weight;
8741
0
    return GF_OK;
8742
0
  case 3:
8743
0
    info->name = "knot";
8744
0
    info->eventType = GF_SG_EVENT_FIELD;
8745
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
8746
0
    info->far_ptr = & ((X_NurbsCurve2D *) node)->knot;
8747
0
    return GF_OK;
8748
0
  case 4:
8749
0
    info->name = "order";
8750
0
    info->eventType = GF_SG_EVENT_FIELD;
8751
0
    info->fieldType = GF_SG_VRML_SFINT32;
8752
0
    info->far_ptr = & ((X_NurbsCurve2D *) node)->order;
8753
0
    return GF_OK;
8754
0
  case 5:
8755
0
    info->name = "closed";
8756
0
    info->eventType = GF_SG_EVENT_FIELD;
8757
0
    info->fieldType = GF_SG_VRML_SFBOOL;
8758
0
    info->far_ptr = & ((X_NurbsCurve2D *) node)->closed;
8759
0
    return GF_OK;
8760
0
  case 6:
8761
0
    info->name = "metadata";
8762
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8763
0
    info->fieldType = GF_SG_VRML_SFNODE;
8764
0
    info->NDTtype = NDT_SFMetadataNode;
8765
0
    info->far_ptr = & ((X_NurbsCurve2D *)node)->metadata;
8766
0
    return GF_OK;
8767
0
  default:
8768
0
    return GF_BAD_PARAM;
8769
0
  }
8770
0
}
8771
8772
8773
static s32 NurbsCurve2D_get_field_index_by_name(char *name)
8774
0
{
8775
0
  if (!strcmp("controlPoint", name)) return 0;
8776
0
  if (!strcmp("tessellation", name)) return 1;
8777
0
  if (!strcmp("weight", name)) return 2;
8778
0
  if (!strcmp("knot", name)) return 3;
8779
0
  if (!strcmp("order", name)) return 4;
8780
0
  if (!strcmp("closed", name)) return 5;
8781
0
  if (!strcmp("metadata", name)) return 6;
8782
0
  return -1;
8783
0
}
8784
8785
8786
static GF_Node *NurbsCurve2D_Create()
8787
0
{
8788
0
  X_NurbsCurve2D *p;
8789
0
  GF_SAFEALLOC(p, X_NurbsCurve2D);
8790
0
  if(!p) return NULL;
8791
0
  gf_node_setup((GF_Node *)p, TAG_X3D_NurbsCurve2D);
8792
8793
  /*default field values*/
8794
0
  p->tessellation = 0;
8795
0
  p->order = 3;
8796
0
  return (GF_Node *)p;
8797
0
}
8798
8799
8800
/*
8801
  NurbsOrientationInterpolator Node deletion
8802
*/
8803
8804
static void NurbsOrientationInterpolator_Del(GF_Node *node)
8805
0
{
8806
0
  X_NurbsOrientationInterpolator *p = (X_NurbsOrientationInterpolator *) node;
8807
0
  gf_node_unregister((GF_Node *) p->controlPoints, node);
8808
0
  gf_sg_mfdouble_del(p->knot);
8809
0
  gf_sg_mfdouble_del(p->weight);
8810
0
  gf_node_unregister((GF_Node *) p->metadata, node);
8811
0
  gf_node_free((GF_Node *)p);
8812
0
}
8813
8814
8815
static u32 NurbsOrientationInterpolator_get_field_count(GF_Node *node, u8 dummy)
8816
0
{
8817
0
  return 7;
8818
0
}
8819
8820
static GF_Err NurbsOrientationInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
8821
0
{
8822
0
  switch (info->fieldIndex) {
8823
0
  case 0:
8824
0
    info->name = "set_fraction";
8825
0
    info->eventType = GF_SG_EVENT_IN;
8826
0
    info->on_event_in = ((X_NurbsOrientationInterpolator *)node)->on_set_fraction;
8827
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
8828
0
    info->far_ptr = & ((X_NurbsOrientationInterpolator *) node)->set_fraction;
8829
0
    return GF_OK;
8830
0
  case 1:
8831
0
    info->name = "controlPoints";
8832
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8833
0
    info->fieldType = GF_SG_VRML_SFNODE;
8834
0
    info->NDTtype = NDT_SFCoordinateNode;
8835
0
    info->far_ptr = & ((X_NurbsOrientationInterpolator *)node)->controlPoints;
8836
0
    return GF_OK;
8837
0
  case 2:
8838
0
    info->name = "knot";
8839
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8840
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
8841
0
    info->far_ptr = & ((X_NurbsOrientationInterpolator *) node)->knot;
8842
0
    return GF_OK;
8843
0
  case 3:
8844
0
    info->name = "order";
8845
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8846
0
    info->fieldType = GF_SG_VRML_SFINT32;
8847
0
    info->far_ptr = & ((X_NurbsOrientationInterpolator *) node)->order;
8848
0
    return GF_OK;
8849
0
  case 4:
8850
0
    info->name = "weight";
8851
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8852
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
8853
0
    info->far_ptr = & ((X_NurbsOrientationInterpolator *) node)->weight;
8854
0
    return GF_OK;
8855
0
  case 5:
8856
0
    info->name = "value_changed";
8857
0
    info->eventType = GF_SG_EVENT_OUT;
8858
0
    info->fieldType = GF_SG_VRML_SFROTATION;
8859
0
    info->far_ptr = & ((X_NurbsOrientationInterpolator *) node)->value_changed;
8860
0
    return GF_OK;
8861
0
  case 6:
8862
0
    info->name = "metadata";
8863
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8864
0
    info->fieldType = GF_SG_VRML_SFNODE;
8865
0
    info->NDTtype = NDT_SFMetadataNode;
8866
0
    info->far_ptr = & ((X_NurbsOrientationInterpolator *)node)->metadata;
8867
0
    return GF_OK;
8868
0
  default:
8869
0
    return GF_BAD_PARAM;
8870
0
  }
8871
0
}
8872
8873
8874
static s32 NurbsOrientationInterpolator_get_field_index_by_name(char *name)
8875
0
{
8876
0
  if (!strcmp("set_fraction", name)) return 0;
8877
0
  if (!strcmp("controlPoints", name)) return 1;
8878
0
  if (!strcmp("knot", name)) return 2;
8879
0
  if (!strcmp("order", name)) return 3;
8880
0
  if (!strcmp("weight", name)) return 4;
8881
0
  if (!strcmp("value_changed", name)) return 5;
8882
0
  if (!strcmp("metadata", name)) return 6;
8883
0
  return -1;
8884
0
}
8885
8886
8887
static GF_Node *NurbsOrientationInterpolator_Create()
8888
0
{
8889
0
  X_NurbsOrientationInterpolator *p;
8890
0
  GF_SAFEALLOC(p, X_NurbsOrientationInterpolator);
8891
0
  if(!p) return NULL;
8892
0
  gf_node_setup((GF_Node *)p, TAG_X3D_NurbsOrientationInterpolator);
8893
8894
  /*default field values*/
8895
0
  p->order = 3;
8896
0
  return (GF_Node *)p;
8897
0
}
8898
8899
8900
/*
8901
  NurbsPatchSurface Node deletion
8902
*/
8903
8904
static void NurbsPatchSurface_Del(GF_Node *node)
8905
0
{
8906
0
  X_NurbsPatchSurface *p = (X_NurbsPatchSurface *) node;
8907
0
  gf_node_unregister((GF_Node *) p->controlPoint, node);
8908
0
  gf_node_unregister((GF_Node *) p->texCoord, node);
8909
0
  gf_sg_mfdouble_del(p->weight);
8910
0
  gf_sg_mfdouble_del(p->uKnot);
8911
0
  gf_sg_mfdouble_del(p->vKnot);
8912
0
  gf_node_unregister((GF_Node *) p->metadata, node);
8913
0
  gf_node_free((GF_Node *)p);
8914
0
}
8915
8916
8917
static u32 NurbsPatchSurface_get_field_count(GF_Node *node, u8 dummy)
8918
0
{
8919
0
  return 15;
8920
0
}
8921
8922
static GF_Err NurbsPatchSurface_get_field(GF_Node *node, GF_FieldInfo *info)
8923
0
{
8924
0
  switch (info->fieldIndex) {
8925
0
  case 0:
8926
0
    info->name = "controlPoint";
8927
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8928
0
    info->fieldType = GF_SG_VRML_SFNODE;
8929
0
    info->NDTtype = NDT_SFCoordinateNode;
8930
0
    info->far_ptr = & ((X_NurbsPatchSurface *)node)->controlPoint;
8931
0
    return GF_OK;
8932
0
  case 1:
8933
0
    info->name = "texCoord";
8934
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8935
0
    info->fieldType = GF_SG_VRML_SFNODE;
8936
0
    info->NDTtype = NDT_SFTextureCoordinateNode;
8937
0
    info->far_ptr = & ((X_NurbsPatchSurface *)node)->texCoord;
8938
0
    return GF_OK;
8939
0
  case 2:
8940
0
    info->name = "uTessellation";
8941
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8942
0
    info->fieldType = GF_SG_VRML_SFINT32;
8943
0
    info->far_ptr = & ((X_NurbsPatchSurface *) node)->uTessellation;
8944
0
    return GF_OK;
8945
0
  case 3:
8946
0
    info->name = "vTessellation";
8947
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8948
0
    info->fieldType = GF_SG_VRML_SFINT32;
8949
0
    info->far_ptr = & ((X_NurbsPatchSurface *) node)->vTessellation;
8950
0
    return GF_OK;
8951
0
  case 4:
8952
0
    info->name = "weight";
8953
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
8954
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
8955
0
    info->far_ptr = & ((X_NurbsPatchSurface *) node)->weight;
8956
0
    return GF_OK;
8957
0
  case 5:
8958
0
    info->name = "solid";
8959
0
    info->eventType = GF_SG_EVENT_FIELD;
8960
0
    info->fieldType = GF_SG_VRML_SFBOOL;
8961
0
    info->far_ptr = & ((X_NurbsPatchSurface *) node)->solid;
8962
0
    return GF_OK;
8963
0
  case 6:
8964
0
    info->name = "uClosed";
8965
0
    info->eventType = GF_SG_EVENT_FIELD;
8966
0
    info->fieldType = GF_SG_VRML_SFBOOL;
8967
0
    info->far_ptr = & ((X_NurbsPatchSurface *) node)->uClosed;
8968
0
    return GF_OK;
8969
0
  case 7:
8970
0
    info->name = "uDimension";
8971
0
    info->eventType = GF_SG_EVENT_FIELD;
8972
0
    info->fieldType = GF_SG_VRML_SFINT32;
8973
0
    info->far_ptr = & ((X_NurbsPatchSurface *) node)->uDimension;
8974
0
    return GF_OK;
8975
0
  case 8:
8976
0
    info->name = "uKnot";
8977
0
    info->eventType = GF_SG_EVENT_FIELD;
8978
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
8979
0
    info->far_ptr = & ((X_NurbsPatchSurface *) node)->uKnot;
8980
0
    return GF_OK;
8981
0
  case 9:
8982
0
    info->name = "uOrder";
8983
0
    info->eventType = GF_SG_EVENT_FIELD;
8984
0
    info->fieldType = GF_SG_VRML_SFINT32;
8985
0
    info->far_ptr = & ((X_NurbsPatchSurface *) node)->uOrder;
8986
0
    return GF_OK;
8987
0
  case 10:
8988
0
    info->name = "vClosed";
8989
0
    info->eventType = GF_SG_EVENT_FIELD;
8990
0
    info->fieldType = GF_SG_VRML_SFBOOL;
8991
0
    info->far_ptr = & ((X_NurbsPatchSurface *) node)->vClosed;
8992
0
    return GF_OK;
8993
0
  case 11:
8994
0
    info->name = "vDimension";
8995
0
    info->eventType = GF_SG_EVENT_FIELD;
8996
0
    info->fieldType = GF_SG_VRML_SFINT32;
8997
0
    info->far_ptr = & ((X_NurbsPatchSurface *) node)->vDimension;
8998
0
    return GF_OK;
8999
0
  case 12:
9000
0
    info->name = "vKnot";
9001
0
    info->eventType = GF_SG_EVENT_FIELD;
9002
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
9003
0
    info->far_ptr = & ((X_NurbsPatchSurface *) node)->vKnot;
9004
0
    return GF_OK;
9005
0
  case 13:
9006
0
    info->name = "vOrder";
9007
0
    info->eventType = GF_SG_EVENT_FIELD;
9008
0
    info->fieldType = GF_SG_VRML_SFINT32;
9009
0
    info->far_ptr = & ((X_NurbsPatchSurface *) node)->vOrder;
9010
0
    return GF_OK;
9011
0
  case 14:
9012
0
    info->name = "metadata";
9013
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9014
0
    info->fieldType = GF_SG_VRML_SFNODE;
9015
0
    info->NDTtype = NDT_SFMetadataNode;
9016
0
    info->far_ptr = & ((X_NurbsPatchSurface *)node)->metadata;
9017
0
    return GF_OK;
9018
0
  default:
9019
0
    return GF_BAD_PARAM;
9020
0
  }
9021
0
}
9022
9023
9024
static s32 NurbsPatchSurface_get_field_index_by_name(char *name)
9025
0
{
9026
0
  if (!strcmp("controlPoint", name)) return 0;
9027
0
  if (!strcmp("texCoord", name)) return 1;
9028
0
  if (!strcmp("uTessellation", name)) return 2;
9029
0
  if (!strcmp("vTessellation", name)) return 3;
9030
0
  if (!strcmp("weight", name)) return 4;
9031
0
  if (!strcmp("solid", name)) return 5;
9032
0
  if (!strcmp("uClosed", name)) return 6;
9033
0
  if (!strcmp("uDimension", name)) return 7;
9034
0
  if (!strcmp("uKnot", name)) return 8;
9035
0
  if (!strcmp("uOrder", name)) return 9;
9036
0
  if (!strcmp("vClosed", name)) return 10;
9037
0
  if (!strcmp("vDimension", name)) return 11;
9038
0
  if (!strcmp("vKnot", name)) return 12;
9039
0
  if (!strcmp("vOrder", name)) return 13;
9040
0
  if (!strcmp("metadata", name)) return 14;
9041
0
  return -1;
9042
0
}
9043
9044
9045
static GF_Node *NurbsPatchSurface_Create()
9046
0
{
9047
0
  X_NurbsPatchSurface *p;
9048
0
  GF_SAFEALLOC(p, X_NurbsPatchSurface);
9049
0
  if(!p) return NULL;
9050
0
  gf_node_setup((GF_Node *)p, TAG_X3D_NurbsPatchSurface);
9051
9052
  /*default field values*/
9053
0
  p->uTessellation = 0;
9054
0
  p->vTessellation = 0;
9055
0
  p->solid = 1;
9056
0
  p->uDimension = 0;
9057
0
  p->uOrder = 3;
9058
0
  p->vDimension = 0;
9059
0
  p->vOrder = 3;
9060
0
  return (GF_Node *)p;
9061
0
}
9062
9063
9064
/*
9065
  NurbsPositionInterpolator Node deletion
9066
*/
9067
9068
static void NurbsPositionInterpolator_Del(GF_Node *node)
9069
0
{
9070
0
  X_NurbsPositionInterpolator *p = (X_NurbsPositionInterpolator *) node;
9071
0
  gf_node_unregister((GF_Node *) p->controlPoints, node);
9072
0
  gf_sg_mfdouble_del(p->knot);
9073
0
  gf_sg_mfdouble_del(p->weight);
9074
0
  gf_node_unregister((GF_Node *) p->metadata, node);
9075
0
  gf_node_free((GF_Node *)p);
9076
0
}
9077
9078
9079
static u32 NurbsPositionInterpolator_get_field_count(GF_Node *node, u8 dummy)
9080
0
{
9081
0
  return 7;
9082
0
}
9083
9084
static GF_Err NurbsPositionInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
9085
0
{
9086
0
  switch (info->fieldIndex) {
9087
0
  case 0:
9088
0
    info->name = "set_fraction";
9089
0
    info->eventType = GF_SG_EVENT_IN;
9090
0
    info->on_event_in = ((X_NurbsPositionInterpolator *)node)->on_set_fraction;
9091
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
9092
0
    info->far_ptr = & ((X_NurbsPositionInterpolator *) node)->set_fraction;
9093
0
    return GF_OK;
9094
0
  case 1:
9095
0
    info->name = "controlPoints";
9096
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9097
0
    info->fieldType = GF_SG_VRML_SFNODE;
9098
0
    info->NDTtype = NDT_SFCoordinateNode;
9099
0
    info->far_ptr = & ((X_NurbsPositionInterpolator *)node)->controlPoints;
9100
0
    return GF_OK;
9101
0
  case 2:
9102
0
    info->name = "knot";
9103
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9104
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
9105
0
    info->far_ptr = & ((X_NurbsPositionInterpolator *) node)->knot;
9106
0
    return GF_OK;
9107
0
  case 3:
9108
0
    info->name = "order";
9109
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9110
0
    info->fieldType = GF_SG_VRML_SFINT32;
9111
0
    info->far_ptr = & ((X_NurbsPositionInterpolator *) node)->order;
9112
0
    return GF_OK;
9113
0
  case 4:
9114
0
    info->name = "weight";
9115
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9116
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
9117
0
    info->far_ptr = & ((X_NurbsPositionInterpolator *) node)->weight;
9118
0
    return GF_OK;
9119
0
  case 5:
9120
0
    info->name = "value_changed";
9121
0
    info->eventType = GF_SG_EVENT_OUT;
9122
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
9123
0
    info->far_ptr = & ((X_NurbsPositionInterpolator *) node)->value_changed;
9124
0
    return GF_OK;
9125
0
  case 6:
9126
0
    info->name = "metadata";
9127
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9128
0
    info->fieldType = GF_SG_VRML_SFNODE;
9129
0
    info->NDTtype = NDT_SFMetadataNode;
9130
0
    info->far_ptr = & ((X_NurbsPositionInterpolator *)node)->metadata;
9131
0
    return GF_OK;
9132
0
  default:
9133
0
    return GF_BAD_PARAM;
9134
0
  }
9135
0
}
9136
9137
9138
static s32 NurbsPositionInterpolator_get_field_index_by_name(char *name)
9139
0
{
9140
0
  if (!strcmp("set_fraction", name)) return 0;
9141
0
  if (!strcmp("controlPoints", name)) return 1;
9142
0
  if (!strcmp("knot", name)) return 2;
9143
0
  if (!strcmp("order", name)) return 3;
9144
0
  if (!strcmp("weight", name)) return 4;
9145
0
  if (!strcmp("value_changed", name)) return 5;
9146
0
  if (!strcmp("metadata", name)) return 6;
9147
0
  return -1;
9148
0
}
9149
9150
9151
static GF_Node *NurbsPositionInterpolator_Create()
9152
0
{
9153
0
  X_NurbsPositionInterpolator *p;
9154
0
  GF_SAFEALLOC(p, X_NurbsPositionInterpolator);
9155
0
  if(!p) return NULL;
9156
0
  gf_node_setup((GF_Node *)p, TAG_X3D_NurbsPositionInterpolator);
9157
9158
  /*default field values*/
9159
0
  p->order = 3;
9160
0
  return (GF_Node *)p;
9161
0
}
9162
9163
9164
/*
9165
  NurbsSet Node deletion
9166
*/
9167
9168
static void NurbsSet_Del(GF_Node *node)
9169
0
{
9170
0
  X_NurbsSet *p = (X_NurbsSet *) node;
9171
0
  gf_node_unregister_children(node, p->addGeometry);
9172
0
  gf_node_unregister_children(node, p->removeGeometry);
9173
0
  gf_node_unregister_children(node, p->geometry);
9174
0
  gf_node_unregister((GF_Node *) p->metadata, node);
9175
0
  gf_node_free((GF_Node *)p);
9176
0
}
9177
9178
9179
static u32 NurbsSet_get_field_count(GF_Node *node, u8 dummy)
9180
0
{
9181
0
  return 5;
9182
0
}
9183
9184
static GF_Err NurbsSet_get_field(GF_Node *node, GF_FieldInfo *info)
9185
0
{
9186
0
  switch (info->fieldIndex) {
9187
0
  case 0:
9188
0
    info->name = "addGeometry";
9189
0
    info->eventType = GF_SG_EVENT_IN;
9190
0
    info->on_event_in = ((X_NurbsSet *)node)->on_addGeometry;
9191
0
    info->fieldType = GF_SG_VRML_MFNODE;
9192
0
    info->NDTtype = NDT_SFNurbsSurfaceNode;
9193
0
    info->far_ptr = & ((X_NurbsSet *)node)->addGeometry;
9194
0
    return GF_OK;
9195
0
  case 1:
9196
0
    info->name = "removeGeometry";
9197
0
    info->eventType = GF_SG_EVENT_IN;
9198
0
    info->on_event_in = ((X_NurbsSet *)node)->on_removeGeometry;
9199
0
    info->fieldType = GF_SG_VRML_MFNODE;
9200
0
    info->NDTtype = NDT_SFNurbsSurfaceNode;
9201
0
    info->far_ptr = & ((X_NurbsSet *)node)->removeGeometry;
9202
0
    return GF_OK;
9203
0
  case 2:
9204
0
    info->name = "geometry";
9205
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9206
0
    info->fieldType = GF_SG_VRML_MFNODE;
9207
0
    info->NDTtype = NDT_SFNurbsSurfaceNode;
9208
0
    info->far_ptr = & ((X_NurbsSet *)node)->geometry;
9209
0
    return GF_OK;
9210
0
  case 3:
9211
0
    info->name = "tessellationScale";
9212
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9213
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
9214
0
    info->far_ptr = & ((X_NurbsSet *) node)->tessellationScale;
9215
0
    return GF_OK;
9216
0
  case 4:
9217
0
    info->name = "metadata";
9218
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9219
0
    info->fieldType = GF_SG_VRML_SFNODE;
9220
0
    info->NDTtype = NDT_SFMetadataNode;
9221
0
    info->far_ptr = & ((X_NurbsSet *)node)->metadata;
9222
0
    return GF_OK;
9223
0
  default:
9224
0
    return GF_BAD_PARAM;
9225
0
  }
9226
0
}
9227
9228
9229
static s32 NurbsSet_get_field_index_by_name(char *name)
9230
0
{
9231
0
  if (!strcmp("addGeometry", name)) return 0;
9232
0
  if (!strcmp("removeGeometry", name)) return 1;
9233
0
  if (!strcmp("geometry", name)) return 2;
9234
0
  if (!strcmp("tessellationScale", name)) return 3;
9235
0
  if (!strcmp("metadata", name)) return 4;
9236
0
  return -1;
9237
0
}
9238
9239
9240
static GF_Node *NurbsSet_Create()
9241
0
{
9242
0
  X_NurbsSet *p;
9243
0
  GF_SAFEALLOC(p, X_NurbsSet);
9244
0
  if(!p) return NULL;
9245
0
  gf_node_setup((GF_Node *)p, TAG_X3D_NurbsSet);
9246
9247
  /*default field values*/
9248
0
  p->tessellationScale = FLT2FIX(1.0);
9249
0
  return (GF_Node *)p;
9250
0
}
9251
9252
9253
/*
9254
  NurbsSurfaceInterpolator Node deletion
9255
*/
9256
9257
static void NurbsSurfaceInterpolator_Del(GF_Node *node)
9258
0
{
9259
0
  X_NurbsSurfaceInterpolator *p = (X_NurbsSurfaceInterpolator *) node;
9260
0
  gf_node_unregister((GF_Node *) p->controlPoints, node);
9261
0
  gf_sg_mfdouble_del(p->weight);
9262
0
  gf_sg_mfdouble_del(p->uKnot);
9263
0
  gf_sg_mfdouble_del(p->vKnot);
9264
0
  gf_node_unregister((GF_Node *) p->metadata, node);
9265
0
  gf_node_free((GF_Node *)p);
9266
0
}
9267
9268
9269
static u32 NurbsSurfaceInterpolator_get_field_count(GF_Node *node, u8 dummy)
9270
0
{
9271
0
  return 12;
9272
0
}
9273
9274
static GF_Err NurbsSurfaceInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
9275
0
{
9276
0
  switch (info->fieldIndex) {
9277
0
  case 0:
9278
0
    info->name = "set_fraction";
9279
0
    info->eventType = GF_SG_EVENT_IN;
9280
0
    info->on_event_in = ((X_NurbsSurfaceInterpolator *)node)->on_set_fraction;
9281
0
    info->fieldType = GF_SG_VRML_SFVEC2F;
9282
0
    info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->set_fraction;
9283
0
    return GF_OK;
9284
0
  case 1:
9285
0
    info->name = "controlPoints";
9286
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9287
0
    info->fieldType = GF_SG_VRML_SFNODE;
9288
0
    info->NDTtype = NDT_SFCoordinateNode;
9289
0
    info->far_ptr = & ((X_NurbsSurfaceInterpolator *)node)->controlPoints;
9290
0
    return GF_OK;
9291
0
  case 2:
9292
0
    info->name = "weight";
9293
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9294
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
9295
0
    info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->weight;
9296
0
    return GF_OK;
9297
0
  case 3:
9298
0
    info->name = "position_changed";
9299
0
    info->eventType = GF_SG_EVENT_OUT;
9300
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
9301
0
    info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->position_changed;
9302
0
    return GF_OK;
9303
0
  case 4:
9304
0
    info->name = "normal_changed";
9305
0
    info->eventType = GF_SG_EVENT_OUT;
9306
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
9307
0
    info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->normal_changed;
9308
0
    return GF_OK;
9309
0
  case 5:
9310
0
    info->name = "uDimension";
9311
0
    info->eventType = GF_SG_EVENT_FIELD;
9312
0
    info->fieldType = GF_SG_VRML_SFINT32;
9313
0
    info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->uDimension;
9314
0
    return GF_OK;
9315
0
  case 6:
9316
0
    info->name = "uKnot";
9317
0
    info->eventType = GF_SG_EVENT_FIELD;
9318
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
9319
0
    info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->uKnot;
9320
0
    return GF_OK;
9321
0
  case 7:
9322
0
    info->name = "uOrder";
9323
0
    info->eventType = GF_SG_EVENT_FIELD;
9324
0
    info->fieldType = GF_SG_VRML_SFINT32;
9325
0
    info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->uOrder;
9326
0
    return GF_OK;
9327
0
  case 8:
9328
0
    info->name = "vDimension";
9329
0
    info->eventType = GF_SG_EVENT_FIELD;
9330
0
    info->fieldType = GF_SG_VRML_SFINT32;
9331
0
    info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->vDimension;
9332
0
    return GF_OK;
9333
0
  case 9:
9334
0
    info->name = "vKnot";
9335
0
    info->eventType = GF_SG_EVENT_FIELD;
9336
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
9337
0
    info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->vKnot;
9338
0
    return GF_OK;
9339
0
  case 10:
9340
0
    info->name = "vOrder";
9341
0
    info->eventType = GF_SG_EVENT_FIELD;
9342
0
    info->fieldType = GF_SG_VRML_SFINT32;
9343
0
    info->far_ptr = & ((X_NurbsSurfaceInterpolator *) node)->vOrder;
9344
0
    return GF_OK;
9345
0
  case 11:
9346
0
    info->name = "metadata";
9347
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9348
0
    info->fieldType = GF_SG_VRML_SFNODE;
9349
0
    info->NDTtype = NDT_SFMetadataNode;
9350
0
    info->far_ptr = & ((X_NurbsSurfaceInterpolator *)node)->metadata;
9351
0
    return GF_OK;
9352
0
  default:
9353
0
    return GF_BAD_PARAM;
9354
0
  }
9355
0
}
9356
9357
9358
static s32 NurbsSurfaceInterpolator_get_field_index_by_name(char *name)
9359
0
{
9360
0
  if (!strcmp("set_fraction", name)) return 0;
9361
0
  if (!strcmp("controlPoints", name)) return 1;
9362
0
  if (!strcmp("weight", name)) return 2;
9363
0
  if (!strcmp("position_changed", name)) return 3;
9364
0
  if (!strcmp("normal_changed", name)) return 4;
9365
0
  if (!strcmp("uDimension", name)) return 5;
9366
0
  if (!strcmp("uKnot", name)) return 6;
9367
0
  if (!strcmp("uOrder", name)) return 7;
9368
0
  if (!strcmp("vDimension", name)) return 8;
9369
0
  if (!strcmp("vKnot", name)) return 9;
9370
0
  if (!strcmp("vOrder", name)) return 10;
9371
0
  if (!strcmp("metadata", name)) return 11;
9372
0
  return -1;
9373
0
}
9374
9375
9376
static GF_Node *NurbsSurfaceInterpolator_Create()
9377
0
{
9378
0
  X_NurbsSurfaceInterpolator *p;
9379
0
  GF_SAFEALLOC(p, X_NurbsSurfaceInterpolator);
9380
0
  if(!p) return NULL;
9381
0
  gf_node_setup((GF_Node *)p, TAG_X3D_NurbsSurfaceInterpolator);
9382
9383
  /*default field values*/
9384
0
  p->uDimension = 0;
9385
0
  p->uOrder = 3;
9386
0
  p->vDimension = 0;
9387
0
  p->vOrder = 3;
9388
0
  return (GF_Node *)p;
9389
0
}
9390
9391
9392
/*
9393
  NurbsSweptSurface Node deletion
9394
*/
9395
9396
static void NurbsSweptSurface_Del(GF_Node *node)
9397
0
{
9398
0
  X_NurbsSweptSurface *p = (X_NurbsSweptSurface *) node;
9399
0
  gf_node_unregister((GF_Node *) p->crossSectionCurve, node);
9400
0
  gf_node_unregister((GF_Node *) p->trajectoryCurve, node);
9401
0
  gf_node_unregister((GF_Node *) p->metadata, node);
9402
0
  gf_node_free((GF_Node *)p);
9403
0
}
9404
9405
9406
static u32 NurbsSweptSurface_get_field_count(GF_Node *node, u8 dummy)
9407
0
{
9408
0
  return 5;
9409
0
}
9410
9411
static GF_Err NurbsSweptSurface_get_field(GF_Node *node, GF_FieldInfo *info)
9412
0
{
9413
0
  switch (info->fieldIndex) {
9414
0
  case 0:
9415
0
    info->name = "crossSectionCurve";
9416
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9417
0
    info->fieldType = GF_SG_VRML_SFNODE;
9418
0
    info->NDTtype = NDT_SFNurbsControlCurveNode;
9419
0
    info->far_ptr = & ((X_NurbsSweptSurface *)node)->crossSectionCurve;
9420
0
    return GF_OK;
9421
0
  case 1:
9422
0
    info->name = "trajectoryCurve";
9423
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9424
0
    info->fieldType = GF_SG_VRML_SFNODE;
9425
0
    info->NDTtype = NDT_SFNurbsCurveNode;
9426
0
    info->far_ptr = & ((X_NurbsSweptSurface *)node)->trajectoryCurve;
9427
0
    return GF_OK;
9428
0
  case 2:
9429
0
    info->name = "ccw";
9430
0
    info->eventType = GF_SG_EVENT_FIELD;
9431
0
    info->fieldType = GF_SG_VRML_SFBOOL;
9432
0
    info->far_ptr = & ((X_NurbsSweptSurface *) node)->ccw;
9433
0
    return GF_OK;
9434
0
  case 3:
9435
0
    info->name = "solid";
9436
0
    info->eventType = GF_SG_EVENT_FIELD;
9437
0
    info->fieldType = GF_SG_VRML_SFBOOL;
9438
0
    info->far_ptr = & ((X_NurbsSweptSurface *) node)->solid;
9439
0
    return GF_OK;
9440
0
  case 4:
9441
0
    info->name = "metadata";
9442
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9443
0
    info->fieldType = GF_SG_VRML_SFNODE;
9444
0
    info->NDTtype = NDT_SFMetadataNode;
9445
0
    info->far_ptr = & ((X_NurbsSweptSurface *)node)->metadata;
9446
0
    return GF_OK;
9447
0
  default:
9448
0
    return GF_BAD_PARAM;
9449
0
  }
9450
0
}
9451
9452
9453
static s32 NurbsSweptSurface_get_field_index_by_name(char *name)
9454
0
{
9455
0
  if (!strcmp("crossSectionCurve", name)) return 0;
9456
0
  if (!strcmp("trajectoryCurve", name)) return 1;
9457
0
  if (!strcmp("ccw", name)) return 2;
9458
0
  if (!strcmp("solid", name)) return 3;
9459
0
  if (!strcmp("metadata", name)) return 4;
9460
0
  return -1;
9461
0
}
9462
9463
9464
static GF_Node *NurbsSweptSurface_Create()
9465
0
{
9466
0
  X_NurbsSweptSurface *p;
9467
0
  GF_SAFEALLOC(p, X_NurbsSweptSurface);
9468
0
  if(!p) return NULL;
9469
0
  gf_node_setup((GF_Node *)p, TAG_X3D_NurbsSweptSurface);
9470
9471
  /*default field values*/
9472
0
  p->ccw = 1;
9473
0
  p->solid = 1;
9474
0
  return (GF_Node *)p;
9475
0
}
9476
9477
9478
/*
9479
  NurbsSwungSurface Node deletion
9480
*/
9481
9482
static void NurbsSwungSurface_Del(GF_Node *node)
9483
0
{
9484
0
  X_NurbsSwungSurface *p = (X_NurbsSwungSurface *) node;
9485
0
  gf_node_unregister((GF_Node *) p->profileCurve, node);
9486
0
  gf_node_unregister((GF_Node *) p->trajectoryCurve, node);
9487
0
  gf_node_unregister((GF_Node *) p->metadata, node);
9488
0
  gf_node_free((GF_Node *)p);
9489
0
}
9490
9491
9492
static u32 NurbsSwungSurface_get_field_count(GF_Node *node, u8 dummy)
9493
0
{
9494
0
  return 5;
9495
0
}
9496
9497
static GF_Err NurbsSwungSurface_get_field(GF_Node *node, GF_FieldInfo *info)
9498
0
{
9499
0
  switch (info->fieldIndex) {
9500
0
  case 0:
9501
0
    info->name = "profileCurve";
9502
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9503
0
    info->fieldType = GF_SG_VRML_SFNODE;
9504
0
    info->NDTtype = NDT_SFNurbsControlCurveNode;
9505
0
    info->far_ptr = & ((X_NurbsSwungSurface *)node)->profileCurve;
9506
0
    return GF_OK;
9507
0
  case 1:
9508
0
    info->name = "trajectoryCurve";
9509
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9510
0
    info->fieldType = GF_SG_VRML_SFNODE;
9511
0
    info->NDTtype = NDT_SFNurbsControlCurveNode;
9512
0
    info->far_ptr = & ((X_NurbsSwungSurface *)node)->trajectoryCurve;
9513
0
    return GF_OK;
9514
0
  case 2:
9515
0
    info->name = "ccw";
9516
0
    info->eventType = GF_SG_EVENT_FIELD;
9517
0
    info->fieldType = GF_SG_VRML_SFBOOL;
9518
0
    info->far_ptr = & ((X_NurbsSwungSurface *) node)->ccw;
9519
0
    return GF_OK;
9520
0
  case 3:
9521
0
    info->name = "solid";
9522
0
    info->eventType = GF_SG_EVENT_FIELD;
9523
0
    info->fieldType = GF_SG_VRML_SFBOOL;
9524
0
    info->far_ptr = & ((X_NurbsSwungSurface *) node)->solid;
9525
0
    return GF_OK;
9526
0
  case 4:
9527
0
    info->name = "metadata";
9528
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9529
0
    info->fieldType = GF_SG_VRML_SFNODE;
9530
0
    info->NDTtype = NDT_SFMetadataNode;
9531
0
    info->far_ptr = & ((X_NurbsSwungSurface *)node)->metadata;
9532
0
    return GF_OK;
9533
0
  default:
9534
0
    return GF_BAD_PARAM;
9535
0
  }
9536
0
}
9537
9538
9539
static s32 NurbsSwungSurface_get_field_index_by_name(char *name)
9540
0
{
9541
0
  if (!strcmp("profileCurve", name)) return 0;
9542
0
  if (!strcmp("trajectoryCurve", name)) return 1;
9543
0
  if (!strcmp("ccw", name)) return 2;
9544
0
  if (!strcmp("solid", name)) return 3;
9545
0
  if (!strcmp("metadata", name)) return 4;
9546
0
  return -1;
9547
0
}
9548
9549
9550
static GF_Node *NurbsSwungSurface_Create()
9551
0
{
9552
0
  X_NurbsSwungSurface *p;
9553
0
  GF_SAFEALLOC(p, X_NurbsSwungSurface);
9554
0
  if(!p) return NULL;
9555
0
  gf_node_setup((GF_Node *)p, TAG_X3D_NurbsSwungSurface);
9556
9557
  /*default field values*/
9558
0
  p->ccw = 1;
9559
0
  p->solid = 1;
9560
0
  return (GF_Node *)p;
9561
0
}
9562
9563
9564
/*
9565
  NurbsTextureCoordinate Node deletion
9566
*/
9567
9568
static void NurbsTextureCoordinate_Del(GF_Node *node)
9569
0
{
9570
0
  X_NurbsTextureCoordinate *p = (X_NurbsTextureCoordinate *) node;
9571
0
  gf_sg_mfvec2f_del(p->controlPoint);
9572
0
  gf_sg_mffloat_del(p->weight);
9573
0
  gf_sg_mfdouble_del(p->uKnot);
9574
0
  gf_sg_mfdouble_del(p->vKnot);
9575
0
  gf_node_unregister((GF_Node *) p->metadata, node);
9576
0
  gf_node_free((GF_Node *)p);
9577
0
}
9578
9579
9580
static u32 NurbsTextureCoordinate_get_field_count(GF_Node *node, u8 dummy)
9581
0
{
9582
0
  return 9;
9583
0
}
9584
9585
static GF_Err NurbsTextureCoordinate_get_field(GF_Node *node, GF_FieldInfo *info)
9586
0
{
9587
0
  switch (info->fieldIndex) {
9588
0
  case 0:
9589
0
    info->name = "controlPoint";
9590
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9591
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
9592
0
    info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->controlPoint;
9593
0
    return GF_OK;
9594
0
  case 1:
9595
0
    info->name = "weight";
9596
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9597
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
9598
0
    info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->weight;
9599
0
    return GF_OK;
9600
0
  case 2:
9601
0
    info->name = "uDimension";
9602
0
    info->eventType = GF_SG_EVENT_FIELD;
9603
0
    info->fieldType = GF_SG_VRML_SFINT32;
9604
0
    info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->uDimension;
9605
0
    return GF_OK;
9606
0
  case 3:
9607
0
    info->name = "uKnot";
9608
0
    info->eventType = GF_SG_EVENT_FIELD;
9609
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
9610
0
    info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->uKnot;
9611
0
    return GF_OK;
9612
0
  case 4:
9613
0
    info->name = "uOrder";
9614
0
    info->eventType = GF_SG_EVENT_FIELD;
9615
0
    info->fieldType = GF_SG_VRML_SFINT32;
9616
0
    info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->uOrder;
9617
0
    return GF_OK;
9618
0
  case 5:
9619
0
    info->name = "vDimension";
9620
0
    info->eventType = GF_SG_EVENT_FIELD;
9621
0
    info->fieldType = GF_SG_VRML_SFINT32;
9622
0
    info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->vDimension;
9623
0
    return GF_OK;
9624
0
  case 6:
9625
0
    info->name = "vKnot";
9626
0
    info->eventType = GF_SG_EVENT_FIELD;
9627
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
9628
0
    info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->vKnot;
9629
0
    return GF_OK;
9630
0
  case 7:
9631
0
    info->name = "vOrder";
9632
0
    info->eventType = GF_SG_EVENT_FIELD;
9633
0
    info->fieldType = GF_SG_VRML_SFINT32;
9634
0
    info->far_ptr = & ((X_NurbsTextureCoordinate *) node)->vOrder;
9635
0
    return GF_OK;
9636
0
  case 8:
9637
0
    info->name = "metadata";
9638
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9639
0
    info->fieldType = GF_SG_VRML_SFNODE;
9640
0
    info->NDTtype = NDT_SFMetadataNode;
9641
0
    info->far_ptr = & ((X_NurbsTextureCoordinate *)node)->metadata;
9642
0
    return GF_OK;
9643
0
  default:
9644
0
    return GF_BAD_PARAM;
9645
0
  }
9646
0
}
9647
9648
9649
static s32 NurbsTextureCoordinate_get_field_index_by_name(char *name)
9650
0
{
9651
0
  if (!strcmp("controlPoint", name)) return 0;
9652
0
  if (!strcmp("weight", name)) return 1;
9653
0
  if (!strcmp("uDimension", name)) return 2;
9654
0
  if (!strcmp("uKnot", name)) return 3;
9655
0
  if (!strcmp("uOrder", name)) return 4;
9656
0
  if (!strcmp("vDimension", name)) return 5;
9657
0
  if (!strcmp("vKnot", name)) return 6;
9658
0
  if (!strcmp("vOrder", name)) return 7;
9659
0
  if (!strcmp("metadata", name)) return 8;
9660
0
  return -1;
9661
0
}
9662
9663
9664
static GF_Node *NurbsTextureCoordinate_Create()
9665
0
{
9666
0
  X_NurbsTextureCoordinate *p;
9667
0
  GF_SAFEALLOC(p, X_NurbsTextureCoordinate);
9668
0
  if(!p) return NULL;
9669
0
  gf_node_setup((GF_Node *)p, TAG_X3D_NurbsTextureCoordinate);
9670
9671
  /*default field values*/
9672
0
  p->uDimension = 0;
9673
0
  p->uOrder = 3;
9674
0
  p->vDimension = 0;
9675
0
  p->vOrder = 3;
9676
0
  return (GF_Node *)p;
9677
0
}
9678
9679
9680
/*
9681
  NurbsTrimmedSurface Node deletion
9682
*/
9683
9684
static void NurbsTrimmedSurface_Del(GF_Node *node)
9685
0
{
9686
0
  X_NurbsTrimmedSurface *p = (X_NurbsTrimmedSurface *) node;
9687
0
  gf_node_unregister_children(node, p->addTrimmingContour);
9688
0
  gf_node_unregister_children(node, p->removeTrimmingContour);
9689
0
  gf_node_unregister_children(node, p->trimmingContour);
9690
0
  gf_node_unregister((GF_Node *) p->controlPoint, node);
9691
0
  gf_node_unregister((GF_Node *) p->texCoord, node);
9692
0
  gf_sg_mfdouble_del(p->weight);
9693
0
  gf_sg_mfdouble_del(p->uKnot);
9694
0
  gf_sg_mfdouble_del(p->vKnot);
9695
0
  gf_node_unregister((GF_Node *) p->metadata, node);
9696
0
  gf_node_free((GF_Node *)p);
9697
0
}
9698
9699
9700
static u32 NurbsTrimmedSurface_get_field_count(GF_Node *node, u8 dummy)
9701
0
{
9702
0
  return 18;
9703
0
}
9704
9705
static GF_Err NurbsTrimmedSurface_get_field(GF_Node *node, GF_FieldInfo *info)
9706
0
{
9707
0
  switch (info->fieldIndex) {
9708
0
  case 0:
9709
0
    info->name = "addTrimmingContour";
9710
0
    info->eventType = GF_SG_EVENT_IN;
9711
0
    info->on_event_in = ((X_NurbsTrimmedSurface *)node)->on_addTrimmingContour;
9712
0
    info->fieldType = GF_SG_VRML_MFNODE;
9713
0
    info->NDTtype = NDT_SFNurbsControlCurveNode;
9714
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *)node)->addTrimmingContour;
9715
0
    return GF_OK;
9716
0
  case 1:
9717
0
    info->name = "removeTrimmingContour";
9718
0
    info->eventType = GF_SG_EVENT_IN;
9719
0
    info->on_event_in = ((X_NurbsTrimmedSurface *)node)->on_removeTrimmingContour;
9720
0
    info->fieldType = GF_SG_VRML_MFNODE;
9721
0
    info->NDTtype = NDT_SFNurbsControlCurveNode;
9722
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *)node)->removeTrimmingContour;
9723
0
    return GF_OK;
9724
0
  case 2:
9725
0
    info->name = "trimmingContour";
9726
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9727
0
    info->fieldType = GF_SG_VRML_MFNODE;
9728
0
    info->NDTtype = NDT_SFNurbsControlCurveNode;
9729
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *)node)->trimmingContour;
9730
0
    return GF_OK;
9731
0
  case 3:
9732
0
    info->name = "controlPoint";
9733
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9734
0
    info->fieldType = GF_SG_VRML_SFNODE;
9735
0
    info->NDTtype = NDT_SFCoordinateNode;
9736
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *)node)->controlPoint;
9737
0
    return GF_OK;
9738
0
  case 4:
9739
0
    info->name = "texCoord";
9740
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9741
0
    info->fieldType = GF_SG_VRML_SFNODE;
9742
0
    info->NDTtype = NDT_SFTextureCoordinateNode;
9743
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *)node)->texCoord;
9744
0
    return GF_OK;
9745
0
  case 5:
9746
0
    info->name = "uTessellation";
9747
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9748
0
    info->fieldType = GF_SG_VRML_SFINT32;
9749
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->uTessellation;
9750
0
    return GF_OK;
9751
0
  case 6:
9752
0
    info->name = "vTessellation";
9753
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9754
0
    info->fieldType = GF_SG_VRML_SFINT32;
9755
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->vTessellation;
9756
0
    return GF_OK;
9757
0
  case 7:
9758
0
    info->name = "weight";
9759
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9760
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
9761
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->weight;
9762
0
    return GF_OK;
9763
0
  case 8:
9764
0
    info->name = "solid";
9765
0
    info->eventType = GF_SG_EVENT_FIELD;
9766
0
    info->fieldType = GF_SG_VRML_SFBOOL;
9767
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->solid;
9768
0
    return GF_OK;
9769
0
  case 9:
9770
0
    info->name = "uClosed";
9771
0
    info->eventType = GF_SG_EVENT_FIELD;
9772
0
    info->fieldType = GF_SG_VRML_SFBOOL;
9773
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->uClosed;
9774
0
    return GF_OK;
9775
0
  case 10:
9776
0
    info->name = "uDimension";
9777
0
    info->eventType = GF_SG_EVENT_FIELD;
9778
0
    info->fieldType = GF_SG_VRML_SFINT32;
9779
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->uDimension;
9780
0
    return GF_OK;
9781
0
  case 11:
9782
0
    info->name = "uKnot";
9783
0
    info->eventType = GF_SG_EVENT_FIELD;
9784
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
9785
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->uKnot;
9786
0
    return GF_OK;
9787
0
  case 12:
9788
0
    info->name = "uOrder";
9789
0
    info->eventType = GF_SG_EVENT_FIELD;
9790
0
    info->fieldType = GF_SG_VRML_SFINT32;
9791
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->uOrder;
9792
0
    return GF_OK;
9793
0
  case 13:
9794
0
    info->name = "vClosed";
9795
0
    info->eventType = GF_SG_EVENT_FIELD;
9796
0
    info->fieldType = GF_SG_VRML_SFBOOL;
9797
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->vClosed;
9798
0
    return GF_OK;
9799
0
  case 14:
9800
0
    info->name = "vDimension";
9801
0
    info->eventType = GF_SG_EVENT_FIELD;
9802
0
    info->fieldType = GF_SG_VRML_SFINT32;
9803
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->vDimension;
9804
0
    return GF_OK;
9805
0
  case 15:
9806
0
    info->name = "vKnot";
9807
0
    info->eventType = GF_SG_EVENT_FIELD;
9808
0
    info->fieldType = GF_SG_VRML_MFDOUBLE;
9809
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->vKnot;
9810
0
    return GF_OK;
9811
0
  case 16:
9812
0
    info->name = "vOrder";
9813
0
    info->eventType = GF_SG_EVENT_FIELD;
9814
0
    info->fieldType = GF_SG_VRML_SFINT32;
9815
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *) node)->vOrder;
9816
0
    return GF_OK;
9817
0
  case 17:
9818
0
    info->name = "metadata";
9819
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9820
0
    info->fieldType = GF_SG_VRML_SFNODE;
9821
0
    info->NDTtype = NDT_SFMetadataNode;
9822
0
    info->far_ptr = & ((X_NurbsTrimmedSurface *)node)->metadata;
9823
0
    return GF_OK;
9824
0
  default:
9825
0
    return GF_BAD_PARAM;
9826
0
  }
9827
0
}
9828
9829
9830
static s32 NurbsTrimmedSurface_get_field_index_by_name(char *name)
9831
0
{
9832
0
  if (!strcmp("addTrimmingContour", name)) return 0;
9833
0
  if (!strcmp("removeTrimmingContour", name)) return 1;
9834
0
  if (!strcmp("trimmingContour", name)) return 2;
9835
0
  if (!strcmp("controlPoint", name)) return 3;
9836
0
  if (!strcmp("texCoord", name)) return 4;
9837
0
  if (!strcmp("uTessellation", name)) return 5;
9838
0
  if (!strcmp("vTessellation", name)) return 6;
9839
0
  if (!strcmp("weight", name)) return 7;
9840
0
  if (!strcmp("solid", name)) return 8;
9841
0
  if (!strcmp("uClosed", name)) return 9;
9842
0
  if (!strcmp("uDimension", name)) return 10;
9843
0
  if (!strcmp("uKnot", name)) return 11;
9844
0
  if (!strcmp("uOrder", name)) return 12;
9845
0
  if (!strcmp("vClosed", name)) return 13;
9846
0
  if (!strcmp("vDimension", name)) return 14;
9847
0
  if (!strcmp("vKnot", name)) return 15;
9848
0
  if (!strcmp("vOrder", name)) return 16;
9849
0
  if (!strcmp("metadata", name)) return 17;
9850
0
  return -1;
9851
0
}
9852
9853
9854
static GF_Node *NurbsTrimmedSurface_Create()
9855
0
{
9856
0
  X_NurbsTrimmedSurface *p;
9857
0
  GF_SAFEALLOC(p, X_NurbsTrimmedSurface);
9858
0
  if(!p) return NULL;
9859
0
  gf_node_setup((GF_Node *)p, TAG_X3D_NurbsTrimmedSurface);
9860
9861
  /*default field values*/
9862
0
  p->uTessellation = 0;
9863
0
  p->vTessellation = 0;
9864
0
  p->solid = 1;
9865
0
  p->uDimension = 0;
9866
0
  p->uOrder = 3;
9867
0
  p->vDimension = 0;
9868
0
  p->vOrder = 3;
9869
0
  return (GF_Node *)p;
9870
0
}
9871
9872
9873
/*
9874
  OrientationInterpolator Node deletion
9875
*/
9876
9877
static void OrientationInterpolator_Del(GF_Node *node)
9878
0
{
9879
0
  X_OrientationInterpolator *p = (X_OrientationInterpolator *) node;
9880
0
  gf_sg_mffloat_del(p->key);
9881
0
  gf_sg_mfrotation_del(p->keyValue);
9882
0
  gf_node_unregister((GF_Node *) p->metadata, node);
9883
0
  gf_node_free((GF_Node *)p);
9884
0
}
9885
9886
9887
static u32 OrientationInterpolator_get_field_count(GF_Node *node, u8 dummy)
9888
0
{
9889
0
  return 5;
9890
0
}
9891
9892
static GF_Err OrientationInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
9893
0
{
9894
0
  switch (info->fieldIndex) {
9895
0
  case 0:
9896
0
    info->name = "set_fraction";
9897
0
    info->eventType = GF_SG_EVENT_IN;
9898
0
    info->on_event_in = ((X_OrientationInterpolator *)node)->on_set_fraction;
9899
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
9900
0
    info->far_ptr = & ((X_OrientationInterpolator *) node)->set_fraction;
9901
0
    return GF_OK;
9902
0
  case 1:
9903
0
    info->name = "key";
9904
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9905
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
9906
0
    info->far_ptr = & ((X_OrientationInterpolator *) node)->key;
9907
0
    return GF_OK;
9908
0
  case 2:
9909
0
    info->name = "keyValue";
9910
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9911
0
    info->fieldType = GF_SG_VRML_MFROTATION;
9912
0
    info->far_ptr = & ((X_OrientationInterpolator *) node)->keyValue;
9913
0
    return GF_OK;
9914
0
  case 3:
9915
0
    info->name = "value_changed";
9916
0
    info->eventType = GF_SG_EVENT_OUT;
9917
0
    info->fieldType = GF_SG_VRML_SFROTATION;
9918
0
    info->far_ptr = & ((X_OrientationInterpolator *) node)->value_changed;
9919
0
    return GF_OK;
9920
0
  case 4:
9921
0
    info->name = "metadata";
9922
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9923
0
    info->fieldType = GF_SG_VRML_SFNODE;
9924
0
    info->NDTtype = NDT_SFMetadataNode;
9925
0
    info->far_ptr = & ((X_OrientationInterpolator *)node)->metadata;
9926
0
    return GF_OK;
9927
0
  default:
9928
0
    return GF_BAD_PARAM;
9929
0
  }
9930
0
}
9931
9932
9933
static s32 OrientationInterpolator_get_field_index_by_name(char *name)
9934
0
{
9935
0
  if (!strcmp("set_fraction", name)) return 0;
9936
0
  if (!strcmp("key", name)) return 1;
9937
0
  if (!strcmp("keyValue", name)) return 2;
9938
0
  if (!strcmp("value_changed", name)) return 3;
9939
0
  if (!strcmp("metadata", name)) return 4;
9940
0
  return -1;
9941
0
}
9942
9943
9944
static GF_Node *OrientationInterpolator_Create()
9945
0
{
9946
0
  X_OrientationInterpolator *p;
9947
0
  GF_SAFEALLOC(p, X_OrientationInterpolator);
9948
0
  if(!p) return NULL;
9949
0
  gf_node_setup((GF_Node *)p, TAG_X3D_OrientationInterpolator);
9950
9951
  /*default field values*/
9952
0
  return (GF_Node *)p;
9953
0
}
9954
9955
9956
/*
9957
  PixelTexture Node deletion
9958
*/
9959
9960
static void PixelTexture_Del(GF_Node *node)
9961
0
{
9962
0
  X_PixelTexture *p = (X_PixelTexture *) node;
9963
0
  gf_sg_sfimage_del(p->image);
9964
0
  gf_node_unregister((GF_Node *) p->metadata, node);
9965
0
  gf_node_free((GF_Node *)p);
9966
0
}
9967
9968
9969
static u32 PixelTexture_get_field_count(GF_Node *node, u8 dummy)
9970
0
{
9971
0
  return 4;
9972
0
}
9973
9974
static GF_Err PixelTexture_get_field(GF_Node *node, GF_FieldInfo *info)
9975
0
{
9976
0
  switch (info->fieldIndex) {
9977
0
  case 0:
9978
0
    info->name = "image";
9979
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9980
0
    info->fieldType = GF_SG_VRML_SFIMAGE;
9981
0
    info->far_ptr = & ((X_PixelTexture *) node)->image;
9982
0
    return GF_OK;
9983
0
  case 1:
9984
0
    info->name = "repeatS";
9985
0
    info->eventType = GF_SG_EVENT_FIELD;
9986
0
    info->fieldType = GF_SG_VRML_SFBOOL;
9987
0
    info->far_ptr = & ((X_PixelTexture *) node)->repeatS;
9988
0
    return GF_OK;
9989
0
  case 2:
9990
0
    info->name = "repeatT";
9991
0
    info->eventType = GF_SG_EVENT_FIELD;
9992
0
    info->fieldType = GF_SG_VRML_SFBOOL;
9993
0
    info->far_ptr = & ((X_PixelTexture *) node)->repeatT;
9994
0
    return GF_OK;
9995
0
  case 3:
9996
0
    info->name = "metadata";
9997
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
9998
0
    info->fieldType = GF_SG_VRML_SFNODE;
9999
0
    info->NDTtype = NDT_SFMetadataNode;
10000
0
    info->far_ptr = & ((X_PixelTexture *)node)->metadata;
10001
0
    return GF_OK;
10002
0
  default:
10003
0
    return GF_BAD_PARAM;
10004
0
  }
10005
0
}
10006
10007
10008
static s32 PixelTexture_get_field_index_by_name(char *name)
10009
0
{
10010
0
  if (!strcmp("image", name)) return 0;
10011
0
  if (!strcmp("repeatS", name)) return 1;
10012
0
  if (!strcmp("repeatT", name)) return 2;
10013
0
  if (!strcmp("metadata", name)) return 3;
10014
0
  return -1;
10015
0
}
10016
10017
10018
static GF_Node *PixelTexture_Create()
10019
0
{
10020
0
  X_PixelTexture *p;
10021
0
  GF_SAFEALLOC(p, X_PixelTexture);
10022
0
  if(!p) return NULL;
10023
0
  gf_node_setup((GF_Node *)p, TAG_X3D_PixelTexture);
10024
10025
  /*default field values*/
10026
0
  p->repeatS = 1;
10027
0
  p->repeatT = 1;
10028
0
  return (GF_Node *)p;
10029
0
}
10030
10031
10032
/*
10033
  PlaneSensor Node deletion
10034
*/
10035
10036
static void PlaneSensor_Del(GF_Node *node)
10037
0
{
10038
0
  X_PlaneSensor *p = (X_PlaneSensor *) node;
10039
0
  gf_node_unregister((GF_Node *) p->metadata, node);
10040
0
  gf_sg_sfstring_del(p->description);
10041
0
  gf_node_free((GF_Node *)p);
10042
0
}
10043
10044
10045
static u32 PlaneSensor_get_field_count(GF_Node *node, u8 dummy)
10046
0
{
10047
0
  return 11;
10048
0
}
10049
10050
static GF_Err PlaneSensor_get_field(GF_Node *node, GF_FieldInfo *info)
10051
0
{
10052
0
  switch (info->fieldIndex) {
10053
0
  case 0:
10054
0
    info->name = "autoOffset";
10055
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10056
0
    info->fieldType = GF_SG_VRML_SFBOOL;
10057
0
    info->far_ptr = & ((X_PlaneSensor *) node)->autoOffset;
10058
0
    return GF_OK;
10059
0
  case 1:
10060
0
    info->name = "enabled";
10061
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10062
0
    info->fieldType = GF_SG_VRML_SFBOOL;
10063
0
    info->far_ptr = & ((X_PlaneSensor *) node)->enabled;
10064
0
    return GF_OK;
10065
0
  case 2:
10066
0
    info->name = "maxPosition";
10067
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10068
0
    info->fieldType = GF_SG_VRML_SFVEC2F;
10069
0
    info->far_ptr = & ((X_PlaneSensor *) node)->maxPosition;
10070
0
    return GF_OK;
10071
0
  case 3:
10072
0
    info->name = "minPosition";
10073
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10074
0
    info->fieldType = GF_SG_VRML_SFVEC2F;
10075
0
    info->far_ptr = & ((X_PlaneSensor *) node)->minPosition;
10076
0
    return GF_OK;
10077
0
  case 4:
10078
0
    info->name = "offset";
10079
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10080
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
10081
0
    info->far_ptr = & ((X_PlaneSensor *) node)->offset;
10082
0
    return GF_OK;
10083
0
  case 5:
10084
0
    info->name = "isActive";
10085
0
    info->eventType = GF_SG_EVENT_OUT;
10086
0
    info->fieldType = GF_SG_VRML_SFBOOL;
10087
0
    info->far_ptr = & ((X_PlaneSensor *) node)->isActive;
10088
0
    return GF_OK;
10089
0
  case 6:
10090
0
    info->name = "trackPoint_changed";
10091
0
    info->eventType = GF_SG_EVENT_OUT;
10092
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
10093
0
    info->far_ptr = & ((X_PlaneSensor *) node)->trackPoint_changed;
10094
0
    return GF_OK;
10095
0
  case 7:
10096
0
    info->name = "translation_changed";
10097
0
    info->eventType = GF_SG_EVENT_OUT;
10098
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
10099
0
    info->far_ptr = & ((X_PlaneSensor *) node)->translation_changed;
10100
0
    return GF_OK;
10101
0
  case 8:
10102
0
    info->name = "metadata";
10103
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10104
0
    info->fieldType = GF_SG_VRML_SFNODE;
10105
0
    info->NDTtype = NDT_SFMetadataNode;
10106
0
    info->far_ptr = & ((X_PlaneSensor *)node)->metadata;
10107
0
    return GF_OK;
10108
0
  case 9:
10109
0
    info->name = "description";
10110
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10111
0
    info->fieldType = GF_SG_VRML_SFSTRING;
10112
0
    info->far_ptr = & ((X_PlaneSensor *) node)->description;
10113
0
    return GF_OK;
10114
0
  case 10:
10115
0
    info->name = "isOver";
10116
0
    info->eventType = GF_SG_EVENT_OUT;
10117
0
    info->fieldType = GF_SG_VRML_SFBOOL;
10118
0
    info->far_ptr = & ((X_PlaneSensor *) node)->isOver;
10119
0
    return GF_OK;
10120
0
  default:
10121
0
    return GF_BAD_PARAM;
10122
0
  }
10123
0
}
10124
10125
10126
static s32 PlaneSensor_get_field_index_by_name(char *name)
10127
0
{
10128
0
  if (!strcmp("autoOffset", name)) return 0;
10129
0
  if (!strcmp("enabled", name)) return 1;
10130
0
  if (!strcmp("maxPosition", name)) return 2;
10131
0
  if (!strcmp("minPosition", name)) return 3;
10132
0
  if (!strcmp("offset", name)) return 4;
10133
0
  if (!strcmp("isActive", name)) return 5;
10134
0
  if (!strcmp("trackPoint_changed", name)) return 6;
10135
0
  if (!strcmp("translation_changed", name)) return 7;
10136
0
  if (!strcmp("metadata", name)) return 8;
10137
0
  if (!strcmp("description", name)) return 9;
10138
0
  if (!strcmp("isOver", name)) return 10;
10139
0
  return -1;
10140
0
}
10141
10142
10143
static GF_Node *PlaneSensor_Create()
10144
0
{
10145
0
  X_PlaneSensor *p;
10146
0
  GF_SAFEALLOC(p, X_PlaneSensor);
10147
0
  if(!p) return NULL;
10148
0
  gf_node_setup((GF_Node *)p, TAG_X3D_PlaneSensor);
10149
10150
  /*default field values*/
10151
0
  p->autoOffset = 1;
10152
0
  p->enabled = 1;
10153
0
  p->maxPosition.x = FLT2FIX(-1);
10154
0
  p->maxPosition.y = FLT2FIX(-1);
10155
0
  p->minPosition.x = FLT2FIX(0);
10156
0
  p->minPosition.y = FLT2FIX(0);
10157
0
  p->offset.x = FLT2FIX(0);
10158
0
  p->offset.y = FLT2FIX(0);
10159
0
  p->offset.z = FLT2FIX(0);
10160
0
  return (GF_Node *)p;
10161
0
}
10162
10163
10164
/*
10165
  PointLight Node deletion
10166
*/
10167
10168
static void PointLight_Del(GF_Node *node)
10169
0
{
10170
0
  X_PointLight *p = (X_PointLight *) node;
10171
0
  gf_node_unregister((GF_Node *) p->metadata, node);
10172
0
  gf_node_free((GF_Node *)p);
10173
0
}
10174
10175
10176
static u32 PointLight_get_field_count(GF_Node *node, u8 dummy)
10177
0
{
10178
0
  return 8;
10179
0
}
10180
10181
static GF_Err PointLight_get_field(GF_Node *node, GF_FieldInfo *info)
10182
0
{
10183
0
  switch (info->fieldIndex) {
10184
0
  case 0:
10185
0
    info->name = "ambientIntensity";
10186
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10187
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
10188
0
    info->far_ptr = & ((X_PointLight *) node)->ambientIntensity;
10189
0
    return GF_OK;
10190
0
  case 1:
10191
0
    info->name = "attenuation";
10192
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10193
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
10194
0
    info->far_ptr = & ((X_PointLight *) node)->attenuation;
10195
0
    return GF_OK;
10196
0
  case 2:
10197
0
    info->name = "color";
10198
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10199
0
    info->fieldType = GF_SG_VRML_SFCOLOR;
10200
0
    info->far_ptr = & ((X_PointLight *) node)->color;
10201
0
    return GF_OK;
10202
0
  case 3:
10203
0
    info->name = "intensity";
10204
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10205
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
10206
0
    info->far_ptr = & ((X_PointLight *) node)->intensity;
10207
0
    return GF_OK;
10208
0
  case 4:
10209
0
    info->name = "location";
10210
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10211
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
10212
0
    info->far_ptr = & ((X_PointLight *) node)->location;
10213
0
    return GF_OK;
10214
0
  case 5:
10215
0
    info->name = "on";
10216
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10217
0
    info->fieldType = GF_SG_VRML_SFBOOL;
10218
0
    info->far_ptr = & ((X_PointLight *) node)->on;
10219
0
    return GF_OK;
10220
0
  case 6:
10221
0
    info->name = "radius";
10222
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10223
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
10224
0
    info->far_ptr = & ((X_PointLight *) node)->radius;
10225
0
    return GF_OK;
10226
0
  case 7:
10227
0
    info->name = "metadata";
10228
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10229
0
    info->fieldType = GF_SG_VRML_SFNODE;
10230
0
    info->NDTtype = NDT_SFMetadataNode;
10231
0
    info->far_ptr = & ((X_PointLight *)node)->metadata;
10232
0
    return GF_OK;
10233
0
  default:
10234
0
    return GF_BAD_PARAM;
10235
0
  }
10236
0
}
10237
10238
10239
static s32 PointLight_get_field_index_by_name(char *name)
10240
0
{
10241
0
  if (!strcmp("ambientIntensity", name)) return 0;
10242
0
  if (!strcmp("attenuation", name)) return 1;
10243
0
  if (!strcmp("color", name)) return 2;
10244
0
  if (!strcmp("intensity", name)) return 3;
10245
0
  if (!strcmp("location", name)) return 4;
10246
0
  if (!strcmp("on", name)) return 5;
10247
0
  if (!strcmp("radius", name)) return 6;
10248
0
  if (!strcmp("metadata", name)) return 7;
10249
0
  return -1;
10250
0
}
10251
10252
10253
static GF_Node *PointLight_Create()
10254
0
{
10255
0
  X_PointLight *p;
10256
0
  GF_SAFEALLOC(p, X_PointLight);
10257
0
  if(!p) return NULL;
10258
0
  gf_node_setup((GF_Node *)p, TAG_X3D_PointLight);
10259
10260
  /*default field values*/
10261
0
  p->ambientIntensity = FLT2FIX(0);
10262
0
  p->attenuation.x = FLT2FIX(1);
10263
0
  p->attenuation.y = FLT2FIX(0);
10264
0
  p->attenuation.z = FLT2FIX(0);
10265
0
  p->color.red = FLT2FIX(1);
10266
0
  p->color.green = FLT2FIX(1);
10267
0
  p->color.blue = FLT2FIX(1);
10268
0
  p->intensity = FLT2FIX(1);
10269
0
  p->location.x = FLT2FIX(0);
10270
0
  p->location.y = FLT2FIX(0);
10271
0
  p->location.z = FLT2FIX(0);
10272
0
  p->on = 1;
10273
0
  p->radius = FLT2FIX(100);
10274
0
  return (GF_Node *)p;
10275
0
}
10276
10277
10278
/*
10279
  PointSet Node deletion
10280
*/
10281
10282
static void PointSet_Del(GF_Node *node)
10283
0
{
10284
0
  X_PointSet *p = (X_PointSet *) node;
10285
0
  gf_node_unregister((GF_Node *) p->color, node);
10286
0
  gf_node_unregister((GF_Node *) p->coord, node);
10287
0
  gf_node_unregister((GF_Node *) p->metadata, node);
10288
0
  gf_node_free((GF_Node *)p);
10289
0
}
10290
10291
10292
static u32 PointSet_get_field_count(GF_Node *node, u8 dummy)
10293
0
{
10294
0
  return 3;
10295
0
}
10296
10297
static GF_Err PointSet_get_field(GF_Node *node, GF_FieldInfo *info)
10298
0
{
10299
0
  switch (info->fieldIndex) {
10300
0
  case 0:
10301
0
    info->name = "color";
10302
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10303
0
    info->fieldType = GF_SG_VRML_SFNODE;
10304
0
    info->NDTtype = NDT_SFColorNode;
10305
0
    info->far_ptr = & ((X_PointSet *)node)->color;
10306
0
    return GF_OK;
10307
0
  case 1:
10308
0
    info->name = "coord";
10309
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10310
0
    info->fieldType = GF_SG_VRML_SFNODE;
10311
0
    info->NDTtype = NDT_SFCoordinateNode;
10312
0
    info->far_ptr = & ((X_PointSet *)node)->coord;
10313
0
    return GF_OK;
10314
0
  case 2:
10315
0
    info->name = "metadata";
10316
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10317
0
    info->fieldType = GF_SG_VRML_SFNODE;
10318
0
    info->NDTtype = NDT_SFMetadataNode;
10319
0
    info->far_ptr = & ((X_PointSet *)node)->metadata;
10320
0
    return GF_OK;
10321
0
  default:
10322
0
    return GF_BAD_PARAM;
10323
0
  }
10324
0
}
10325
10326
10327
static s32 PointSet_get_field_index_by_name(char *name)
10328
0
{
10329
0
  if (!strcmp("color", name)) return 0;
10330
0
  if (!strcmp("coord", name)) return 1;
10331
0
  if (!strcmp("metadata", name)) return 2;
10332
0
  return -1;
10333
0
}
10334
10335
10336
static GF_Node *PointSet_Create()
10337
0
{
10338
0
  X_PointSet *p;
10339
0
  GF_SAFEALLOC(p, X_PointSet);
10340
0
  if(!p) return NULL;
10341
0
  gf_node_setup((GF_Node *)p, TAG_X3D_PointSet);
10342
10343
  /*default field values*/
10344
0
  return (GF_Node *)p;
10345
0
}
10346
10347
10348
/*
10349
  Polyline2D Node deletion
10350
*/
10351
10352
static void Polyline2D_Del(GF_Node *node)
10353
0
{
10354
0
  X_Polyline2D *p = (X_Polyline2D *) node;
10355
0
  gf_sg_mfvec2f_del(p->lineSegments);
10356
0
  gf_node_unregister((GF_Node *) p->metadata, node);
10357
0
  gf_node_free((GF_Node *)p);
10358
0
}
10359
10360
10361
static u32 Polyline2D_get_field_count(GF_Node *node, u8 dummy)
10362
0
{
10363
0
  return 2;
10364
0
}
10365
10366
static GF_Err Polyline2D_get_field(GF_Node *node, GF_FieldInfo *info)
10367
0
{
10368
0
  switch (info->fieldIndex) {
10369
0
  case 0:
10370
0
    info->name = "lineSegments";
10371
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10372
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
10373
0
    info->far_ptr = & ((X_Polyline2D *) node)->lineSegments;
10374
0
    return GF_OK;
10375
0
  case 1:
10376
0
    info->name = "metadata";
10377
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10378
0
    info->fieldType = GF_SG_VRML_SFNODE;
10379
0
    info->NDTtype = NDT_SFMetadataNode;
10380
0
    info->far_ptr = & ((X_Polyline2D *)node)->metadata;
10381
0
    return GF_OK;
10382
0
  default:
10383
0
    return GF_BAD_PARAM;
10384
0
  }
10385
0
}
10386
10387
10388
static s32 Polyline2D_get_field_index_by_name(char *name)
10389
0
{
10390
0
  if (!strcmp("lineSegments", name)) return 0;
10391
0
  if (!strcmp("metadata", name)) return 1;
10392
0
  return -1;
10393
0
}
10394
10395
10396
static GF_Node *Polyline2D_Create()
10397
0
{
10398
0
  X_Polyline2D *p;
10399
0
  GF_SAFEALLOC(p, X_Polyline2D);
10400
0
  if(!p) return NULL;
10401
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Polyline2D);
10402
10403
  /*default field values*/
10404
0
  return (GF_Node *)p;
10405
0
}
10406
10407
10408
/*
10409
  Polypoint2D Node deletion
10410
*/
10411
10412
static void Polypoint2D_Del(GF_Node *node)
10413
0
{
10414
0
  X_Polypoint2D *p = (X_Polypoint2D *) node;
10415
0
  gf_sg_mfvec2f_del(p->point);
10416
0
  gf_node_unregister((GF_Node *) p->metadata, node);
10417
0
  gf_node_free((GF_Node *)p);
10418
0
}
10419
10420
10421
static u32 Polypoint2D_get_field_count(GF_Node *node, u8 dummy)
10422
0
{
10423
0
  return 2;
10424
0
}
10425
10426
static GF_Err Polypoint2D_get_field(GF_Node *node, GF_FieldInfo *info)
10427
0
{
10428
0
  switch (info->fieldIndex) {
10429
0
  case 0:
10430
0
    info->name = "point";
10431
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10432
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
10433
0
    info->far_ptr = & ((X_Polypoint2D *) node)->point;
10434
0
    return GF_OK;
10435
0
  case 1:
10436
0
    info->name = "metadata";
10437
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10438
0
    info->fieldType = GF_SG_VRML_SFNODE;
10439
0
    info->NDTtype = NDT_SFMetadataNode;
10440
0
    info->far_ptr = & ((X_Polypoint2D *)node)->metadata;
10441
0
    return GF_OK;
10442
0
  default:
10443
0
    return GF_BAD_PARAM;
10444
0
  }
10445
0
}
10446
10447
10448
static s32 Polypoint2D_get_field_index_by_name(char *name)
10449
0
{
10450
0
  if (!strcmp("point", name)) return 0;
10451
0
  if (!strcmp("metadata", name)) return 1;
10452
0
  return -1;
10453
0
}
10454
10455
10456
static GF_Node *Polypoint2D_Create()
10457
0
{
10458
0
  X_Polypoint2D *p;
10459
0
  GF_SAFEALLOC(p, X_Polypoint2D);
10460
0
  if(!p) return NULL;
10461
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Polypoint2D);
10462
10463
  /*default field values*/
10464
0
  return (GF_Node *)p;
10465
0
}
10466
10467
10468
/*
10469
  PositionInterpolator Node deletion
10470
*/
10471
10472
static void PositionInterpolator_Del(GF_Node *node)
10473
0
{
10474
0
  X_PositionInterpolator *p = (X_PositionInterpolator *) node;
10475
0
  gf_sg_mffloat_del(p->key);
10476
0
  gf_sg_mfvec3f_del(p->keyValue);
10477
0
  gf_node_unregister((GF_Node *) p->metadata, node);
10478
0
  gf_node_free((GF_Node *)p);
10479
0
}
10480
10481
10482
static u32 PositionInterpolator_get_field_count(GF_Node *node, u8 dummy)
10483
0
{
10484
0
  return 5;
10485
0
}
10486
10487
static GF_Err PositionInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
10488
0
{
10489
0
  switch (info->fieldIndex) {
10490
0
  case 0:
10491
0
    info->name = "set_fraction";
10492
0
    info->eventType = GF_SG_EVENT_IN;
10493
0
    info->on_event_in = ((X_PositionInterpolator *)node)->on_set_fraction;
10494
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
10495
0
    info->far_ptr = & ((X_PositionInterpolator *) node)->set_fraction;
10496
0
    return GF_OK;
10497
0
  case 1:
10498
0
    info->name = "key";
10499
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10500
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
10501
0
    info->far_ptr = & ((X_PositionInterpolator *) node)->key;
10502
0
    return GF_OK;
10503
0
  case 2:
10504
0
    info->name = "keyValue";
10505
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10506
0
    info->fieldType = GF_SG_VRML_MFVEC3F;
10507
0
    info->far_ptr = & ((X_PositionInterpolator *) node)->keyValue;
10508
0
    return GF_OK;
10509
0
  case 3:
10510
0
    info->name = "value_changed";
10511
0
    info->eventType = GF_SG_EVENT_OUT;
10512
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
10513
0
    info->far_ptr = & ((X_PositionInterpolator *) node)->value_changed;
10514
0
    return GF_OK;
10515
0
  case 4:
10516
0
    info->name = "metadata";
10517
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10518
0
    info->fieldType = GF_SG_VRML_SFNODE;
10519
0
    info->NDTtype = NDT_SFMetadataNode;
10520
0
    info->far_ptr = & ((X_PositionInterpolator *)node)->metadata;
10521
0
    return GF_OK;
10522
0
  default:
10523
0
    return GF_BAD_PARAM;
10524
0
  }
10525
0
}
10526
10527
10528
static s32 PositionInterpolator_get_field_index_by_name(char *name)
10529
0
{
10530
0
  if (!strcmp("set_fraction", name)) return 0;
10531
0
  if (!strcmp("key", name)) return 1;
10532
0
  if (!strcmp("keyValue", name)) return 2;
10533
0
  if (!strcmp("value_changed", name)) return 3;
10534
0
  if (!strcmp("metadata", name)) return 4;
10535
0
  return -1;
10536
0
}
10537
10538
10539
static GF_Node *PositionInterpolator_Create()
10540
0
{
10541
0
  X_PositionInterpolator *p;
10542
0
  GF_SAFEALLOC(p, X_PositionInterpolator);
10543
0
  if(!p) return NULL;
10544
0
  gf_node_setup((GF_Node *)p, TAG_X3D_PositionInterpolator);
10545
10546
  /*default field values*/
10547
0
  return (GF_Node *)p;
10548
0
}
10549
10550
10551
/*
10552
  PositionInterpolator2D Node deletion
10553
*/
10554
10555
static void PositionInterpolator2D_Del(GF_Node *node)
10556
0
{
10557
0
  X_PositionInterpolator2D *p = (X_PositionInterpolator2D *) node;
10558
0
  gf_sg_mffloat_del(p->key);
10559
0
  gf_sg_mfvec2f_del(p->keyValue);
10560
0
  gf_node_unregister((GF_Node *) p->metadata, node);
10561
0
  gf_node_free((GF_Node *)p);
10562
0
}
10563
10564
10565
static u32 PositionInterpolator2D_get_field_count(GF_Node *node, u8 dummy)
10566
0
{
10567
0
  return 5;
10568
0
}
10569
10570
static GF_Err PositionInterpolator2D_get_field(GF_Node *node, GF_FieldInfo *info)
10571
0
{
10572
0
  switch (info->fieldIndex) {
10573
0
  case 0:
10574
0
    info->name = "set_fraction";
10575
0
    info->eventType = GF_SG_EVENT_IN;
10576
0
    info->on_event_in = ((X_PositionInterpolator2D *)node)->on_set_fraction;
10577
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
10578
0
    info->far_ptr = & ((X_PositionInterpolator2D *) node)->set_fraction;
10579
0
    return GF_OK;
10580
0
  case 1:
10581
0
    info->name = "key";
10582
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10583
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
10584
0
    info->far_ptr = & ((X_PositionInterpolator2D *) node)->key;
10585
0
    return GF_OK;
10586
0
  case 2:
10587
0
    info->name = "keyValue";
10588
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10589
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
10590
0
    info->far_ptr = & ((X_PositionInterpolator2D *) node)->keyValue;
10591
0
    return GF_OK;
10592
0
  case 3:
10593
0
    info->name = "value_changed";
10594
0
    info->eventType = GF_SG_EVENT_OUT;
10595
0
    info->fieldType = GF_SG_VRML_SFVEC2F;
10596
0
    info->far_ptr = & ((X_PositionInterpolator2D *) node)->value_changed;
10597
0
    return GF_OK;
10598
0
  case 4:
10599
0
    info->name = "metadata";
10600
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10601
0
    info->fieldType = GF_SG_VRML_SFNODE;
10602
0
    info->NDTtype = NDT_SFMetadataNode;
10603
0
    info->far_ptr = & ((X_PositionInterpolator2D *)node)->metadata;
10604
0
    return GF_OK;
10605
0
  default:
10606
0
    return GF_BAD_PARAM;
10607
0
  }
10608
0
}
10609
10610
10611
static s32 PositionInterpolator2D_get_field_index_by_name(char *name)
10612
0
{
10613
0
  if (!strcmp("set_fraction", name)) return 0;
10614
0
  if (!strcmp("key", name)) return 1;
10615
0
  if (!strcmp("keyValue", name)) return 2;
10616
0
  if (!strcmp("value_changed", name)) return 3;
10617
0
  if (!strcmp("metadata", name)) return 4;
10618
0
  return -1;
10619
0
}
10620
10621
10622
static GF_Node *PositionInterpolator2D_Create()
10623
0
{
10624
0
  X_PositionInterpolator2D *p;
10625
0
  GF_SAFEALLOC(p, X_PositionInterpolator2D);
10626
0
  if(!p) return NULL;
10627
0
  gf_node_setup((GF_Node *)p, TAG_X3D_PositionInterpolator2D);
10628
10629
  /*default field values*/
10630
0
  return (GF_Node *)p;
10631
0
}
10632
10633
10634
/*
10635
  ProximitySensor Node deletion
10636
*/
10637
10638
static void ProximitySensor_Del(GF_Node *node)
10639
0
{
10640
0
  X_ProximitySensor *p = (X_ProximitySensor *) node;
10641
0
  gf_node_unregister((GF_Node *) p->metadata, node);
10642
0
  gf_node_free((GF_Node *)p);
10643
0
}
10644
10645
10646
static u32 ProximitySensor_get_field_count(GF_Node *node, u8 dummy)
10647
0
{
10648
0
  return 10;
10649
0
}
10650
10651
static GF_Err ProximitySensor_get_field(GF_Node *node, GF_FieldInfo *info)
10652
0
{
10653
0
  switch (info->fieldIndex) {
10654
0
  case 0:
10655
0
    info->name = "center";
10656
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10657
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
10658
0
    info->far_ptr = & ((X_ProximitySensor *) node)->center;
10659
0
    return GF_OK;
10660
0
  case 1:
10661
0
    info->name = "size";
10662
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10663
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
10664
0
    info->far_ptr = & ((X_ProximitySensor *) node)->size;
10665
0
    return GF_OK;
10666
0
  case 2:
10667
0
    info->name = "enabled";
10668
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10669
0
    info->fieldType = GF_SG_VRML_SFBOOL;
10670
0
    info->far_ptr = & ((X_ProximitySensor *) node)->enabled;
10671
0
    return GF_OK;
10672
0
  case 3:
10673
0
    info->name = "isActive";
10674
0
    info->eventType = GF_SG_EVENT_OUT;
10675
0
    info->fieldType = GF_SG_VRML_SFBOOL;
10676
0
    info->far_ptr = & ((X_ProximitySensor *) node)->isActive;
10677
0
    return GF_OK;
10678
0
  case 4:
10679
0
    info->name = "position_changed";
10680
0
    info->eventType = GF_SG_EVENT_OUT;
10681
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
10682
0
    info->far_ptr = & ((X_ProximitySensor *) node)->position_changed;
10683
0
    return GF_OK;
10684
0
  case 5:
10685
0
    info->name = "orientation_changed";
10686
0
    info->eventType = GF_SG_EVENT_OUT;
10687
0
    info->fieldType = GF_SG_VRML_SFROTATION;
10688
0
    info->far_ptr = & ((X_ProximitySensor *) node)->orientation_changed;
10689
0
    return GF_OK;
10690
0
  case 6:
10691
0
    info->name = "enterTime";
10692
0
    info->eventType = GF_SG_EVENT_OUT;
10693
0
    info->fieldType = GF_SG_VRML_SFTIME;
10694
0
    info->far_ptr = & ((X_ProximitySensor *) node)->enterTime;
10695
0
    return GF_OK;
10696
0
  case 7:
10697
0
    info->name = "exitTime";
10698
0
    info->eventType = GF_SG_EVENT_OUT;
10699
0
    info->fieldType = GF_SG_VRML_SFTIME;
10700
0
    info->far_ptr = & ((X_ProximitySensor *) node)->exitTime;
10701
0
    return GF_OK;
10702
0
  case 8:
10703
0
    info->name = "metadata";
10704
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10705
0
    info->fieldType = GF_SG_VRML_SFNODE;
10706
0
    info->NDTtype = NDT_SFMetadataNode;
10707
0
    info->far_ptr = & ((X_ProximitySensor *)node)->metadata;
10708
0
    return GF_OK;
10709
0
  case 9:
10710
0
    info->name = "centerOfRotation_changed";
10711
0
    info->eventType = GF_SG_EVENT_OUT;
10712
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
10713
0
    info->far_ptr = & ((X_ProximitySensor *) node)->centerOfRotation_changed;
10714
0
    return GF_OK;
10715
0
  default:
10716
0
    return GF_BAD_PARAM;
10717
0
  }
10718
0
}
10719
10720
10721
static s32 ProximitySensor_get_field_index_by_name(char *name)
10722
0
{
10723
0
  if (!strcmp("center", name)) return 0;
10724
0
  if (!strcmp("size", name)) return 1;
10725
0
  if (!strcmp("enabled", name)) return 2;
10726
0
  if (!strcmp("isActive", name)) return 3;
10727
0
  if (!strcmp("position_changed", name)) return 4;
10728
0
  if (!strcmp("orientation_changed", name)) return 5;
10729
0
  if (!strcmp("enterTime", name)) return 6;
10730
0
  if (!strcmp("exitTime", name)) return 7;
10731
0
  if (!strcmp("metadata", name)) return 8;
10732
0
  if (!strcmp("centerOfRotation_changed", name)) return 9;
10733
0
  return -1;
10734
0
}
10735
10736
10737
static GF_Node *ProximitySensor_Create()
10738
0
{
10739
0
  X_ProximitySensor *p;
10740
0
  GF_SAFEALLOC(p, X_ProximitySensor);
10741
0
  if(!p) return NULL;
10742
0
  gf_node_setup((GF_Node *)p, TAG_X3D_ProximitySensor);
10743
10744
  /*default field values*/
10745
0
  p->center.x = FLT2FIX(0);
10746
0
  p->center.y = FLT2FIX(0);
10747
0
  p->center.z = FLT2FIX(0);
10748
0
  p->size.x = FLT2FIX(0);
10749
0
  p->size.y = FLT2FIX(0);
10750
0
  p->size.z = FLT2FIX(0);
10751
0
  p->enabled = 1;
10752
0
  return (GF_Node *)p;
10753
0
}
10754
10755
10756
/*
10757
  ReceiverPdu Node deletion
10758
*/
10759
10760
static void ReceiverPdu_Del(GF_Node *node)
10761
0
{
10762
0
  X_ReceiverPdu *p = (X_ReceiverPdu *) node;
10763
0
  gf_sg_sfstring_del(p->address);
10764
0
  gf_sg_sfstring_del(p->multicastRelayHost);
10765
0
  gf_sg_sfstring_del(p->networkMode);
10766
0
  gf_node_unregister((GF_Node *) p->metadata, node);
10767
0
  gf_node_free((GF_Node *)p);
10768
0
}
10769
10770
10771
static u32 ReceiverPdu_get_field_count(GF_Node *node, u8 dummy)
10772
0
{
10773
0
  return 26;
10774
0
}
10775
10776
static GF_Err ReceiverPdu_get_field(GF_Node *node, GF_FieldInfo *info)
10777
0
{
10778
0
  switch (info->fieldIndex) {
10779
0
  case 0:
10780
0
    info->name = "address";
10781
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10782
0
    info->fieldType = GF_SG_VRML_SFSTRING;
10783
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->address;
10784
0
    return GF_OK;
10785
0
  case 1:
10786
0
    info->name = "applicationID";
10787
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10788
0
    info->fieldType = GF_SG_VRML_SFINT32;
10789
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->applicationID;
10790
0
    return GF_OK;
10791
0
  case 2:
10792
0
    info->name = "entityID";
10793
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10794
0
    info->fieldType = GF_SG_VRML_SFINT32;
10795
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->entityID;
10796
0
    return GF_OK;
10797
0
  case 3:
10798
0
    info->name = "multicastRelayHost";
10799
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10800
0
    info->fieldType = GF_SG_VRML_SFSTRING;
10801
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->multicastRelayHost;
10802
0
    return GF_OK;
10803
0
  case 4:
10804
0
    info->name = "multicastRelayPort";
10805
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10806
0
    info->fieldType = GF_SG_VRML_SFINT32;
10807
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->multicastRelayPort;
10808
0
    return GF_OK;
10809
0
  case 5:
10810
0
    info->name = "networkMode";
10811
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10812
0
    info->fieldType = GF_SG_VRML_SFSTRING;
10813
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->networkMode;
10814
0
    return GF_OK;
10815
0
  case 6:
10816
0
    info->name = "port";
10817
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10818
0
    info->fieldType = GF_SG_VRML_SFINT32;
10819
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->port;
10820
0
    return GF_OK;
10821
0
  case 7:
10822
0
    info->name = "radioID";
10823
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10824
0
    info->fieldType = GF_SG_VRML_SFINT32;
10825
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->radioID;
10826
0
    return GF_OK;
10827
0
  case 8:
10828
0
    info->name = "readInterval";
10829
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10830
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
10831
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->readInterval;
10832
0
    return GF_OK;
10833
0
  case 9:
10834
0
    info->name = "receivedPower";
10835
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10836
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
10837
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->receivedPower;
10838
0
    return GF_OK;
10839
0
  case 10:
10840
0
    info->name = "receiverState";
10841
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10842
0
    info->fieldType = GF_SG_VRML_SFINT32;
10843
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->receiverState;
10844
0
    return GF_OK;
10845
0
  case 11:
10846
0
    info->name = "rtpHeaderExpected";
10847
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10848
0
    info->fieldType = GF_SG_VRML_SFBOOL;
10849
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->rtpHeaderExpected;
10850
0
    return GF_OK;
10851
0
  case 12:
10852
0
    info->name = "siteID";
10853
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10854
0
    info->fieldType = GF_SG_VRML_SFINT32;
10855
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->siteID;
10856
0
    return GF_OK;
10857
0
  case 13:
10858
0
    info->name = "transmitterApplicationID";
10859
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10860
0
    info->fieldType = GF_SG_VRML_SFINT32;
10861
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->transmitterApplicationID;
10862
0
    return GF_OK;
10863
0
  case 14:
10864
0
    info->name = "transmitterEntityID";
10865
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10866
0
    info->fieldType = GF_SG_VRML_SFINT32;
10867
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->transmitterEntityID;
10868
0
    return GF_OK;
10869
0
  case 15:
10870
0
    info->name = "transmitterRadioID";
10871
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10872
0
    info->fieldType = GF_SG_VRML_SFINT32;
10873
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->transmitterRadioID;
10874
0
    return GF_OK;
10875
0
  case 16:
10876
0
    info->name = "transmitterSiteID";
10877
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10878
0
    info->fieldType = GF_SG_VRML_SFINT32;
10879
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->transmitterSiteID;
10880
0
    return GF_OK;
10881
0
  case 17:
10882
0
    info->name = "whichGeometry";
10883
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10884
0
    info->fieldType = GF_SG_VRML_SFINT32;
10885
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->whichGeometry;
10886
0
    return GF_OK;
10887
0
  case 18:
10888
0
    info->name = "writeInterval";
10889
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10890
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
10891
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->writeInterval;
10892
0
    return GF_OK;
10893
0
  case 19:
10894
0
    info->name = "isActive";
10895
0
    info->eventType = GF_SG_EVENT_OUT;
10896
0
    info->fieldType = GF_SG_VRML_SFBOOL;
10897
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->isActive;
10898
0
    return GF_OK;
10899
0
  case 20:
10900
0
    info->name = "isNetworkReader";
10901
0
    info->eventType = GF_SG_EVENT_OUT;
10902
0
    info->fieldType = GF_SG_VRML_SFBOOL;
10903
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->isNetworkReader;
10904
0
    return GF_OK;
10905
0
  case 21:
10906
0
    info->name = "isNetworkWriter";
10907
0
    info->eventType = GF_SG_EVENT_OUT;
10908
0
    info->fieldType = GF_SG_VRML_SFBOOL;
10909
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->isNetworkWriter;
10910
0
    return GF_OK;
10911
0
  case 22:
10912
0
    info->name = "isRtpHeaderHeard";
10913
0
    info->eventType = GF_SG_EVENT_OUT;
10914
0
    info->fieldType = GF_SG_VRML_SFBOOL;
10915
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->isRtpHeaderHeard;
10916
0
    return GF_OK;
10917
0
  case 23:
10918
0
    info->name = "isStandAlone";
10919
0
    info->eventType = GF_SG_EVENT_OUT;
10920
0
    info->fieldType = GF_SG_VRML_SFBOOL;
10921
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->isStandAlone;
10922
0
    return GF_OK;
10923
0
  case 24:
10924
0
    info->name = "timestamp";
10925
0
    info->eventType = GF_SG_EVENT_OUT;
10926
0
    info->fieldType = GF_SG_VRML_SFTIME;
10927
0
    info->far_ptr = & ((X_ReceiverPdu *) node)->timestamp;
10928
0
    return GF_OK;
10929
0
  case 25:
10930
0
    info->name = "metadata";
10931
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
10932
0
    info->fieldType = GF_SG_VRML_SFNODE;
10933
0
    info->NDTtype = NDT_SFMetadataNode;
10934
0
    info->far_ptr = & ((X_ReceiverPdu *)node)->metadata;
10935
0
    return GF_OK;
10936
0
  default:
10937
0
    return GF_BAD_PARAM;
10938
0
  }
10939
0
}
10940
10941
10942
static s32 ReceiverPdu_get_field_index_by_name(char *name)
10943
0
{
10944
0
  if (!strcmp("address", name)) return 0;
10945
0
  if (!strcmp("applicationID", name)) return 1;
10946
0
  if (!strcmp("entityID", name)) return 2;
10947
0
  if (!strcmp("multicastRelayHost", name)) return 3;
10948
0
  if (!strcmp("multicastRelayPort", name)) return 4;
10949
0
  if (!strcmp("networkMode", name)) return 5;
10950
0
  if (!strcmp("port", name)) return 6;
10951
0
  if (!strcmp("radioID", name)) return 7;
10952
0
  if (!strcmp("readInterval", name)) return 8;
10953
0
  if (!strcmp("receivedPower", name)) return 9;
10954
0
  if (!strcmp("receiverState", name)) return 10;
10955
0
  if (!strcmp("rtpHeaderExpected", name)) return 11;
10956
0
  if (!strcmp("siteID", name)) return 12;
10957
0
  if (!strcmp("transmitterApplicationID", name)) return 13;
10958
0
  if (!strcmp("transmitterEntityID", name)) return 14;
10959
0
  if (!strcmp("transmitterRadioID", name)) return 15;
10960
0
  if (!strcmp("transmitterSiteID", name)) return 16;
10961
0
  if (!strcmp("whichGeometry", name)) return 17;
10962
0
  if (!strcmp("writeInterval", name)) return 18;
10963
0
  if (!strcmp("isActive", name)) return 19;
10964
0
  if (!strcmp("isNetworkReader", name)) return 20;
10965
0
  if (!strcmp("isNetworkWriter", name)) return 21;
10966
0
  if (!strcmp("isRtpHeaderHeard", name)) return 22;
10967
0
  if (!strcmp("isStandAlone", name)) return 23;
10968
0
  if (!strcmp("timestamp", name)) return 24;
10969
0
  if (!strcmp("metadata", name)) return 25;
10970
0
  return -1;
10971
0
}
10972
10973
10974
static GF_Node *ReceiverPdu_Create()
10975
0
{
10976
0
  X_ReceiverPdu *p;
10977
0
  GF_SAFEALLOC(p, X_ReceiverPdu);
10978
0
  if(!p) return NULL;
10979
0
  gf_node_setup((GF_Node *)p, TAG_X3D_ReceiverPdu);
10980
10981
  /*default field values*/
10982
0
  p->address.buffer = (char*) gf_malloc(sizeof(char) * 10);
10983
0
  strcpy(p->address.buffer, "localhost");
10984
0
  p->applicationID = 1;
10985
0
  p->entityID = 0;
10986
0
  p->multicastRelayPort = 0;
10987
0
  p->networkMode.buffer = (char*) gf_malloc(sizeof(char) * 11);
10988
0
  strcpy(p->networkMode.buffer, "standAlone");
10989
0
  p->port = 0;
10990
0
  p->radioID = 0;
10991
0
  p->readInterval = FLT2FIX(0.1);
10992
0
  p->receivedPower = FLT2FIX(0.0);
10993
0
  p->receiverState = 0;
10994
0
  p->siteID = 0;
10995
0
  p->transmitterApplicationID = 1;
10996
0
  p->transmitterEntityID = 0;
10997
0
  p->transmitterRadioID = 0;
10998
0
  p->transmitterSiteID = 0;
10999
0
  p->whichGeometry = 1;
11000
0
  p->writeInterval = FLT2FIX(1.0);
11001
0
  return (GF_Node *)p;
11002
0
}
11003
11004
11005
/*
11006
  Rectangle2D Node deletion
11007
*/
11008
11009
static void Rectangle2D_Del(GF_Node *node)
11010
0
{
11011
0
  X_Rectangle2D *p = (X_Rectangle2D *) node;
11012
0
  gf_node_unregister((GF_Node *) p->metadata, node);
11013
0
  gf_node_free((GF_Node *)p);
11014
0
}
11015
11016
11017
static u32 Rectangle2D_get_field_count(GF_Node *node, u8 dummy)
11018
0
{
11019
0
  return 2;
11020
0
}
11021
11022
static GF_Err Rectangle2D_get_field(GF_Node *node, GF_FieldInfo *info)
11023
0
{
11024
0
  switch (info->fieldIndex) {
11025
0
  case 0:
11026
0
    info->name = "size";
11027
0
    info->eventType = GF_SG_EVENT_FIELD;
11028
0
    info->fieldType = GF_SG_VRML_SFVEC2F;
11029
0
    info->far_ptr = & ((X_Rectangle2D *) node)->size;
11030
0
    return GF_OK;
11031
0
  case 1:
11032
0
    info->name = "metadata";
11033
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11034
0
    info->fieldType = GF_SG_VRML_SFNODE;
11035
0
    info->NDTtype = NDT_SFMetadataNode;
11036
0
    info->far_ptr = & ((X_Rectangle2D *)node)->metadata;
11037
0
    return GF_OK;
11038
0
  default:
11039
0
    return GF_BAD_PARAM;
11040
0
  }
11041
0
}
11042
11043
11044
static s32 Rectangle2D_get_field_index_by_name(char *name)
11045
0
{
11046
0
  if (!strcmp("size", name)) return 0;
11047
0
  if (!strcmp("metadata", name)) return 1;
11048
0
  return -1;
11049
0
}
11050
11051
11052
static GF_Node *Rectangle2D_Create()
11053
0
{
11054
0
  X_Rectangle2D *p;
11055
0
  GF_SAFEALLOC(p, X_Rectangle2D);
11056
0
  if(!p) return NULL;
11057
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Rectangle2D);
11058
11059
  /*default field values*/
11060
0
  p->size.x = FLT2FIX(2);
11061
0
  p->size.y = FLT2FIX(2);
11062
0
  return (GF_Node *)p;
11063
0
}
11064
11065
11066
/*
11067
  ScalarInterpolator Node deletion
11068
*/
11069
11070
static void ScalarInterpolator_Del(GF_Node *node)
11071
0
{
11072
0
  X_ScalarInterpolator *p = (X_ScalarInterpolator *) node;
11073
0
  gf_sg_mffloat_del(p->key);
11074
0
  gf_sg_mffloat_del(p->keyValue);
11075
0
  gf_node_unregister((GF_Node *) p->metadata, node);
11076
0
  gf_node_free((GF_Node *)p);
11077
0
}
11078
11079
11080
static u32 ScalarInterpolator_get_field_count(GF_Node *node, u8 dummy)
11081
0
{
11082
0
  return 5;
11083
0
}
11084
11085
static GF_Err ScalarInterpolator_get_field(GF_Node *node, GF_FieldInfo *info)
11086
0
{
11087
0
  switch (info->fieldIndex) {
11088
0
  case 0:
11089
0
    info->name = "set_fraction";
11090
0
    info->eventType = GF_SG_EVENT_IN;
11091
0
    info->on_event_in = ((X_ScalarInterpolator *)node)->on_set_fraction;
11092
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11093
0
    info->far_ptr = & ((X_ScalarInterpolator *) node)->set_fraction;
11094
0
    return GF_OK;
11095
0
  case 1:
11096
0
    info->name = "key";
11097
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11098
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
11099
0
    info->far_ptr = & ((X_ScalarInterpolator *) node)->key;
11100
0
    return GF_OK;
11101
0
  case 2:
11102
0
    info->name = "keyValue";
11103
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11104
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
11105
0
    info->far_ptr = & ((X_ScalarInterpolator *) node)->keyValue;
11106
0
    return GF_OK;
11107
0
  case 3:
11108
0
    info->name = "value_changed";
11109
0
    info->eventType = GF_SG_EVENT_OUT;
11110
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11111
0
    info->far_ptr = & ((X_ScalarInterpolator *) node)->value_changed;
11112
0
    return GF_OK;
11113
0
  case 4:
11114
0
    info->name = "metadata";
11115
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11116
0
    info->fieldType = GF_SG_VRML_SFNODE;
11117
0
    info->NDTtype = NDT_SFMetadataNode;
11118
0
    info->far_ptr = & ((X_ScalarInterpolator *)node)->metadata;
11119
0
    return GF_OK;
11120
0
  default:
11121
0
    return GF_BAD_PARAM;
11122
0
  }
11123
0
}
11124
11125
11126
static s32 ScalarInterpolator_get_field_index_by_name(char *name)
11127
0
{
11128
0
  if (!strcmp("set_fraction", name)) return 0;
11129
0
  if (!strcmp("key", name)) return 1;
11130
0
  if (!strcmp("keyValue", name)) return 2;
11131
0
  if (!strcmp("value_changed", name)) return 3;
11132
0
  if (!strcmp("metadata", name)) return 4;
11133
0
  return -1;
11134
0
}
11135
11136
11137
static GF_Node *ScalarInterpolator_Create()
11138
0
{
11139
0
  X_ScalarInterpolator *p;
11140
0
  GF_SAFEALLOC(p, X_ScalarInterpolator);
11141
0
  if(!p) return NULL;
11142
0
  gf_node_setup((GF_Node *)p, TAG_X3D_ScalarInterpolator);
11143
11144
  /*default field values*/
11145
0
  return (GF_Node *)p;
11146
0
}
11147
11148
11149
/*
11150
  Script Node deletion
11151
*/
11152
11153
static void Script_Del(GF_Node *node)
11154
0
{
11155
0
  X_Script *p = (X_Script *) node;
11156
0
  gf_sg_mfscript_del(p->url);
11157
0
  gf_node_unregister((GF_Node *) p->metadata, node);
11158
0
  gf_node_free((GF_Node *)p);
11159
0
}
11160
11161
11162
//unused
11163
#if 0
11164
static u32 Script_get_field_count(GF_Node *node, u8 dummy)
11165
{
11166
  return 4;
11167
}
11168
#endif
11169
11170
static GF_Err Script_get_field(GF_Node *node, GF_FieldInfo *info)
11171
0
{
11172
0
  switch (info->fieldIndex) {
11173
0
  case 0:
11174
0
    info->name = "url";
11175
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11176
0
    info->fieldType = GF_SG_VRML_MFSCRIPT;
11177
0
    info->far_ptr = & ((X_Script *) node)->url;
11178
0
    return GF_OK;
11179
0
  case 1:
11180
0
    info->name = "directOutput";
11181
0
    info->eventType = GF_SG_EVENT_FIELD;
11182
0
    info->fieldType = GF_SG_VRML_SFBOOL;
11183
0
    info->far_ptr = & ((X_Script *) node)->directOutput;
11184
0
    return GF_OK;
11185
0
  case 2:
11186
0
    info->name = "mustEvaluate";
11187
0
    info->eventType = GF_SG_EVENT_FIELD;
11188
0
    info->fieldType = GF_SG_VRML_SFBOOL;
11189
0
    info->far_ptr = & ((X_Script *) node)->mustEvaluate;
11190
0
    return GF_OK;
11191
0
  case 3:
11192
0
    info->name = "metadata";
11193
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11194
0
    info->fieldType = GF_SG_VRML_SFNODE;
11195
0
    info->NDTtype = NDT_SFMetadataNode;
11196
0
    info->far_ptr = & ((X_Script *)node)->metadata;
11197
0
    return GF_OK;
11198
0
  default:
11199
0
    return GF_BAD_PARAM;
11200
0
  }
11201
0
}
11202
11203
11204
//unused
11205
#if 0
11206
static s32 Script_get_field_index_by_name(char *name)
11207
{
11208
  if (!strcmp("url", name)) return 0;
11209
  if (!strcmp("directOutput", name)) return 1;
11210
  if (!strcmp("mustEvaluate", name)) return 2;
11211
  if (!strcmp("metadata", name)) return 3;
11212
  return -1;
11213
}
11214
#endif
11215
11216
static GF_Node *Script_Create()
11217
0
{
11218
0
  X_Script *p;
11219
0
  GF_SAFEALLOC(p, X_Script);
11220
0
  if(!p) return NULL;
11221
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Script);
11222
11223
  /*default field values*/
11224
0
  return (GF_Node *)p;
11225
0
}
11226
11227
11228
/*
11229
  Shape Node deletion
11230
*/
11231
11232
static void Shape_Del(GF_Node *node)
11233
0
{
11234
0
  X_Shape *p = (X_Shape *) node;
11235
0
  gf_node_unregister((GF_Node *) p->appearance, node);
11236
0
  gf_node_unregister((GF_Node *) p->geometry, node);
11237
0
  gf_node_unregister((GF_Node *) p->metadata, node);
11238
0
  gf_node_free((GF_Node *)p);
11239
0
}
11240
11241
11242
static u32 Shape_get_field_count(GF_Node *node, u8 dummy)
11243
0
{
11244
0
  return 3;
11245
0
}
11246
11247
static GF_Err Shape_get_field(GF_Node *node, GF_FieldInfo *info)
11248
0
{
11249
0
  switch (info->fieldIndex) {
11250
0
  case 0:
11251
0
    info->name = "appearance";
11252
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11253
0
    info->fieldType = GF_SG_VRML_SFNODE;
11254
0
    info->NDTtype = NDT_SFAppearanceNode;
11255
0
    info->far_ptr = & ((X_Shape *)node)->appearance;
11256
0
    return GF_OK;
11257
0
  case 1:
11258
0
    info->name = "geometry";
11259
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11260
0
    info->fieldType = GF_SG_VRML_SFNODE;
11261
0
    info->NDTtype = NDT_SFGeometryNode;
11262
0
    info->far_ptr = & ((X_Shape *)node)->geometry;
11263
0
    return GF_OK;
11264
0
  case 2:
11265
0
    info->name = "metadata";
11266
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11267
0
    info->fieldType = GF_SG_VRML_SFNODE;
11268
0
    info->NDTtype = NDT_SFMetadataNode;
11269
0
    info->far_ptr = & ((X_Shape *)node)->metadata;
11270
0
    return GF_OK;
11271
0
  default:
11272
0
    return GF_BAD_PARAM;
11273
0
  }
11274
0
}
11275
11276
11277
static s32 Shape_get_field_index_by_name(char *name)
11278
0
{
11279
0
  if (!strcmp("appearance", name)) return 0;
11280
0
  if (!strcmp("geometry", name)) return 1;
11281
0
  if (!strcmp("metadata", name)) return 2;
11282
0
  return -1;
11283
0
}
11284
11285
11286
static GF_Node *Shape_Create()
11287
0
{
11288
0
  X_Shape *p;
11289
0
  GF_SAFEALLOC(p, X_Shape);
11290
0
  if(!p) return NULL;
11291
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Shape);
11292
11293
  /*default field values*/
11294
0
  return (GF_Node *)p;
11295
0
}
11296
11297
11298
/*
11299
  SignalPdu Node deletion
11300
*/
11301
11302
static void SignalPdu_Del(GF_Node *node)
11303
0
{
11304
0
  X_SignalPdu *p = (X_SignalPdu *) node;
11305
0
  gf_sg_sfstring_del(p->address);
11306
0
  gf_sg_mfint32_del(p->data);
11307
0
  gf_sg_sfstring_del(p->multicastRelayHost);
11308
0
  gf_sg_sfstring_del(p->networkMode);
11309
0
  gf_node_unregister((GF_Node *) p->metadata, node);
11310
0
  gf_node_free((GF_Node *)p);
11311
0
}
11312
11313
11314
static u32 SignalPdu_get_field_count(GF_Node *node, u8 dummy)
11315
0
{
11316
0
  return 26;
11317
0
}
11318
11319
static GF_Err SignalPdu_get_field(GF_Node *node, GF_FieldInfo *info)
11320
0
{
11321
0
  switch (info->fieldIndex) {
11322
0
  case 0:
11323
0
    info->name = "address";
11324
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11325
0
    info->fieldType = GF_SG_VRML_SFSTRING;
11326
0
    info->far_ptr = & ((X_SignalPdu *) node)->address;
11327
0
    return GF_OK;
11328
0
  case 1:
11329
0
    info->name = "applicationID";
11330
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11331
0
    info->fieldType = GF_SG_VRML_SFINT32;
11332
0
    info->far_ptr = & ((X_SignalPdu *) node)->applicationID;
11333
0
    return GF_OK;
11334
0
  case 2:
11335
0
    info->name = "data";
11336
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11337
0
    info->fieldType = GF_SG_VRML_MFINT32;
11338
0
    info->far_ptr = & ((X_SignalPdu *) node)->data;
11339
0
    return GF_OK;
11340
0
  case 3:
11341
0
    info->name = "dataLength";
11342
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11343
0
    info->fieldType = GF_SG_VRML_SFINT32;
11344
0
    info->far_ptr = & ((X_SignalPdu *) node)->dataLength;
11345
0
    return GF_OK;
11346
0
  case 4:
11347
0
    info->name = "encodingScheme";
11348
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11349
0
    info->fieldType = GF_SG_VRML_SFINT32;
11350
0
    info->far_ptr = & ((X_SignalPdu *) node)->encodingScheme;
11351
0
    return GF_OK;
11352
0
  case 5:
11353
0
    info->name = "entityID";
11354
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11355
0
    info->fieldType = GF_SG_VRML_SFINT32;
11356
0
    info->far_ptr = & ((X_SignalPdu *) node)->entityID;
11357
0
    return GF_OK;
11358
0
  case 6:
11359
0
    info->name = "multicastRelayHost";
11360
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11361
0
    info->fieldType = GF_SG_VRML_SFSTRING;
11362
0
    info->far_ptr = & ((X_SignalPdu *) node)->multicastRelayHost;
11363
0
    return GF_OK;
11364
0
  case 7:
11365
0
    info->name = "multicastRelayPort";
11366
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11367
0
    info->fieldType = GF_SG_VRML_SFINT32;
11368
0
    info->far_ptr = & ((X_SignalPdu *) node)->multicastRelayPort;
11369
0
    return GF_OK;
11370
0
  case 8:
11371
0
    info->name = "networkMode";
11372
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11373
0
    info->fieldType = GF_SG_VRML_SFSTRING;
11374
0
    info->far_ptr = & ((X_SignalPdu *) node)->networkMode;
11375
0
    return GF_OK;
11376
0
  case 9:
11377
0
    info->name = "port";
11378
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11379
0
    info->fieldType = GF_SG_VRML_SFINT32;
11380
0
    info->far_ptr = & ((X_SignalPdu *) node)->port;
11381
0
    return GF_OK;
11382
0
  case 10:
11383
0
    info->name = "radioID";
11384
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11385
0
    info->fieldType = GF_SG_VRML_SFINT32;
11386
0
    info->far_ptr = & ((X_SignalPdu *) node)->radioID;
11387
0
    return GF_OK;
11388
0
  case 11:
11389
0
    info->name = "readInterval";
11390
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11391
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11392
0
    info->far_ptr = & ((X_SignalPdu *) node)->readInterval;
11393
0
    return GF_OK;
11394
0
  case 12:
11395
0
    info->name = "rtpHeaderExpected";
11396
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11397
0
    info->fieldType = GF_SG_VRML_SFBOOL;
11398
0
    info->far_ptr = & ((X_SignalPdu *) node)->rtpHeaderExpected;
11399
0
    return GF_OK;
11400
0
  case 13:
11401
0
    info->name = "sampleRate";
11402
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11403
0
    info->fieldType = GF_SG_VRML_SFINT32;
11404
0
    info->far_ptr = & ((X_SignalPdu *) node)->sampleRate;
11405
0
    return GF_OK;
11406
0
  case 14:
11407
0
    info->name = "samples";
11408
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11409
0
    info->fieldType = GF_SG_VRML_SFINT32;
11410
0
    info->far_ptr = & ((X_SignalPdu *) node)->samples;
11411
0
    return GF_OK;
11412
0
  case 15:
11413
0
    info->name = "siteID";
11414
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11415
0
    info->fieldType = GF_SG_VRML_SFINT32;
11416
0
    info->far_ptr = & ((X_SignalPdu *) node)->siteID;
11417
0
    return GF_OK;
11418
0
  case 16:
11419
0
    info->name = "tdlType";
11420
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11421
0
    info->fieldType = GF_SG_VRML_SFINT32;
11422
0
    info->far_ptr = & ((X_SignalPdu *) node)->tdlType;
11423
0
    return GF_OK;
11424
0
  case 17:
11425
0
    info->name = "whichGeometry";
11426
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11427
0
    info->fieldType = GF_SG_VRML_SFINT32;
11428
0
    info->far_ptr = & ((X_SignalPdu *) node)->whichGeometry;
11429
0
    return GF_OK;
11430
0
  case 18:
11431
0
    info->name = "writeInterval";
11432
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11433
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11434
0
    info->far_ptr = & ((X_SignalPdu *) node)->writeInterval;
11435
0
    return GF_OK;
11436
0
  case 19:
11437
0
    info->name = "isActive";
11438
0
    info->eventType = GF_SG_EVENT_OUT;
11439
0
    info->fieldType = GF_SG_VRML_SFBOOL;
11440
0
    info->far_ptr = & ((X_SignalPdu *) node)->isActive;
11441
0
    return GF_OK;
11442
0
  case 20:
11443
0
    info->name = "isNetworkReader";
11444
0
    info->eventType = GF_SG_EVENT_OUT;
11445
0
    info->fieldType = GF_SG_VRML_SFBOOL;
11446
0
    info->far_ptr = & ((X_SignalPdu *) node)->isNetworkReader;
11447
0
    return GF_OK;
11448
0
  case 21:
11449
0
    info->name = "isNetworkWriter";
11450
0
    info->eventType = GF_SG_EVENT_OUT;
11451
0
    info->fieldType = GF_SG_VRML_SFBOOL;
11452
0
    info->far_ptr = & ((X_SignalPdu *) node)->isNetworkWriter;
11453
0
    return GF_OK;
11454
0
  case 22:
11455
0
    info->name = "isRtpHeaderHeard";
11456
0
    info->eventType = GF_SG_EVENT_OUT;
11457
0
    info->fieldType = GF_SG_VRML_SFBOOL;
11458
0
    info->far_ptr = & ((X_SignalPdu *) node)->isRtpHeaderHeard;
11459
0
    return GF_OK;
11460
0
  case 23:
11461
0
    info->name = "isStandAlone";
11462
0
    info->eventType = GF_SG_EVENT_OUT;
11463
0
    info->fieldType = GF_SG_VRML_SFBOOL;
11464
0
    info->far_ptr = & ((X_SignalPdu *) node)->isStandAlone;
11465
0
    return GF_OK;
11466
0
  case 24:
11467
0
    info->name = "timestamp";
11468
0
    info->eventType = GF_SG_EVENT_OUT;
11469
0
    info->fieldType = GF_SG_VRML_SFTIME;
11470
0
    info->far_ptr = & ((X_SignalPdu *) node)->timestamp;
11471
0
    return GF_OK;
11472
0
  case 25:
11473
0
    info->name = "metadata";
11474
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11475
0
    info->fieldType = GF_SG_VRML_SFNODE;
11476
0
    info->NDTtype = NDT_SFMetadataNode;
11477
0
    info->far_ptr = & ((X_SignalPdu *)node)->metadata;
11478
0
    return GF_OK;
11479
0
  default:
11480
0
    return GF_BAD_PARAM;
11481
0
  }
11482
0
}
11483
11484
11485
static s32 SignalPdu_get_field_index_by_name(char *name)
11486
0
{
11487
0
  if (!strcmp("address", name)) return 0;
11488
0
  if (!strcmp("applicationID", name)) return 1;
11489
0
  if (!strcmp("data", name)) return 2;
11490
0
  if (!strcmp("dataLength", name)) return 3;
11491
0
  if (!strcmp("encodingScheme", name)) return 4;
11492
0
  if (!strcmp("entityID", name)) return 5;
11493
0
  if (!strcmp("multicastRelayHost", name)) return 6;
11494
0
  if (!strcmp("multicastRelayPort", name)) return 7;
11495
0
  if (!strcmp("networkMode", name)) return 8;
11496
0
  if (!strcmp("port", name)) return 9;
11497
0
  if (!strcmp("radioID", name)) return 10;
11498
0
  if (!strcmp("readInterval", name)) return 11;
11499
0
  if (!strcmp("rtpHeaderExpected", name)) return 12;
11500
0
  if (!strcmp("sampleRate", name)) return 13;
11501
0
  if (!strcmp("samples", name)) return 14;
11502
0
  if (!strcmp("siteID", name)) return 15;
11503
0
  if (!strcmp("tdlType", name)) return 16;
11504
0
  if (!strcmp("whichGeometry", name)) return 17;
11505
0
  if (!strcmp("writeInterval", name)) return 18;
11506
0
  if (!strcmp("isActive", name)) return 19;
11507
0
  if (!strcmp("isNetworkReader", name)) return 20;
11508
0
  if (!strcmp("isNetworkWriter", name)) return 21;
11509
0
  if (!strcmp("isRtpHeaderHeard", name)) return 22;
11510
0
  if (!strcmp("isStandAlone", name)) return 23;
11511
0
  if (!strcmp("timestamp", name)) return 24;
11512
0
  if (!strcmp("metadata", name)) return 25;
11513
0
  return -1;
11514
0
}
11515
11516
11517
static GF_Node *SignalPdu_Create()
11518
0
{
11519
0
  X_SignalPdu *p;
11520
0
  GF_SAFEALLOC(p, X_SignalPdu);
11521
0
  if(!p) return NULL;
11522
0
  gf_node_setup((GF_Node *)p, TAG_X3D_SignalPdu);
11523
11524
  /*default field values*/
11525
0
  p->address.buffer = (char*) gf_malloc(sizeof(char) * 10);
11526
0
  strcpy(p->address.buffer, "localhost");
11527
0
  p->applicationID = 1;
11528
0
  p->dataLength = 0;
11529
0
  p->encodingScheme = 0;
11530
0
  p->entityID = 0;
11531
0
  p->multicastRelayPort = 0;
11532
0
  p->networkMode.buffer = (char*) gf_malloc(sizeof(char) * 11);
11533
0
  strcpy(p->networkMode.buffer, "standAlone");
11534
0
  p->port = 0;
11535
0
  p->radioID = 0;
11536
0
  p->readInterval = FLT2FIX(0.1);
11537
0
  p->sampleRate = 0;
11538
0
  p->samples = 0;
11539
0
  p->siteID = 0;
11540
0
  p->tdlType = 0;
11541
0
  p->whichGeometry = 1;
11542
0
  p->writeInterval = FLT2FIX(1.0);
11543
0
  return (GF_Node *)p;
11544
0
}
11545
11546
11547
/*
11548
  Sound Node deletion
11549
*/
11550
11551
static void Sound_Del(GF_Node *node)
11552
0
{
11553
0
  X_Sound *p = (X_Sound *) node;
11554
0
  gf_node_unregister((GF_Node *) p->source, node);
11555
0
  gf_node_unregister((GF_Node *) p->metadata, node);
11556
0
  gf_node_free((GF_Node *)p);
11557
0
}
11558
11559
11560
static u32 Sound_get_field_count(GF_Node *node, u8 dummy)
11561
0
{
11562
0
  return 11;
11563
0
}
11564
11565
static GF_Err Sound_get_field(GF_Node *node, GF_FieldInfo *info)
11566
0
{
11567
0
  switch (info->fieldIndex) {
11568
0
  case 0:
11569
0
    info->name = "direction";
11570
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11571
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
11572
0
    info->far_ptr = & ((X_Sound *) node)->direction;
11573
0
    return GF_OK;
11574
0
  case 1:
11575
0
    info->name = "intensity";
11576
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11577
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11578
0
    info->far_ptr = & ((X_Sound *) node)->intensity;
11579
0
    return GF_OK;
11580
0
  case 2:
11581
0
    info->name = "location";
11582
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11583
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
11584
0
    info->far_ptr = & ((X_Sound *) node)->location;
11585
0
    return GF_OK;
11586
0
  case 3:
11587
0
    info->name = "maxBack";
11588
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11589
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11590
0
    info->far_ptr = & ((X_Sound *) node)->maxBack;
11591
0
    return GF_OK;
11592
0
  case 4:
11593
0
    info->name = "maxFront";
11594
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11595
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11596
0
    info->far_ptr = & ((X_Sound *) node)->maxFront;
11597
0
    return GF_OK;
11598
0
  case 5:
11599
0
    info->name = "minBack";
11600
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11601
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11602
0
    info->far_ptr = & ((X_Sound *) node)->minBack;
11603
0
    return GF_OK;
11604
0
  case 6:
11605
0
    info->name = "minFront";
11606
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11607
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11608
0
    info->far_ptr = & ((X_Sound *) node)->minFront;
11609
0
    return GF_OK;
11610
0
  case 7:
11611
0
    info->name = "priority";
11612
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11613
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11614
0
    info->far_ptr = & ((X_Sound *) node)->priority;
11615
0
    return GF_OK;
11616
0
  case 8:
11617
0
    info->name = "source";
11618
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11619
0
    info->fieldType = GF_SG_VRML_SFNODE;
11620
0
    info->NDTtype = NDT_SFAudioNode;
11621
0
    info->far_ptr = & ((X_Sound *)node)->source;
11622
0
    return GF_OK;
11623
0
  case 9:
11624
0
    info->name = "spatialize";
11625
0
    info->eventType = GF_SG_EVENT_FIELD;
11626
0
    info->fieldType = GF_SG_VRML_SFBOOL;
11627
0
    info->far_ptr = & ((X_Sound *) node)->spatialize;
11628
0
    return GF_OK;
11629
0
  case 10:
11630
0
    info->name = "metadata";
11631
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11632
0
    info->fieldType = GF_SG_VRML_SFNODE;
11633
0
    info->NDTtype = NDT_SFMetadataNode;
11634
0
    info->far_ptr = & ((X_Sound *)node)->metadata;
11635
0
    return GF_OK;
11636
0
  default:
11637
0
    return GF_BAD_PARAM;
11638
0
  }
11639
0
}
11640
11641
11642
static s32 Sound_get_field_index_by_name(char *name)
11643
0
{
11644
0
  if (!strcmp("direction", name)) return 0;
11645
0
  if (!strcmp("intensity", name)) return 1;
11646
0
  if (!strcmp("location", name)) return 2;
11647
0
  if (!strcmp("maxBack", name)) return 3;
11648
0
  if (!strcmp("maxFront", name)) return 4;
11649
0
  if (!strcmp("minBack", name)) return 5;
11650
0
  if (!strcmp("minFront", name)) return 6;
11651
0
  if (!strcmp("priority", name)) return 7;
11652
0
  if (!strcmp("source", name)) return 8;
11653
0
  if (!strcmp("spatialize", name)) return 9;
11654
0
  if (!strcmp("metadata", name)) return 10;
11655
0
  return -1;
11656
0
}
11657
11658
11659
static GF_Node *Sound_Create()
11660
0
{
11661
0
  X_Sound *p;
11662
0
  GF_SAFEALLOC(p, X_Sound);
11663
0
  if(!p) return NULL;
11664
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Sound);
11665
11666
  /*default field values*/
11667
0
  p->direction.x = FLT2FIX(0);
11668
0
  p->direction.y = FLT2FIX(0);
11669
0
  p->direction.z = FLT2FIX(1);
11670
0
  p->intensity = FLT2FIX(1);
11671
0
  p->location.x = FLT2FIX(0);
11672
0
  p->location.y = FLT2FIX(0);
11673
0
  p->location.z = FLT2FIX(0);
11674
0
  p->maxBack = FLT2FIX(10);
11675
0
  p->maxFront = FLT2FIX(10);
11676
0
  p->minBack = FLT2FIX(1);
11677
0
  p->minFront = FLT2FIX(1);
11678
0
  p->priority = FLT2FIX(0);
11679
0
  p->spatialize = 1;
11680
0
  return (GF_Node *)p;
11681
0
}
11682
11683
11684
/*
11685
  Sphere Node deletion
11686
*/
11687
11688
static void Sphere_Del(GF_Node *node)
11689
0
{
11690
0
  X_Sphere *p = (X_Sphere *) node;
11691
0
  gf_node_unregister((GF_Node *) p->metadata, node);
11692
0
  gf_node_free((GF_Node *)p);
11693
0
}
11694
11695
11696
static u32 Sphere_get_field_count(GF_Node *node, u8 dummy)
11697
0
{
11698
0
  return 2;
11699
0
}
11700
11701
static GF_Err Sphere_get_field(GF_Node *node, GF_FieldInfo *info)
11702
0
{
11703
0
  switch (info->fieldIndex) {
11704
0
  case 0:
11705
0
    info->name = "radius";
11706
0
    info->eventType = GF_SG_EVENT_FIELD;
11707
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11708
0
    info->far_ptr = & ((X_Sphere *) node)->radius;
11709
0
    return GF_OK;
11710
0
  case 1:
11711
0
    info->name = "metadata";
11712
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11713
0
    info->fieldType = GF_SG_VRML_SFNODE;
11714
0
    info->NDTtype = NDT_SFMetadataNode;
11715
0
    info->far_ptr = & ((X_Sphere *)node)->metadata;
11716
0
    return GF_OK;
11717
0
  default:
11718
0
    return GF_BAD_PARAM;
11719
0
  }
11720
0
}
11721
11722
11723
static s32 Sphere_get_field_index_by_name(char *name)
11724
0
{
11725
0
  if (!strcmp("radius", name)) return 0;
11726
0
  if (!strcmp("metadata", name)) return 1;
11727
0
  return -1;
11728
0
}
11729
11730
11731
static GF_Node *Sphere_Create()
11732
0
{
11733
0
  X_Sphere *p;
11734
0
  GF_SAFEALLOC(p, X_Sphere);
11735
0
  if(!p) return NULL;
11736
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Sphere);
11737
11738
  /*default field values*/
11739
0
  p->radius = FLT2FIX(1);
11740
0
  return (GF_Node *)p;
11741
0
}
11742
11743
11744
/*
11745
  SphereSensor Node deletion
11746
*/
11747
11748
static void SphereSensor_Del(GF_Node *node)
11749
0
{
11750
0
  X_SphereSensor *p = (X_SphereSensor *) node;
11751
0
  gf_node_unregister((GF_Node *) p->metadata, node);
11752
0
  gf_sg_sfstring_del(p->description);
11753
0
  gf_node_free((GF_Node *)p);
11754
0
}
11755
11756
11757
static u32 SphereSensor_get_field_count(GF_Node *node, u8 dummy)
11758
0
{
11759
0
  return 9;
11760
0
}
11761
11762
static GF_Err SphereSensor_get_field(GF_Node *node, GF_FieldInfo *info)
11763
0
{
11764
0
  switch (info->fieldIndex) {
11765
0
  case 0:
11766
0
    info->name = "autoOffset";
11767
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11768
0
    info->fieldType = GF_SG_VRML_SFBOOL;
11769
0
    info->far_ptr = & ((X_SphereSensor *) node)->autoOffset;
11770
0
    return GF_OK;
11771
0
  case 1:
11772
0
    info->name = "enabled";
11773
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11774
0
    info->fieldType = GF_SG_VRML_SFBOOL;
11775
0
    info->far_ptr = & ((X_SphereSensor *) node)->enabled;
11776
0
    return GF_OK;
11777
0
  case 2:
11778
0
    info->name = "offset";
11779
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11780
0
    info->fieldType = GF_SG_VRML_SFROTATION;
11781
0
    info->far_ptr = & ((X_SphereSensor *) node)->offset;
11782
0
    return GF_OK;
11783
0
  case 3:
11784
0
    info->name = "isActive";
11785
0
    info->eventType = GF_SG_EVENT_OUT;
11786
0
    info->fieldType = GF_SG_VRML_SFBOOL;
11787
0
    info->far_ptr = & ((X_SphereSensor *) node)->isActive;
11788
0
    return GF_OK;
11789
0
  case 4:
11790
0
    info->name = "rotation_changed";
11791
0
    info->eventType = GF_SG_EVENT_OUT;
11792
0
    info->fieldType = GF_SG_VRML_SFROTATION;
11793
0
    info->far_ptr = & ((X_SphereSensor *) node)->rotation_changed;
11794
0
    return GF_OK;
11795
0
  case 5:
11796
0
    info->name = "trackPoint_changed";
11797
0
    info->eventType = GF_SG_EVENT_OUT;
11798
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
11799
0
    info->far_ptr = & ((X_SphereSensor *) node)->trackPoint_changed;
11800
0
    return GF_OK;
11801
0
  case 6:
11802
0
    info->name = "metadata";
11803
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11804
0
    info->fieldType = GF_SG_VRML_SFNODE;
11805
0
    info->NDTtype = NDT_SFMetadataNode;
11806
0
    info->far_ptr = & ((X_SphereSensor *)node)->metadata;
11807
0
    return GF_OK;
11808
0
  case 7:
11809
0
    info->name = "description";
11810
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11811
0
    info->fieldType = GF_SG_VRML_SFSTRING;
11812
0
    info->far_ptr = & ((X_SphereSensor *) node)->description;
11813
0
    return GF_OK;
11814
0
  case 8:
11815
0
    info->name = "isOver";
11816
0
    info->eventType = GF_SG_EVENT_OUT;
11817
0
    info->fieldType = GF_SG_VRML_SFBOOL;
11818
0
    info->far_ptr = & ((X_SphereSensor *) node)->isOver;
11819
0
    return GF_OK;
11820
0
  default:
11821
0
    return GF_BAD_PARAM;
11822
0
  }
11823
0
}
11824
11825
11826
static s32 SphereSensor_get_field_index_by_name(char *name)
11827
0
{
11828
0
  if (!strcmp("autoOffset", name)) return 0;
11829
0
  if (!strcmp("enabled", name)) return 1;
11830
0
  if (!strcmp("offset", name)) return 2;
11831
0
  if (!strcmp("isActive", name)) return 3;
11832
0
  if (!strcmp("rotation_changed", name)) return 4;
11833
0
  if (!strcmp("trackPoint_changed", name)) return 5;
11834
0
  if (!strcmp("metadata", name)) return 6;
11835
0
  if (!strcmp("description", name)) return 7;
11836
0
  if (!strcmp("isOver", name)) return 8;
11837
0
  return -1;
11838
0
}
11839
11840
11841
static GF_Node *SphereSensor_Create()
11842
0
{
11843
0
  X_SphereSensor *p;
11844
0
  GF_SAFEALLOC(p, X_SphereSensor);
11845
0
  if(!p) return NULL;
11846
0
  gf_node_setup((GF_Node *)p, TAG_X3D_SphereSensor);
11847
11848
  /*default field values*/
11849
0
  p->autoOffset = 1;
11850
0
  p->enabled = 1;
11851
0
  p->offset.x = FLT2FIX(0);
11852
0
  p->offset.y = FLT2FIX(1);
11853
0
  p->offset.z = FLT2FIX(0);
11854
0
  p->offset.q = FLT2FIX(0);
11855
0
  return (GF_Node *)p;
11856
0
}
11857
11858
11859
/*
11860
  SpotLight Node deletion
11861
*/
11862
11863
static void SpotLight_Del(GF_Node *node)
11864
0
{
11865
0
  X_SpotLight *p = (X_SpotLight *) node;
11866
0
  gf_node_unregister((GF_Node *) p->metadata, node);
11867
0
  gf_node_free((GF_Node *)p);
11868
0
}
11869
11870
11871
static u32 SpotLight_get_field_count(GF_Node *node, u8 dummy)
11872
0
{
11873
0
  return 11;
11874
0
}
11875
11876
static GF_Err SpotLight_get_field(GF_Node *node, GF_FieldInfo *info)
11877
0
{
11878
0
  switch (info->fieldIndex) {
11879
0
  case 0:
11880
0
    info->name = "ambientIntensity";
11881
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11882
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11883
0
    info->far_ptr = & ((X_SpotLight *) node)->ambientIntensity;
11884
0
    return GF_OK;
11885
0
  case 1:
11886
0
    info->name = "attenuation";
11887
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11888
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
11889
0
    info->far_ptr = & ((X_SpotLight *) node)->attenuation;
11890
0
    return GF_OK;
11891
0
  case 2:
11892
0
    info->name = "beamWidth";
11893
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11894
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11895
0
    info->far_ptr = & ((X_SpotLight *) node)->beamWidth;
11896
0
    return GF_OK;
11897
0
  case 3:
11898
0
    info->name = "color";
11899
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11900
0
    info->fieldType = GF_SG_VRML_SFCOLOR;
11901
0
    info->far_ptr = & ((X_SpotLight *) node)->color;
11902
0
    return GF_OK;
11903
0
  case 4:
11904
0
    info->name = "cutOffAngle";
11905
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11906
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11907
0
    info->far_ptr = & ((X_SpotLight *) node)->cutOffAngle;
11908
0
    return GF_OK;
11909
0
  case 5:
11910
0
    info->name = "direction";
11911
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11912
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
11913
0
    info->far_ptr = & ((X_SpotLight *) node)->direction;
11914
0
    return GF_OK;
11915
0
  case 6:
11916
0
    info->name = "intensity";
11917
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11918
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11919
0
    info->far_ptr = & ((X_SpotLight *) node)->intensity;
11920
0
    return GF_OK;
11921
0
  case 7:
11922
0
    info->name = "location";
11923
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11924
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
11925
0
    info->far_ptr = & ((X_SpotLight *) node)->location;
11926
0
    return GF_OK;
11927
0
  case 8:
11928
0
    info->name = "on";
11929
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11930
0
    info->fieldType = GF_SG_VRML_SFBOOL;
11931
0
    info->far_ptr = & ((X_SpotLight *) node)->on;
11932
0
    return GF_OK;
11933
0
  case 9:
11934
0
    info->name = "radius";
11935
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11936
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
11937
0
    info->far_ptr = & ((X_SpotLight *) node)->radius;
11938
0
    return GF_OK;
11939
0
  case 10:
11940
0
    info->name = "metadata";
11941
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
11942
0
    info->fieldType = GF_SG_VRML_SFNODE;
11943
0
    info->NDTtype = NDT_SFMetadataNode;
11944
0
    info->far_ptr = & ((X_SpotLight *)node)->metadata;
11945
0
    return GF_OK;
11946
0
  default:
11947
0
    return GF_BAD_PARAM;
11948
0
  }
11949
0
}
11950
11951
11952
static s32 SpotLight_get_field_index_by_name(char *name)
11953
0
{
11954
0
  if (!strcmp("ambientIntensity", name)) return 0;
11955
0
  if (!strcmp("attenuation", name)) return 1;
11956
0
  if (!strcmp("beamWidth", name)) return 2;
11957
0
  if (!strcmp("color", name)) return 3;
11958
0
  if (!strcmp("cutOffAngle", name)) return 4;
11959
0
  if (!strcmp("direction", name)) return 5;
11960
0
  if (!strcmp("intensity", name)) return 6;
11961
0
  if (!strcmp("location", name)) return 7;
11962
0
  if (!strcmp("on", name)) return 8;
11963
0
  if (!strcmp("radius", name)) return 9;
11964
0
  if (!strcmp("metadata", name)) return 10;
11965
0
  return -1;
11966
0
}
11967
11968
11969
static GF_Node *SpotLight_Create()
11970
0
{
11971
0
  X_SpotLight *p;
11972
0
  GF_SAFEALLOC(p, X_SpotLight);
11973
0
  if(!p) return NULL;
11974
0
  gf_node_setup((GF_Node *)p, TAG_X3D_SpotLight);
11975
11976
  /*default field values*/
11977
0
  p->ambientIntensity = FLT2FIX(0);
11978
0
  p->attenuation.x = FLT2FIX(1);
11979
0
  p->attenuation.y = FLT2FIX(0);
11980
0
  p->attenuation.z = FLT2FIX(0);
11981
0
  p->beamWidth = FLT2FIX(1.570796);
11982
0
  p->color.red = FLT2FIX(1);
11983
0
  p->color.green = FLT2FIX(1);
11984
0
  p->color.blue = FLT2FIX(1);
11985
0
  p->cutOffAngle = FLT2FIX(0.785398);
11986
0
  p->direction.x = FLT2FIX(0);
11987
0
  p->direction.y = FLT2FIX(0);
11988
0
  p->direction.z = FLT2FIX(-1);
11989
0
  p->intensity = FLT2FIX(1);
11990
0
  p->location.x = FLT2FIX(0);
11991
0
  p->location.y = FLT2FIX(0);
11992
0
  p->location.z = FLT2FIX(0);
11993
0
  p->on = 1;
11994
0
  p->radius = FLT2FIX(100);
11995
0
  return (GF_Node *)p;
11996
0
}
11997
11998
11999
/*
12000
  StaticGroup Node deletion
12001
*/
12002
12003
static void StaticGroup_Del(GF_Node *node)
12004
0
{
12005
0
  X_StaticGroup *p = (X_StaticGroup *) node;
12006
0
  gf_node_unregister((GF_Node *) p->metadata, node);
12007
0
  gf_sg_vrml_parent_destroy(node);
12008
0
  gf_node_free((GF_Node *)p);
12009
0
}
12010
12011
12012
static u32 StaticGroup_get_field_count(GF_Node *node, u8 dummy)
12013
0
{
12014
0
  return 2;
12015
0
}
12016
12017
static GF_Err StaticGroup_get_field(GF_Node *node, GF_FieldInfo *info)
12018
0
{
12019
0
  switch (info->fieldIndex) {
12020
0
  case 0:
12021
0
    info->name = "children";
12022
0
    info->eventType = GF_SG_EVENT_FIELD;
12023
0
    info->fieldType = GF_SG_VRML_MFNODE;
12024
0
    info->NDTtype = NDT_SF3DNode;
12025
0
    info->far_ptr = & ((X_StaticGroup *)node)->children;
12026
0
    return GF_OK;
12027
0
  case 1:
12028
0
    info->name = "metadata";
12029
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12030
0
    info->fieldType = GF_SG_VRML_SFNODE;
12031
0
    info->NDTtype = NDT_SFMetadataNode;
12032
0
    info->far_ptr = & ((X_StaticGroup *)node)->metadata;
12033
0
    return GF_OK;
12034
0
  default:
12035
0
    return GF_BAD_PARAM;
12036
0
  }
12037
0
}
12038
12039
12040
static s32 StaticGroup_get_field_index_by_name(char *name)
12041
0
{
12042
0
  if (!strcmp("children", name)) return 0;
12043
0
  if (!strcmp("metadata", name)) return 1;
12044
0
  return -1;
12045
0
}
12046
12047
12048
static GF_Node *StaticGroup_Create()
12049
0
{
12050
0
  X_StaticGroup *p;
12051
0
  GF_SAFEALLOC(p, X_StaticGroup);
12052
0
  if(!p) return NULL;
12053
0
  gf_node_setup((GF_Node *)p, TAG_X3D_StaticGroup);
12054
0
  gf_sg_vrml_parent_setup((GF_Node *) p);
12055
12056
  /*default field values*/
12057
0
  return (GF_Node *)p;
12058
0
}
12059
12060
12061
/*
12062
  StringSensor Node deletion
12063
*/
12064
12065
static void StringSensor_Del(GF_Node *node)
12066
0
{
12067
0
  X_StringSensor *p = (X_StringSensor *) node;
12068
0
  gf_sg_sfstring_del(p->enteredText);
12069
0
  gf_sg_sfstring_del(p->finalText);
12070
0
  gf_node_unregister((GF_Node *) p->metadata, node);
12071
0
  gf_node_free((GF_Node *)p);
12072
0
}
12073
12074
12075
static u32 StringSensor_get_field_count(GF_Node *node, u8 dummy)
12076
0
{
12077
0
  return 6;
12078
0
}
12079
12080
static GF_Err StringSensor_get_field(GF_Node *node, GF_FieldInfo *info)
12081
0
{
12082
0
  switch (info->fieldIndex) {
12083
0
  case 0:
12084
0
    info->name = "deletionAllowed";
12085
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12086
0
    info->fieldType = GF_SG_VRML_SFBOOL;
12087
0
    info->far_ptr = & ((X_StringSensor *) node)->deletionAllowed;
12088
0
    return GF_OK;
12089
0
  case 1:
12090
0
    info->name = "enabled";
12091
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12092
0
    info->fieldType = GF_SG_VRML_SFBOOL;
12093
0
    info->far_ptr = & ((X_StringSensor *) node)->enabled;
12094
0
    return GF_OK;
12095
0
  case 2:
12096
0
    info->name = "enteredText";
12097
0
    info->eventType = GF_SG_EVENT_OUT;
12098
0
    info->fieldType = GF_SG_VRML_SFSTRING;
12099
0
    info->far_ptr = & ((X_StringSensor *) node)->enteredText;
12100
0
    return GF_OK;
12101
0
  case 3:
12102
0
    info->name = "finalText";
12103
0
    info->eventType = GF_SG_EVENT_OUT;
12104
0
    info->fieldType = GF_SG_VRML_SFSTRING;
12105
0
    info->far_ptr = & ((X_StringSensor *) node)->finalText;
12106
0
    return GF_OK;
12107
0
  case 4:
12108
0
    info->name = "isActive";
12109
0
    info->eventType = GF_SG_EVENT_OUT;
12110
0
    info->fieldType = GF_SG_VRML_SFBOOL;
12111
0
    info->far_ptr = & ((X_StringSensor *) node)->isActive;
12112
0
    return GF_OK;
12113
0
  case 5:
12114
0
    info->name = "metadata";
12115
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12116
0
    info->fieldType = GF_SG_VRML_SFNODE;
12117
0
    info->NDTtype = NDT_SFMetadataNode;
12118
0
    info->far_ptr = & ((X_StringSensor *)node)->metadata;
12119
0
    return GF_OK;
12120
0
  default:
12121
0
    return GF_BAD_PARAM;
12122
0
  }
12123
0
}
12124
12125
12126
static s32 StringSensor_get_field_index_by_name(char *name)
12127
0
{
12128
0
  if (!strcmp("deletionAllowed", name)) return 0;
12129
0
  if (!strcmp("enabled", name)) return 1;
12130
0
  if (!strcmp("enteredText", name)) return 2;
12131
0
  if (!strcmp("finalText", name)) return 3;
12132
0
  if (!strcmp("isActive", name)) return 4;
12133
0
  if (!strcmp("metadata", name)) return 5;
12134
0
  return -1;
12135
0
}
12136
12137
12138
static GF_Node *StringSensor_Create()
12139
0
{
12140
0
  X_StringSensor *p;
12141
0
  GF_SAFEALLOC(p, X_StringSensor);
12142
0
  if(!p) return NULL;
12143
0
  gf_node_setup((GF_Node *)p, TAG_X3D_StringSensor);
12144
12145
  /*default field values*/
12146
0
  p->deletionAllowed = 1;
12147
0
  p->enabled = 1;
12148
0
  return (GF_Node *)p;
12149
0
}
12150
12151
12152
/*
12153
  Switch Node deletion
12154
*/
12155
12156
static void Switch_Del(GF_Node *node)
12157
0
{
12158
0
  X_Switch *p = (X_Switch *) node;
12159
0
  gf_node_unregister((GF_Node *) p->metadata, node);
12160
0
  gf_sg_vrml_parent_destroy(node);
12161
0
  gf_node_free((GF_Node *)p);
12162
0
}
12163
12164
12165
static u32 Switch_get_field_count(GF_Node *node, u8 dummy)
12166
0
{
12167
0
  return 5;
12168
0
}
12169
12170
static GF_Err Switch_get_field(GF_Node *node, GF_FieldInfo *info)
12171
0
{
12172
0
  switch (info->fieldIndex) {
12173
0
  case 0:
12174
0
    info->name = "addChildren";
12175
0
    info->eventType = GF_SG_EVENT_IN;
12176
0
    info->on_event_in = ((X_Switch *)node)->on_addChildren;
12177
0
    info->fieldType = GF_SG_VRML_MFNODE;
12178
0
    info->NDTtype = NDT_SF3DNode;
12179
0
    info->far_ptr = & ((X_Switch *)node)->addChildren;
12180
0
    return GF_OK;
12181
0
  case 1:
12182
0
    info->name = "removeChildren";
12183
0
    info->eventType = GF_SG_EVENT_IN;
12184
0
    info->on_event_in = ((X_Switch *)node)->on_removeChildren;
12185
0
    info->fieldType = GF_SG_VRML_MFNODE;
12186
0
    info->NDTtype = NDT_SF3DNode;
12187
0
    info->far_ptr = & ((X_Switch *)node)->removeChildren;
12188
0
    return GF_OK;
12189
0
  case 2:
12190
0
    info->name = "children";
12191
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12192
0
    info->fieldType = GF_SG_VRML_MFNODE;
12193
0
    info->NDTtype = NDT_SF3DNode;
12194
0
    info->far_ptr = & ((X_Switch *)node)->children;
12195
0
    return GF_OK;
12196
0
  case 3:
12197
0
    info->name = "whichChoice";
12198
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12199
0
    info->fieldType = GF_SG_VRML_SFINT32;
12200
0
    info->far_ptr = & ((X_Switch *) node)->whichChoice;
12201
0
    return GF_OK;
12202
0
  case 4:
12203
0
    info->name = "metadata";
12204
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12205
0
    info->fieldType = GF_SG_VRML_SFNODE;
12206
0
    info->NDTtype = NDT_SFMetadataNode;
12207
0
    info->far_ptr = & ((X_Switch *)node)->metadata;
12208
0
    return GF_OK;
12209
0
  default:
12210
0
    return GF_BAD_PARAM;
12211
0
  }
12212
0
}
12213
12214
12215
static s32 Switch_get_field_index_by_name(char *name)
12216
0
{
12217
0
  if (!strcmp("addChildren", name)) return 0;
12218
0
  if (!strcmp("removeChildren", name)) return 1;
12219
0
  if (!strcmp("children", name)) return 2;
12220
0
  if (!strcmp("whichChoice", name)) return 3;
12221
0
  if (!strcmp("metadata", name)) return 4;
12222
0
  return -1;
12223
0
}
12224
12225
12226
static GF_Node *Switch_Create()
12227
0
{
12228
0
  X_Switch *p;
12229
0
  GF_SAFEALLOC(p, X_Switch);
12230
0
  if(!p) return NULL;
12231
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Switch);
12232
0
  gf_sg_vrml_parent_setup((GF_Node *) p);
12233
12234
  /*default field values*/
12235
0
  p->whichChoice = -1;
12236
0
  return (GF_Node *)p;
12237
0
}
12238
12239
12240
/*
12241
  Text Node deletion
12242
*/
12243
12244
static void Text_Del(GF_Node *node)
12245
0
{
12246
0
  X_Text *p = (X_Text *) node;
12247
0
  gf_sg_mfstring_del(p->string);
12248
0
  gf_sg_mffloat_del(p->length);
12249
0
  gf_node_unregister((GF_Node *) p->fontStyle, node);
12250
0
  gf_node_unregister((GF_Node *) p->metadata, node);
12251
0
  gf_node_free((GF_Node *)p);
12252
0
}
12253
12254
12255
static u32 Text_get_field_count(GF_Node *node, u8 dummy)
12256
0
{
12257
0
  return 5;
12258
0
}
12259
12260
static GF_Err Text_get_field(GF_Node *node, GF_FieldInfo *info)
12261
0
{
12262
0
  switch (info->fieldIndex) {
12263
0
  case 0:
12264
0
    info->name = "string";
12265
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12266
0
    info->fieldType = GF_SG_VRML_MFSTRING;
12267
0
    info->far_ptr = & ((X_Text *) node)->string;
12268
0
    return GF_OK;
12269
0
  case 1:
12270
0
    info->name = "length";
12271
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12272
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
12273
0
    info->far_ptr = & ((X_Text *) node)->length;
12274
0
    return GF_OK;
12275
0
  case 2:
12276
0
    info->name = "fontStyle";
12277
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12278
0
    info->fieldType = GF_SG_VRML_SFNODE;
12279
0
    info->NDTtype = NDT_SFFontStyleNode;
12280
0
    info->far_ptr = & ((X_Text *)node)->fontStyle;
12281
0
    return GF_OK;
12282
0
  case 3:
12283
0
    info->name = "maxExtent";
12284
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12285
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
12286
0
    info->far_ptr = & ((X_Text *) node)->maxExtent;
12287
0
    return GF_OK;
12288
0
  case 4:
12289
0
    info->name = "metadata";
12290
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12291
0
    info->fieldType = GF_SG_VRML_SFNODE;
12292
0
    info->NDTtype = NDT_SFMetadataNode;
12293
0
    info->far_ptr = & ((X_Text *)node)->metadata;
12294
0
    return GF_OK;
12295
0
  default:
12296
0
    return GF_BAD_PARAM;
12297
0
  }
12298
0
}
12299
12300
12301
static s32 Text_get_field_index_by_name(char *name)
12302
0
{
12303
0
  if (!strcmp("string", name)) return 0;
12304
0
  if (!strcmp("length", name)) return 1;
12305
0
  if (!strcmp("fontStyle", name)) return 2;
12306
0
  if (!strcmp("maxExtent", name)) return 3;
12307
0
  if (!strcmp("metadata", name)) return 4;
12308
0
  return -1;
12309
0
}
12310
12311
12312
static GF_Node *Text_Create()
12313
0
{
12314
0
  X_Text *p;
12315
0
  GF_SAFEALLOC(p, X_Text);
12316
0
  if(!p) return NULL;
12317
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Text);
12318
12319
  /*default field values*/
12320
0
  p->maxExtent = FLT2FIX(0.0);
12321
0
  return (GF_Node *)p;
12322
0
}
12323
12324
12325
/*
12326
  TextureBackground Node deletion
12327
*/
12328
12329
static void TextureBackground_Del(GF_Node *node)
12330
0
{
12331
0
  X_TextureBackground *p = (X_TextureBackground *) node;
12332
0
  gf_sg_mffloat_del(p->groundAngle);
12333
0
  gf_sg_mfcolor_del(p->groundColor);
12334
0
  gf_node_unregister((GF_Node *) p->backTexture, node);
12335
0
  gf_node_unregister((GF_Node *) p->bottomTexture, node);
12336
0
  gf_node_unregister((GF_Node *) p->frontTexture, node);
12337
0
  gf_node_unregister((GF_Node *) p->leftTexture, node);
12338
0
  gf_node_unregister((GF_Node *) p->rightTexture, node);
12339
0
  gf_node_unregister((GF_Node *) p->topTexture, node);
12340
0
  gf_sg_mffloat_del(p->skyAngle);
12341
0
  gf_sg_mfcolor_del(p->skyColor);
12342
0
  gf_sg_mffloat_del(p->transparency);
12343
0
  gf_node_unregister((GF_Node *) p->metadata, node);
12344
0
  gf_node_free((GF_Node *)p);
12345
0
}
12346
12347
12348
static u32 TextureBackground_get_field_count(GF_Node *node, u8 dummy)
12349
0
{
12350
0
  return 15;
12351
0
}
12352
12353
static GF_Err TextureBackground_get_field(GF_Node *node, GF_FieldInfo *info)
12354
0
{
12355
0
  switch (info->fieldIndex) {
12356
0
  case 0:
12357
0
    info->name = "set_bind";
12358
0
    info->eventType = GF_SG_EVENT_IN;
12359
0
    info->on_event_in = ((X_TextureBackground *)node)->on_set_bind;
12360
0
    info->fieldType = GF_SG_VRML_SFBOOL;
12361
0
    info->far_ptr = & ((X_TextureBackground *) node)->set_bind;
12362
0
    return GF_OK;
12363
0
  case 1:
12364
0
    info->name = "groundAngle";
12365
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12366
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
12367
0
    info->far_ptr = & ((X_TextureBackground *) node)->groundAngle;
12368
0
    return GF_OK;
12369
0
  case 2:
12370
0
    info->name = "groundColor";
12371
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12372
0
    info->fieldType = GF_SG_VRML_MFCOLOR;
12373
0
    info->far_ptr = & ((X_TextureBackground *) node)->groundColor;
12374
0
    return GF_OK;
12375
0
  case 3:
12376
0
    info->name = "backTexture";
12377
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12378
0
    info->fieldType = GF_SG_VRML_SFNODE;
12379
0
    info->NDTtype = NDT_SFTextureNode;
12380
0
    info->far_ptr = & ((X_TextureBackground *)node)->backTexture;
12381
0
    return GF_OK;
12382
0
  case 4:
12383
0
    info->name = "bottomTexture";
12384
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12385
0
    info->fieldType = GF_SG_VRML_SFNODE;
12386
0
    info->NDTtype = NDT_SFTextureNode;
12387
0
    info->far_ptr = & ((X_TextureBackground *)node)->bottomTexture;
12388
0
    return GF_OK;
12389
0
  case 5:
12390
0
    info->name = "frontTexture";
12391
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12392
0
    info->fieldType = GF_SG_VRML_SFNODE;
12393
0
    info->NDTtype = NDT_SFTextureNode;
12394
0
    info->far_ptr = & ((X_TextureBackground *)node)->frontTexture;
12395
0
    return GF_OK;
12396
0
  case 6:
12397
0
    info->name = "leftTexture";
12398
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12399
0
    info->fieldType = GF_SG_VRML_SFNODE;
12400
0
    info->NDTtype = NDT_SFTextureNode;
12401
0
    info->far_ptr = & ((X_TextureBackground *)node)->leftTexture;
12402
0
    return GF_OK;
12403
0
  case 7:
12404
0
    info->name = "rightTexture";
12405
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12406
0
    info->fieldType = GF_SG_VRML_SFNODE;
12407
0
    info->NDTtype = NDT_SFTextureNode;
12408
0
    info->far_ptr = & ((X_TextureBackground *)node)->rightTexture;
12409
0
    return GF_OK;
12410
0
  case 8:
12411
0
    info->name = "topTexture";
12412
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12413
0
    info->fieldType = GF_SG_VRML_SFNODE;
12414
0
    info->NDTtype = NDT_SFTextureNode;
12415
0
    info->far_ptr = & ((X_TextureBackground *)node)->topTexture;
12416
0
    return GF_OK;
12417
0
  case 9:
12418
0
    info->name = "skyAngle";
12419
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12420
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
12421
0
    info->far_ptr = & ((X_TextureBackground *) node)->skyAngle;
12422
0
    return GF_OK;
12423
0
  case 10:
12424
0
    info->name = "skyColor";
12425
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12426
0
    info->fieldType = GF_SG_VRML_MFCOLOR;
12427
0
    info->far_ptr = & ((X_TextureBackground *) node)->skyColor;
12428
0
    return GF_OK;
12429
0
  case 11:
12430
0
    info->name = "transparency";
12431
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12432
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
12433
0
    info->far_ptr = & ((X_TextureBackground *) node)->transparency;
12434
0
    return GF_OK;
12435
0
  case 12:
12436
0
    info->name = "bindTime";
12437
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12438
0
    info->fieldType = GF_SG_VRML_SFTIME;
12439
0
    info->far_ptr = & ((X_TextureBackground *) node)->bindTime;
12440
0
    return GF_OK;
12441
0
  case 13:
12442
0
    info->name = "isBound";
12443
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12444
0
    info->fieldType = GF_SG_VRML_SFBOOL;
12445
0
    info->far_ptr = & ((X_TextureBackground *) node)->isBound;
12446
0
    return GF_OK;
12447
0
  case 14:
12448
0
    info->name = "metadata";
12449
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12450
0
    info->fieldType = GF_SG_VRML_SFNODE;
12451
0
    info->NDTtype = NDT_SFMetadataNode;
12452
0
    info->far_ptr = & ((X_TextureBackground *)node)->metadata;
12453
0
    return GF_OK;
12454
0
  default:
12455
0
    return GF_BAD_PARAM;
12456
0
  }
12457
0
}
12458
12459
12460
static s32 TextureBackground_get_field_index_by_name(char *name)
12461
0
{
12462
0
  if (!strcmp("set_bind", name)) return 0;
12463
0
  if (!strcmp("groundAngle", name)) return 1;
12464
0
  if (!strcmp("groundColor", name)) return 2;
12465
0
  if (!strcmp("backTexture", name)) return 3;
12466
0
  if (!strcmp("bottomTexture", name)) return 4;
12467
0
  if (!strcmp("frontTexture", name)) return 5;
12468
0
  if (!strcmp("leftTexture", name)) return 6;
12469
0
  if (!strcmp("rightTexture", name)) return 7;
12470
0
  if (!strcmp("topTexture", name)) return 8;
12471
0
  if (!strcmp("skyAngle", name)) return 9;
12472
0
  if (!strcmp("skyColor", name)) return 10;
12473
0
  if (!strcmp("transparency", name)) return 11;
12474
0
  if (!strcmp("bindTime", name)) return 12;
12475
0
  if (!strcmp("isBound", name)) return 13;
12476
0
  if (!strcmp("metadata", name)) return 14;
12477
0
  return -1;
12478
0
}
12479
12480
12481
static GF_Node *TextureBackground_Create()
12482
0
{
12483
0
  X_TextureBackground *p;
12484
0
  GF_SAFEALLOC(p, X_TextureBackground);
12485
0
  if(!p) return NULL;
12486
0
  gf_node_setup((GF_Node *)p, TAG_X3D_TextureBackground);
12487
12488
  /*default field values*/
12489
0
  p->skyColor.vals = (SFColor*)gf_malloc(sizeof(SFColor)*1);
12490
0
  p->skyColor.count = 1;
12491
0
  p->skyColor.vals[0].red = FLT2FIX(0);
12492
0
  p->skyColor.vals[0].green = FLT2FIX(0);
12493
0
  p->skyColor.vals[0].blue = FLT2FIX(0);
12494
0
  p->transparency.vals = (SFFloat *)gf_malloc(sizeof(SFFloat)*1);
12495
0
  p->transparency.count = 1;
12496
0
  p->transparency.vals[0] = FLT2FIX(0);
12497
0
  return (GF_Node *)p;
12498
0
}
12499
12500
12501
/*
12502
  TextureCoordinate Node deletion
12503
*/
12504
12505
static void TextureCoordinate_Del(GF_Node *node)
12506
0
{
12507
0
  X_TextureCoordinate *p = (X_TextureCoordinate *) node;
12508
0
  gf_sg_mfvec2f_del(p->point);
12509
0
  gf_node_unregister((GF_Node *) p->metadata, node);
12510
0
  gf_node_free((GF_Node *)p);
12511
0
}
12512
12513
12514
static u32 TextureCoordinate_get_field_count(GF_Node *node, u8 dummy)
12515
0
{
12516
0
  return 2;
12517
0
}
12518
12519
static GF_Err TextureCoordinate_get_field(GF_Node *node, GF_FieldInfo *info)
12520
0
{
12521
0
  switch (info->fieldIndex) {
12522
0
  case 0:
12523
0
    info->name = "point";
12524
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12525
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
12526
0
    info->far_ptr = & ((X_TextureCoordinate *) node)->point;
12527
0
    return GF_OK;
12528
0
  case 1:
12529
0
    info->name = "metadata";
12530
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12531
0
    info->fieldType = GF_SG_VRML_SFNODE;
12532
0
    info->NDTtype = NDT_SFMetadataNode;
12533
0
    info->far_ptr = & ((X_TextureCoordinate *)node)->metadata;
12534
0
    return GF_OK;
12535
0
  default:
12536
0
    return GF_BAD_PARAM;
12537
0
  }
12538
0
}
12539
12540
12541
static s32 TextureCoordinate_get_field_index_by_name(char *name)
12542
0
{
12543
0
  if (!strcmp("point", name)) return 0;
12544
0
  if (!strcmp("metadata", name)) return 1;
12545
0
  return -1;
12546
0
}
12547
12548
12549
static GF_Node *TextureCoordinate_Create()
12550
0
{
12551
0
  X_TextureCoordinate *p;
12552
0
  GF_SAFEALLOC(p, X_TextureCoordinate);
12553
0
  if(!p) return NULL;
12554
0
  gf_node_setup((GF_Node *)p, TAG_X3D_TextureCoordinate);
12555
12556
  /*default field values*/
12557
0
  return (GF_Node *)p;
12558
0
}
12559
12560
12561
/*
12562
  TextureCoordinateGenerator Node deletion
12563
*/
12564
12565
static void TextureCoordinateGenerator_Del(GF_Node *node)
12566
0
{
12567
0
  X_TextureCoordinateGenerator *p = (X_TextureCoordinateGenerator *) node;
12568
0
  gf_sg_sfstring_del(p->mode);
12569
0
  gf_sg_mffloat_del(p->parameter);
12570
0
  gf_node_unregister((GF_Node *) p->metadata, node);
12571
0
  gf_node_free((GF_Node *)p);
12572
0
}
12573
12574
12575
static u32 TextureCoordinateGenerator_get_field_count(GF_Node *node, u8 dummy)
12576
0
{
12577
0
  return 3;
12578
0
}
12579
12580
static GF_Err TextureCoordinateGenerator_get_field(GF_Node *node, GF_FieldInfo *info)
12581
0
{
12582
0
  switch (info->fieldIndex) {
12583
0
  case 0:
12584
0
    info->name = "mode";
12585
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12586
0
    info->fieldType = GF_SG_VRML_SFSTRING;
12587
0
    info->far_ptr = & ((X_TextureCoordinateGenerator *) node)->mode;
12588
0
    return GF_OK;
12589
0
  case 1:
12590
0
    info->name = "parameter";
12591
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12592
0
    info->fieldType = GF_SG_VRML_MFFLOAT;
12593
0
    info->far_ptr = & ((X_TextureCoordinateGenerator *) node)->parameter;
12594
0
    return GF_OK;
12595
0
  case 2:
12596
0
    info->name = "metadata";
12597
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12598
0
    info->fieldType = GF_SG_VRML_SFNODE;
12599
0
    info->NDTtype = NDT_SFMetadataNode;
12600
0
    info->far_ptr = & ((X_TextureCoordinateGenerator *)node)->metadata;
12601
0
    return GF_OK;
12602
0
  default:
12603
0
    return GF_BAD_PARAM;
12604
0
  }
12605
0
}
12606
12607
12608
static s32 TextureCoordinateGenerator_get_field_index_by_name(char *name)
12609
0
{
12610
0
  if (!strcmp("mode", name)) return 0;
12611
0
  if (!strcmp("parameter", name)) return 1;
12612
0
  if (!strcmp("metadata", name)) return 2;
12613
0
  return -1;
12614
0
}
12615
12616
12617
static GF_Node *TextureCoordinateGenerator_Create()
12618
0
{
12619
0
  X_TextureCoordinateGenerator *p;
12620
0
  GF_SAFEALLOC(p, X_TextureCoordinateGenerator);
12621
0
  if(!p) return NULL;
12622
0
  gf_node_setup((GF_Node *)p, TAG_X3D_TextureCoordinateGenerator);
12623
12624
  /*default field values*/
12625
0
  p->mode.buffer = (char*) gf_malloc(sizeof(char) * 7);
12626
0
  strcpy(p->mode.buffer, "SPHERE");
12627
0
  return (GF_Node *)p;
12628
0
}
12629
12630
12631
/*
12632
  TextureTransform Node deletion
12633
*/
12634
12635
static void TextureTransform_Del(GF_Node *node)
12636
0
{
12637
0
  X_TextureTransform *p = (X_TextureTransform *) node;
12638
0
  gf_node_unregister((GF_Node *) p->metadata, node);
12639
0
  gf_node_free((GF_Node *)p);
12640
0
}
12641
12642
12643
static u32 TextureTransform_get_field_count(GF_Node *node, u8 dummy)
12644
0
{
12645
0
  return 5;
12646
0
}
12647
12648
static GF_Err TextureTransform_get_field(GF_Node *node, GF_FieldInfo *info)
12649
0
{
12650
0
  switch (info->fieldIndex) {
12651
0
  case 0:
12652
0
    info->name = "center";
12653
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12654
0
    info->fieldType = GF_SG_VRML_SFVEC2F;
12655
0
    info->far_ptr = & ((X_TextureTransform *) node)->center;
12656
0
    return GF_OK;
12657
0
  case 1:
12658
0
    info->name = "rotation";
12659
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12660
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
12661
0
    info->far_ptr = & ((X_TextureTransform *) node)->rotation;
12662
0
    return GF_OK;
12663
0
  case 2:
12664
0
    info->name = "scale";
12665
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12666
0
    info->fieldType = GF_SG_VRML_SFVEC2F;
12667
0
    info->far_ptr = & ((X_TextureTransform *) node)->scale;
12668
0
    return GF_OK;
12669
0
  case 3:
12670
0
    info->name = "translation";
12671
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12672
0
    info->fieldType = GF_SG_VRML_SFVEC2F;
12673
0
    info->far_ptr = & ((X_TextureTransform *) node)->translation;
12674
0
    return GF_OK;
12675
0
  case 4:
12676
0
    info->name = "metadata";
12677
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12678
0
    info->fieldType = GF_SG_VRML_SFNODE;
12679
0
    info->NDTtype = NDT_SFMetadataNode;
12680
0
    info->far_ptr = & ((X_TextureTransform *)node)->metadata;
12681
0
    return GF_OK;
12682
0
  default:
12683
0
    return GF_BAD_PARAM;
12684
0
  }
12685
0
}
12686
12687
12688
static s32 TextureTransform_get_field_index_by_name(char *name)
12689
0
{
12690
0
  if (!strcmp("center", name)) return 0;
12691
0
  if (!strcmp("rotation", name)) return 1;
12692
0
  if (!strcmp("scale", name)) return 2;
12693
0
  if (!strcmp("translation", name)) return 3;
12694
0
  if (!strcmp("metadata", name)) return 4;
12695
0
  return -1;
12696
0
}
12697
12698
12699
static GF_Node *TextureTransform_Create()
12700
0
{
12701
0
  X_TextureTransform *p;
12702
0
  GF_SAFEALLOC(p, X_TextureTransform);
12703
0
  if(!p) return NULL;
12704
0
  gf_node_setup((GF_Node *)p, TAG_X3D_TextureTransform);
12705
12706
  /*default field values*/
12707
0
  p->center.x = FLT2FIX(0);
12708
0
  p->center.y = FLT2FIX(0);
12709
0
  p->rotation = FLT2FIX(0);
12710
0
  p->scale.x = FLT2FIX(1);
12711
0
  p->scale.y = FLT2FIX(1);
12712
0
  p->translation.x = FLT2FIX(0);
12713
0
  p->translation.y = FLT2FIX(0);
12714
0
  return (GF_Node *)p;
12715
0
}
12716
12717
12718
/*
12719
  TimeSensor Node deletion
12720
*/
12721
12722
static void TimeSensor_Del(GF_Node *node)
12723
0
{
12724
0
  X_TimeSensor *p = (X_TimeSensor *) node;
12725
0
  gf_node_unregister((GF_Node *) p->metadata, node);
12726
0
  gf_node_free((GF_Node *)p);
12727
0
}
12728
12729
12730
static u32 TimeSensor_get_field_count(GF_Node *node, u8 dummy)
12731
0
{
12732
0
  return 14;
12733
0
}
12734
12735
static GF_Err TimeSensor_get_field(GF_Node *node, GF_FieldInfo *info)
12736
0
{
12737
0
  switch (info->fieldIndex) {
12738
0
  case 0:
12739
0
    info->name = "cycleInterval";
12740
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12741
0
    info->fieldType = GF_SG_VRML_SFTIME;
12742
0
    info->far_ptr = & ((X_TimeSensor *) node)->cycleInterval;
12743
0
    return GF_OK;
12744
0
  case 1:
12745
0
    info->name = "enabled";
12746
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12747
0
    info->fieldType = GF_SG_VRML_SFBOOL;
12748
0
    info->far_ptr = & ((X_TimeSensor *) node)->enabled;
12749
0
    return GF_OK;
12750
0
  case 2:
12751
0
    info->name = "loop";
12752
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12753
0
    info->fieldType = GF_SG_VRML_SFBOOL;
12754
0
    info->far_ptr = & ((X_TimeSensor *) node)->loop;
12755
0
    return GF_OK;
12756
0
  case 3:
12757
0
    info->name = "startTime";
12758
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12759
0
    info->fieldType = GF_SG_VRML_SFTIME;
12760
0
    info->far_ptr = & ((X_TimeSensor *) node)->startTime;
12761
0
    return GF_OK;
12762
0
  case 4:
12763
0
    info->name = "stopTime";
12764
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12765
0
    info->fieldType = GF_SG_VRML_SFTIME;
12766
0
    info->far_ptr = & ((X_TimeSensor *) node)->stopTime;
12767
0
    return GF_OK;
12768
0
  case 5:
12769
0
    info->name = "cycleTime";
12770
0
    info->eventType = GF_SG_EVENT_OUT;
12771
0
    info->fieldType = GF_SG_VRML_SFTIME;
12772
0
    info->far_ptr = & ((X_TimeSensor *) node)->cycleTime;
12773
0
    return GF_OK;
12774
0
  case 6:
12775
0
    info->name = "fraction_changed";
12776
0
    info->eventType = GF_SG_EVENT_OUT;
12777
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
12778
0
    info->far_ptr = & ((X_TimeSensor *) node)->fraction_changed;
12779
0
    return GF_OK;
12780
0
  case 7:
12781
0
    info->name = "isActive";
12782
0
    info->eventType = GF_SG_EVENT_OUT;
12783
0
    info->fieldType = GF_SG_VRML_SFBOOL;
12784
0
    info->far_ptr = & ((X_TimeSensor *) node)->isActive;
12785
0
    return GF_OK;
12786
0
  case 8:
12787
0
    info->name = "time";
12788
0
    info->eventType = GF_SG_EVENT_OUT;
12789
0
    info->fieldType = GF_SG_VRML_SFTIME;
12790
0
    info->far_ptr = & ((X_TimeSensor *) node)->time;
12791
0
    return GF_OK;
12792
0
  case 9:
12793
0
    info->name = "metadata";
12794
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12795
0
    info->fieldType = GF_SG_VRML_SFNODE;
12796
0
    info->NDTtype = NDT_SFMetadataNode;
12797
0
    info->far_ptr = & ((X_TimeSensor *)node)->metadata;
12798
0
    return GF_OK;
12799
0
  case 10:
12800
0
    info->name = "pauseTime";
12801
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12802
0
    info->fieldType = GF_SG_VRML_SFTIME;
12803
0
    info->far_ptr = & ((X_TimeSensor *) node)->pauseTime;
12804
0
    return GF_OK;
12805
0
  case 11:
12806
0
    info->name = "resumeTime";
12807
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12808
0
    info->fieldType = GF_SG_VRML_SFTIME;
12809
0
    info->far_ptr = & ((X_TimeSensor *) node)->resumeTime;
12810
0
    return GF_OK;
12811
0
  case 12:
12812
0
    info->name = "elapsedTime";
12813
0
    info->eventType = GF_SG_EVENT_OUT;
12814
0
    info->fieldType = GF_SG_VRML_SFTIME;
12815
0
    info->far_ptr = & ((X_TimeSensor *) node)->elapsedTime;
12816
0
    return GF_OK;
12817
0
  case 13:
12818
0
    info->name = "isPaused";
12819
0
    info->eventType = GF_SG_EVENT_OUT;
12820
0
    info->fieldType = GF_SG_VRML_SFBOOL;
12821
0
    info->far_ptr = & ((X_TimeSensor *) node)->isPaused;
12822
0
    return GF_OK;
12823
0
  default:
12824
0
    return GF_BAD_PARAM;
12825
0
  }
12826
0
}
12827
12828
12829
static s32 TimeSensor_get_field_index_by_name(char *name)
12830
0
{
12831
0
  if (!strcmp("cycleInterval", name)) return 0;
12832
0
  if (!strcmp("enabled", name)) return 1;
12833
0
  if (!strcmp("loop", name)) return 2;
12834
0
  if (!strcmp("startTime", name)) return 3;
12835
0
  if (!strcmp("stopTime", name)) return 4;
12836
0
  if (!strcmp("cycleTime", name)) return 5;
12837
0
  if (!strcmp("fraction_changed", name)) return 6;
12838
0
  if (!strcmp("isActive", name)) return 7;
12839
0
  if (!strcmp("time", name)) return 8;
12840
0
  if (!strcmp("metadata", name)) return 9;
12841
0
  if (!strcmp("pauseTime", name)) return 10;
12842
0
  if (!strcmp("resumeTime", name)) return 11;
12843
0
  if (!strcmp("elapsedTime", name)) return 12;
12844
0
  if (!strcmp("isPaused", name)) return 13;
12845
0
  return -1;
12846
0
}
12847
12848
12849
static GF_Node *TimeSensor_Create()
12850
0
{
12851
0
  X_TimeSensor *p;
12852
0
  GF_SAFEALLOC(p, X_TimeSensor);
12853
0
  if(!p) return NULL;
12854
0
  gf_node_setup((GF_Node *)p, TAG_X3D_TimeSensor);
12855
12856
  /*default field values*/
12857
0
  p->cycleInterval = 1;
12858
0
  p->enabled = 1;
12859
0
  p->startTime = 0;
12860
0
  p->stopTime = 0;
12861
0
  p->pauseTime = 0;
12862
0
  p->resumeTime = 0;
12863
0
  return (GF_Node *)p;
12864
0
}
12865
12866
12867
/*
12868
  TimeTrigger Node deletion
12869
*/
12870
12871
static void TimeTrigger_Del(GF_Node *node)
12872
0
{
12873
0
  X_TimeTrigger *p = (X_TimeTrigger *) node;
12874
0
  gf_node_unregister((GF_Node *) p->metadata, node);
12875
0
  gf_node_free((GF_Node *)p);
12876
0
}
12877
12878
12879
static u32 TimeTrigger_get_field_count(GF_Node *node, u8 dummy)
12880
0
{
12881
0
  return 3;
12882
0
}
12883
12884
static GF_Err TimeTrigger_get_field(GF_Node *node, GF_FieldInfo *info)
12885
0
{
12886
0
  switch (info->fieldIndex) {
12887
0
  case 0:
12888
0
    info->name = "set_boolean";
12889
0
    info->eventType = GF_SG_EVENT_IN;
12890
0
    info->on_event_in = ((X_TimeTrigger *)node)->on_set_boolean;
12891
0
    info->fieldType = GF_SG_VRML_SFBOOL;
12892
0
    info->far_ptr = & ((X_TimeTrigger *) node)->set_boolean;
12893
0
    return GF_OK;
12894
0
  case 1:
12895
0
    info->name = "triggerTime";
12896
0
    info->eventType = GF_SG_EVENT_OUT;
12897
0
    info->fieldType = GF_SG_VRML_SFTIME;
12898
0
    info->far_ptr = & ((X_TimeTrigger *) node)->triggerTime;
12899
0
    return GF_OK;
12900
0
  case 2:
12901
0
    info->name = "metadata";
12902
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12903
0
    info->fieldType = GF_SG_VRML_SFNODE;
12904
0
    info->NDTtype = NDT_SFMetadataNode;
12905
0
    info->far_ptr = & ((X_TimeTrigger *)node)->metadata;
12906
0
    return GF_OK;
12907
0
  default:
12908
0
    return GF_BAD_PARAM;
12909
0
  }
12910
0
}
12911
12912
12913
static s32 TimeTrigger_get_field_index_by_name(char *name)
12914
0
{
12915
0
  if (!strcmp("set_boolean", name)) return 0;
12916
0
  if (!strcmp("triggerTime", name)) return 1;
12917
0
  if (!strcmp("metadata", name)) return 2;
12918
0
  return -1;
12919
0
}
12920
12921
12922
static GF_Node *TimeTrigger_Create()
12923
0
{
12924
0
  X_TimeTrigger *p;
12925
0
  GF_SAFEALLOC(p, X_TimeTrigger);
12926
0
  if(!p) return NULL;
12927
0
  gf_node_setup((GF_Node *)p, TAG_X3D_TimeTrigger);
12928
12929
  /*default field values*/
12930
0
  return (GF_Node *)p;
12931
0
}
12932
12933
12934
/*
12935
  TouchSensor Node deletion
12936
*/
12937
12938
static void TouchSensor_Del(GF_Node *node)
12939
0
{
12940
0
  X_TouchSensor *p = (X_TouchSensor *) node;
12941
0
  gf_node_unregister((GF_Node *) p->metadata, node);
12942
0
  gf_sg_sfstring_del(p->description);
12943
0
  gf_node_free((GF_Node *)p);
12944
0
}
12945
12946
12947
static u32 TouchSensor_get_field_count(GF_Node *node, u8 dummy)
12948
0
{
12949
0
  return 9;
12950
0
}
12951
12952
static GF_Err TouchSensor_get_field(GF_Node *node, GF_FieldInfo *info)
12953
0
{
12954
0
  switch (info->fieldIndex) {
12955
0
  case 0:
12956
0
    info->name = "enabled";
12957
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
12958
0
    info->fieldType = GF_SG_VRML_SFBOOL;
12959
0
    info->far_ptr = & ((X_TouchSensor *) node)->enabled;
12960
0
    return GF_OK;
12961
0
  case 1:
12962
0
    info->name = "hitNormal_changed";
12963
0
    info->eventType = GF_SG_EVENT_OUT;
12964
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
12965
0
    info->far_ptr = & ((X_TouchSensor *) node)->hitNormal_changed;
12966
0
    return GF_OK;
12967
0
  case 2:
12968
0
    info->name = "hitPoint_changed";
12969
0
    info->eventType = GF_SG_EVENT_OUT;
12970
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
12971
0
    info->far_ptr = & ((X_TouchSensor *) node)->hitPoint_changed;
12972
0
    return GF_OK;
12973
0
  case 3:
12974
0
    info->name = "hitTexCoord_changed";
12975
0
    info->eventType = GF_SG_EVENT_OUT;
12976
0
    info->fieldType = GF_SG_VRML_SFVEC2F;
12977
0
    info->far_ptr = & ((X_TouchSensor *) node)->hitTexCoord_changed;
12978
0
    return GF_OK;
12979
0
  case 4:
12980
0
    info->name = "isActive";
12981
0
    info->eventType = GF_SG_EVENT_OUT;
12982
0
    info->fieldType = GF_SG_VRML_SFBOOL;
12983
0
    info->far_ptr = & ((X_TouchSensor *) node)->isActive;
12984
0
    return GF_OK;
12985
0
  case 5:
12986
0
    info->name = "isOver";
12987
0
    info->eventType = GF_SG_EVENT_OUT;
12988
0
    info->fieldType = GF_SG_VRML_SFBOOL;
12989
0
    info->far_ptr = & ((X_TouchSensor *) node)->isOver;
12990
0
    return GF_OK;
12991
0
  case 6:
12992
0
    info->name = "touchTime";
12993
0
    info->eventType = GF_SG_EVENT_OUT;
12994
0
    info->fieldType = GF_SG_VRML_SFTIME;
12995
0
    info->far_ptr = & ((X_TouchSensor *) node)->touchTime;
12996
0
    return GF_OK;
12997
0
  case 7:
12998
0
    info->name = "metadata";
12999
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13000
0
    info->fieldType = GF_SG_VRML_SFNODE;
13001
0
    info->NDTtype = NDT_SFMetadataNode;
13002
0
    info->far_ptr = & ((X_TouchSensor *)node)->metadata;
13003
0
    return GF_OK;
13004
0
  case 8:
13005
0
    info->name = "description";
13006
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13007
0
    info->fieldType = GF_SG_VRML_SFSTRING;
13008
0
    info->far_ptr = & ((X_TouchSensor *) node)->description;
13009
0
    return GF_OK;
13010
0
  default:
13011
0
    return GF_BAD_PARAM;
13012
0
  }
13013
0
}
13014
13015
13016
static s32 TouchSensor_get_field_index_by_name(char *name)
13017
0
{
13018
0
  if (!strcmp("enabled", name)) return 0;
13019
0
  if (!strcmp("hitNormal_changed", name)) return 1;
13020
0
  if (!strcmp("hitPoint_changed", name)) return 2;
13021
0
  if (!strcmp("hitTexCoord_changed", name)) return 3;
13022
0
  if (!strcmp("isActive", name)) return 4;
13023
0
  if (!strcmp("isOver", name)) return 5;
13024
0
  if (!strcmp("touchTime", name)) return 6;
13025
0
  if (!strcmp("metadata", name)) return 7;
13026
0
  if (!strcmp("description", name)) return 8;
13027
0
  return -1;
13028
0
}
13029
13030
13031
static GF_Node *TouchSensor_Create()
13032
0
{
13033
0
  X_TouchSensor *p;
13034
0
  GF_SAFEALLOC(p, X_TouchSensor);
13035
0
  if(!p) return NULL;
13036
0
  gf_node_setup((GF_Node *)p, TAG_X3D_TouchSensor);
13037
13038
  /*default field values*/
13039
0
  p->enabled = 1;
13040
0
  return (GF_Node *)p;
13041
0
}
13042
13043
13044
/*
13045
  Transform Node deletion
13046
*/
13047
13048
static void Transform_Del(GF_Node *node)
13049
0
{
13050
0
  X_Transform *p = (X_Transform *) node;
13051
0
  gf_node_unregister((GF_Node *) p->metadata, node);
13052
0
  gf_sg_vrml_parent_destroy(node);
13053
0
  gf_node_free((GF_Node *)p);
13054
0
}
13055
13056
13057
static u32 Transform_get_field_count(GF_Node *node, u8 dummy)
13058
0
{
13059
0
  return 9;
13060
0
}
13061
13062
static GF_Err Transform_get_field(GF_Node *node, GF_FieldInfo *info)
13063
0
{
13064
0
  switch (info->fieldIndex) {
13065
0
  case 0:
13066
0
    info->name = "addChildren";
13067
0
    info->eventType = GF_SG_EVENT_IN;
13068
0
    info->on_event_in = ((X_Transform *)node)->on_addChildren;
13069
0
    info->fieldType = GF_SG_VRML_MFNODE;
13070
0
    info->NDTtype = NDT_SF3DNode;
13071
0
    info->far_ptr = & ((X_Transform *)node)->addChildren;
13072
0
    return GF_OK;
13073
0
  case 1:
13074
0
    info->name = "removeChildren";
13075
0
    info->eventType = GF_SG_EVENT_IN;
13076
0
    info->on_event_in = ((X_Transform *)node)->on_removeChildren;
13077
0
    info->fieldType = GF_SG_VRML_MFNODE;
13078
0
    info->NDTtype = NDT_SF3DNode;
13079
0
    info->far_ptr = & ((X_Transform *)node)->removeChildren;
13080
0
    return GF_OK;
13081
0
  case 2:
13082
0
    info->name = "center";
13083
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13084
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
13085
0
    info->far_ptr = & ((X_Transform *) node)->center;
13086
0
    return GF_OK;
13087
0
  case 3:
13088
0
    info->name = "children";
13089
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13090
0
    info->fieldType = GF_SG_VRML_MFNODE;
13091
0
    info->NDTtype = NDT_SF3DNode;
13092
0
    info->far_ptr = & ((X_Transform *)node)->children;
13093
0
    return GF_OK;
13094
0
  case 4:
13095
0
    info->name = "rotation";
13096
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13097
0
    info->fieldType = GF_SG_VRML_SFROTATION;
13098
0
    info->far_ptr = & ((X_Transform *) node)->rotation;
13099
0
    return GF_OK;
13100
0
  case 5:
13101
0
    info->name = "scale";
13102
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13103
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
13104
0
    info->far_ptr = & ((X_Transform *) node)->scale;
13105
0
    return GF_OK;
13106
0
  case 6:
13107
0
    info->name = "scaleOrientation";
13108
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13109
0
    info->fieldType = GF_SG_VRML_SFROTATION;
13110
0
    info->far_ptr = & ((X_Transform *) node)->scaleOrientation;
13111
0
    return GF_OK;
13112
0
  case 7:
13113
0
    info->name = "translation";
13114
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13115
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
13116
0
    info->far_ptr = & ((X_Transform *) node)->translation;
13117
0
    return GF_OK;
13118
0
  case 8:
13119
0
    info->name = "metadata";
13120
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13121
0
    info->fieldType = GF_SG_VRML_SFNODE;
13122
0
    info->NDTtype = NDT_SFMetadataNode;
13123
0
    info->far_ptr = & ((X_Transform *)node)->metadata;
13124
0
    return GF_OK;
13125
0
  default:
13126
0
    return GF_BAD_PARAM;
13127
0
  }
13128
0
}
13129
13130
13131
static s32 Transform_get_field_index_by_name(char *name)
13132
0
{
13133
0
  if (!strcmp("addChildren", name)) return 0;
13134
0
  if (!strcmp("removeChildren", name)) return 1;
13135
0
  if (!strcmp("center", name)) return 2;
13136
0
  if (!strcmp("children", name)) return 3;
13137
0
  if (!strcmp("rotation", name)) return 4;
13138
0
  if (!strcmp("scale", name)) return 5;
13139
0
  if (!strcmp("scaleOrientation", name)) return 6;
13140
0
  if (!strcmp("translation", name)) return 7;
13141
0
  if (!strcmp("metadata", name)) return 8;
13142
0
  return -1;
13143
0
}
13144
13145
13146
static GF_Node *Transform_Create()
13147
0
{
13148
0
  X_Transform *p;
13149
0
  GF_SAFEALLOC(p, X_Transform);
13150
0
  if(!p) return NULL;
13151
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Transform);
13152
0
  gf_sg_vrml_parent_setup((GF_Node *) p);
13153
13154
  /*default field values*/
13155
0
  p->center.x = FLT2FIX(0);
13156
0
  p->center.y = FLT2FIX(0);
13157
0
  p->center.z = FLT2FIX(0);
13158
0
  p->rotation.x = FLT2FIX(0);
13159
0
  p->rotation.y = FLT2FIX(0);
13160
0
  p->rotation.z = FLT2FIX(1);
13161
0
  p->rotation.q = FLT2FIX(0);
13162
0
  p->scale.x = FLT2FIX(1);
13163
0
  p->scale.y = FLT2FIX(1);
13164
0
  p->scale.z = FLT2FIX(1);
13165
0
  p->scaleOrientation.x = FLT2FIX(0);
13166
0
  p->scaleOrientation.y = FLT2FIX(0);
13167
0
  p->scaleOrientation.z = FLT2FIX(1);
13168
0
  p->scaleOrientation.q = FLT2FIX(0);
13169
0
  p->translation.x = FLT2FIX(0);
13170
0
  p->translation.y = FLT2FIX(0);
13171
0
  p->translation.z = FLT2FIX(0);
13172
0
  return (GF_Node *)p;
13173
0
}
13174
13175
13176
/*
13177
  TransmitterPdu Node deletion
13178
*/
13179
13180
static void TransmitterPdu_Del(GF_Node *node)
13181
0
{
13182
0
  X_TransmitterPdu *p = (X_TransmitterPdu *) node;
13183
0
  gf_sg_sfstring_del(p->address);
13184
0
  gf_sg_sfstring_del(p->multicastRelayHost);
13185
0
  gf_sg_sfstring_del(p->networkMode);
13186
0
  gf_node_unregister((GF_Node *) p->metadata, node);
13187
0
  gf_node_free((GF_Node *)p);
13188
0
}
13189
13190
13191
static u32 TransmitterPdu_get_field_count(GF_Node *node, u8 dummy)
13192
0
{
13193
0
  return 42;
13194
0
}
13195
13196
static GF_Err TransmitterPdu_get_field(GF_Node *node, GF_FieldInfo *info)
13197
0
{
13198
0
  switch (info->fieldIndex) {
13199
0
  case 0:
13200
0
    info->name = "address";
13201
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13202
0
    info->fieldType = GF_SG_VRML_SFSTRING;
13203
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->address;
13204
0
    return GF_OK;
13205
0
  case 1:
13206
0
    info->name = "antennaLocation";
13207
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13208
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
13209
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->antennaLocation;
13210
0
    return GF_OK;
13211
0
  case 2:
13212
0
    info->name = "antennaPatternLength";
13213
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13214
0
    info->fieldType = GF_SG_VRML_SFINT32;
13215
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->antennaPatternLength;
13216
0
    return GF_OK;
13217
0
  case 3:
13218
0
    info->name = "antennaPatternType";
13219
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13220
0
    info->fieldType = GF_SG_VRML_SFINT32;
13221
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->antennaPatternType;
13222
0
    return GF_OK;
13223
0
  case 4:
13224
0
    info->name = "applicationID";
13225
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13226
0
    info->fieldType = GF_SG_VRML_SFINT32;
13227
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->applicationID;
13228
0
    return GF_OK;
13229
0
  case 5:
13230
0
    info->name = "cryptoKeyID";
13231
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13232
0
    info->fieldType = GF_SG_VRML_SFINT32;
13233
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->cryptoKeyID;
13234
0
    return GF_OK;
13235
0
  case 6:
13236
0
    info->name = "cryptoSystem";
13237
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13238
0
    info->fieldType = GF_SG_VRML_SFINT32;
13239
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->cryptoSystem;
13240
0
    return GF_OK;
13241
0
  case 7:
13242
0
    info->name = "entityID";
13243
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13244
0
    info->fieldType = GF_SG_VRML_SFINT32;
13245
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->entityID;
13246
0
    return GF_OK;
13247
0
  case 8:
13248
0
    info->name = "frequency";
13249
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13250
0
    info->fieldType = GF_SG_VRML_SFINT32;
13251
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->frequency;
13252
0
    return GF_OK;
13253
0
  case 9:
13254
0
    info->name = "inputSource";
13255
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13256
0
    info->fieldType = GF_SG_VRML_SFINT32;
13257
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->inputSource;
13258
0
    return GF_OK;
13259
0
  case 10:
13260
0
    info->name = "lengthOfModulationParameters";
13261
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13262
0
    info->fieldType = GF_SG_VRML_SFINT32;
13263
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->lengthOfModulationParameters;
13264
0
    return GF_OK;
13265
0
  case 11:
13266
0
    info->name = "modulationTypeDetail";
13267
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13268
0
    info->fieldType = GF_SG_VRML_SFINT32;
13269
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->modulationTypeDetail;
13270
0
    return GF_OK;
13271
0
  case 12:
13272
0
    info->name = "modulationTypeMajor";
13273
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13274
0
    info->fieldType = GF_SG_VRML_SFINT32;
13275
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->modulationTypeMajor;
13276
0
    return GF_OK;
13277
0
  case 13:
13278
0
    info->name = "modulationTypeSpreadSpectrum";
13279
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13280
0
    info->fieldType = GF_SG_VRML_SFINT32;
13281
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->modulationTypeSpreadSpectrum;
13282
0
    return GF_OK;
13283
0
  case 14:
13284
0
    info->name = "modulationTypeSystem";
13285
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13286
0
    info->fieldType = GF_SG_VRML_SFINT32;
13287
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->modulationTypeSystem;
13288
0
    return GF_OK;
13289
0
  case 15:
13290
0
    info->name = "multicastRelayHost";
13291
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13292
0
    info->fieldType = GF_SG_VRML_SFSTRING;
13293
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->multicastRelayHost;
13294
0
    return GF_OK;
13295
0
  case 16:
13296
0
    info->name = "multicastRelayPort";
13297
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13298
0
    info->fieldType = GF_SG_VRML_SFINT32;
13299
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->multicastRelayPort;
13300
0
    return GF_OK;
13301
0
  case 17:
13302
0
    info->name = "networkMode";
13303
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13304
0
    info->fieldType = GF_SG_VRML_SFSTRING;
13305
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->networkMode;
13306
0
    return GF_OK;
13307
0
  case 18:
13308
0
    info->name = "port";
13309
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13310
0
    info->fieldType = GF_SG_VRML_SFINT32;
13311
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->port;
13312
0
    return GF_OK;
13313
0
  case 19:
13314
0
    info->name = "power";
13315
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13316
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
13317
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->power;
13318
0
    return GF_OK;
13319
0
  case 20:
13320
0
    info->name = "radioEntityTypeCategory";
13321
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13322
0
    info->fieldType = GF_SG_VRML_SFINT32;
13323
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->radioEntityTypeCategory;
13324
0
    return GF_OK;
13325
0
  case 21:
13326
0
    info->name = "radioEntityTypeCountry";
13327
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13328
0
    info->fieldType = GF_SG_VRML_SFINT32;
13329
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->radioEntityTypeCountry;
13330
0
    return GF_OK;
13331
0
  case 22:
13332
0
    info->name = "radioEntityTypeDomain";
13333
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13334
0
    info->fieldType = GF_SG_VRML_SFINT32;
13335
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->radioEntityTypeDomain;
13336
0
    return GF_OK;
13337
0
  case 23:
13338
0
    info->name = "radioEntityTypeKind";
13339
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13340
0
    info->fieldType = GF_SG_VRML_SFINT32;
13341
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->radioEntityTypeKind;
13342
0
    return GF_OK;
13343
0
  case 24:
13344
0
    info->name = "radioEntityTypeNomenclature";
13345
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13346
0
    info->fieldType = GF_SG_VRML_SFINT32;
13347
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->radioEntityTypeNomenclature;
13348
0
    return GF_OK;
13349
0
  case 25:
13350
0
    info->name = "radioEntityTypeNomenclatureVersion";
13351
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13352
0
    info->fieldType = GF_SG_VRML_SFINT32;
13353
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->radioEntityTypeNomenclatureVersion;
13354
0
    return GF_OK;
13355
0
  case 26:
13356
0
    info->name = "radioID";
13357
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13358
0
    info->fieldType = GF_SG_VRML_SFINT32;
13359
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->radioID;
13360
0
    return GF_OK;
13361
0
  case 27:
13362
0
    info->name = "readInterval";
13363
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13364
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
13365
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->readInterval;
13366
0
    return GF_OK;
13367
0
  case 28:
13368
0
    info->name = "relativeAntennaLocation";
13369
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13370
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
13371
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->relativeAntennaLocation;
13372
0
    return GF_OK;
13373
0
  case 29:
13374
0
    info->name = "rtpHeaderExpected";
13375
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13376
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13377
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->rtpHeaderExpected;
13378
0
    return GF_OK;
13379
0
  case 30:
13380
0
    info->name = "siteID";
13381
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13382
0
    info->fieldType = GF_SG_VRML_SFINT32;
13383
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->siteID;
13384
0
    return GF_OK;
13385
0
  case 31:
13386
0
    info->name = "transmitFrequencyBandwidth";
13387
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13388
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
13389
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->transmitFrequencyBandwidth;
13390
0
    return GF_OK;
13391
0
  case 32:
13392
0
    info->name = "transmitState";
13393
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13394
0
    info->fieldType = GF_SG_VRML_SFINT32;
13395
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->transmitState;
13396
0
    return GF_OK;
13397
0
  case 33:
13398
0
    info->name = "whichGeometry";
13399
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13400
0
    info->fieldType = GF_SG_VRML_SFINT32;
13401
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->whichGeometry;
13402
0
    return GF_OK;
13403
0
  case 34:
13404
0
    info->name = "writeInterval";
13405
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13406
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
13407
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->writeInterval;
13408
0
    return GF_OK;
13409
0
  case 35:
13410
0
    info->name = "isActive";
13411
0
    info->eventType = GF_SG_EVENT_OUT;
13412
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13413
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->isActive;
13414
0
    return GF_OK;
13415
0
  case 36:
13416
0
    info->name = "isNetworkReader";
13417
0
    info->eventType = GF_SG_EVENT_OUT;
13418
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13419
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->isNetworkReader;
13420
0
    return GF_OK;
13421
0
  case 37:
13422
0
    info->name = "isNetworkWriter";
13423
0
    info->eventType = GF_SG_EVENT_OUT;
13424
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13425
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->isNetworkWriter;
13426
0
    return GF_OK;
13427
0
  case 38:
13428
0
    info->name = "isRtpHeaderHeard";
13429
0
    info->eventType = GF_SG_EVENT_OUT;
13430
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13431
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->isRtpHeaderHeard;
13432
0
    return GF_OK;
13433
0
  case 39:
13434
0
    info->name = "isStandAlone";
13435
0
    info->eventType = GF_SG_EVENT_OUT;
13436
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13437
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->isStandAlone;
13438
0
    return GF_OK;
13439
0
  case 40:
13440
0
    info->name = "timestamp";
13441
0
    info->eventType = GF_SG_EVENT_OUT;
13442
0
    info->fieldType = GF_SG_VRML_SFTIME;
13443
0
    info->far_ptr = & ((X_TransmitterPdu *) node)->timestamp;
13444
0
    return GF_OK;
13445
0
  case 41:
13446
0
    info->name = "metadata";
13447
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13448
0
    info->fieldType = GF_SG_VRML_SFNODE;
13449
0
    info->NDTtype = NDT_SFMetadataNode;
13450
0
    info->far_ptr = & ((X_TransmitterPdu *)node)->metadata;
13451
0
    return GF_OK;
13452
0
  default:
13453
0
    return GF_BAD_PARAM;
13454
0
  }
13455
0
}
13456
13457
13458
static s32 TransmitterPdu_get_field_index_by_name(char *name)
13459
0
{
13460
0
  if (!strcmp("address", name)) return 0;
13461
0
  if (!strcmp("antennaLocation", name)) return 1;
13462
0
  if (!strcmp("antennaPatternLength", name)) return 2;
13463
0
  if (!strcmp("antennaPatternType", name)) return 3;
13464
0
  if (!strcmp("applicationID", name)) return 4;
13465
0
  if (!strcmp("cryptoKeyID", name)) return 5;
13466
0
  if (!strcmp("cryptoSystem", name)) return 6;
13467
0
  if (!strcmp("entityID", name)) return 7;
13468
0
  if (!strcmp("frequency", name)) return 8;
13469
0
  if (!strcmp("inputSource", name)) return 9;
13470
0
  if (!strcmp("lengthOfModulationParameters", name)) return 10;
13471
0
  if (!strcmp("modulationTypeDetail", name)) return 11;
13472
0
  if (!strcmp("modulationTypeMajor", name)) return 12;
13473
0
  if (!strcmp("modulationTypeSpreadSpectrum", name)) return 13;
13474
0
  if (!strcmp("modulationTypeSystem", name)) return 14;
13475
0
  if (!strcmp("multicastRelayHost", name)) return 15;
13476
0
  if (!strcmp("multicastRelayPort", name)) return 16;
13477
0
  if (!strcmp("networkMode", name)) return 17;
13478
0
  if (!strcmp("port", name)) return 18;
13479
0
  if (!strcmp("power", name)) return 19;
13480
0
  if (!strcmp("radioEntityTypeCategory", name)) return 20;
13481
0
  if (!strcmp("radioEntityTypeCountry", name)) return 21;
13482
0
  if (!strcmp("radioEntityTypeDomain", name)) return 22;
13483
0
  if (!strcmp("radioEntityTypeKind", name)) return 23;
13484
0
  if (!strcmp("radioEntityTypeNomenclature", name)) return 24;
13485
0
  if (!strcmp("radioEntityTypeNomenclatureVersion", name)) return 25;
13486
0
  if (!strcmp("radioID", name)) return 26;
13487
0
  if (!strcmp("readInterval", name)) return 27;
13488
0
  if (!strcmp("relativeAntennaLocation", name)) return 28;
13489
0
  if (!strcmp("rtpHeaderExpected", name)) return 29;
13490
0
  if (!strcmp("siteID", name)) return 30;
13491
0
  if (!strcmp("transmitFrequencyBandwidth", name)) return 31;
13492
0
  if (!strcmp("transmitState", name)) return 32;
13493
0
  if (!strcmp("whichGeometry", name)) return 33;
13494
0
  if (!strcmp("writeInterval", name)) return 34;
13495
0
  if (!strcmp("isActive", name)) return 35;
13496
0
  if (!strcmp("isNetworkReader", name)) return 36;
13497
0
  if (!strcmp("isNetworkWriter", name)) return 37;
13498
0
  if (!strcmp("isRtpHeaderHeard", name)) return 38;
13499
0
  if (!strcmp("isStandAlone", name)) return 39;
13500
0
  if (!strcmp("timestamp", name)) return 40;
13501
0
  if (!strcmp("metadata", name)) return 41;
13502
0
  return -1;
13503
0
}
13504
13505
13506
static GF_Node *TransmitterPdu_Create()
13507
0
{
13508
0
  X_TransmitterPdu *p;
13509
0
  GF_SAFEALLOC(p, X_TransmitterPdu);
13510
0
  if(!p) return NULL;
13511
0
  gf_node_setup((GF_Node *)p, TAG_X3D_TransmitterPdu);
13512
13513
  /*default field values*/
13514
0
  p->address.buffer = (char*) gf_malloc(sizeof(char) * 10);
13515
0
  strcpy(p->address.buffer, "localhost");
13516
0
  p->antennaLocation.x = FLT2FIX(0);
13517
0
  p->antennaLocation.y = FLT2FIX(0);
13518
0
  p->antennaLocation.z = FLT2FIX(0);
13519
0
  p->antennaPatternLength = 0;
13520
0
  p->antennaPatternType = 0;
13521
0
  p->applicationID = 1;
13522
0
  p->cryptoKeyID = 0;
13523
0
  p->cryptoSystem = 0;
13524
0
  p->entityID = 0;
13525
0
  p->frequency = 0;
13526
0
  p->inputSource = 0;
13527
0
  p->lengthOfModulationParameters = 0;
13528
0
  p->modulationTypeDetail = 0;
13529
0
  p->modulationTypeMajor = 0;
13530
0
  p->modulationTypeSpreadSpectrum = 0;
13531
0
  p->modulationTypeSystem = 0;
13532
0
  p->multicastRelayPort = 0;
13533
0
  p->networkMode.buffer = (char*) gf_malloc(sizeof(char) * 11);
13534
0
  strcpy(p->networkMode.buffer, "standAlone");
13535
0
  p->port = 0;
13536
0
  p->power = FLT2FIX(0.0);
13537
0
  p->radioEntityTypeCategory = 0;
13538
0
  p->radioEntityTypeCountry = 0;
13539
0
  p->radioEntityTypeDomain = 0;
13540
0
  p->radioEntityTypeKind = 0;
13541
0
  p->radioEntityTypeNomenclature = 0;
13542
0
  p->radioEntityTypeNomenclatureVersion = 0;
13543
0
  p->radioID = 0;
13544
0
  p->readInterval = FLT2FIX(0.1);
13545
0
  p->relativeAntennaLocation.x = FLT2FIX(0);
13546
0
  p->relativeAntennaLocation.y = FLT2FIX(0);
13547
0
  p->relativeAntennaLocation.z = FLT2FIX(0);
13548
0
  p->siteID = 0;
13549
0
  p->transmitFrequencyBandwidth = FLT2FIX(0.0);
13550
0
  p->transmitState = 0;
13551
0
  p->whichGeometry = 1;
13552
0
  p->writeInterval = FLT2FIX(1.0);
13553
0
  return (GF_Node *)p;
13554
0
}
13555
13556
13557
/*
13558
  TriangleFanSet Node deletion
13559
*/
13560
13561
static void TriangleFanSet_Del(GF_Node *node)
13562
0
{
13563
0
  X_TriangleFanSet *p = (X_TriangleFanSet *) node;
13564
0
  gf_node_unregister((GF_Node *) p->color, node);
13565
0
  gf_node_unregister((GF_Node *) p->coord, node);
13566
0
  gf_sg_mfint32_del(p->fanCount);
13567
0
  gf_node_unregister((GF_Node *) p->normal, node);
13568
0
  gf_node_unregister((GF_Node *) p->texCoord, node);
13569
0
  gf_node_unregister((GF_Node *) p->metadata, node);
13570
0
  gf_node_free((GF_Node *)p);
13571
0
}
13572
13573
13574
static u32 TriangleFanSet_get_field_count(GF_Node *node, u8 dummy)
13575
0
{
13576
0
  return 10;
13577
0
}
13578
13579
static GF_Err TriangleFanSet_get_field(GF_Node *node, GF_FieldInfo *info)
13580
0
{
13581
0
  switch (info->fieldIndex) {
13582
0
  case 0:
13583
0
    info->name = "color";
13584
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13585
0
    info->fieldType = GF_SG_VRML_SFNODE;
13586
0
    info->NDTtype = NDT_SFColorNode;
13587
0
    info->far_ptr = & ((X_TriangleFanSet *)node)->color;
13588
0
    return GF_OK;
13589
0
  case 1:
13590
0
    info->name = "coord";
13591
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13592
0
    info->fieldType = GF_SG_VRML_SFNODE;
13593
0
    info->NDTtype = NDT_SFCoordinateNode;
13594
0
    info->far_ptr = & ((X_TriangleFanSet *)node)->coord;
13595
0
    return GF_OK;
13596
0
  case 2:
13597
0
    info->name = "fanCount";
13598
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13599
0
    info->fieldType = GF_SG_VRML_MFINT32;
13600
0
    info->far_ptr = & ((X_TriangleFanSet *) node)->fanCount;
13601
0
    return GF_OK;
13602
0
  case 3:
13603
0
    info->name = "normal";
13604
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13605
0
    info->fieldType = GF_SG_VRML_SFNODE;
13606
0
    info->NDTtype = NDT_SFNormalNode;
13607
0
    info->far_ptr = & ((X_TriangleFanSet *)node)->normal;
13608
0
    return GF_OK;
13609
0
  case 4:
13610
0
    info->name = "texCoord";
13611
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13612
0
    info->fieldType = GF_SG_VRML_SFNODE;
13613
0
    info->NDTtype = NDT_SFTextureCoordinateNode;
13614
0
    info->far_ptr = & ((X_TriangleFanSet *)node)->texCoord;
13615
0
    return GF_OK;
13616
0
  case 5:
13617
0
    info->name = "ccw";
13618
0
    info->eventType = GF_SG_EVENT_FIELD;
13619
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13620
0
    info->far_ptr = & ((X_TriangleFanSet *) node)->ccw;
13621
0
    return GF_OK;
13622
0
  case 6:
13623
0
    info->name = "colorPerVertex";
13624
0
    info->eventType = GF_SG_EVENT_FIELD;
13625
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13626
0
    info->far_ptr = & ((X_TriangleFanSet *) node)->colorPerVertex;
13627
0
    return GF_OK;
13628
0
  case 7:
13629
0
    info->name = "normalPerVertex";
13630
0
    info->eventType = GF_SG_EVENT_FIELD;
13631
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13632
0
    info->far_ptr = & ((X_TriangleFanSet *) node)->normalPerVertex;
13633
0
    return GF_OK;
13634
0
  case 8:
13635
0
    info->name = "solid";
13636
0
    info->eventType = GF_SG_EVENT_FIELD;
13637
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13638
0
    info->far_ptr = & ((X_TriangleFanSet *) node)->solid;
13639
0
    return GF_OK;
13640
0
  case 9:
13641
0
    info->name = "metadata";
13642
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13643
0
    info->fieldType = GF_SG_VRML_SFNODE;
13644
0
    info->NDTtype = NDT_SFMetadataNode;
13645
0
    info->far_ptr = & ((X_TriangleFanSet *)node)->metadata;
13646
0
    return GF_OK;
13647
0
  default:
13648
0
    return GF_BAD_PARAM;
13649
0
  }
13650
0
}
13651
13652
13653
static s32 TriangleFanSet_get_field_index_by_name(char *name)
13654
0
{
13655
0
  if (!strcmp("color", name)) return 0;
13656
0
  if (!strcmp("coord", name)) return 1;
13657
0
  if (!strcmp("fanCount", name)) return 2;
13658
0
  if (!strcmp("normal", name)) return 3;
13659
0
  if (!strcmp("texCoord", name)) return 4;
13660
0
  if (!strcmp("ccw", name)) return 5;
13661
0
  if (!strcmp("colorPerVertex", name)) return 6;
13662
0
  if (!strcmp("normalPerVertex", name)) return 7;
13663
0
  if (!strcmp("solid", name)) return 8;
13664
0
  if (!strcmp("metadata", name)) return 9;
13665
0
  return -1;
13666
0
}
13667
13668
13669
static GF_Node *TriangleFanSet_Create()
13670
0
{
13671
0
  X_TriangleFanSet *p;
13672
0
  GF_SAFEALLOC(p, X_TriangleFanSet);
13673
0
  if(!p) return NULL;
13674
0
  gf_node_setup((GF_Node *)p, TAG_X3D_TriangleFanSet);
13675
13676
  /*default field values*/
13677
0
  p->ccw = 1;
13678
0
  p->colorPerVertex = 1;
13679
0
  p->normalPerVertex = 1;
13680
0
  p->solid = 1;
13681
0
  return (GF_Node *)p;
13682
0
}
13683
13684
13685
/*
13686
  TriangleSet Node deletion
13687
*/
13688
13689
static void TriangleSet_Del(GF_Node *node)
13690
0
{
13691
0
  X_TriangleSet *p = (X_TriangleSet *) node;
13692
0
  gf_node_unregister((GF_Node *) p->color, node);
13693
0
  gf_node_unregister((GF_Node *) p->coord, node);
13694
0
  gf_node_unregister((GF_Node *) p->normal, node);
13695
0
  gf_node_unregister((GF_Node *) p->texCoord, node);
13696
0
  gf_node_unregister((GF_Node *) p->metadata, node);
13697
0
  gf_node_free((GF_Node *)p);
13698
0
}
13699
13700
13701
static u32 TriangleSet_get_field_count(GF_Node *node, u8 dummy)
13702
0
{
13703
0
  return 9;
13704
0
}
13705
13706
static GF_Err TriangleSet_get_field(GF_Node *node, GF_FieldInfo *info)
13707
0
{
13708
0
  switch (info->fieldIndex) {
13709
0
  case 0:
13710
0
    info->name = "color";
13711
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13712
0
    info->fieldType = GF_SG_VRML_SFNODE;
13713
0
    info->NDTtype = NDT_SFColorNode;
13714
0
    info->far_ptr = & ((X_TriangleSet *)node)->color;
13715
0
    return GF_OK;
13716
0
  case 1:
13717
0
    info->name = "coord";
13718
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13719
0
    info->fieldType = GF_SG_VRML_SFNODE;
13720
0
    info->NDTtype = NDT_SFCoordinateNode;
13721
0
    info->far_ptr = & ((X_TriangleSet *)node)->coord;
13722
0
    return GF_OK;
13723
0
  case 2:
13724
0
    info->name = "normal";
13725
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13726
0
    info->fieldType = GF_SG_VRML_SFNODE;
13727
0
    info->NDTtype = NDT_SFNormalNode;
13728
0
    info->far_ptr = & ((X_TriangleSet *)node)->normal;
13729
0
    return GF_OK;
13730
0
  case 3:
13731
0
    info->name = "texCoord";
13732
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13733
0
    info->fieldType = GF_SG_VRML_SFNODE;
13734
0
    info->NDTtype = NDT_SFTextureCoordinateNode;
13735
0
    info->far_ptr = & ((X_TriangleSet *)node)->texCoord;
13736
0
    return GF_OK;
13737
0
  case 4:
13738
0
    info->name = "ccw";
13739
0
    info->eventType = GF_SG_EVENT_FIELD;
13740
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13741
0
    info->far_ptr = & ((X_TriangleSet *) node)->ccw;
13742
0
    return GF_OK;
13743
0
  case 5:
13744
0
    info->name = "colorPerVertex";
13745
0
    info->eventType = GF_SG_EVENT_FIELD;
13746
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13747
0
    info->far_ptr = & ((X_TriangleSet *) node)->colorPerVertex;
13748
0
    return GF_OK;
13749
0
  case 6:
13750
0
    info->name = "normalPerVertex";
13751
0
    info->eventType = GF_SG_EVENT_FIELD;
13752
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13753
0
    info->far_ptr = & ((X_TriangleSet *) node)->normalPerVertex;
13754
0
    return GF_OK;
13755
0
  case 7:
13756
0
    info->name = "solid";
13757
0
    info->eventType = GF_SG_EVENT_FIELD;
13758
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13759
0
    info->far_ptr = & ((X_TriangleSet *) node)->solid;
13760
0
    return GF_OK;
13761
0
  case 8:
13762
0
    info->name = "metadata";
13763
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13764
0
    info->fieldType = GF_SG_VRML_SFNODE;
13765
0
    info->NDTtype = NDT_SFMetadataNode;
13766
0
    info->far_ptr = & ((X_TriangleSet *)node)->metadata;
13767
0
    return GF_OK;
13768
0
  default:
13769
0
    return GF_BAD_PARAM;
13770
0
  }
13771
0
}
13772
13773
13774
static s32 TriangleSet_get_field_index_by_name(char *name)
13775
0
{
13776
0
  if (!strcmp("color", name)) return 0;
13777
0
  if (!strcmp("coord", name)) return 1;
13778
0
  if (!strcmp("normal", name)) return 2;
13779
0
  if (!strcmp("texCoord", name)) return 3;
13780
0
  if (!strcmp("ccw", name)) return 4;
13781
0
  if (!strcmp("colorPerVertex", name)) return 5;
13782
0
  if (!strcmp("normalPerVertex", name)) return 6;
13783
0
  if (!strcmp("solid", name)) return 7;
13784
0
  if (!strcmp("metadata", name)) return 8;
13785
0
  return -1;
13786
0
}
13787
13788
13789
static GF_Node *TriangleSet_Create()
13790
0
{
13791
0
  X_TriangleSet *p;
13792
0
  GF_SAFEALLOC(p, X_TriangleSet);
13793
0
  if(!p) return NULL;
13794
0
  gf_node_setup((GF_Node *)p, TAG_X3D_TriangleSet);
13795
13796
  /*default field values*/
13797
0
  p->ccw = 1;
13798
0
  p->colorPerVertex = 1;
13799
0
  p->normalPerVertex = 1;
13800
0
  p->solid = 1;
13801
0
  return (GF_Node *)p;
13802
0
}
13803
13804
13805
/*
13806
  TriangleSet2D Node deletion
13807
*/
13808
13809
static void TriangleSet2D_Del(GF_Node *node)
13810
0
{
13811
0
  X_TriangleSet2D *p = (X_TriangleSet2D *) node;
13812
0
  gf_sg_mfvec2f_del(p->vertices);
13813
0
  gf_node_unregister((GF_Node *) p->metadata, node);
13814
0
  gf_node_free((GF_Node *)p);
13815
0
}
13816
13817
13818
static u32 TriangleSet2D_get_field_count(GF_Node *node, u8 dummy)
13819
0
{
13820
0
  return 2;
13821
0
}
13822
13823
static GF_Err TriangleSet2D_get_field(GF_Node *node, GF_FieldInfo *info)
13824
0
{
13825
0
  switch (info->fieldIndex) {
13826
0
  case 0:
13827
0
    info->name = "vertices";
13828
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13829
0
    info->fieldType = GF_SG_VRML_MFVEC2F;
13830
0
    info->far_ptr = & ((X_TriangleSet2D *) node)->vertices;
13831
0
    return GF_OK;
13832
0
  case 1:
13833
0
    info->name = "metadata";
13834
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13835
0
    info->fieldType = GF_SG_VRML_SFNODE;
13836
0
    info->NDTtype = NDT_SFMetadataNode;
13837
0
    info->far_ptr = & ((X_TriangleSet2D *)node)->metadata;
13838
0
    return GF_OK;
13839
0
  default:
13840
0
    return GF_BAD_PARAM;
13841
0
  }
13842
0
}
13843
13844
13845
static s32 TriangleSet2D_get_field_index_by_name(char *name)
13846
0
{
13847
0
  if (!strcmp("vertices", name)) return 0;
13848
0
  if (!strcmp("metadata", name)) return 1;
13849
0
  return -1;
13850
0
}
13851
13852
13853
static GF_Node *TriangleSet2D_Create()
13854
0
{
13855
0
  X_TriangleSet2D *p;
13856
0
  GF_SAFEALLOC(p, X_TriangleSet2D);
13857
0
  if(!p) return NULL;
13858
0
  gf_node_setup((GF_Node *)p, TAG_X3D_TriangleSet2D);
13859
13860
  /*default field values*/
13861
0
  return (GF_Node *)p;
13862
0
}
13863
13864
13865
/*
13866
  TriangleStripSet Node deletion
13867
*/
13868
13869
static void TriangleStripSet_Del(GF_Node *node)
13870
0
{
13871
0
  X_TriangleStripSet *p = (X_TriangleStripSet *) node;
13872
0
  gf_node_unregister((GF_Node *) p->color, node);
13873
0
  gf_node_unregister((GF_Node *) p->coord, node);
13874
0
  gf_node_unregister((GF_Node *) p->normal, node);
13875
0
  gf_sg_mfint32_del(p->stripCount);
13876
0
  gf_node_unregister((GF_Node *) p->texCoord, node);
13877
0
  gf_node_unregister((GF_Node *) p->metadata, node);
13878
0
  gf_node_free((GF_Node *)p);
13879
0
}
13880
13881
13882
static u32 TriangleStripSet_get_field_count(GF_Node *node, u8 dummy)
13883
0
{
13884
0
  return 10;
13885
0
}
13886
13887
static GF_Err TriangleStripSet_get_field(GF_Node *node, GF_FieldInfo *info)
13888
0
{
13889
0
  switch (info->fieldIndex) {
13890
0
  case 0:
13891
0
    info->name = "color";
13892
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13893
0
    info->fieldType = GF_SG_VRML_SFNODE;
13894
0
    info->NDTtype = NDT_SFColorNode;
13895
0
    info->far_ptr = & ((X_TriangleStripSet *)node)->color;
13896
0
    return GF_OK;
13897
0
  case 1:
13898
0
    info->name = "coord";
13899
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13900
0
    info->fieldType = GF_SG_VRML_SFNODE;
13901
0
    info->NDTtype = NDT_SFCoordinateNode;
13902
0
    info->far_ptr = & ((X_TriangleStripSet *)node)->coord;
13903
0
    return GF_OK;
13904
0
  case 2:
13905
0
    info->name = "normal";
13906
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13907
0
    info->fieldType = GF_SG_VRML_SFNODE;
13908
0
    info->NDTtype = NDT_SFNormalNode;
13909
0
    info->far_ptr = & ((X_TriangleStripSet *)node)->normal;
13910
0
    return GF_OK;
13911
0
  case 3:
13912
0
    info->name = "stripCount";
13913
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13914
0
    info->fieldType = GF_SG_VRML_MFINT32;
13915
0
    info->far_ptr = & ((X_TriangleStripSet *) node)->stripCount;
13916
0
    return GF_OK;
13917
0
  case 4:
13918
0
    info->name = "texCoord";
13919
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13920
0
    info->fieldType = GF_SG_VRML_SFNODE;
13921
0
    info->NDTtype = NDT_SFTextureCoordinateNode;
13922
0
    info->far_ptr = & ((X_TriangleStripSet *)node)->texCoord;
13923
0
    return GF_OK;
13924
0
  case 5:
13925
0
    info->name = "ccw";
13926
0
    info->eventType = GF_SG_EVENT_FIELD;
13927
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13928
0
    info->far_ptr = & ((X_TriangleStripSet *) node)->ccw;
13929
0
    return GF_OK;
13930
0
  case 6:
13931
0
    info->name = "colorPerVertex";
13932
0
    info->eventType = GF_SG_EVENT_FIELD;
13933
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13934
0
    info->far_ptr = & ((X_TriangleStripSet *) node)->colorPerVertex;
13935
0
    return GF_OK;
13936
0
  case 7:
13937
0
    info->name = "normalPerVertex";
13938
0
    info->eventType = GF_SG_EVENT_FIELD;
13939
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13940
0
    info->far_ptr = & ((X_TriangleStripSet *) node)->normalPerVertex;
13941
0
    return GF_OK;
13942
0
  case 8:
13943
0
    info->name = "solid";
13944
0
    info->eventType = GF_SG_EVENT_FIELD;
13945
0
    info->fieldType = GF_SG_VRML_SFBOOL;
13946
0
    info->far_ptr = & ((X_TriangleStripSet *) node)->solid;
13947
0
    return GF_OK;
13948
0
  case 9:
13949
0
    info->name = "metadata";
13950
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
13951
0
    info->fieldType = GF_SG_VRML_SFNODE;
13952
0
    info->NDTtype = NDT_SFMetadataNode;
13953
0
    info->far_ptr = & ((X_TriangleStripSet *)node)->metadata;
13954
0
    return GF_OK;
13955
0
  default:
13956
0
    return GF_BAD_PARAM;
13957
0
  }
13958
0
}
13959
13960
13961
static s32 TriangleStripSet_get_field_index_by_name(char *name)
13962
0
{
13963
0
  if (!strcmp("color", name)) return 0;
13964
0
  if (!strcmp("coord", name)) return 1;
13965
0
  if (!strcmp("normal", name)) return 2;
13966
0
  if (!strcmp("stripCount", name)) return 3;
13967
0
  if (!strcmp("texCoord", name)) return 4;
13968
0
  if (!strcmp("ccw", name)) return 5;
13969
0
  if (!strcmp("colorPerVertex", name)) return 6;
13970
0
  if (!strcmp("normalPerVertex", name)) return 7;
13971
0
  if (!strcmp("solid", name)) return 8;
13972
0
  if (!strcmp("metadata", name)) return 9;
13973
0
  return -1;
13974
0
}
13975
13976
13977
static GF_Node *TriangleStripSet_Create()
13978
0
{
13979
0
  X_TriangleStripSet *p;
13980
0
  GF_SAFEALLOC(p, X_TriangleStripSet);
13981
0
  if(!p) return NULL;
13982
0
  gf_node_setup((GF_Node *)p, TAG_X3D_TriangleStripSet);
13983
13984
  /*default field values*/
13985
0
  p->ccw = 1;
13986
0
  p->colorPerVertex = 1;
13987
0
  p->normalPerVertex = 1;
13988
0
  p->solid = 1;
13989
0
  return (GF_Node *)p;
13990
0
}
13991
13992
13993
/*
13994
  Viewpoint Node deletion
13995
*/
13996
13997
static void Viewpoint_Del(GF_Node *node)
13998
0
{
13999
0
  X_Viewpoint *p = (X_Viewpoint *) node;
14000
0
  gf_sg_sfstring_del(p->description);
14001
0
  gf_node_unregister((GF_Node *) p->metadata, node);
14002
0
  gf_node_free((GF_Node *)p);
14003
0
}
14004
14005
14006
static u32 Viewpoint_get_field_count(GF_Node *node, u8 dummy)
14007
0
{
14008
0
  return 10;
14009
0
}
14010
14011
static GF_Err Viewpoint_get_field(GF_Node *node, GF_FieldInfo *info)
14012
0
{
14013
0
  switch (info->fieldIndex) {
14014
0
  case 0:
14015
0
    info->name = "set_bind";
14016
0
    info->eventType = GF_SG_EVENT_IN;
14017
0
    info->on_event_in = ((X_Viewpoint *)node)->on_set_bind;
14018
0
    info->fieldType = GF_SG_VRML_SFBOOL;
14019
0
    info->far_ptr = & ((X_Viewpoint *) node)->set_bind;
14020
0
    return GF_OK;
14021
0
  case 1:
14022
0
    info->name = "fieldOfView";
14023
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14024
0
    info->fieldType = GF_SG_VRML_SFFLOAT;
14025
0
    info->far_ptr = & ((X_Viewpoint *) node)->fieldOfView;
14026
0
    return GF_OK;
14027
0
  case 2:
14028
0
    info->name = "jump";
14029
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14030
0
    info->fieldType = GF_SG_VRML_SFBOOL;
14031
0
    info->far_ptr = & ((X_Viewpoint *) node)->jump;
14032
0
    return GF_OK;
14033
0
  case 3:
14034
0
    info->name = "orientation";
14035
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14036
0
    info->fieldType = GF_SG_VRML_SFROTATION;
14037
0
    info->far_ptr = & ((X_Viewpoint *) node)->orientation;
14038
0
    return GF_OK;
14039
0
  case 4:
14040
0
    info->name = "position";
14041
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14042
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
14043
0
    info->far_ptr = & ((X_Viewpoint *) node)->position;
14044
0
    return GF_OK;
14045
0
  case 5:
14046
0
    info->name = "description";
14047
0
    info->eventType = GF_SG_EVENT_FIELD;
14048
0
    info->fieldType = GF_SG_VRML_SFSTRING;
14049
0
    info->far_ptr = & ((X_Viewpoint *) node)->description;
14050
0
    return GF_OK;
14051
0
  case 6:
14052
0
    info->name = "bindTime";
14053
0
    info->eventType = GF_SG_EVENT_OUT;
14054
0
    info->fieldType = GF_SG_VRML_SFTIME;
14055
0
    info->far_ptr = & ((X_Viewpoint *) node)->bindTime;
14056
0
    return GF_OK;
14057
0
  case 7:
14058
0
    info->name = "isBound";
14059
0
    info->eventType = GF_SG_EVENT_OUT;
14060
0
    info->fieldType = GF_SG_VRML_SFBOOL;
14061
0
    info->far_ptr = & ((X_Viewpoint *) node)->isBound;
14062
0
    return GF_OK;
14063
0
  case 8:
14064
0
    info->name = "metadata";
14065
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14066
0
    info->fieldType = GF_SG_VRML_SFNODE;
14067
0
    info->NDTtype = NDT_SFMetadataNode;
14068
0
    info->far_ptr = & ((X_Viewpoint *)node)->metadata;
14069
0
    return GF_OK;
14070
0
  case 9:
14071
0
    info->name = "centerOfRotation";
14072
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14073
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
14074
0
    info->far_ptr = & ((X_Viewpoint *) node)->centerOfRotation;
14075
0
    return GF_OK;
14076
0
  default:
14077
0
    return GF_BAD_PARAM;
14078
0
  }
14079
0
}
14080
14081
14082
static s32 Viewpoint_get_field_index_by_name(char *name)
14083
0
{
14084
0
  if (!strcmp("set_bind", name)) return 0;
14085
0
  if (!strcmp("fieldOfView", name)) return 1;
14086
0
  if (!strcmp("jump", name)) return 2;
14087
0
  if (!strcmp("orientation", name)) return 3;
14088
0
  if (!strcmp("position", name)) return 4;
14089
0
  if (!strcmp("description", name)) return 5;
14090
0
  if (!strcmp("bindTime", name)) return 6;
14091
0
  if (!strcmp("isBound", name)) return 7;
14092
0
  if (!strcmp("metadata", name)) return 8;
14093
0
  if (!strcmp("centerOfRotation", name)) return 9;
14094
0
  return -1;
14095
0
}
14096
14097
14098
static GF_Node *Viewpoint_Create()
14099
0
{
14100
0
  X_Viewpoint *p;
14101
0
  GF_SAFEALLOC(p, X_Viewpoint);
14102
0
  if(!p) return NULL;
14103
0
  gf_node_setup((GF_Node *)p, TAG_X3D_Viewpoint);
14104
14105
  /*default field values*/
14106
0
  p->fieldOfView = FLT2FIX(0.785398);
14107
0
  p->jump = 1;
14108
0
  p->orientation.x = FLT2FIX(0);
14109
0
  p->orientation.y = FLT2FIX(0);
14110
0
  p->orientation.z = FLT2FIX(1);
14111
0
  p->orientation.q = FLT2FIX(0);
14112
0
  p->position.x = FLT2FIX(0);
14113
0
  p->position.y = FLT2FIX(0);
14114
0
  p->position.z = FLT2FIX(10);
14115
0
  p->centerOfRotation.x = FLT2FIX(0);
14116
0
  p->centerOfRotation.y = FLT2FIX(0);
14117
0
  p->centerOfRotation.z = FLT2FIX(0);
14118
0
  return (GF_Node *)p;
14119
0
}
14120
14121
14122
/*
14123
  VisibilitySensor Node deletion
14124
*/
14125
14126
static void VisibilitySensor_Del(GF_Node *node)
14127
0
{
14128
0
  X_VisibilitySensor *p = (X_VisibilitySensor *) node;
14129
0
  gf_node_unregister((GF_Node *) p->metadata, node);
14130
0
  gf_node_free((GF_Node *)p);
14131
0
}
14132
14133
14134
static u32 VisibilitySensor_get_field_count(GF_Node *node, u8 dummy)
14135
0
{
14136
0
  return 7;
14137
0
}
14138
14139
static GF_Err VisibilitySensor_get_field(GF_Node *node, GF_FieldInfo *info)
14140
0
{
14141
0
  switch (info->fieldIndex) {
14142
0
  case 0:
14143
0
    info->name = "center";
14144
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14145
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
14146
0
    info->far_ptr = & ((X_VisibilitySensor *) node)->center;
14147
0
    return GF_OK;
14148
0
  case 1:
14149
0
    info->name = "enabled";
14150
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14151
0
    info->fieldType = GF_SG_VRML_SFBOOL;
14152
0
    info->far_ptr = & ((X_VisibilitySensor *) node)->enabled;
14153
0
    return GF_OK;
14154
0
  case 2:
14155
0
    info->name = "size";
14156
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14157
0
    info->fieldType = GF_SG_VRML_SFVEC3F;
14158
0
    info->far_ptr = & ((X_VisibilitySensor *) node)->size;
14159
0
    return GF_OK;
14160
0
  case 3:
14161
0
    info->name = "enterTime";
14162
0
    info->eventType = GF_SG_EVENT_OUT;
14163
0
    info->fieldType = GF_SG_VRML_SFTIME;
14164
0
    info->far_ptr = & ((X_VisibilitySensor *) node)->enterTime;
14165
0
    return GF_OK;
14166
0
  case 4:
14167
0
    info->name = "exitTime";
14168
0
    info->eventType = GF_SG_EVENT_OUT;
14169
0
    info->fieldType = GF_SG_VRML_SFTIME;
14170
0
    info->far_ptr = & ((X_VisibilitySensor *) node)->exitTime;
14171
0
    return GF_OK;
14172
0
  case 5:
14173
0
    info->name = "isActive";
14174
0
    info->eventType = GF_SG_EVENT_OUT;
14175
0
    info->fieldType = GF_SG_VRML_SFBOOL;
14176
0
    info->far_ptr = & ((X_VisibilitySensor *) node)->isActive;
14177
0
    return GF_OK;
14178
0
  case 6:
14179
0
    info->name = "metadata";
14180
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14181
0
    info->fieldType = GF_SG_VRML_SFNODE;
14182
0
    info->NDTtype = NDT_SFMetadataNode;
14183
0
    info->far_ptr = & ((X_VisibilitySensor *)node)->metadata;
14184
0
    return GF_OK;
14185
0
  default:
14186
0
    return GF_BAD_PARAM;
14187
0
  }
14188
0
}
14189
14190
14191
static s32 VisibilitySensor_get_field_index_by_name(char *name)
14192
0
{
14193
0
  if (!strcmp("center", name)) return 0;
14194
0
  if (!strcmp("enabled", name)) return 1;
14195
0
  if (!strcmp("size", name)) return 2;
14196
0
  if (!strcmp("enterTime", name)) return 3;
14197
0
  if (!strcmp("exitTime", name)) return 4;
14198
0
  if (!strcmp("isActive", name)) return 5;
14199
0
  if (!strcmp("metadata", name)) return 6;
14200
0
  return -1;
14201
0
}
14202
14203
14204
static GF_Node *VisibilitySensor_Create()
14205
0
{
14206
0
  X_VisibilitySensor *p;
14207
0
  GF_SAFEALLOC(p, X_VisibilitySensor);
14208
0
  if(!p) return NULL;
14209
0
  gf_node_setup((GF_Node *)p, TAG_X3D_VisibilitySensor);
14210
14211
  /*default field values*/
14212
0
  p->center.x = FLT2FIX(0);
14213
0
  p->center.y = FLT2FIX(0);
14214
0
  p->center.z = FLT2FIX(0);
14215
0
  p->enabled = 1;
14216
0
  p->size.x = FLT2FIX(0);
14217
0
  p->size.y = FLT2FIX(0);
14218
0
  p->size.z = FLT2FIX(0);
14219
0
  return (GF_Node *)p;
14220
0
}
14221
14222
14223
/*
14224
  WorldInfo Node deletion
14225
*/
14226
14227
static void WorldInfo_Del(GF_Node *node)
14228
0
{
14229
0
  X_WorldInfo *p = (X_WorldInfo *) node;
14230
0
  gf_sg_mfstring_del(p->info);
14231
0
  gf_sg_sfstring_del(p->title);
14232
0
  gf_node_unregister((GF_Node *) p->metadata, node);
14233
0
  gf_node_free((GF_Node *)p);
14234
0
}
14235
14236
14237
static u32 WorldInfo_get_field_count(GF_Node *node, u8 dummy)
14238
0
{
14239
0
  return 3;
14240
0
}
14241
14242
static GF_Err WorldInfo_get_field(GF_Node *node, GF_FieldInfo *info)
14243
0
{
14244
0
  switch (info->fieldIndex) {
14245
0
  case 0:
14246
0
    info->name = "info";
14247
0
    info->eventType = GF_SG_EVENT_FIELD;
14248
0
    info->fieldType = GF_SG_VRML_MFSTRING;
14249
0
    info->far_ptr = & ((X_WorldInfo *) node)->info;
14250
0
    return GF_OK;
14251
0
  case 1:
14252
0
    info->name = "title";
14253
0
    info->eventType = GF_SG_EVENT_FIELD;
14254
0
    info->fieldType = GF_SG_VRML_SFSTRING;
14255
0
    info->far_ptr = & ((X_WorldInfo *) node)->title;
14256
0
    return GF_OK;
14257
0
  case 2:
14258
0
    info->name = "metadata";
14259
0
    info->eventType = GF_SG_EVENT_EXPOSED_FIELD;
14260
0
    info->fieldType = GF_SG_VRML_SFNODE;
14261
0
    info->NDTtype = NDT_SFMetadataNode;
14262
0
    info->far_ptr = & ((X_WorldInfo *)node)->metadata;
14263
0
    return GF_OK;
14264
0
  default:
14265
0
    return GF_BAD_PARAM;
14266
0
  }
14267
0
}
14268
14269
14270
static s32 WorldInfo_get_field_index_by_name(char *name)
14271
0
{
14272
0
  if (!strcmp("info", name)) return 0;
14273
0
  if (!strcmp("title", name)) return 1;
14274
0
  if (!strcmp("metadata", name)) return 2;
14275
0
  return -1;
14276
0
}
14277
14278
14279
static GF_Node *WorldInfo_Create()
14280
0
{
14281
0
  X_WorldInfo *p;
14282
0
  GF_SAFEALLOC(p, X_WorldInfo);
14283
0
  if(!p) return NULL;
14284
0
  gf_node_setup((GF_Node *)p, TAG_X3D_WorldInfo);
14285
14286
  /*default field values*/
14287
0
  return (GF_Node *)p;
14288
0
}
14289
14290
14291
14292
14293
GF_Node *gf_sg_x3d_node_new(u32 NodeTag)
14294
0
{
14295
0
  switch (NodeTag) {
14296
0
  case TAG_X3D_Anchor:
14297
0
    return Anchor_Create();
14298
0
  case TAG_X3D_Appearance:
14299
0
    return Appearance_Create();
14300
0
  case TAG_X3D_Arc2D:
14301
0
    return Arc2D_Create();
14302
0
  case TAG_X3D_ArcClose2D:
14303
0
    return ArcClose2D_Create();
14304
0
  case TAG_X3D_AudioClip:
14305
0
    return AudioClip_Create();
14306
0
  case TAG_X3D_Background:
14307
0
    return Background_Create();
14308
0
  case TAG_X3D_Billboard:
14309
0
    return Billboard_Create();
14310
0
  case TAG_X3D_BooleanFilter:
14311
0
    return BooleanFilter_Create();
14312
0
  case TAG_X3D_BooleanSequencer:
14313
0
    return BooleanSequencer_Create();
14314
0
  case TAG_X3D_BooleanToggle:
14315
0
    return BooleanToggle_Create();
14316
0
  case TAG_X3D_BooleanTrigger:
14317
0
    return BooleanTrigger_Create();
14318
0
  case TAG_X3D_Box:
14319
0
    return Box_Create();
14320
0
  case TAG_X3D_Circle2D:
14321
0
    return Circle2D_Create();
14322
0
  case TAG_X3D_Collision:
14323
0
    return Collision_Create();
14324
0
  case TAG_X3D_Color:
14325
0
    return Color_Create();
14326
0
  case TAG_X3D_ColorInterpolator:
14327
0
    return ColorInterpolator_Create();
14328
0
  case TAG_X3D_ColorRGBA:
14329
0
    return ColorRGBA_Create();
14330
0
  case TAG_X3D_Cone:
14331
0
    return Cone_Create();
14332
0
  case TAG_X3D_Contour2D:
14333
0
    return Contour2D_Create();
14334
0
  case TAG_X3D_ContourPolyline2D:
14335
0
    return ContourPolyline2D_Create();
14336
0
  case TAG_X3D_Coordinate:
14337
0
    return Coordinate_Create();
14338
0
  case TAG_X3D_CoordinateDouble:
14339
0
    return CoordinateDouble_Create();
14340
0
  case TAG_X3D_Coordinate2D:
14341
0
    return Coordinate2D_Create();
14342
0
  case TAG_X3D_CoordinateInterpolator:
14343
0
    return CoordinateInterpolator_Create();
14344
0
  case TAG_X3D_CoordinateInterpolator2D:
14345
0
    return CoordinateInterpolator2D_Create();
14346
0
  case TAG_X3D_Cylinder:
14347
0
    return Cylinder_Create();
14348
0
  case TAG_X3D_CylinderSensor:
14349
0
    return CylinderSensor_Create();
14350
0
  case TAG_X3D_DirectionalLight:
14351
0
    return DirectionalLight_Create();
14352
0
  case TAG_X3D_Disk2D:
14353
0
    return Disk2D_Create();
14354
0
  case TAG_X3D_ElevationGrid:
14355
0
    return ElevationGrid_Create();
14356
0
  case TAG_X3D_EspduTransform:
14357
0
    return EspduTransform_Create();
14358
0
  case TAG_X3D_Extrusion:
14359
0
    return Extrusion_Create();
14360
0
  case TAG_X3D_FillProperties:
14361
0
    return FillProperties_Create();
14362
0
  case TAG_X3D_Fog:
14363
0
    return Fog_Create();
14364
0
  case TAG_X3D_FontStyle:
14365
0
    return FontStyle_Create();
14366
0
  case TAG_X3D_GeoCoordinate:
14367
0
    return GeoCoordinate_Create();
14368
0
  case TAG_X3D_GeoElevationGrid:
14369
0
    return GeoElevationGrid_Create();
14370
0
  case TAG_X3D_GeoLocation:
14371
0
    return GeoLocation_Create();
14372
0
  case TAG_X3D_GeoLOD:
14373
0
    return GeoLOD_Create();
14374
0
  case TAG_X3D_GeoMetadata:
14375
0
    return GeoMetadata_Create();
14376
0
  case TAG_X3D_GeoOrigin:
14377
0
    return GeoOrigin_Create();
14378
0
  case TAG_X3D_GeoPositionInterpolator:
14379
0
    return GeoPositionInterpolator_Create();
14380
0
  case TAG_X3D_GeoTouchSensor:
14381
0
    return GeoTouchSensor_Create();
14382
0
  case TAG_X3D_GeoViewpoint:
14383
0
    return GeoViewpoint_Create();
14384
0
  case TAG_X3D_Group:
14385
0
    return Group_Create();
14386
0
  case TAG_X3D_HAnimDisplacer:
14387
0
    return HAnimDisplacer_Create();
14388
0
  case TAG_X3D_HAnimHumanoid:
14389
0
    return HAnimHumanoid_Create();
14390
0
  case TAG_X3D_HAnimJoint:
14391
0
    return HAnimJoint_Create();
14392
0
  case TAG_X3D_HAnimSegment:
14393
0
    return HAnimSegment_Create();
14394
0
  case TAG_X3D_HAnimSite:
14395
0
    return HAnimSite_Create();
14396
0
  case TAG_X3D_ImageTexture:
14397
0
    return ImageTexture_Create();
14398
0
  case TAG_X3D_IndexedFaceSet:
14399
0
    return IndexedFaceSet_Create();
14400
0
  case TAG_X3D_IndexedLineSet:
14401
0
    return IndexedLineSet_Create();
14402
0
  case TAG_X3D_IndexedTriangleFanSet:
14403
0
    return IndexedTriangleFanSet_Create();
14404
0
  case TAG_X3D_IndexedTriangleSet:
14405
0
    return IndexedTriangleSet_Create();
14406
0
  case TAG_X3D_IndexedTriangleStripSet:
14407
0
    return IndexedTriangleStripSet_Create();
14408
0
  case TAG_X3D_Inline:
14409
0
    return Inline_Create();
14410
0
  case TAG_X3D_IntegerSequencer:
14411
0
    return IntegerSequencer_Create();
14412
0
  case TAG_X3D_IntegerTrigger:
14413
0
    return IntegerTrigger_Create();
14414
0
  case TAG_X3D_KeySensor:
14415
0
    return KeySensor_Create();
14416
0
  case TAG_X3D_LineProperties:
14417
0
    return LineProperties_Create();
14418
0
  case TAG_X3D_LineSet:
14419
0
    return LineSet_Create();
14420
0
  case TAG_X3D_LoadSensor:
14421
0
    return LoadSensor_Create();
14422
0
  case TAG_X3D_LOD:
14423
0
    return LOD_Create();
14424
0
  case TAG_X3D_Material:
14425
0
    return Material_Create();
14426
0
  case TAG_X3D_MetadataDouble:
14427
0
    return MetadataDouble_Create();
14428
0
  case TAG_X3D_MetadataFloat:
14429
0
    return MetadataFloat_Create();
14430
0
  case TAG_X3D_MetadataInteger:
14431
0
    return MetadataInteger_Create();
14432
0
  case TAG_X3D_MetadataSet:
14433
0
    return MetadataSet_Create();
14434
0
  case TAG_X3D_MetadataString:
14435
0
    return MetadataString_Create();
14436
0
  case TAG_X3D_MovieTexture:
14437
0
    return MovieTexture_Create();
14438
0
  case TAG_X3D_MultiTexture:
14439
0
    return MultiTexture_Create();
14440
0
  case TAG_X3D_MultiTextureCoordinate:
14441
0
    return MultiTextureCoordinate_Create();
14442
0
  case TAG_X3D_MultiTextureTransform:
14443
0
    return MultiTextureTransform_Create();
14444
0
  case TAG_X3D_NavigationInfo:
14445
0
    return NavigationInfo_Create();
14446
0
  case TAG_X3D_Normal:
14447
0
    return Normal_Create();
14448
0
  case TAG_X3D_NormalInterpolator:
14449
0
    return NormalInterpolator_Create();
14450
0
  case TAG_X3D_NurbsCurve:
14451
0
    return NurbsCurve_Create();
14452
0
  case TAG_X3D_NurbsCurve2D:
14453
0
    return NurbsCurve2D_Create();
14454
0
  case TAG_X3D_NurbsOrientationInterpolator:
14455
0
    return NurbsOrientationInterpolator_Create();
14456
0
  case TAG_X3D_NurbsPatchSurface:
14457
0
    return NurbsPatchSurface_Create();
14458
0
  case TAG_X3D_NurbsPositionInterpolator:
14459
0
    return NurbsPositionInterpolator_Create();
14460
0
  case TAG_X3D_NurbsSet:
14461
0
    return NurbsSet_Create();
14462
0
  case TAG_X3D_NurbsSurfaceInterpolator:
14463
0
    return NurbsSurfaceInterpolator_Create();
14464
0
  case TAG_X3D_NurbsSweptSurface:
14465
0
    return NurbsSweptSurface_Create();
14466
0
  case TAG_X3D_NurbsSwungSurface:
14467
0
    return NurbsSwungSurface_Create();
14468
0
  case TAG_X3D_NurbsTextureCoordinate:
14469
0
    return NurbsTextureCoordinate_Create();
14470
0
  case TAG_X3D_NurbsTrimmedSurface:
14471
0
    return NurbsTrimmedSurface_Create();
14472
0
  case TAG_X3D_OrientationInterpolator:
14473
0
    return OrientationInterpolator_Create();
14474
0
  case TAG_X3D_PixelTexture:
14475
0
    return PixelTexture_Create();
14476
0
  case TAG_X3D_PlaneSensor:
14477
0
    return PlaneSensor_Create();
14478
0
  case TAG_X3D_PointLight:
14479
0
    return PointLight_Create();
14480
0
  case TAG_X3D_PointSet:
14481
0
    return PointSet_Create();
14482
0
  case TAG_X3D_Polyline2D:
14483
0
    return Polyline2D_Create();
14484
0
  case TAG_X3D_Polypoint2D:
14485
0
    return Polypoint2D_Create();
14486
0
  case TAG_X3D_PositionInterpolator:
14487
0
    return PositionInterpolator_Create();
14488
0
  case TAG_X3D_PositionInterpolator2D:
14489
0
    return PositionInterpolator2D_Create();
14490
0
  case TAG_X3D_ProximitySensor:
14491
0
    return ProximitySensor_Create();
14492
0
  case TAG_X3D_ReceiverPdu:
14493
0
    return ReceiverPdu_Create();
14494
0
  case TAG_X3D_Rectangle2D:
14495
0
    return Rectangle2D_Create();
14496
0
  case TAG_X3D_ScalarInterpolator:
14497
0
    return ScalarInterpolator_Create();
14498
0
  case TAG_X3D_Script:
14499
0
    return Script_Create();
14500
0
  case TAG_X3D_Shape:
14501
0
    return Shape_Create();
14502
0
  case TAG_X3D_SignalPdu:
14503
0
    return SignalPdu_Create();
14504
0
  case TAG_X3D_Sound:
14505
0
    return Sound_Create();
14506
0
  case TAG_X3D_Sphere:
14507
0
    return Sphere_Create();
14508
0
  case TAG_X3D_SphereSensor:
14509
0
    return SphereSensor_Create();
14510
0
  case TAG_X3D_SpotLight:
14511
0
    return SpotLight_Create();
14512
0
  case TAG_X3D_StaticGroup:
14513
0
    return StaticGroup_Create();
14514
0
  case TAG_X3D_StringSensor:
14515
0
    return StringSensor_Create();
14516
0
  case TAG_X3D_Switch:
14517
0
    return Switch_Create();
14518
0
  case TAG_X3D_Text:
14519
0
    return Text_Create();
14520
0
  case TAG_X3D_TextureBackground:
14521
0
    return TextureBackground_Create();
14522
0
  case TAG_X3D_TextureCoordinate:
14523
0
    return TextureCoordinate_Create();
14524
0
  case TAG_X3D_TextureCoordinateGenerator:
14525
0
    return TextureCoordinateGenerator_Create();
14526
0
  case TAG_X3D_TextureTransform:
14527
0
    return TextureTransform_Create();
14528
0
  case TAG_X3D_TimeSensor:
14529
0
    return TimeSensor_Create();
14530
0
  case TAG_X3D_TimeTrigger:
14531
0
    return TimeTrigger_Create();
14532
0
  case TAG_X3D_TouchSensor:
14533
0
    return TouchSensor_Create();
14534
0
  case TAG_X3D_Transform:
14535
0
    return Transform_Create();
14536
0
  case TAG_X3D_TransmitterPdu:
14537
0
    return TransmitterPdu_Create();
14538
0
  case TAG_X3D_TriangleFanSet:
14539
0
    return TriangleFanSet_Create();
14540
0
  case TAG_X3D_TriangleSet:
14541
0
    return TriangleSet_Create();
14542
0
  case TAG_X3D_TriangleSet2D:
14543
0
    return TriangleSet2D_Create();
14544
0
  case TAG_X3D_TriangleStripSet:
14545
0
    return TriangleStripSet_Create();
14546
0
  case TAG_X3D_Viewpoint:
14547
0
    return Viewpoint_Create();
14548
0
  case TAG_X3D_VisibilitySensor:
14549
0
    return VisibilitySensor_Create();
14550
0
  case TAG_X3D_WorldInfo:
14551
0
    return WorldInfo_Create();
14552
0
  default:
14553
0
    return NULL;
14554
0
  }
14555
0
}
14556
14557
const char *gf_sg_x3d_node_get_class_name(u32 NodeTag)
14558
0
{
14559
0
  switch (NodeTag) {
14560
0
  case TAG_X3D_Anchor:
14561
0
    return "Anchor";
14562
0
  case TAG_X3D_Appearance:
14563
0
    return "Appearance";
14564
0
  case TAG_X3D_Arc2D:
14565
0
    return "Arc2D";
14566
0
  case TAG_X3D_ArcClose2D:
14567
0
    return "ArcClose2D";
14568
0
  case TAG_X3D_AudioClip:
14569
0
    return "AudioClip";
14570
0
  case TAG_X3D_Background:
14571
0
    return "Background";
14572
0
  case TAG_X3D_Billboard:
14573
0
    return "Billboard";
14574
0
  case TAG_X3D_BooleanFilter:
14575
0
    return "BooleanFilter";
14576
0
  case TAG_X3D_BooleanSequencer:
14577
0
    return "BooleanSequencer";
14578
0
  case TAG_X3D_BooleanToggle:
14579
0
    return "BooleanToggle";
14580
0
  case TAG_X3D_BooleanTrigger:
14581
0
    return "BooleanTrigger";
14582
0
  case TAG_X3D_Box:
14583
0
    return "Box";
14584
0
  case TAG_X3D_Circle2D:
14585
0
    return "Circle2D";
14586
0
  case TAG_X3D_Collision:
14587
0
    return "Collision";
14588
0
  case TAG_X3D_Color:
14589
0
    return "Color";
14590
0
  case TAG_X3D_ColorInterpolator:
14591
0
    return "ColorInterpolator";
14592
0
  case TAG_X3D_ColorRGBA:
14593
0
    return "ColorRGBA";
14594
0
  case TAG_X3D_Cone:
14595
0
    return "Cone";
14596
0
  case TAG_X3D_Contour2D:
14597
0
    return "Contour2D";
14598
0
  case TAG_X3D_ContourPolyline2D:
14599
0
    return "ContourPolyline2D";
14600
0
  case TAG_X3D_Coordinate:
14601
0
    return "Coordinate";
14602
0
  case TAG_X3D_CoordinateDouble:
14603
0
    return "CoordinateDouble";
14604
0
  case TAG_X3D_Coordinate2D:
14605
0
    return "Coordinate2D";
14606
0
  case TAG_X3D_CoordinateInterpolator:
14607
0
    return "CoordinateInterpolator";
14608
0
  case TAG_X3D_CoordinateInterpolator2D:
14609
0
    return "CoordinateInterpolator2D";
14610
0
  case TAG_X3D_Cylinder:
14611
0
    return "Cylinder";
14612
0
  case TAG_X3D_CylinderSensor:
14613
0
    return "CylinderSensor";
14614
0
  case TAG_X3D_DirectionalLight:
14615
0
    return "DirectionalLight";
14616
0
  case TAG_X3D_Disk2D:
14617
0
    return "Disk2D";
14618
0
  case TAG_X3D_ElevationGrid:
14619
0
    return "ElevationGrid";
14620
0
  case TAG_X3D_EspduTransform:
14621
0
    return "EspduTransform";
14622
0
  case TAG_X3D_Extrusion:
14623
0
    return "Extrusion";
14624
0
  case TAG_X3D_FillProperties:
14625
0
    return "FillProperties";
14626
0
  case TAG_X3D_Fog:
14627
0
    return "Fog";
14628
0
  case TAG_X3D_FontStyle:
14629
0
    return "FontStyle";
14630
0
  case TAG_X3D_GeoCoordinate:
14631
0
    return "GeoCoordinate";
14632
0
  case TAG_X3D_GeoElevationGrid:
14633
0
    return "GeoElevationGrid";
14634
0
  case TAG_X3D_GeoLocation:
14635
0
    return "GeoLocation";
14636
0
  case TAG_X3D_GeoLOD:
14637
0
    return "GeoLOD";
14638
0
  case TAG_X3D_GeoMetadata:
14639
0
    return "GeoMetadata";
14640
0
  case TAG_X3D_GeoOrigin:
14641
0
    return "GeoOrigin";
14642
0
  case TAG_X3D_GeoPositionInterpolator:
14643
0
    return "GeoPositionInterpolator";
14644
0
  case TAG_X3D_GeoTouchSensor:
14645
0
    return "GeoTouchSensor";
14646
0
  case TAG_X3D_GeoViewpoint:
14647
0
    return "GeoViewpoint";
14648
0
  case TAG_X3D_Group:
14649
0
    return "Group";
14650
0
  case TAG_X3D_HAnimDisplacer:
14651
0
    return "HAnimDisplacer";
14652
0
  case TAG_X3D_HAnimHumanoid:
14653
0
    return "HAnimHumanoid";
14654
0
  case TAG_X3D_HAnimJoint:
14655
0
    return "HAnimJoint";
14656
0
  case TAG_X3D_HAnimSegment:
14657
0
    return "HAnimSegment";
14658
0
  case TAG_X3D_HAnimSite:
14659
0
    return "HAnimSite";
14660
0
  case TAG_X3D_ImageTexture:
14661
0
    return "ImageTexture";
14662
0
  case TAG_X3D_IndexedFaceSet:
14663
0
    return "IndexedFaceSet";
14664
0
  case TAG_X3D_IndexedLineSet:
14665
0
    return "IndexedLineSet";
14666
0
  case TAG_X3D_IndexedTriangleFanSet:
14667
0
    return "IndexedTriangleFanSet";
14668
0
  case TAG_X3D_IndexedTriangleSet:
14669
0
    return "IndexedTriangleSet";
14670
0
  case TAG_X3D_IndexedTriangleStripSet:
14671
0
    return "IndexedTriangleStripSet";
14672
0
  case TAG_X3D_Inline:
14673
0
    return "Inline";
14674
0
  case TAG_X3D_IntegerSequencer:
14675
0
    return "IntegerSequencer";
14676
0
  case TAG_X3D_IntegerTrigger:
14677
0
    return "IntegerTrigger";
14678
0
  case TAG_X3D_KeySensor:
14679
0
    return "KeySensor";
14680
0
  case TAG_X3D_LineProperties:
14681
0
    return "LineProperties";
14682
0
  case TAG_X3D_LineSet:
14683
0
    return "LineSet";
14684
0
  case TAG_X3D_LoadSensor:
14685
0
    return "LoadSensor";
14686
0
  case TAG_X3D_LOD:
14687
0
    return "LOD";
14688
0
  case TAG_X3D_Material:
14689
0
    return "Material";
14690
0
  case TAG_X3D_MetadataDouble:
14691
0
    return "MetadataDouble";
14692
0
  case TAG_X3D_MetadataFloat:
14693
0
    return "MetadataFloat";
14694
0
  case TAG_X3D_MetadataInteger:
14695
0
    return "MetadataInteger";
14696
0
  case TAG_X3D_MetadataSet:
14697
0
    return "MetadataSet";
14698
0
  case TAG_X3D_MetadataString:
14699
0
    return "MetadataString";
14700
0
  case TAG_X3D_MovieTexture:
14701
0
    return "MovieTexture";
14702
0
  case TAG_X3D_MultiTexture:
14703
0
    return "MultiTexture";
14704
0
  case TAG_X3D_MultiTextureCoordinate:
14705
0
    return "MultiTextureCoordinate";
14706
0
  case TAG_X3D_MultiTextureTransform:
14707
0
    return "MultiTextureTransform";
14708
0
  case TAG_X3D_NavigationInfo:
14709
0
    return "NavigationInfo";
14710
0
  case TAG_X3D_Normal:
14711
0
    return "Normal";
14712
0
  case TAG_X3D_NormalInterpolator:
14713
0
    return "NormalInterpolator";
14714
0
  case TAG_X3D_NurbsCurve:
14715
0
    return "NurbsCurve";
14716
0
  case TAG_X3D_NurbsCurve2D:
14717
0
    return "NurbsCurve2D";
14718
0
  case TAG_X3D_NurbsOrientationInterpolator:
14719
0
    return "NurbsOrientationInterpolator";
14720
0
  case TAG_X3D_NurbsPatchSurface:
14721
0
    return "NurbsPatchSurface";
14722
0
  case TAG_X3D_NurbsPositionInterpolator:
14723
0
    return "NurbsPositionInterpolator";
14724
0
  case TAG_X3D_NurbsSet:
14725
0
    return "NurbsSet";
14726
0
  case TAG_X3D_NurbsSurfaceInterpolator:
14727
0
    return "NurbsSurfaceInterpolator";
14728
0
  case TAG_X3D_NurbsSweptSurface:
14729
0
    return "NurbsSweptSurface";
14730
0
  case TAG_X3D_NurbsSwungSurface:
14731
0
    return "NurbsSwungSurface";
14732
0
  case TAG_X3D_NurbsTextureCoordinate:
14733
0
    return "NurbsTextureCoordinate";
14734
0
  case TAG_X3D_NurbsTrimmedSurface:
14735
0
    return "NurbsTrimmedSurface";
14736
0
  case TAG_X3D_OrientationInterpolator:
14737
0
    return "OrientationInterpolator";
14738
0
  case TAG_X3D_PixelTexture:
14739
0
    return "PixelTexture";
14740
0
  case TAG_X3D_PlaneSensor:
14741
0
    return "PlaneSensor";
14742
0
  case TAG_X3D_PointLight:
14743
0
    return "PointLight";
14744
0
  case TAG_X3D_PointSet:
14745
0
    return "PointSet";
14746
0
  case TAG_X3D_Polyline2D:
14747
0
    return "Polyline2D";
14748
0
  case TAG_X3D_Polypoint2D:
14749
0
    return "Polypoint2D";
14750
0
  case TAG_X3D_PositionInterpolator:
14751
0
    return "PositionInterpolator";
14752
0
  case TAG_X3D_PositionInterpolator2D:
14753
0
    return "PositionInterpolator2D";
14754
0
  case TAG_X3D_ProximitySensor:
14755
0
    return "ProximitySensor";
14756
0
  case TAG_X3D_ReceiverPdu:
14757
0
    return "ReceiverPdu";
14758
0
  case TAG_X3D_Rectangle2D:
14759
0
    return "Rectangle2D";
14760
0
  case TAG_X3D_ScalarInterpolator:
14761
0
    return "ScalarInterpolator";
14762
0
  case TAG_X3D_Script:
14763
0
    return "Script";
14764
0
  case TAG_X3D_Shape:
14765
0
    return "Shape";
14766
0
  case TAG_X3D_SignalPdu:
14767
0
    return "SignalPdu";
14768
0
  case TAG_X3D_Sound:
14769
0
    return "Sound";
14770
0
  case TAG_X3D_Sphere:
14771
0
    return "Sphere";
14772
0
  case TAG_X3D_SphereSensor:
14773
0
    return "SphereSensor";
14774
0
  case TAG_X3D_SpotLight:
14775
0
    return "SpotLight";
14776
0
  case TAG_X3D_StaticGroup:
14777
0
    return "StaticGroup";
14778
0
  case TAG_X3D_StringSensor:
14779
0
    return "StringSensor";
14780
0
  case TAG_X3D_Switch:
14781
0
    return "Switch";
14782
0
  case TAG_X3D_Text:
14783
0
    return "Text";
14784
0
  case TAG_X3D_TextureBackground:
14785
0
    return "TextureBackground";
14786
0
  case TAG_X3D_TextureCoordinate:
14787
0
    return "TextureCoordinate";
14788
0
  case TAG_X3D_TextureCoordinateGenerator:
14789
0
    return "TextureCoordinateGenerator";
14790
0
  case TAG_X3D_TextureTransform:
14791
0
    return "TextureTransform";
14792
0
  case TAG_X3D_TimeSensor:
14793
0
    return "TimeSensor";
14794
0
  case TAG_X3D_TimeTrigger:
14795
0
    return "TimeTrigger";
14796
0
  case TAG_X3D_TouchSensor:
14797
0
    return "TouchSensor";
14798
0
  case TAG_X3D_Transform:
14799
0
    return "Transform";
14800
0
  case TAG_X3D_TransmitterPdu:
14801
0
    return "TransmitterPdu";
14802
0
  case TAG_X3D_TriangleFanSet:
14803
0
    return "TriangleFanSet";
14804
0
  case TAG_X3D_TriangleSet:
14805
0
    return "TriangleSet";
14806
0
  case TAG_X3D_TriangleSet2D:
14807
0
    return "TriangleSet2D";
14808
0
  case TAG_X3D_TriangleStripSet:
14809
0
    return "TriangleStripSet";
14810
0
  case TAG_X3D_Viewpoint:
14811
0
    return "Viewpoint";
14812
0
  case TAG_X3D_VisibilitySensor:
14813
0
    return "VisibilitySensor";
14814
0
  case TAG_X3D_WorldInfo:
14815
0
    return "WorldInfo";
14816
0
  default:
14817
0
    return "Unknown Node";
14818
0
  }
14819
0
}
14820
14821
void gf_sg_x3d_node_del(GF_Node *node)
14822
0
{
14823
0
  switch (node->sgprivate->tag) {
14824
0
  case TAG_X3D_Anchor:
14825
0
    Anchor_Del(node);
14826
0
    return;
14827
0
  case TAG_X3D_Appearance:
14828
0
    Appearance_Del(node);
14829
0
    return;
14830
0
  case TAG_X3D_Arc2D:
14831
0
    Arc2D_Del(node);
14832
0
    return;
14833
0
  case TAG_X3D_ArcClose2D:
14834
0
    ArcClose2D_Del(node);
14835
0
    return;
14836
0
  case TAG_X3D_AudioClip:
14837
0
    AudioClip_Del(node);
14838
0
    return;
14839
0
  case TAG_X3D_Background:
14840
0
    Background_Del(node);
14841
0
    return;
14842
0
  case TAG_X3D_Billboard:
14843
0
    Billboard_Del(node);
14844
0
    return;
14845
0
  case TAG_X3D_BooleanFilter:
14846
0
    BooleanFilter_Del(node);
14847
0
    return;
14848
0
  case TAG_X3D_BooleanSequencer:
14849
0
    BooleanSequencer_Del(node);
14850
0
    return;
14851
0
  case TAG_X3D_BooleanToggle:
14852
0
    BooleanToggle_Del(node);
14853
0
    return;
14854
0
  case TAG_X3D_BooleanTrigger:
14855
0
    BooleanTrigger_Del(node);
14856
0
    return;
14857
0
  case TAG_X3D_Box:
14858
0
    Box_Del(node);
14859
0
    return;
14860
0
  case TAG_X3D_Circle2D:
14861
0
    Circle2D_Del(node);
14862
0
    return;
14863
0
  case TAG_X3D_Collision:
14864
0
    Collision_Del(node);
14865
0
    return;
14866
0
  case TAG_X3D_Color:
14867
0
    Color_Del(node);
14868
0
    return;
14869
0
  case TAG_X3D_ColorInterpolator:
14870
0
    ColorInterpolator_Del(node);
14871
0
    return;
14872
0
  case TAG_X3D_ColorRGBA:
14873
0
    ColorRGBA_Del(node);
14874
0
    return;
14875
0
  case TAG_X3D_Cone:
14876
0
    Cone_Del(node);
14877
0
    return;
14878
0
  case TAG_X3D_Contour2D:
14879
0
    Contour2D_Del(node);
14880
0
    return;
14881
0
  case TAG_X3D_ContourPolyline2D:
14882
0
    ContourPolyline2D_Del(node);
14883
0
    return;
14884
0
  case TAG_X3D_Coordinate:
14885
0
    Coordinate_Del(node);
14886
0
    return;
14887
0
  case TAG_X3D_CoordinateDouble:
14888
0
    CoordinateDouble_Del(node);
14889
0
    return;
14890
0
  case TAG_X3D_Coordinate2D:
14891
0
    Coordinate2D_Del(node);
14892
0
    return;
14893
0
  case TAG_X3D_CoordinateInterpolator:
14894
0
    CoordinateInterpolator_Del(node);
14895
0
    return;
14896
0
  case TAG_X3D_CoordinateInterpolator2D:
14897
0
    CoordinateInterpolator2D_Del(node);
14898
0
    return;
14899
0
  case TAG_X3D_Cylinder:
14900
0
    Cylinder_Del(node);
14901
0
    return;
14902
0
  case TAG_X3D_CylinderSensor:
14903
0
    CylinderSensor_Del(node);
14904
0
    return;
14905
0
  case TAG_X3D_DirectionalLight:
14906
0
    DirectionalLight_Del(node);
14907
0
    return;
14908
0
  case TAG_X3D_Disk2D:
14909
0
    Disk2D_Del(node);
14910
0
    return;
14911
0
  case TAG_X3D_ElevationGrid:
14912
0
    ElevationGrid_Del(node);
14913
0
    return;
14914
0
  case TAG_X3D_EspduTransform:
14915
0
    EspduTransform_Del(node);
14916
0
    return;
14917
0
  case TAG_X3D_Extrusion:
14918
0
    Extrusion_Del(node);
14919
0
    return;
14920
0
  case TAG_X3D_FillProperties:
14921
0
    FillProperties_Del(node);
14922
0
    return;
14923
0
  case TAG_X3D_Fog:
14924
0
    Fog_Del(node);
14925
0
    return;
14926
0
  case TAG_X3D_FontStyle:
14927
0
    FontStyle_Del(node);
14928
0
    return;
14929
0
  case TAG_X3D_GeoCoordinate:
14930
0
    GeoCoordinate_Del(node);
14931
0
    return;
14932
0
  case TAG_X3D_GeoElevationGrid:
14933
0
    GeoElevationGrid_Del(node);
14934
0
    return;
14935
0
  case TAG_X3D_GeoLocation:
14936
0
    GeoLocation_Del(node);
14937
0
    return;
14938
0
  case TAG_X3D_GeoLOD:
14939
0
    GeoLOD_Del(node);
14940
0
    return;
14941
0
  case TAG_X3D_GeoMetadata:
14942
0
    GeoMetadata_Del(node);
14943
0
    return;
14944
0
  case TAG_X3D_GeoOrigin:
14945
0
    GeoOrigin_Del(node);
14946
0
    return;
14947
0
  case TAG_X3D_GeoPositionInterpolator:
14948
0
    GeoPositionInterpolator_Del(node);
14949
0
    return;
14950
0
  case TAG_X3D_GeoTouchSensor:
14951
0
    GeoTouchSensor_Del(node);
14952
0
    return;
14953
0
  case TAG_X3D_GeoViewpoint:
14954
0
    GeoViewpoint_Del(node);
14955
0
    return;
14956
0
  case TAG_X3D_Group:
14957
0
    Group_Del(node);
14958
0
    return;
14959
0
  case TAG_X3D_HAnimDisplacer:
14960
0
    HAnimDisplacer_Del(node);
14961
0
    return;
14962
0
  case TAG_X3D_HAnimHumanoid:
14963
0
    HAnimHumanoid_Del(node);
14964
0
    return;
14965
0
  case TAG_X3D_HAnimJoint:
14966
0
    HAnimJoint_Del(node);
14967
0
    return;
14968
0
  case TAG_X3D_HAnimSegment:
14969
0
    HAnimSegment_Del(node);
14970
0
    return;
14971
0
  case TAG_X3D_HAnimSite:
14972
0
    HAnimSite_Del(node);
14973
0
    return;
14974
0
  case TAG_X3D_ImageTexture:
14975
0
    ImageTexture_Del(node);
14976
0
    return;
14977
0
  case TAG_X3D_IndexedFaceSet:
14978
0
    IndexedFaceSet_Del(node);
14979
0
    return;
14980
0
  case TAG_X3D_IndexedLineSet:
14981
0
    IndexedLineSet_Del(node);
14982
0
    return;
14983
0
  case TAG_X3D_IndexedTriangleFanSet:
14984
0
    IndexedTriangleFanSet_Del(node);
14985
0
    return;
14986
0
  case TAG_X3D_IndexedTriangleSet:
14987
0
    IndexedTriangleSet_Del(node);
14988
0
    return;
14989
0
  case TAG_X3D_IndexedTriangleStripSet:
14990
0
    IndexedTriangleStripSet_Del(node);
14991
0
    return;
14992
0
  case TAG_X3D_Inline:
14993
0
    Inline_Del(node);
14994
0
    return;
14995
0
  case TAG_X3D_IntegerSequencer:
14996
0
    IntegerSequencer_Del(node);
14997
0
    return;
14998
0
  case TAG_X3D_IntegerTrigger:
14999
0
    IntegerTrigger_Del(node);
15000
0
    return;
15001
0
  case TAG_X3D_KeySensor:
15002
0
    KeySensor_Del(node);
15003
0
    return;
15004
0
  case TAG_X3D_LineProperties:
15005
0
    LineProperties_Del(node);
15006
0
    return;
15007
0
  case TAG_X3D_LineSet:
15008
0
    LineSet_Del(node);
15009
0
    return;
15010
0
  case TAG_X3D_LoadSensor:
15011
0
    LoadSensor_Del(node);
15012
0
    return;
15013
0
  case TAG_X3D_LOD:
15014
0
    LOD_Del(node);
15015
0
    return;
15016
0
  case TAG_X3D_Material:
15017
0
    Material_Del(node);
15018
0
    return;
15019
0
  case TAG_X3D_MetadataDouble:
15020
0
    MetadataDouble_Del(node);
15021
0
    return;
15022
0
  case TAG_X3D_MetadataFloat:
15023
0
    MetadataFloat_Del(node);
15024
0
    return;
15025
0
  case TAG_X3D_MetadataInteger:
15026
0
    MetadataInteger_Del(node);
15027
0
    return;
15028
0
  case TAG_X3D_MetadataSet:
15029
0
    MetadataSet_Del(node);
15030
0
    return;
15031
0
  case TAG_X3D_MetadataString:
15032
0
    MetadataString_Del(node);
15033
0
    return;
15034
0
  case TAG_X3D_MovieTexture:
15035
0
    MovieTexture_Del(node);
15036
0
    return;
15037
0
  case TAG_X3D_MultiTexture:
15038
0
    MultiTexture_Del(node);
15039
0
    return;
15040
0
  case TAG_X3D_MultiTextureCoordinate:
15041
0
    MultiTextureCoordinate_Del(node);
15042
0
    return;
15043
0
  case TAG_X3D_MultiTextureTransform:
15044
0
    MultiTextureTransform_Del(node);
15045
0
    return;
15046
0
  case TAG_X3D_NavigationInfo:
15047
0
    NavigationInfo_Del(node);
15048
0
    return;
15049
0
  case TAG_X3D_Normal:
15050
0
    Normal_Del(node);
15051
0
    return;
15052
0
  case TAG_X3D_NormalInterpolator:
15053
0
    NormalInterpolator_Del(node);
15054
0
    return;
15055
0
  case TAG_X3D_NurbsCurve:
15056
0
    NurbsCurve_Del(node);
15057
0
    return;
15058
0
  case TAG_X3D_NurbsCurve2D:
15059
0
    NurbsCurve2D_Del(node);
15060
0
    return;
15061
0
  case TAG_X3D_NurbsOrientationInterpolator:
15062
0
    NurbsOrientationInterpolator_Del(node);
15063
0
    return;
15064
0
  case TAG_X3D_NurbsPatchSurface:
15065
0
    NurbsPatchSurface_Del(node);
15066
0
    return;
15067
0
  case TAG_X3D_NurbsPositionInterpolator:
15068
0
    NurbsPositionInterpolator_Del(node);
15069
0
    return;
15070
0
  case TAG_X3D_NurbsSet:
15071
0
    NurbsSet_Del(node);
15072
0
    return;
15073
0
  case TAG_X3D_NurbsSurfaceInterpolator:
15074
0
    NurbsSurfaceInterpolator_Del(node);
15075
0
    return;
15076
0
  case TAG_X3D_NurbsSweptSurface:
15077
0
    NurbsSweptSurface_Del(node);
15078
0
    return;
15079
0
  case TAG_X3D_NurbsSwungSurface:
15080
0
    NurbsSwungSurface_Del(node);
15081
0
    return;
15082
0
  case TAG_X3D_NurbsTextureCoordinate:
15083
0
    NurbsTextureCoordinate_Del(node);
15084
0
    return;
15085
0
  case TAG_X3D_NurbsTrimmedSurface:
15086
0
    NurbsTrimmedSurface_Del(node);
15087
0
    return;
15088
0
  case TAG_X3D_OrientationInterpolator:
15089
0
    OrientationInterpolator_Del(node);
15090
0
    return;
15091
0
  case TAG_X3D_PixelTexture:
15092
0
    PixelTexture_Del(node);
15093
0
    return;
15094
0
  case TAG_X3D_PlaneSensor:
15095
0
    PlaneSensor_Del(node);
15096
0
    return;
15097
0
  case TAG_X3D_PointLight:
15098
0
    PointLight_Del(node);
15099
0
    return;
15100
0
  case TAG_X3D_PointSet:
15101
0
    PointSet_Del(node);
15102
0
    return;
15103
0
  case TAG_X3D_Polyline2D:
15104
0
    Polyline2D_Del(node);
15105
0
    return;
15106
0
  case TAG_X3D_Polypoint2D:
15107
0
    Polypoint2D_Del(node);
15108
0
    return;
15109
0
  case TAG_X3D_PositionInterpolator:
15110
0
    PositionInterpolator_Del(node);
15111
0
    return;
15112
0
  case TAG_X3D_PositionInterpolator2D:
15113
0
    PositionInterpolator2D_Del(node);
15114
0
    return;
15115
0
  case TAG_X3D_ProximitySensor:
15116
0
    ProximitySensor_Del(node);
15117
0
    return;
15118
0
  case TAG_X3D_ReceiverPdu:
15119
0
    ReceiverPdu_Del(node);
15120
0
    return;
15121
0
  case TAG_X3D_Rectangle2D:
15122
0
    Rectangle2D_Del(node);
15123
0
    return;
15124
0
  case TAG_X3D_ScalarInterpolator:
15125
0
    ScalarInterpolator_Del(node);
15126
0
    return;
15127
0
  case TAG_X3D_Script:
15128
0
    Script_Del(node);
15129
0
    return;
15130
0
  case TAG_X3D_Shape:
15131
0
    Shape_Del(node);
15132
0
    return;
15133
0
  case TAG_X3D_SignalPdu:
15134
0
    SignalPdu_Del(node);
15135
0
    return;
15136
0
  case TAG_X3D_Sound:
15137
0
    Sound_Del(node);
15138
0
    return;
15139
0
  case TAG_X3D_Sphere:
15140
0
    Sphere_Del(node);
15141
0
    return;
15142
0
  case TAG_X3D_SphereSensor:
15143
0
    SphereSensor_Del(node);
15144
0
    return;
15145
0
  case TAG_X3D_SpotLight:
15146
0
    SpotLight_Del(node);
15147
0
    return;
15148
0
  case TAG_X3D_StaticGroup:
15149
0
    StaticGroup_Del(node);
15150
0
    return;
15151
0
  case TAG_X3D_StringSensor:
15152
0
    StringSensor_Del(node);
15153
0
    return;
15154
0
  case TAG_X3D_Switch:
15155
0
    Switch_Del(node);
15156
0
    return;
15157
0
  case TAG_X3D_Text:
15158
0
    Text_Del(node);
15159
0
    return;
15160
0
  case TAG_X3D_TextureBackground:
15161
0
    TextureBackground_Del(node);
15162
0
    return;
15163
0
  case TAG_X3D_TextureCoordinate:
15164
0
    TextureCoordinate_Del(node);
15165
0
    return;
15166
0
  case TAG_X3D_TextureCoordinateGenerator:
15167
0
    TextureCoordinateGenerator_Del(node);
15168
0
    return;
15169
0
  case TAG_X3D_TextureTransform:
15170
0
    TextureTransform_Del(node);
15171
0
    return;
15172
0
  case TAG_X3D_TimeSensor:
15173
0
    TimeSensor_Del(node);
15174
0
    return;
15175
0
  case TAG_X3D_TimeTrigger:
15176
0
    TimeTrigger_Del(node);
15177
0
    return;
15178
0
  case TAG_X3D_TouchSensor:
15179
0
    TouchSensor_Del(node);
15180
0
    return;
15181
0
  case TAG_X3D_Transform:
15182
0
    Transform_Del(node);
15183
0
    return;
15184
0
  case TAG_X3D_TransmitterPdu:
15185
0
    TransmitterPdu_Del(node);
15186
0
    return;
15187
0
  case TAG_X3D_TriangleFanSet:
15188
0
    TriangleFanSet_Del(node);
15189
0
    return;
15190
0
  case TAG_X3D_TriangleSet:
15191
0
    TriangleSet_Del(node);
15192
0
    return;
15193
0
  case TAG_X3D_TriangleSet2D:
15194
0
    TriangleSet2D_Del(node);
15195
0
    return;
15196
0
  case TAG_X3D_TriangleStripSet:
15197
0
    TriangleStripSet_Del(node);
15198
0
    return;
15199
0
  case TAG_X3D_Viewpoint:
15200
0
    Viewpoint_Del(node);
15201
0
    return;
15202
0
  case TAG_X3D_VisibilitySensor:
15203
0
    VisibilitySensor_Del(node);
15204
0
    return;
15205
0
  case TAG_X3D_WorldInfo:
15206
0
    WorldInfo_Del(node);
15207
0
    return;
15208
0
  default:
15209
0
    return;
15210
0
  }
15211
0
}
15212
15213
u32 gf_sg_x3d_node_get_field_count(GF_Node *node)
15214
0
{
15215
0
  switch (node->sgprivate->tag) {
15216
0
  case TAG_X3D_Anchor:
15217
0
    return Anchor_get_field_count(node, 0);
15218
0
  case TAG_X3D_Appearance:
15219
0
    return Appearance_get_field_count(node, 0);
15220
0
  case TAG_X3D_Arc2D:
15221
0
    return Arc2D_get_field_count(node, 0);
15222
0
  case TAG_X3D_ArcClose2D:
15223
0
    return ArcClose2D_get_field_count(node, 0);
15224
0
  case TAG_X3D_AudioClip:
15225
0
    return AudioClip_get_field_count(node, 0);
15226
0
  case TAG_X3D_Background:
15227
0
    return Background_get_field_count(node, 0);
15228
0
  case TAG_X3D_Billboard:
15229
0
    return Billboard_get_field_count(node, 0);
15230
0
  case TAG_X3D_BooleanFilter:
15231
0
    return BooleanFilter_get_field_count(node, 0);
15232
0
  case TAG_X3D_BooleanSequencer:
15233
0
    return BooleanSequencer_get_field_count(node, 0);
15234
0
  case TAG_X3D_BooleanToggle:
15235
0
    return BooleanToggle_get_field_count(node, 0);
15236
0
  case TAG_X3D_BooleanTrigger:
15237
0
    return BooleanTrigger_get_field_count(node, 0);
15238
0
  case TAG_X3D_Box:
15239
0
    return Box_get_field_count(node, 0);
15240
0
  case TAG_X3D_Circle2D:
15241
0
    return Circle2D_get_field_count(node, 0);
15242
0
  case TAG_X3D_Collision:
15243
0
    return Collision_get_field_count(node, 0);
15244
0
  case TAG_X3D_Color:
15245
0
    return Color_get_field_count(node, 0);
15246
0
  case TAG_X3D_ColorInterpolator:
15247
0
    return ColorInterpolator_get_field_count(node, 0);
15248
0
  case TAG_X3D_ColorRGBA:
15249
0
    return ColorRGBA_get_field_count(node, 0);
15250
0
  case TAG_X3D_Cone:
15251
0
    return Cone_get_field_count(node, 0);
15252
0
  case TAG_X3D_Contour2D:
15253
0
    return Contour2D_get_field_count(node, 0);
15254
0
  case TAG_X3D_ContourPolyline2D:
15255
0
    return ContourPolyline2D_get_field_count(node, 0);
15256
0
  case TAG_X3D_Coordinate:
15257
0
    return Coordinate_get_field_count(node, 0);
15258
0
  case TAG_X3D_CoordinateDouble:
15259
0
    return CoordinateDouble_get_field_count(node, 0);
15260
0
  case TAG_X3D_Coordinate2D:
15261
0
    return Coordinate2D_get_field_count(node, 0);
15262
0
  case TAG_X3D_CoordinateInterpolator:
15263
0
    return CoordinateInterpolator_get_field_count(node, 0);
15264
0
  case TAG_X3D_CoordinateInterpolator2D:
15265
0
    return CoordinateInterpolator2D_get_field_count(node, 0);
15266
0
  case TAG_X3D_Cylinder:
15267
0
    return Cylinder_get_field_count(node, 0);
15268
0
  case TAG_X3D_CylinderSensor:
15269
0
    return CylinderSensor_get_field_count(node, 0);
15270
0
  case TAG_X3D_DirectionalLight:
15271
0
    return DirectionalLight_get_field_count(node, 0);
15272
0
  case TAG_X3D_Disk2D:
15273
0
    return Disk2D_get_field_count(node, 0);
15274
0
  case TAG_X3D_ElevationGrid:
15275
0
    return ElevationGrid_get_field_count(node, 0);
15276
0
  case TAG_X3D_EspduTransform:
15277
0
    return EspduTransform_get_field_count(node, 0);
15278
0
  case TAG_X3D_Extrusion:
15279
0
    return Extrusion_get_field_count(node, 0);
15280
0
  case TAG_X3D_FillProperties:
15281
0
    return FillProperties_get_field_count(node, 0);
15282
0
  case TAG_X3D_Fog:
15283
0
    return Fog_get_field_count(node, 0);
15284
0
  case TAG_X3D_FontStyle:
15285
0
    return FontStyle_get_field_count(node, 0);
15286
0
  case TAG_X3D_GeoCoordinate:
15287
0
    return GeoCoordinate_get_field_count(node, 0);
15288
0
  case TAG_X3D_GeoElevationGrid:
15289
0
    return GeoElevationGrid_get_field_count(node, 0);
15290
0
  case TAG_X3D_GeoLocation:
15291
0
    return GeoLocation_get_field_count(node, 0);
15292
0
  case TAG_X3D_GeoLOD:
15293
0
    return GeoLOD_get_field_count(node, 0);
15294
0
  case TAG_X3D_GeoMetadata:
15295
0
    return GeoMetadata_get_field_count(node, 0);
15296
0
  case TAG_X3D_GeoOrigin:
15297
0
    return GeoOrigin_get_field_count(node, 0);
15298
0
  case TAG_X3D_GeoPositionInterpolator:
15299
0
    return GeoPositionInterpolator_get_field_count(node, 0);
15300
0
  case TAG_X3D_GeoTouchSensor:
15301
0
    return GeoTouchSensor_get_field_count(node, 0);
15302
0
  case TAG_X3D_GeoViewpoint:
15303
0
    return GeoViewpoint_get_field_count(node, 0);
15304
0
  case TAG_X3D_Group:
15305
0
    return Group_get_field_count(node, 0);
15306
0
  case TAG_X3D_HAnimDisplacer:
15307
0
    return HAnimDisplacer_get_field_count(node, 0);
15308
0
  case TAG_X3D_HAnimHumanoid:
15309
0
    return HAnimHumanoid_get_field_count(node, 0);
15310
0
  case TAG_X3D_HAnimJoint:
15311
0
    return HAnimJoint_get_field_count(node, 0);
15312
0
  case TAG_X3D_HAnimSegment:
15313
0
    return HAnimSegment_get_field_count(node, 0);
15314
0
  case TAG_X3D_HAnimSite:
15315
0
    return HAnimSite_get_field_count(node, 0);
15316
0
  case TAG_X3D_ImageTexture:
15317
0
    return ImageTexture_get_field_count(node, 0);
15318
0
  case TAG_X3D_IndexedFaceSet:
15319
0
    return IndexedFaceSet_get_field_count(node, 0);
15320
0
  case TAG_X3D_IndexedLineSet:
15321
0
    return IndexedLineSet_get_field_count(node, 0);
15322
0
  case TAG_X3D_IndexedTriangleFanSet:
15323
0
    return IndexedTriangleFanSet_get_field_count(node, 0);
15324
0
  case TAG_X3D_IndexedTriangleSet:
15325
0
    return IndexedTriangleSet_get_field_count(node, 0);
15326
0
  case TAG_X3D_IndexedTriangleStripSet:
15327
0
    return IndexedTriangleStripSet_get_field_count(node, 0);
15328
0
  case TAG_X3D_Inline:
15329
0
    return Inline_get_field_count(node, 0);
15330
0
  case TAG_X3D_IntegerSequencer:
15331
0
    return IntegerSequencer_get_field_count(node, 0);
15332
0
  case TAG_X3D_IntegerTrigger:
15333
0
    return IntegerTrigger_get_field_count(node, 0);
15334
0
  case TAG_X3D_KeySensor:
15335
0
    return KeySensor_get_field_count(node, 0);
15336
0
  case TAG_X3D_LineProperties:
15337
0
    return LineProperties_get_field_count(node, 0);
15338
0
  case TAG_X3D_LineSet:
15339
0
    return LineSet_get_field_count(node, 0);
15340
0
  case TAG_X3D_LoadSensor:
15341
0
    return LoadSensor_get_field_count(node, 0);
15342
0
  case TAG_X3D_LOD:
15343
0
    return LOD_get_field_count(node, 0);
15344
0
  case TAG_X3D_Material:
15345
0
    return Material_get_field_count(node, 0);
15346
0
  case TAG_X3D_MetadataDouble:
15347
0
    return MetadataDouble_get_field_count(node, 0);
15348
0
  case TAG_X3D_MetadataFloat:
15349
0
    return MetadataFloat_get_field_count(node, 0);
15350
0
  case TAG_X3D_MetadataInteger:
15351
0
    return MetadataInteger_get_field_count(node, 0);
15352
0
  case TAG_X3D_MetadataSet:
15353
0
    return MetadataSet_get_field_count(node, 0);
15354
0
  case TAG_X3D_MetadataString:
15355
0
    return MetadataString_get_field_count(node, 0);
15356
0
  case TAG_X3D_MovieTexture:
15357
0
    return MovieTexture_get_field_count(node, 0);
15358
0
  case TAG_X3D_MultiTexture:
15359
0
    return MultiTexture_get_field_count(node, 0);
15360
0
  case TAG_X3D_MultiTextureCoordinate:
15361
0
    return MultiTextureCoordinate_get_field_count(node, 0);
15362
0
  case TAG_X3D_MultiTextureTransform:
15363
0
    return MultiTextureTransform_get_field_count(node, 0);
15364
0
  case TAG_X3D_NavigationInfo:
15365
0
    return NavigationInfo_get_field_count(node, 0);
15366
0
  case TAG_X3D_Normal:
15367
0
    return Normal_get_field_count(node, 0);
15368
0
  case TAG_X3D_NormalInterpolator:
15369
0
    return NormalInterpolator_get_field_count(node, 0);
15370
0
  case TAG_X3D_NurbsCurve:
15371
0
    return NurbsCurve_get_field_count(node, 0);
15372
0
  case TAG_X3D_NurbsCurve2D:
15373
0
    return NurbsCurve2D_get_field_count(node, 0);
15374
0
  case TAG_X3D_NurbsOrientationInterpolator:
15375
0
    return NurbsOrientationInterpolator_get_field_count(node, 0);
15376
0
  case TAG_X3D_NurbsPatchSurface:
15377
0
    return NurbsPatchSurface_get_field_count(node, 0);
15378
0
  case TAG_X3D_NurbsPositionInterpolator:
15379
0
    return NurbsPositionInterpolator_get_field_count(node, 0);
15380
0
  case TAG_X3D_NurbsSet:
15381
0
    return NurbsSet_get_field_count(node, 0);
15382
0
  case TAG_X3D_NurbsSurfaceInterpolator:
15383
0
    return NurbsSurfaceInterpolator_get_field_count(node, 0);
15384
0
  case TAG_X3D_NurbsSweptSurface:
15385
0
    return NurbsSweptSurface_get_field_count(node, 0);
15386
0
  case TAG_X3D_NurbsSwungSurface:
15387
0
    return NurbsSwungSurface_get_field_count(node, 0);
15388
0
  case TAG_X3D_NurbsTextureCoordinate:
15389
0
    return NurbsTextureCoordinate_get_field_count(node, 0);
15390
0
  case TAG_X3D_NurbsTrimmedSurface:
15391
0
    return NurbsTrimmedSurface_get_field_count(node, 0);
15392
0
  case TAG_X3D_OrientationInterpolator:
15393
0
    return OrientationInterpolator_get_field_count(node, 0);
15394
0
  case TAG_X3D_PixelTexture:
15395
0
    return PixelTexture_get_field_count(node, 0);
15396
0
  case TAG_X3D_PlaneSensor:
15397
0
    return PlaneSensor_get_field_count(node, 0);
15398
0
  case TAG_X3D_PointLight:
15399
0
    return PointLight_get_field_count(node, 0);
15400
0
  case TAG_X3D_PointSet:
15401
0
    return PointSet_get_field_count(node, 0);
15402
0
  case TAG_X3D_Polyline2D:
15403
0
    return Polyline2D_get_field_count(node, 0);
15404
0
  case TAG_X3D_Polypoint2D:
15405
0
    return Polypoint2D_get_field_count(node, 0);
15406
0
  case TAG_X3D_PositionInterpolator:
15407
0
    return PositionInterpolator_get_field_count(node, 0);
15408
0
  case TAG_X3D_PositionInterpolator2D:
15409
0
    return PositionInterpolator2D_get_field_count(node, 0);
15410
0
  case TAG_X3D_ProximitySensor:
15411
0
    return ProximitySensor_get_field_count(node, 0);
15412
0
  case TAG_X3D_ReceiverPdu:
15413
0
    return ReceiverPdu_get_field_count(node, 0);
15414
0
  case TAG_X3D_Rectangle2D:
15415
0
    return Rectangle2D_get_field_count(node, 0);
15416
0
  case TAG_X3D_ScalarInterpolator:
15417
0
    return ScalarInterpolator_get_field_count(node, 0);
15418
//unused
15419
#if 0
15420
  case TAG_X3D_Script:
15421
    return Script_get_field_count(node, 0);
15422
#endif
15423
0
  case TAG_X3D_Shape:
15424
0
    return Shape_get_field_count(node, 0);
15425
0
  case TAG_X3D_SignalPdu:
15426
0
    return SignalPdu_get_field_count(node, 0);
15427
0
  case TAG_X3D_Sound:
15428
0
    return Sound_get_field_count(node, 0);
15429
0
  case TAG_X3D_Sphere:
15430
0
    return Sphere_get_field_count(node, 0);
15431
0
  case TAG_X3D_SphereSensor:
15432
0
    return SphereSensor_get_field_count(node, 0);
15433
0
  case TAG_X3D_SpotLight:
15434
0
    return SpotLight_get_field_count(node, 0);
15435
0
  case TAG_X3D_StaticGroup:
15436
0
    return StaticGroup_get_field_count(node, 0);
15437
0
  case TAG_X3D_StringSensor:
15438
0
    return StringSensor_get_field_count(node, 0);
15439
0
  case TAG_X3D_Switch:
15440
0
    return Switch_get_field_count(node, 0);
15441
0
  case TAG_X3D_Text:
15442
0
    return Text_get_field_count(node, 0);
15443
0
  case TAG_X3D_TextureBackground:
15444
0
    return TextureBackground_get_field_count(node, 0);
15445
0
  case TAG_X3D_TextureCoordinate:
15446
0
    return TextureCoordinate_get_field_count(node, 0);
15447
0
  case TAG_X3D_TextureCoordinateGenerator:
15448
0
    return TextureCoordinateGenerator_get_field_count(node, 0);
15449
0
  case TAG_X3D_TextureTransform:
15450
0
    return TextureTransform_get_field_count(node, 0);
15451
0
  case TAG_X3D_TimeSensor:
15452
0
    return TimeSensor_get_field_count(node, 0);
15453
0
  case TAG_X3D_TimeTrigger:
15454
0
    return TimeTrigger_get_field_count(node, 0);
15455
0
  case TAG_X3D_TouchSensor:
15456
0
    return TouchSensor_get_field_count(node, 0);
15457
0
  case TAG_X3D_Transform:
15458
0
    return Transform_get_field_count(node, 0);
15459
0
  case TAG_X3D_TransmitterPdu:
15460
0
    return TransmitterPdu_get_field_count(node, 0);
15461
0
  case TAG_X3D_TriangleFanSet:
15462
0
    return TriangleFanSet_get_field_count(node, 0);
15463
0
  case TAG_X3D_TriangleSet:
15464
0
    return TriangleSet_get_field_count(node, 0);
15465
0
  case TAG_X3D_TriangleSet2D:
15466
0
    return TriangleSet2D_get_field_count(node, 0);
15467
0
  case TAG_X3D_TriangleStripSet:
15468
0
    return TriangleStripSet_get_field_count(node, 0);
15469
0
  case TAG_X3D_Viewpoint:
15470
0
    return Viewpoint_get_field_count(node, 0);
15471
0
  case TAG_X3D_VisibilitySensor:
15472
0
    return VisibilitySensor_get_field_count(node, 0);
15473
0
  case TAG_X3D_WorldInfo:
15474
0
    return WorldInfo_get_field_count(node, 0);
15475
0
  default:
15476
0
    return 0;
15477
0
  }
15478
0
}
15479
15480
GF_Err gf_sg_x3d_node_get_field(GF_Node *node, GF_FieldInfo *field)
15481
0
{
15482
0
  switch (node->sgprivate->tag) {
15483
0
  case TAG_X3D_Anchor:
15484
0
    return Anchor_get_field(node, field);
15485
0
  case TAG_X3D_Appearance:
15486
0
    return Appearance_get_field(node, field);
15487
0
  case TAG_X3D_Arc2D:
15488
0
    return Arc2D_get_field(node, field);
15489
0
  case TAG_X3D_ArcClose2D:
15490
0
    return ArcClose2D_get_field(node, field);
15491
0
  case TAG_X3D_AudioClip:
15492
0
    return AudioClip_get_field(node, field);
15493
0
  case TAG_X3D_Background:
15494
0
    return Background_get_field(node, field);
15495
0
  case TAG_X3D_Billboard:
15496
0
    return Billboard_get_field(node, field);
15497
0
  case TAG_X3D_BooleanFilter:
15498
0
    return BooleanFilter_get_field(node, field);
15499
0
  case TAG_X3D_BooleanSequencer:
15500
0
    return BooleanSequencer_get_field(node, field);
15501
0
  case TAG_X3D_BooleanToggle:
15502
0
    return BooleanToggle_get_field(node, field);
15503
0
  case TAG_X3D_BooleanTrigger:
15504
0
    return BooleanTrigger_get_field(node, field);
15505
0
  case TAG_X3D_Box:
15506
0
    return Box_get_field(node, field);
15507
0
  case TAG_X3D_Circle2D:
15508
0
    return Circle2D_get_field(node, field);
15509
0
  case TAG_X3D_Collision:
15510
0
    return Collision_get_field(node, field);
15511
0
  case TAG_X3D_Color:
15512
0
    return Color_get_field(node, field);
15513
0
  case TAG_X3D_ColorInterpolator:
15514
0
    return ColorInterpolator_get_field(node, field);
15515
0
  case TAG_X3D_ColorRGBA:
15516
0
    return ColorRGBA_get_field(node, field);
15517
0
  case TAG_X3D_Cone:
15518
0
    return Cone_get_field(node, field);
15519
0
  case TAG_X3D_Contour2D:
15520
0
    return Contour2D_get_field(node, field);
15521
0
  case TAG_X3D_ContourPolyline2D:
15522
0
    return ContourPolyline2D_get_field(node, field);
15523
0
  case TAG_X3D_Coordinate:
15524
0
    return Coordinate_get_field(node, field);
15525
0
  case TAG_X3D_CoordinateDouble:
15526
0
    return CoordinateDouble_get_field(node, field);
15527
0
  case TAG_X3D_Coordinate2D:
15528
0
    return Coordinate2D_get_field(node, field);
15529
0
  case TAG_X3D_CoordinateInterpolator:
15530
0
    return CoordinateInterpolator_get_field(node, field);
15531
0
  case TAG_X3D_CoordinateInterpolator2D:
15532
0
    return CoordinateInterpolator2D_get_field(node, field);
15533
0
  case TAG_X3D_Cylinder:
15534
0
    return Cylinder_get_field(node, field);
15535
0
  case TAG_X3D_CylinderSensor:
15536
0
    return CylinderSensor_get_field(node, field);
15537
0
  case TAG_X3D_DirectionalLight:
15538
0
    return DirectionalLight_get_field(node, field);
15539
0
  case TAG_X3D_Disk2D:
15540
0
    return Disk2D_get_field(node, field);
15541
0
  case TAG_X3D_ElevationGrid:
15542
0
    return ElevationGrid_get_field(node, field);
15543
0
  case TAG_X3D_EspduTransform:
15544
0
    return EspduTransform_get_field(node, field);
15545
0
  case TAG_X3D_Extrusion:
15546
0
    return Extrusion_get_field(node, field);
15547
0
  case TAG_X3D_FillProperties:
15548
0
    return FillProperties_get_field(node, field);
15549
0
  case TAG_X3D_Fog:
15550
0
    return Fog_get_field(node, field);
15551
0
  case TAG_X3D_FontStyle:
15552
0
    return FontStyle_get_field(node, field);
15553
0
  case TAG_X3D_GeoCoordinate:
15554
0
    return GeoCoordinate_get_field(node, field);
15555
0
  case TAG_X3D_GeoElevationGrid:
15556
0
    return GeoElevationGrid_get_field(node, field);
15557
0
  case TAG_X3D_GeoLocation:
15558
0
    return GeoLocation_get_field(node, field);
15559
0
  case TAG_X3D_GeoLOD:
15560
0
    return GeoLOD_get_field(node, field);
15561
0
  case TAG_X3D_GeoMetadata:
15562
0
    return GeoMetadata_get_field(node, field);
15563
0
  case TAG_X3D_GeoOrigin:
15564
0
    return GeoOrigin_get_field(node, field);
15565
0
  case TAG_X3D_GeoPositionInterpolator:
15566
0
    return GeoPositionInterpolator_get_field(node, field);
15567
0
  case TAG_X3D_GeoTouchSensor:
15568
0
    return GeoTouchSensor_get_field(node, field);
15569
0
  case TAG_X3D_GeoViewpoint:
15570
0
    return GeoViewpoint_get_field(node, field);
15571
0
  case TAG_X3D_Group:
15572
0
    return Group_get_field(node, field);
15573
0
  case TAG_X3D_HAnimDisplacer:
15574
0
    return HAnimDisplacer_get_field(node, field);
15575
0
  case TAG_X3D_HAnimHumanoid:
15576
0
    return HAnimHumanoid_get_field(node, field);
15577
0
  case TAG_X3D_HAnimJoint:
15578
0
    return HAnimJoint_get_field(node, field);
15579
0
  case TAG_X3D_HAnimSegment:
15580
0
    return HAnimSegment_get_field(node, field);
15581
0
  case TAG_X3D_HAnimSite:
15582
0
    return HAnimSite_get_field(node, field);
15583
0
  case TAG_X3D_ImageTexture:
15584
0
    return ImageTexture_get_field(node, field);
15585
0
  case TAG_X3D_IndexedFaceSet:
15586
0
    return IndexedFaceSet_get_field(node, field);
15587
0
  case TAG_X3D_IndexedLineSet:
15588
0
    return IndexedLineSet_get_field(node, field);
15589
0
  case TAG_X3D_IndexedTriangleFanSet:
15590
0
    return IndexedTriangleFanSet_get_field(node, field);
15591
0
  case TAG_X3D_IndexedTriangleSet:
15592
0
    return IndexedTriangleSet_get_field(node, field);
15593
0
  case TAG_X3D_IndexedTriangleStripSet:
15594
0
    return IndexedTriangleStripSet_get_field(node, field);
15595
0
  case TAG_X3D_Inline:
15596
0
    return Inline_get_field(node, field);
15597
0
  case TAG_X3D_IntegerSequencer:
15598
0
    return IntegerSequencer_get_field(node, field);
15599
0
  case TAG_X3D_IntegerTrigger:
15600
0
    return IntegerTrigger_get_field(node, field);
15601
0
  case TAG_X3D_KeySensor:
15602
0
    return KeySensor_get_field(node, field);
15603
0
  case TAG_X3D_LineProperties:
15604
0
    return LineProperties_get_field(node, field);
15605
0
  case TAG_X3D_LineSet:
15606
0
    return LineSet_get_field(node, field);
15607
0
  case TAG_X3D_LoadSensor:
15608
0
    return LoadSensor_get_field(node, field);
15609
0
  case TAG_X3D_LOD:
15610
0
    return LOD_get_field(node, field);
15611
0
  case TAG_X3D_Material:
15612
0
    return Material_get_field(node, field);
15613
0
  case TAG_X3D_MetadataDouble:
15614
0
    return MetadataDouble_get_field(node, field);
15615
0
  case TAG_X3D_MetadataFloat:
15616
0
    return MetadataFloat_get_field(node, field);
15617
0
  case TAG_X3D_MetadataInteger:
15618
0
    return MetadataInteger_get_field(node, field);
15619
0
  case TAG_X3D_MetadataSet:
15620
0
    return MetadataSet_get_field(node, field);
15621
0
  case TAG_X3D_MetadataString:
15622
0
    return MetadataString_get_field(node, field);
15623
0
  case TAG_X3D_MovieTexture:
15624
0
    return MovieTexture_get_field(node, field);
15625
0
  case TAG_X3D_MultiTexture:
15626
0
    return MultiTexture_get_field(node, field);
15627
0
  case TAG_X3D_MultiTextureCoordinate:
15628
0
    return MultiTextureCoordinate_get_field(node, field);
15629
0
  case TAG_X3D_MultiTextureTransform:
15630
0
    return MultiTextureTransform_get_field(node, field);
15631
0
  case TAG_X3D_NavigationInfo:
15632
0
    return NavigationInfo_get_field(node, field);
15633
0
  case TAG_X3D_Normal:
15634
0
    return Normal_get_field(node, field);
15635
0
  case TAG_X3D_NormalInterpolator:
15636
0
    return NormalInterpolator_get_field(node, field);
15637
0
  case TAG_X3D_NurbsCurve:
15638
0
    return NurbsCurve_get_field(node, field);
15639
0
  case TAG_X3D_NurbsCurve2D:
15640
0
    return NurbsCurve2D_get_field(node, field);
15641
0
  case TAG_X3D_NurbsOrientationInterpolator:
15642
0
    return NurbsOrientationInterpolator_get_field(node, field);
15643
0
  case TAG_X3D_NurbsPatchSurface:
15644
0
    return NurbsPatchSurface_get_field(node, field);
15645
0
  case TAG_X3D_NurbsPositionInterpolator:
15646
0
    return NurbsPositionInterpolator_get_field(node, field);
15647
0
  case TAG_X3D_NurbsSet:
15648
0
    return NurbsSet_get_field(node, field);
15649
0
  case TAG_X3D_NurbsSurfaceInterpolator:
15650
0
    return NurbsSurfaceInterpolator_get_field(node, field);
15651
0
  case TAG_X3D_NurbsSweptSurface:
15652
0
    return NurbsSweptSurface_get_field(node, field);
15653
0
  case TAG_X3D_NurbsSwungSurface:
15654
0
    return NurbsSwungSurface_get_field(node, field);
15655
0
  case TAG_X3D_NurbsTextureCoordinate:
15656
0
    return NurbsTextureCoordinate_get_field(node, field);
15657
0
  case TAG_X3D_NurbsTrimmedSurface:
15658
0
    return NurbsTrimmedSurface_get_field(node, field);
15659
0
  case TAG_X3D_OrientationInterpolator:
15660
0
    return OrientationInterpolator_get_field(node, field);
15661
0
  case TAG_X3D_PixelTexture:
15662
0
    return PixelTexture_get_field(node, field);
15663
0
  case TAG_X3D_PlaneSensor:
15664
0
    return PlaneSensor_get_field(node, field);
15665
0
  case TAG_X3D_PointLight:
15666
0
    return PointLight_get_field(node, field);
15667
0
  case TAG_X3D_PointSet:
15668
0
    return PointSet_get_field(node, field);
15669
0
  case TAG_X3D_Polyline2D:
15670
0
    return Polyline2D_get_field(node, field);
15671
0
  case TAG_X3D_Polypoint2D:
15672
0
    return Polypoint2D_get_field(node, field);
15673
0
  case TAG_X3D_PositionInterpolator:
15674
0
    return PositionInterpolator_get_field(node, field);
15675
0
  case TAG_X3D_PositionInterpolator2D:
15676
0
    return PositionInterpolator2D_get_field(node, field);
15677
0
  case TAG_X3D_ProximitySensor:
15678
0
    return ProximitySensor_get_field(node, field);
15679
0
  case TAG_X3D_ReceiverPdu:
15680
0
    return ReceiverPdu_get_field(node, field);
15681
0
  case TAG_X3D_Rectangle2D:
15682
0
    return Rectangle2D_get_field(node, field);
15683
0
  case TAG_X3D_ScalarInterpolator:
15684
0
    return ScalarInterpolator_get_field(node, field);
15685
0
  case TAG_X3D_Script:
15686
0
    return Script_get_field(node, field);
15687
0
  case TAG_X3D_Shape:
15688
0
    return Shape_get_field(node, field);
15689
0
  case TAG_X3D_SignalPdu:
15690
0
    return SignalPdu_get_field(node, field);
15691
0
  case TAG_X3D_Sound:
15692
0
    return Sound_get_field(node, field);
15693
0
  case TAG_X3D_Sphere:
15694
0
    return Sphere_get_field(node, field);
15695
0
  case TAG_X3D_SphereSensor:
15696
0
    return SphereSensor_get_field(node, field);
15697
0
  case TAG_X3D_SpotLight:
15698
0
    return SpotLight_get_field(node, field);
15699
0
  case TAG_X3D_StaticGroup:
15700
0
    return StaticGroup_get_field(node, field);
15701
0
  case TAG_X3D_StringSensor:
15702
0
    return StringSensor_get_field(node, field);
15703
0
  case TAG_X3D_Switch:
15704
0
    return Switch_get_field(node, field);
15705
0
  case TAG_X3D_Text:
15706
0
    return Text_get_field(node, field);
15707
0
  case TAG_X3D_TextureBackground:
15708
0
    return TextureBackground_get_field(node, field);
15709
0
  case TAG_X3D_TextureCoordinate:
15710
0
    return TextureCoordinate_get_field(node, field);
15711
0
  case TAG_X3D_TextureCoordinateGenerator:
15712
0
    return TextureCoordinateGenerator_get_field(node, field);
15713
0
  case TAG_X3D_TextureTransform:
15714
0
    return TextureTransform_get_field(node, field);
15715
0
  case TAG_X3D_TimeSensor:
15716
0
    return TimeSensor_get_field(node, field);
15717
0
  case TAG_X3D_TimeTrigger:
15718
0
    return TimeTrigger_get_field(node, field);
15719
0
  case TAG_X3D_TouchSensor:
15720
0
    return TouchSensor_get_field(node, field);
15721
0
  case TAG_X3D_Transform:
15722
0
    return Transform_get_field(node, field);
15723
0
  case TAG_X3D_TransmitterPdu:
15724
0
    return TransmitterPdu_get_field(node, field);
15725
0
  case TAG_X3D_TriangleFanSet:
15726
0
    return TriangleFanSet_get_field(node, field);
15727
0
  case TAG_X3D_TriangleSet:
15728
0
    return TriangleSet_get_field(node, field);
15729
0
  case TAG_X3D_TriangleSet2D:
15730
0
    return TriangleSet2D_get_field(node, field);
15731
0
  case TAG_X3D_TriangleStripSet:
15732
0
    return TriangleStripSet_get_field(node, field);
15733
0
  case TAG_X3D_Viewpoint:
15734
0
    return Viewpoint_get_field(node, field);
15735
0
  case TAG_X3D_VisibilitySensor:
15736
0
    return VisibilitySensor_get_field(node, field);
15737
0
  case TAG_X3D_WorldInfo:
15738
0
    return WorldInfo_get_field(node, field);
15739
0
  default:
15740
0
    return GF_BAD_PARAM;
15741
0
  }
15742
0
}
15743
15744
15745
GF_EXPORT
15746
u32 gf_node_x3d_type_by_class_name(const char *node_name)
15747
0
{
15748
0
  if(!node_name) return 0;
15749
0
  if (!strcmp(node_name, "Anchor")) return TAG_X3D_Anchor;
15750
0
  if (!strcmp(node_name, "Appearance")) return TAG_X3D_Appearance;
15751
0
  if (!strcmp(node_name, "Arc2D")) return TAG_X3D_Arc2D;
15752
0
  if (!strcmp(node_name, "ArcClose2D")) return TAG_X3D_ArcClose2D;
15753
0
  if (!strcmp(node_name, "AudioClip")) return TAG_X3D_AudioClip;
15754
0
  if (!strcmp(node_name, "Background")) return TAG_X3D_Background;
15755
0
  if (!strcmp(node_name, "Billboard")) return TAG_X3D_Billboard;
15756
0
  if (!strcmp(node_name, "BooleanFilter")) return TAG_X3D_BooleanFilter;
15757
0
  if (!strcmp(node_name, "BooleanSequencer")) return TAG_X3D_BooleanSequencer;
15758
0
  if (!strcmp(node_name, "BooleanToggle")) return TAG_X3D_BooleanToggle;
15759
0
  if (!strcmp(node_name, "BooleanTrigger")) return TAG_X3D_BooleanTrigger;
15760
0
  if (!strcmp(node_name, "Box")) return TAG_X3D_Box;
15761
0
  if (!strcmp(node_name, "Circle2D")) return TAG_X3D_Circle2D;
15762
0
  if (!strcmp(node_name, "Collision")) return TAG_X3D_Collision;
15763
0
  if (!strcmp(node_name, "Color")) return TAG_X3D_Color;
15764
0
  if (!strcmp(node_name, "ColorInterpolator")) return TAG_X3D_ColorInterpolator;
15765
0
  if (!strcmp(node_name, "ColorRGBA")) return TAG_X3D_ColorRGBA;
15766
0
  if (!strcmp(node_name, "Cone")) return TAG_X3D_Cone;
15767
0
  if (!strcmp(node_name, "Contour2D")) return TAG_X3D_Contour2D;
15768
0
  if (!strcmp(node_name, "ContourPolyline2D")) return TAG_X3D_ContourPolyline2D;
15769
0
  if (!strcmp(node_name, "Coordinate")) return TAG_X3D_Coordinate;
15770
0
  if (!strcmp(node_name, "CoordinateDouble")) return TAG_X3D_CoordinateDouble;
15771
0
  if (!strcmp(node_name, "Coordinate2D")) return TAG_X3D_Coordinate2D;
15772
0
  if (!strcmp(node_name, "CoordinateInterpolator")) return TAG_X3D_CoordinateInterpolator;
15773
0
  if (!strcmp(node_name, "CoordinateInterpolator2D")) return TAG_X3D_CoordinateInterpolator2D;
15774
0
  if (!strcmp(node_name, "Cylinder")) return TAG_X3D_Cylinder;
15775
0
  if (!strcmp(node_name, "CylinderSensor")) return TAG_X3D_CylinderSensor;
15776
0
  if (!strcmp(node_name, "DirectionalLight")) return TAG_X3D_DirectionalLight;
15777
0
  if (!strcmp(node_name, "Disk2D")) return TAG_X3D_Disk2D;
15778
0
  if (!strcmp(node_name, "ElevationGrid")) return TAG_X3D_ElevationGrid;
15779
0
  if (!strcmp(node_name, "EspduTransform")) return TAG_X3D_EspduTransform;
15780
0
  if (!strcmp(node_name, "Extrusion")) return TAG_X3D_Extrusion;
15781
0
  if (!strcmp(node_name, "FillProperties")) return TAG_X3D_FillProperties;
15782
0
  if (!strcmp(node_name, "Fog")) return TAG_X3D_Fog;
15783
0
  if (!strcmp(node_name, "FontStyle")) return TAG_X3D_FontStyle;
15784
0
  if (!strcmp(node_name, "GeoCoordinate")) return TAG_X3D_GeoCoordinate;
15785
0
  if (!strcmp(node_name, "GeoElevationGrid")) return TAG_X3D_GeoElevationGrid;
15786
0
  if (!strcmp(node_name, "GeoLocation")) return TAG_X3D_GeoLocation;
15787
0
  if (!strcmp(node_name, "GeoLOD")) return TAG_X3D_GeoLOD;
15788
0
  if (!strcmp(node_name, "GeoMetadata")) return TAG_X3D_GeoMetadata;
15789
0
  if (!strcmp(node_name, "GeoOrigin")) return TAG_X3D_GeoOrigin;
15790
0
  if (!strcmp(node_name, "GeoPositionInterpolator")) return TAG_X3D_GeoPositionInterpolator;
15791
0
  if (!strcmp(node_name, "GeoTouchSensor")) return TAG_X3D_GeoTouchSensor;
15792
0
  if (!strcmp(node_name, "GeoViewpoint")) return TAG_X3D_GeoViewpoint;
15793
0
  if (!strcmp(node_name, "Group")) return TAG_X3D_Group;
15794
0
  if (!strcmp(node_name, "HAnimDisplacer")) return TAG_X3D_HAnimDisplacer;
15795
0
  if (!strcmp(node_name, "HAnimHumanoid")) return TAG_X3D_HAnimHumanoid;
15796
0
  if (!strcmp(node_name, "HAnimJoint")) return TAG_X3D_HAnimJoint;
15797
0
  if (!strcmp(node_name, "HAnimSegment")) return TAG_X3D_HAnimSegment;
15798
0
  if (!strcmp(node_name, "HAnimSite")) return TAG_X3D_HAnimSite;
15799
0
  if (!strcmp(node_name, "ImageTexture")) return TAG_X3D_ImageTexture;
15800
0
  if (!strcmp(node_name, "IndexedFaceSet")) return TAG_X3D_IndexedFaceSet;
15801
0
  if (!strcmp(node_name, "IndexedLineSet")) return TAG_X3D_IndexedLineSet;
15802
0
  if (!strcmp(node_name, "IndexedTriangleFanSet")) return TAG_X3D_IndexedTriangleFanSet;
15803
0
  if (!strcmp(node_name, "IndexedTriangleSet")) return TAG_X3D_IndexedTriangleSet;
15804
0
  if (!strcmp(node_name, "IndexedTriangleStripSet")) return TAG_X3D_IndexedTriangleStripSet;
15805
0
  if (!strcmp(node_name, "Inline")) return TAG_X3D_Inline;
15806
0
  if (!strcmp(node_name, "IntegerSequencer")) return TAG_X3D_IntegerSequencer;
15807
0
  if (!strcmp(node_name, "IntegerTrigger")) return TAG_X3D_IntegerTrigger;
15808
0
  if (!strcmp(node_name, "KeySensor")) return TAG_X3D_KeySensor;
15809
0
  if (!strcmp(node_name, "LineProperties")) return TAG_X3D_LineProperties;
15810
0
  if (!strcmp(node_name, "LineSet")) return TAG_X3D_LineSet;
15811
0
  if (!strcmp(node_name, "LoadSensor")) return TAG_X3D_LoadSensor;
15812
0
  if (!strcmp(node_name, "LOD")) return TAG_X3D_LOD;
15813
0
  if (!strcmp(node_name, "Material")) return TAG_X3D_Material;
15814
0
  if (!strcmp(node_name, "MetadataDouble")) return TAG_X3D_MetadataDouble;
15815
0
  if (!strcmp(node_name, "MetadataFloat")) return TAG_X3D_MetadataFloat;
15816
0
  if (!strcmp(node_name, "MetadataInteger")) return TAG_X3D_MetadataInteger;
15817
0
  if (!strcmp(node_name, "MetadataSet")) return TAG_X3D_MetadataSet;
15818
0
  if (!strcmp(node_name, "MetadataString")) return TAG_X3D_MetadataString;
15819
0
  if (!strcmp(node_name, "MovieTexture")) return TAG_X3D_MovieTexture;
15820
0
  if (!strcmp(node_name, "MultiTexture")) return TAG_X3D_MultiTexture;
15821
0
  if (!strcmp(node_name, "MultiTextureCoordinate")) return TAG_X3D_MultiTextureCoordinate;
15822
0
  if (!strcmp(node_name, "MultiTextureTransform")) return TAG_X3D_MultiTextureTransform;
15823
0
  if (!strcmp(node_name, "NavigationInfo")) return TAG_X3D_NavigationInfo;
15824
0
  if (!strcmp(node_name, "Normal")) return TAG_X3D_Normal;
15825
0
  if (!strcmp(node_name, "NormalInterpolator")) return TAG_X3D_NormalInterpolator;
15826
0
  if (!strcmp(node_name, "NurbsCurve")) return TAG_X3D_NurbsCurve;
15827
0
  if (!strcmp(node_name, "NurbsCurve2D")) return TAG_X3D_NurbsCurve2D;
15828
0
  if (!strcmp(node_name, "NurbsOrientationInterpolator")) return TAG_X3D_NurbsOrientationInterpolator;
15829
0
  if (!strcmp(node_name, "NurbsPatchSurface")) return TAG_X3D_NurbsPatchSurface;
15830
0
  if (!strcmp(node_name, "NurbsPositionInterpolator")) return TAG_X3D_NurbsPositionInterpolator;
15831
0
  if (!strcmp(node_name, "NurbsSet")) return TAG_X3D_NurbsSet;
15832
0
  if (!strcmp(node_name, "NurbsSurfaceInterpolator")) return TAG_X3D_NurbsSurfaceInterpolator;
15833
0
  if (!strcmp(node_name, "NurbsSweptSurface")) return TAG_X3D_NurbsSweptSurface;
15834
0
  if (!strcmp(node_name, "NurbsSwungSurface")) return TAG_X3D_NurbsSwungSurface;
15835
0
  if (!strcmp(node_name, "NurbsTextureCoordinate")) return TAG_X3D_NurbsTextureCoordinate;
15836
0
  if (!strcmp(node_name, "NurbsTrimmedSurface")) return TAG_X3D_NurbsTrimmedSurface;
15837
0
  if (!strcmp(node_name, "OrientationInterpolator")) return TAG_X3D_OrientationInterpolator;
15838
0
  if (!strcmp(node_name, "PixelTexture")) return TAG_X3D_PixelTexture;
15839
0
  if (!strcmp(node_name, "PlaneSensor")) return TAG_X3D_PlaneSensor;
15840
0
  if (!strcmp(node_name, "PointLight")) return TAG_X3D_PointLight;
15841
0
  if (!strcmp(node_name, "PointSet")) return TAG_X3D_PointSet;
15842
0
  if (!strcmp(node_name, "Polyline2D")) return TAG_X3D_Polyline2D;
15843
0
  if (!strcmp(node_name, "Polypoint2D")) return TAG_X3D_Polypoint2D;
15844
0
  if (!strcmp(node_name, "PositionInterpolator")) return TAG_X3D_PositionInterpolator;
15845
0
  if (!strcmp(node_name, "PositionInterpolator2D")) return TAG_X3D_PositionInterpolator2D;
15846
0
  if (!strcmp(node_name, "ProximitySensor")) return TAG_X3D_ProximitySensor;
15847
0
  if (!strcmp(node_name, "ReceiverPdu")) return TAG_X3D_ReceiverPdu;
15848
0
  if (!strcmp(node_name, "Rectangle2D")) return TAG_X3D_Rectangle2D;
15849
0
  if (!strcmp(node_name, "ScalarInterpolator")) return TAG_X3D_ScalarInterpolator;
15850
0
  if (!strcmp(node_name, "Script")) return TAG_X3D_Script;
15851
0
  if (!strcmp(node_name, "Shape")) return TAG_X3D_Shape;
15852
0
  if (!strcmp(node_name, "SignalPdu")) return TAG_X3D_SignalPdu;
15853
0
  if (!strcmp(node_name, "Sound")) return TAG_X3D_Sound;
15854
0
  if (!strcmp(node_name, "Sphere")) return TAG_X3D_Sphere;
15855
0
  if (!strcmp(node_name, "SphereSensor")) return TAG_X3D_SphereSensor;
15856
0
  if (!strcmp(node_name, "SpotLight")) return TAG_X3D_SpotLight;
15857
0
  if (!strcmp(node_name, "StaticGroup")) return TAG_X3D_StaticGroup;
15858
0
  if (!strcmp(node_name, "StringSensor")) return TAG_X3D_StringSensor;
15859
0
  if (!strcmp(node_name, "Switch")) return TAG_X3D_Switch;
15860
0
  if (!strcmp(node_name, "Text")) return TAG_X3D_Text;
15861
0
  if (!strcmp(node_name, "TextureBackground")) return TAG_X3D_TextureBackground;
15862
0
  if (!strcmp(node_name, "TextureCoordinate")) return TAG_X3D_TextureCoordinate;
15863
0
  if (!strcmp(node_name, "TextureCoordinateGenerator")) return TAG_X3D_TextureCoordinateGenerator;
15864
0
  if (!strcmp(node_name, "TextureTransform")) return TAG_X3D_TextureTransform;
15865
0
  if (!strcmp(node_name, "TimeSensor")) return TAG_X3D_TimeSensor;
15866
0
  if (!strcmp(node_name, "TimeTrigger")) return TAG_X3D_TimeTrigger;
15867
0
  if (!strcmp(node_name, "TouchSensor")) return TAG_X3D_TouchSensor;
15868
0
  if (!strcmp(node_name, "Transform")) return TAG_X3D_Transform;
15869
0
  if (!strcmp(node_name, "TransmitterPdu")) return TAG_X3D_TransmitterPdu;
15870
0
  if (!strcmp(node_name, "TriangleFanSet")) return TAG_X3D_TriangleFanSet;
15871
0
  if (!strcmp(node_name, "TriangleSet")) return TAG_X3D_TriangleSet;
15872
0
  if (!strcmp(node_name, "TriangleSet2D")) return TAG_X3D_TriangleSet2D;
15873
0
  if (!strcmp(node_name, "TriangleStripSet")) return TAG_X3D_TriangleStripSet;
15874
0
  if (!strcmp(node_name, "Viewpoint")) return TAG_X3D_Viewpoint;
15875
0
  if (!strcmp(node_name, "VisibilitySensor")) return TAG_X3D_VisibilitySensor;
15876
0
  if (!strcmp(node_name, "WorldInfo")) return TAG_X3D_WorldInfo;
15877
0
  return 0;
15878
0
}
15879
15880
s32 gf_sg_x3d_node_get_field_index_by_name(GF_Node *node, char *name)
15881
0
{
15882
0
  switch (node->sgprivate->tag) {
15883
0
  case TAG_X3D_Anchor:
15884
0
    return Anchor_get_field_index_by_name(name);
15885
0
  case TAG_X3D_Appearance:
15886
0
    return Appearance_get_field_index_by_name(name);
15887
0
  case TAG_X3D_Arc2D:
15888
0
    return Arc2D_get_field_index_by_name(name);
15889
0
  case TAG_X3D_ArcClose2D:
15890
0
    return ArcClose2D_get_field_index_by_name(name);
15891
0
  case TAG_X3D_AudioClip:
15892
0
    return AudioClip_get_field_index_by_name(name);
15893
0
  case TAG_X3D_Background:
15894
0
    return Background_get_field_index_by_name(name);
15895
0
  case TAG_X3D_Billboard:
15896
0
    return Billboard_get_field_index_by_name(name);
15897
0
  case TAG_X3D_BooleanFilter:
15898
0
    return BooleanFilter_get_field_index_by_name(name);
15899
0
  case TAG_X3D_BooleanSequencer:
15900
0
    return BooleanSequencer_get_field_index_by_name(name);
15901
0
  case TAG_X3D_BooleanToggle:
15902
0
    return BooleanToggle_get_field_index_by_name(name);
15903
0
  case TAG_X3D_BooleanTrigger:
15904
0
    return BooleanTrigger_get_field_index_by_name(name);
15905
0
  case TAG_X3D_Box:
15906
0
    return Box_get_field_index_by_name(name);
15907
0
  case TAG_X3D_Circle2D:
15908
0
    return Circle2D_get_field_index_by_name(name);
15909
0
  case TAG_X3D_Collision:
15910
0
    return Collision_get_field_index_by_name(name);
15911
0
  case TAG_X3D_Color:
15912
0
    return Color_get_field_index_by_name(name);
15913
0
  case TAG_X3D_ColorInterpolator:
15914
0
    return ColorInterpolator_get_field_index_by_name(name);
15915
0
  case TAG_X3D_ColorRGBA:
15916
0
    return ColorRGBA_get_field_index_by_name(name);
15917
0
  case TAG_X3D_Cone:
15918
0
    return Cone_get_field_index_by_name(name);
15919
0
  case TAG_X3D_Contour2D:
15920
0
    return Contour2D_get_field_index_by_name(name);
15921
0
  case TAG_X3D_ContourPolyline2D:
15922
0
    return ContourPolyline2D_get_field_index_by_name(name);
15923
0
  case TAG_X3D_Coordinate:
15924
0
    return Coordinate_get_field_index_by_name(name);
15925
0
  case TAG_X3D_CoordinateDouble:
15926
0
    return CoordinateDouble_get_field_index_by_name(name);
15927
0
  case TAG_X3D_Coordinate2D:
15928
0
    return Coordinate2D_get_field_index_by_name(name);
15929
0
  case TAG_X3D_CoordinateInterpolator:
15930
0
    return CoordinateInterpolator_get_field_index_by_name(name);
15931
0
  case TAG_X3D_CoordinateInterpolator2D:
15932
0
    return CoordinateInterpolator2D_get_field_index_by_name(name);
15933
0
  case TAG_X3D_Cylinder:
15934
0
    return Cylinder_get_field_index_by_name(name);
15935
0
  case TAG_X3D_CylinderSensor:
15936
0
    return CylinderSensor_get_field_index_by_name(name);
15937
0
  case TAG_X3D_DirectionalLight:
15938
0
    return DirectionalLight_get_field_index_by_name(name);
15939
0
  case TAG_X3D_Disk2D:
15940
0
    return Disk2D_get_field_index_by_name(name);
15941
0
  case TAG_X3D_ElevationGrid:
15942
0
    return ElevationGrid_get_field_index_by_name(name);
15943
0
  case TAG_X3D_EspduTransform:
15944
0
    return EspduTransform_get_field_index_by_name(name);
15945
0
  case TAG_X3D_Extrusion:
15946
0
    return Extrusion_get_field_index_by_name(name);
15947
0
  case TAG_X3D_FillProperties:
15948
0
    return FillProperties_get_field_index_by_name(name);
15949
0
  case TAG_X3D_Fog:
15950
0
    return Fog_get_field_index_by_name(name);
15951
0
  case TAG_X3D_FontStyle:
15952
0
    return FontStyle_get_field_index_by_name(name);
15953
0
  case TAG_X3D_GeoCoordinate:
15954
0
    return GeoCoordinate_get_field_index_by_name(name);
15955
0
  case TAG_X3D_GeoElevationGrid:
15956
0
    return GeoElevationGrid_get_field_index_by_name(name);
15957
0
  case TAG_X3D_GeoLocation:
15958
0
    return GeoLocation_get_field_index_by_name(name);
15959
0
  case TAG_X3D_GeoLOD:
15960
0
    return GeoLOD_get_field_index_by_name(name);
15961
0
  case TAG_X3D_GeoMetadata:
15962
0
    return GeoMetadata_get_field_index_by_name(name);
15963
0
  case TAG_X3D_GeoOrigin:
15964
0
    return GeoOrigin_get_field_index_by_name(name);
15965
0
  case TAG_X3D_GeoPositionInterpolator:
15966
0
    return GeoPositionInterpolator_get_field_index_by_name(name);
15967
0
  case TAG_X3D_GeoTouchSensor:
15968
0
    return GeoTouchSensor_get_field_index_by_name(name);
15969
0
  case TAG_X3D_GeoViewpoint:
15970
0
    return GeoViewpoint_get_field_index_by_name(name);
15971
0
  case TAG_X3D_Group:
15972
0
    return Group_get_field_index_by_name(name);
15973
0
  case TAG_X3D_HAnimDisplacer:
15974
0
    return HAnimDisplacer_get_field_index_by_name(name);
15975
0
  case TAG_X3D_HAnimHumanoid:
15976
0
    return HAnimHumanoid_get_field_index_by_name(name);
15977
0
  case TAG_X3D_HAnimJoint:
15978
0
    return HAnimJoint_get_field_index_by_name(name);
15979
0
  case TAG_X3D_HAnimSegment:
15980
0
    return HAnimSegment_get_field_index_by_name(name);
15981
0
  case TAG_X3D_HAnimSite:
15982
0
    return HAnimSite_get_field_index_by_name(name);
15983
0
  case TAG_X3D_ImageTexture:
15984
0
    return ImageTexture_get_field_index_by_name(name);
15985
0
  case TAG_X3D_IndexedFaceSet:
15986
0
    return IndexedFaceSet_get_field_index_by_name(name);
15987
0
  case TAG_X3D_IndexedLineSet:
15988
0
    return IndexedLineSet_get_field_index_by_name(name);
15989
0
  case TAG_X3D_IndexedTriangleFanSet:
15990
0
    return IndexedTriangleFanSet_get_field_index_by_name(name);
15991
0
  case TAG_X3D_IndexedTriangleSet:
15992
0
    return IndexedTriangleSet_get_field_index_by_name(name);
15993
0
  case TAG_X3D_IndexedTriangleStripSet:
15994
0
    return IndexedTriangleStripSet_get_field_index_by_name(name);
15995
0
  case TAG_X3D_Inline:
15996
0
    return Inline_get_field_index_by_name(name);
15997
0
  case TAG_X3D_IntegerSequencer:
15998
0
    return IntegerSequencer_get_field_index_by_name(name);
15999
0
  case TAG_X3D_IntegerTrigger:
16000
0
    return IntegerTrigger_get_field_index_by_name(name);
16001
0
  case TAG_X3D_KeySensor:
16002
0
    return KeySensor_get_field_index_by_name(name);
16003
0
  case TAG_X3D_LineProperties:
16004
0
    return LineProperties_get_field_index_by_name(name);
16005
0
  case TAG_X3D_LineSet:
16006
0
    return LineSet_get_field_index_by_name(name);
16007
0
  case TAG_X3D_LoadSensor:
16008
0
    return LoadSensor_get_field_index_by_name(name);
16009
0
  case TAG_X3D_LOD:
16010
0
    return LOD_get_field_index_by_name(name);
16011
0
  case TAG_X3D_Material:
16012
0
    return Material_get_field_index_by_name(name);
16013
0
  case TAG_X3D_MetadataDouble:
16014
0
    return MetadataDouble_get_field_index_by_name(name);
16015
0
  case TAG_X3D_MetadataFloat:
16016
0
    return MetadataFloat_get_field_index_by_name(name);
16017
0
  case TAG_X3D_MetadataInteger:
16018
0
    return MetadataInteger_get_field_index_by_name(name);
16019
0
  case TAG_X3D_MetadataSet:
16020
0
    return MetadataSet_get_field_index_by_name(name);
16021
0
  case TAG_X3D_MetadataString:
16022
0
    return MetadataString_get_field_index_by_name(name);
16023
0
  case TAG_X3D_MovieTexture:
16024
0
    return MovieTexture_get_field_index_by_name(name);
16025
0
  case TAG_X3D_MultiTexture:
16026
0
    return MultiTexture_get_field_index_by_name(name);
16027
0
  case TAG_X3D_MultiTextureCoordinate:
16028
0
    return MultiTextureCoordinate_get_field_index_by_name(name);
16029
0
  case TAG_X3D_MultiTextureTransform:
16030
0
    return MultiTextureTransform_get_field_index_by_name(name);
16031
0
  case TAG_X3D_NavigationInfo:
16032
0
    return NavigationInfo_get_field_index_by_name(name);
16033
0
  case TAG_X3D_Normal:
16034
0
    return Normal_get_field_index_by_name(name);
16035
0
  case TAG_X3D_NormalInterpolator:
16036
0
    return NormalInterpolator_get_field_index_by_name(name);
16037
0
  case TAG_X3D_NurbsCurve:
16038
0
    return NurbsCurve_get_field_index_by_name(name);
16039
0
  case TAG_X3D_NurbsCurve2D:
16040
0
    return NurbsCurve2D_get_field_index_by_name(name);
16041
0
  case TAG_X3D_NurbsOrientationInterpolator:
16042
0
    return NurbsOrientationInterpolator_get_field_index_by_name(name);
16043
0
  case TAG_X3D_NurbsPatchSurface:
16044
0
    return NurbsPatchSurface_get_field_index_by_name(name);
16045
0
  case TAG_X3D_NurbsPositionInterpolator:
16046
0
    return NurbsPositionInterpolator_get_field_index_by_name(name);
16047
0
  case TAG_X3D_NurbsSet:
16048
0
    return NurbsSet_get_field_index_by_name(name);
16049
0
  case TAG_X3D_NurbsSurfaceInterpolator:
16050
0
    return NurbsSurfaceInterpolator_get_field_index_by_name(name);
16051
0
  case TAG_X3D_NurbsSweptSurface:
16052
0
    return NurbsSweptSurface_get_field_index_by_name(name);
16053
0
  case TAG_X3D_NurbsSwungSurface:
16054
0
    return NurbsSwungSurface_get_field_index_by_name(name);
16055
0
  case TAG_X3D_NurbsTextureCoordinate:
16056
0
    return NurbsTextureCoordinate_get_field_index_by_name(name);
16057
0
  case TAG_X3D_NurbsTrimmedSurface:
16058
0
    return NurbsTrimmedSurface_get_field_index_by_name(name);
16059
0
  case TAG_X3D_OrientationInterpolator:
16060
0
    return OrientationInterpolator_get_field_index_by_name(name);
16061
0
  case TAG_X3D_PixelTexture:
16062
0
    return PixelTexture_get_field_index_by_name(name);
16063
0
  case TAG_X3D_PlaneSensor:
16064
0
    return PlaneSensor_get_field_index_by_name(name);
16065
0
  case TAG_X3D_PointLight:
16066
0
    return PointLight_get_field_index_by_name(name);
16067
0
  case TAG_X3D_PointSet:
16068
0
    return PointSet_get_field_index_by_name(name);
16069
0
  case TAG_X3D_Polyline2D:
16070
0
    return Polyline2D_get_field_index_by_name(name);
16071
0
  case TAG_X3D_Polypoint2D:
16072
0
    return Polypoint2D_get_field_index_by_name(name);
16073
0
  case TAG_X3D_PositionInterpolator:
16074
0
    return PositionInterpolator_get_field_index_by_name(name);
16075
0
  case TAG_X3D_PositionInterpolator2D:
16076
0
    return PositionInterpolator2D_get_field_index_by_name(name);
16077
0
  case TAG_X3D_ProximitySensor:
16078
0
    return ProximitySensor_get_field_index_by_name(name);
16079
0
  case TAG_X3D_ReceiverPdu:
16080
0
    return ReceiverPdu_get_field_index_by_name(name);
16081
0
  case TAG_X3D_Rectangle2D:
16082
0
    return Rectangle2D_get_field_index_by_name(name);
16083
0
  case TAG_X3D_ScalarInterpolator:
16084
0
    return ScalarInterpolator_get_field_index_by_name(name);
16085
//unused
16086
#if 0
16087
  case TAG_X3D_Script:
16088
    return Script_get_field_index_by_name(name);
16089
#endif
16090
0
  case TAG_X3D_Shape:
16091
0
    return Shape_get_field_index_by_name(name);
16092
0
  case TAG_X3D_SignalPdu:
16093
0
    return SignalPdu_get_field_index_by_name(name);
16094
0
  case TAG_X3D_Sound:
16095
0
    return Sound_get_field_index_by_name(name);
16096
0
  case TAG_X3D_Sphere:
16097
0
    return Sphere_get_field_index_by_name(name);
16098
0
  case TAG_X3D_SphereSensor:
16099
0
    return SphereSensor_get_field_index_by_name(name);
16100
0
  case TAG_X3D_SpotLight:
16101
0
    return SpotLight_get_field_index_by_name(name);
16102
0
  case TAG_X3D_StaticGroup:
16103
0
    return StaticGroup_get_field_index_by_name(name);
16104
0
  case TAG_X3D_StringSensor:
16105
0
    return StringSensor_get_field_index_by_name(name);
16106
0
  case TAG_X3D_Switch:
16107
0
    return Switch_get_field_index_by_name(name);
16108
0
  case TAG_X3D_Text:
16109
0
    return Text_get_field_index_by_name(name);
16110
0
  case TAG_X3D_TextureBackground:
16111
0
    return TextureBackground_get_field_index_by_name(name);
16112
0
  case TAG_X3D_TextureCoordinate:
16113
0
    return TextureCoordinate_get_field_index_by_name(name);
16114
0
  case TAG_X3D_TextureCoordinateGenerator:
16115
0
    return TextureCoordinateGenerator_get_field_index_by_name(name);
16116
0
  case TAG_X3D_TextureTransform:
16117
0
    return TextureTransform_get_field_index_by_name(name);
16118
0
  case TAG_X3D_TimeSensor:
16119
0
    return TimeSensor_get_field_index_by_name(name);
16120
0
  case TAG_X3D_TimeTrigger:
16121
0
    return TimeTrigger_get_field_index_by_name(name);
16122
0
  case TAG_X3D_TouchSensor:
16123
0
    return TouchSensor_get_field_index_by_name(name);
16124
0
  case TAG_X3D_Transform:
16125
0
    return Transform_get_field_index_by_name(name);
16126
0
  case TAG_X3D_TransmitterPdu:
16127
0
    return TransmitterPdu_get_field_index_by_name(name);
16128
0
  case TAG_X3D_TriangleFanSet:
16129
0
    return TriangleFanSet_get_field_index_by_name(name);
16130
0
  case TAG_X3D_TriangleSet:
16131
0
    return TriangleSet_get_field_index_by_name(name);
16132
0
  case TAG_X3D_TriangleSet2D:
16133
0
    return TriangleSet2D_get_field_index_by_name(name);
16134
0
  case TAG_X3D_TriangleStripSet:
16135
0
    return TriangleStripSet_get_field_index_by_name(name);
16136
0
  case TAG_X3D_Viewpoint:
16137
0
    return Viewpoint_get_field_index_by_name(name);
16138
0
  case TAG_X3D_VisibilitySensor:
16139
0
    return VisibilitySensor_get_field_index_by_name(name);
16140
0
  case TAG_X3D_WorldInfo:
16141
0
    return WorldInfo_get_field_index_by_name(name);
16142
0
  default:
16143
0
    return -1;
16144
0
  }
16145
0
}
16146
16147
16148
16149
/* NDT X3D */
16150
16151
0
#define SFWorldNode_X3D_Count 127
16152
static const u32 SFWorldNode_X3D_TypeToTag[127] = {
16153
  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
16154
};
16155
16156
0
#define SF3DNode_X3D_Count  60
16157
static const u32 SF3DNode_X3D_TypeToTag[60] = {
16158
  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
16159
};
16160
16161
0
#define SF2DNode_X3D_Count  34
16162
static const u32 SF2DNode_X3D_TypeToTag[34] = {
16163
  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
16164
};
16165
16166
0
#define SFAppearanceNode_X3D_Count  1
16167
static const u32 SFAppearanceNode_X3D_TypeToTag[1] = {
16168
  TAG_X3D_Appearance
16169
};
16170
16171
0
#define SFGeometryNode_X3D_Count  31
16172
static const u32 SFGeometryNode_X3D_TypeToTag[31] = {
16173
  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
16174
};
16175
16176
0
#define SFAudioNode_X3D_Count 1
16177
static const u32 SFAudioNode_X3D_TypeToTag[1] = {
16178
  TAG_X3D_AudioClip
16179
};
16180
16181
0
#define SFStreamingNode_X3D_Count 4
16182
static const u32 SFStreamingNode_X3D_TypeToTag[4] = {
16183
  TAG_X3D_AudioClip, TAG_X3D_Inline, TAG_X3D_LoadSensor, TAG_X3D_MovieTexture
16184
};
16185
16186
0
#define SFBackground3DNode_X3D_Count  2
16187
static const u32 SFBackground3DNode_X3D_TypeToTag[2] = {
16188
  TAG_X3D_Background, TAG_X3D_TextureBackground
16189
};
16190
16191
0
#define SFColorNode_X3D_Count 2
16192
static const u32 SFColorNode_X3D_TypeToTag[2] = {
16193
  TAG_X3D_Color, TAG_X3D_ColorRGBA
16194
};
16195
16196
0
#define SFNurbsControlCurveNode_X3D_Count 3
16197
static const u32 SFNurbsControlCurveNode_X3D_TypeToTag[3] = {
16198
  TAG_X3D_Contour2D, TAG_X3D_ContourPolyline2D, TAG_X3D_NurbsCurve2D
16199
};
16200
16201
0
#define SFCoordinateNode_X3D_Count  3
16202
static const u32 SFCoordinateNode_X3D_TypeToTag[3] = {
16203
  TAG_X3D_Coordinate, TAG_X3D_CoordinateDouble, TAG_X3D_GeoCoordinate
16204
};
16205
16206
0
#define SFCoordinate2DNode_X3D_Count  1
16207
static const u32 SFCoordinate2DNode_X3D_TypeToTag[1] = {
16208
  TAG_X3D_Coordinate2D
16209
};
16210
16211
0
#define SFFillPropertiesNode_X3D_Count  1
16212
static const u32 SFFillPropertiesNode_X3D_TypeToTag[1] = {
16213
  TAG_X3D_FillProperties
16214
};
16215
16216
0
#define SFFogNode_X3D_Count 1
16217
static const u32 SFFogNode_X3D_TypeToTag[1] = {
16218
  TAG_X3D_Fog
16219
};
16220
16221
0
#define SFFontStyleNode_X3D_Count 1
16222
static const u32 SFFontStyleNode_X3D_TypeToTag[1] = {
16223
  TAG_X3D_FontStyle
16224
};
16225
16226
0
#define SFGeoOriginNode_X3D_Count 1
16227
static const u32 SFGeoOriginNode_X3D_TypeToTag[1] = {
16228
  TAG_X3D_GeoOrigin
16229
};
16230
16231
0
#define SFViewpointNode_X3D_Count 2
16232
static const u32 SFViewpointNode_X3D_TypeToTag[2] = {
16233
  TAG_X3D_GeoViewpoint, TAG_X3D_Viewpoint
16234
};
16235
16236
0
#define SFTopNode_X3D_Count 1
16237
static const u32 SFTopNode_X3D_TypeToTag[1] = {
16238
  TAG_X3D_Group
16239
};
16240
16241
0
#define SFHAnimDisplacerNode_X3D_Count  1
16242
static const u32 SFHAnimDisplacerNode_X3D_TypeToTag[1] = {
16243
  TAG_X3D_HAnimDisplacer
16244
};
16245
16246
0
#define SFHAnimNode_X3D_Count 3
16247
static const u32 SFHAnimNode_X3D_TypeToTag[3] = {
16248
  TAG_X3D_HAnimJoint, TAG_X3D_HAnimSegment, TAG_X3D_HAnimSite
16249
};
16250
16251
0
#define SFTextureNode_X3D_Count 4
16252
static const u32 SFTextureNode_X3D_TypeToTag[4] = {
16253
  TAG_X3D_ImageTexture, TAG_X3D_MovieTexture, TAG_X3D_MultiTexture, TAG_X3D_PixelTexture
16254
};
16255
16256
0
#define SFX3DLinePropertiesNode_X3D_Count 1
16257
static const u32 SFX3DLinePropertiesNode_X3D_TypeToTag[1] = {
16258
  TAG_X3D_LineProperties
16259
};
16260
16261
0
#define SFMaterialNode_X3D_Count  1
16262
static const u32 SFMaterialNode_X3D_TypeToTag[1] = {
16263
  TAG_X3D_Material
16264
};
16265
16266
0
#define SFMetadataNode_X3D_Count  5
16267
static const u32 SFMetadataNode_X3D_TypeToTag[5] = {
16268
  TAG_X3D_MetadataDouble, TAG_X3D_MetadataFloat, TAG_X3D_MetadataInteger, TAG_X3D_MetadataSet, TAG_X3D_MetadataString
16269
};
16270
16271
0
#define SFTextureCoordinateNode_X3D_Count 4
16272
static const u32 SFTextureCoordinateNode_X3D_TypeToTag[4] = {
16273
  TAG_X3D_MultiTextureCoordinate, TAG_X3D_NurbsTextureCoordinate, TAG_X3D_TextureCoordinate, TAG_X3D_TextureCoordinateGenerator
16274
};
16275
16276
0
#define SFTextureTransformNode_X3D_Count  2
16277
static const u32 SFTextureTransformNode_X3D_TypeToTag[2] = {
16278
  TAG_X3D_MultiTextureTransform, TAG_X3D_TextureTransform
16279
};
16280
16281
0
#define SFNavigationInfoNode_X3D_Count  1
16282
static const u32 SFNavigationInfoNode_X3D_TypeToTag[1] = {
16283
  TAG_X3D_NavigationInfo
16284
};
16285
16286
0
#define SFNormalNode_X3D_Count  1
16287
static const u32 SFNormalNode_X3D_TypeToTag[1] = {
16288
  TAG_X3D_Normal
16289
};
16290
16291
0
#define SFNurbsCurveNode_X3D_Count  1
16292
static const u32 SFNurbsCurveNode_X3D_TypeToTag[1] = {
16293
  TAG_X3D_NurbsCurve
16294
};
16295
16296
0
#define SFNurbsSurfaceNode_X3D_Count  4
16297
static const u32 SFNurbsSurfaceNode_X3D_TypeToTag[4] = {
16298
  TAG_X3D_NurbsPatchSurface, TAG_X3D_NurbsSweptSurface, TAG_X3D_NurbsSwungSurface, TAG_X3D_NurbsTrimmedSurface
16299
};
16300
16301
16302
16303
GF_EXPORT
16304
Bool gf_x3d_get_node_type(u32 NDT_Tag, u32 NodeTag)
16305
0
{
16306
0
  const u32 *types;
16307
0
  u32 count, i;
16308
0
  if (!NodeTag) return 0;
16309
0
  types = NULL;
16310
0
  switch (NDT_Tag) {
16311
0
  case NDT_SFWorldNode:
16312
0
    types = SFWorldNode_X3D_TypeToTag;
16313
0
    count = SFWorldNode_X3D_Count;
16314
0
    break;
16315
0
  case NDT_SF3DNode:
16316
0
    types = SF3DNode_X3D_TypeToTag;
16317
0
    count = SF3DNode_X3D_Count;
16318
0
    break;
16319
0
  case NDT_SF2DNode:
16320
0
    types = SF2DNode_X3D_TypeToTag;
16321
0
    count = SF2DNode_X3D_Count;
16322
0
    break;
16323
0
  case NDT_SFAppearanceNode:
16324
0
    types = SFAppearanceNode_X3D_TypeToTag;
16325
0
    count = SFAppearanceNode_X3D_Count;
16326
0
    break;
16327
0
  case NDT_SFGeometryNode:
16328
0
    types = SFGeometryNode_X3D_TypeToTag;
16329
0
    count = SFGeometryNode_X3D_Count;
16330
0
    break;
16331
0
  case NDT_SFAudioNode:
16332
0
    types = SFAudioNode_X3D_TypeToTag;
16333
0
    count = SFAudioNode_X3D_Count;
16334
0
    break;
16335
0
  case NDT_SFStreamingNode:
16336
0
    types = SFStreamingNode_X3D_TypeToTag;
16337
0
    count = SFStreamingNode_X3D_Count;
16338
0
    break;
16339
0
  case NDT_SFBackground3DNode:
16340
0
    types = SFBackground3DNode_X3D_TypeToTag;
16341
0
    count = SFBackground3DNode_X3D_Count;
16342
0
    break;
16343
0
  case NDT_SFColorNode:
16344
0
    types = SFColorNode_X3D_TypeToTag;
16345
0
    count = SFColorNode_X3D_Count;
16346
0
    break;
16347
0
  case NDT_SFNurbsControlCurveNode:
16348
0
    types = SFNurbsControlCurveNode_X3D_TypeToTag;
16349
0
    count = SFNurbsControlCurveNode_X3D_Count;
16350
0
    break;
16351
0
  case NDT_SFCoordinateNode:
16352
0
    types = SFCoordinateNode_X3D_TypeToTag;
16353
0
    count = SFCoordinateNode_X3D_Count;
16354
0
    break;
16355
0
  case NDT_SFCoordinate2DNode:
16356
0
    types = SFCoordinate2DNode_X3D_TypeToTag;
16357
0
    count = SFCoordinate2DNode_X3D_Count;
16358
0
    break;
16359
0
  case NDT_SFFillPropertiesNode:
16360
0
    types = SFFillPropertiesNode_X3D_TypeToTag;
16361
0
    count = SFFillPropertiesNode_X3D_Count;
16362
0
    break;
16363
0
  case NDT_SFFogNode:
16364
0
    types = SFFogNode_X3D_TypeToTag;
16365
0
    count = SFFogNode_X3D_Count;
16366
0
    break;
16367
0
  case NDT_SFFontStyleNode:
16368
0
    types = SFFontStyleNode_X3D_TypeToTag;
16369
0
    count = SFFontStyleNode_X3D_Count;
16370
0
    break;
16371
0
  case NDT_SFGeoOriginNode:
16372
0
    types = SFGeoOriginNode_X3D_TypeToTag;
16373
0
    count = SFGeoOriginNode_X3D_Count;
16374
0
    break;
16375
0
  case NDT_SFViewpointNode:
16376
0
    types = SFViewpointNode_X3D_TypeToTag;
16377
0
    count = SFViewpointNode_X3D_Count;
16378
0
    break;
16379
0
  case NDT_SFTopNode:
16380
0
    types = SFTopNode_X3D_TypeToTag;
16381
0
    count = SFTopNode_X3D_Count;
16382
0
    break;
16383
0
  case NDT_SFHAnimDisplacerNode:
16384
0
    types = SFHAnimDisplacerNode_X3D_TypeToTag;
16385
0
    count = SFHAnimDisplacerNode_X3D_Count;
16386
0
    break;
16387
0
  case NDT_SFHAnimNode:
16388
0
    types = SFHAnimNode_X3D_TypeToTag;
16389
0
    count = SFHAnimNode_X3D_Count;
16390
0
    break;
16391
0
  case NDT_SFTextureNode:
16392
0
    types = SFTextureNode_X3D_TypeToTag;
16393
0
    count = SFTextureNode_X3D_Count;
16394
0
    break;
16395
0
  case NDT_SFX3DLinePropertiesNode:
16396
0
    types = SFX3DLinePropertiesNode_X3D_TypeToTag;
16397
0
    count = SFX3DLinePropertiesNode_X3D_Count;
16398
0
    break;
16399
0
  case NDT_SFMaterialNode:
16400
0
    types = SFMaterialNode_X3D_TypeToTag;
16401
0
    count = SFMaterialNode_X3D_Count;
16402
0
    break;
16403
0
  case NDT_SFMetadataNode:
16404
0
    types = SFMetadataNode_X3D_TypeToTag;
16405
0
    count = SFMetadataNode_X3D_Count;
16406
0
    break;
16407
0
  case NDT_SFTextureCoordinateNode:
16408
0
    types = SFTextureCoordinateNode_X3D_TypeToTag;
16409
0
    count = SFTextureCoordinateNode_X3D_Count;
16410
0
    break;
16411
0
  case NDT_SFTextureTransformNode:
16412
0
    types = SFTextureTransformNode_X3D_TypeToTag;
16413
0
    count = SFTextureTransformNode_X3D_Count;
16414
0
    break;
16415
0
  case NDT_SFNavigationInfoNode:
16416
0
    types = SFNavigationInfoNode_X3D_TypeToTag;
16417
0
    count = SFNavigationInfoNode_X3D_Count;
16418
0
    break;
16419
0
  case NDT_SFNormalNode:
16420
0
    types = SFNormalNode_X3D_TypeToTag;
16421
0
    count = SFNormalNode_X3D_Count;
16422
0
    break;
16423
0
  case NDT_SFNurbsCurveNode:
16424
0
    types = SFNurbsCurveNode_X3D_TypeToTag;
16425
0
    count = SFNurbsCurveNode_X3D_Count;
16426
0
    break;
16427
0
  case NDT_SFNurbsSurfaceNode:
16428
0
    types = SFNurbsSurfaceNode_X3D_TypeToTag;
16429
0
    count = SFNurbsSurfaceNode_X3D_Count;
16430
0
    break;
16431
0
  default:
16432
0
    return 0;
16433
0
  }
16434
0
  for(i=0; i<count; i++) {
16435
0
    if (types[i]==NodeTag) return 1;
16436
0
  }
16437
0
  return 0;
16438
0
}
16439
#endif /*GPAC_DISABLE_X3D*/
16440