29 int isMF(
int nodetype)
31 return (nodetype %2 == 1) && nodetype >= 0 && nodetype <= 41;
33 int isSF(
int nodetype)
35 return (nodetype % 2 == 0) && nodetype >= 0 && nodetype <= 41;
37 X3DNode *X3D_newSF(
int nodetype)
45 case FIELDTYPE_SFColor:
46 retval = X3D_newSFColor(0.0f,0.0f,0.0f);
break;
47 case FIELDTYPE_SFFloat:
48 retval = X3D_newSFFloat(0.0f);
break;
49 case FIELDTYPE_SFTime:
50 retval = X3D_newSFTime(0.0);
break;
51 case FIELDTYPE_SFInt32:
52 retval = X3D_newSFInt32(0);
break;
53 case FIELDTYPE_SFString:
54 retval = X3D_newSFString(
"");
break;
55 case FIELDTYPE_SFNode:
56 retval = X3D_newSFNode();
break;
57 case FIELDTYPE_SFRotation:
58 retval = X3D_newSFRotation(0.0f,1.0f,0.0f,0.0f);
break;
59 case FIELDTYPE_SFVec2f:
60 retval = X3D_newSFVec2f(0.0f,0.0f);
break;
61 case FIELDTYPE_SFVec3f:
62 retval = X3D_newSFVec3f(0.0f,0.0f,0.0f);
break;
63 case FIELDTYPE_SFColorRGBA:
64 retval = X3D_newSFColorRGBA(.5f,.5f,.5f,1.0f);
break;
65 case FIELDTYPE_SFBool:
66 retval = X3D_newSFBool(0);
break;
67 case FIELDTYPE_SFVec3d:
68 retval = X3D_newSFVec3d(0.0,0.0,0.0);
break;
69 case FIELDTYPE_SFVec2d:
70 retval = X3D_newSFVec2d(0.0,0.0);
break;
75 printf (
"New node not implemented yet for this type\n");
return NULL;
78 int X3D_sizeof(
int fieldtype)
86 case FIELDTYPE_SFColor:
88 case FIELDTYPE_SFFloat:
90 case FIELDTYPE_SFTime:
92 case FIELDTYPE_SFInt32:
94 case FIELDTYPE_SFString:
96 case FIELDTYPE_SFNode:
98 case FIELDTYPE_SFRotation:
100 case FIELDTYPE_SFVec2f:
102 case FIELDTYPE_SFVec3f:
104 case FIELDTYPE_SFColorRGBA:
106 case FIELDTYPE_SFBool:
108 case FIELDTYPE_SFVec3d:
110 case FIELDTYPE_SFVec2d:
113 case FIELDTYPE_MFColor:
115 case FIELDTYPE_MFFloat:
117 case FIELDTYPE_MFTime:
119 case FIELDTYPE_MFInt32:
121 case FIELDTYPE_MFString:
123 case FIELDTYPE_MFNode:
125 case FIELDTYPE_MFRotation:
127 case FIELDTYPE_MFVec2f:
129 case FIELDTYPE_MFVec3f:
131 case FIELDTYPE_MFColorRGBA:
133 case FIELDTYPE_MFBool:
135 case FIELDTYPE_MFVec3d:
137 case FIELDTYPE_MFVec2d:
144 X3DNode *_swigNewMF(
int itype,
int num )
149 retval = malloc (
sizeof (
X3DNode));
150 retval->type = itype;
151 retval->X3D_MFNode.n = num;
155 p = malloc (
sizeof (
X3DNode) * num);
157 q = (
char*)X3D_newSF(itype-1);
158 for (i = 0; i < num; i++) {
159 memcpy(p,q,X3D_sizeof(itype-1));
160 p+= X3D_sizeof(itype-1);
164 retval->X3D_MFNode.p = NULL;
168 X3DNode *X3D_swigNewMF(
char *fieldtype,
int num )
172 ftype = findFieldInFIELDTYPES(fieldtype);
173 if( isMF(ftype) ) itype = ftype;
174 if( isSF(ftype) ) itype = ftype+1;
177 return _swigNewMF(itype,num);
180 printf (
"New node not implemented yet for this type\n");
return NULL;
191 if( !isSF(vtype) )
return;
192 if( item < 0 || item > 3)
return;
195 case FIELDTYPE_SFTime:
196 v = value->X3D_SFTime.value;
break;
197 case FIELDTYPE_SFFloat:
198 v = (double)value->X3D_SFFloat.value;
break;
199 case FIELDTYPE_SFInt32:
200 v = (
double)value->X3D_SFInt32.value;
break;
201 case FIELDTYPE_SFBool:
202 v = (double)value->X3D_SFBool.value;
break;
209 case FIELDTYPE_SFColor:
211 node->X3D_SFColor.c[item] = (float)v;
break;
212 case FIELDTYPE_SFFloat:
214 node->X3D_SFFloat.value = (float)v;
break;
215 case FIELDTYPE_SFTime:
217 node->X3D_SFTime.value = (float)v;
break;
218 case FIELDTYPE_SFInt32:
220 node->X3D_SFInt32.value = (int)v;
break;
221 case FIELDTYPE_SFString:
222 if(item > strlen(node->X3D_SFString.strptr))
break;
223 node->X3D_SFString.strptr[item] = (char)((
int)v);
break;
224 case FIELDTYPE_SFNode:
226 node->X3D_SFNode.adr = (int)v;
break;
227 case FIELDTYPE_SFRotation:
229 node->X3D_SFRotation.r[item] = (float)v;
break;
230 case FIELDTYPE_SFVec2f:
232 node->X3D_SFVec2f.c[item] = (float)v;
break;
233 case FIELDTYPE_SFVec3f:
235 node->X3D_SFVec3f.c[item] = (float)v;
break;
236 case FIELDTYPE_SFColorRGBA:
238 node->X3D_SFColorRGBA.r[item] = (float)v;
break;
239 case FIELDTYPE_SFBool:
241 node->X3D_SFBool.value = ((int)v)?1:0;
break;
242 case FIELDTYPE_SFVec3d:
244 node->X3D_SFVec3d.c[item] = (double)v;
break;
245 case FIELDTYPE_SFVec2d:
247 node->X3D_SFVec2d.c[item] = (double)v;
break;
265 if( item < 0 || item > 3)
return NULL;
268 case FIELDTYPE_SFColor:
270 v.f = node->X3D_SFColor.c[item]; vtype =FIELDTYPE_SFFloat;
break;
271 case FIELDTYPE_SFFloat:
273 v.f = node->X3D_SFFloat.value; vtype =FIELDTYPE_SFFloat;
break;
274 case FIELDTYPE_SFTime:
276 v.d = node->X3D_SFTime.value; vtype = FIELDTYPE_SFTime;
break;
277 case FIELDTYPE_SFInt32:
279 v.i = node->X3D_SFInt32.value; vtype = FIELDTYPE_SFInt32;
break;
280 case FIELDTYPE_SFString:
281 if(item > strlen(node->X3D_SFString.strptr))
break;
282 v.i = (int)(
char)node->X3D_SFString.strptr[item]; vtype = FIELDTYPE_SFInt32;
break;
283 case FIELDTYPE_SFNode:
285 v.i = (int)node->X3D_SFNode.adr; vtype = FIELDTYPE_SFInt32;
break;
286 case FIELDTYPE_SFRotation:
288 v.f = node->X3D_SFRotation.r[item]; vtype =FIELDTYPE_SFFloat;
break;
289 case FIELDTYPE_SFVec2f:
291 v.f = node->X3D_SFVec2f.c[item]; vtype =FIELDTYPE_SFFloat;
break;
292 case FIELDTYPE_SFVec3f:
294 v.f = node->X3D_SFVec3f.c[item];vtype =FIELDTYPE_SFFloat;
break;
295 case FIELDTYPE_SFColorRGBA:
297 v.f = node->X3D_SFColorRGBA.r[item]; vtype =FIELDTYPE_SFFloat;
break;
298 case FIELDTYPE_SFBool:
300 v.i = node->X3D_SFBool.value; vtype = FIELDTYPE_SFInt32;
break;
301 case FIELDTYPE_SFVec3d:
303 v.d = node->X3D_SFVec3d.c[item]; vtype =FIELDTYPE_SFTime;
break;
304 case FIELDTYPE_SFVec2d:
306 v.d = node->X3D_SFVec2d.c[item]; vtype =FIELDTYPE_SFTime;
break;
312 case FIELDTYPE_SFTime:
313 return X3D_newSFTime(v.d);
break;
314 case FIELDTYPE_SFFloat:
315 return X3D_newSFFloat(v.f);
break;
316 case FIELDTYPE_SFInt32:
317 return X3D_newSFInt32(v.i);
break;
318 case FIELDTYPE_SFBool:
319 return X3D_newSFInt32(v.i);
break;
333 int ntype = node->type;
336 case FIELDTYPE_SFColor:
337 f = node->X3D_SFColor.c;
338 retval = X3D_newSFColor(f[0],f[1],f[2]);
break;
339 case FIELDTYPE_SFFloat:
340 retval = X3D_newSFFloat(node->X3D_SFFloat.value);
break;
341 case FIELDTYPE_SFTime:
342 retval = X3D_newSFTime(node->X3D_SFTime.value);
break;
343 case FIELDTYPE_SFInt32:
344 retval = X3D_newSFInt32(node->X3D_SFInt32.value);
break;
345 case FIELDTYPE_SFString:
346 retval = X3D_newSFString(node->X3D_SFString.strptr);
347 s = node->X3D_SFString.strptr;
348 n = min(strlen(s)+1,STRLEN);
349 retval->X3D_SFString.strptr = malloc(n);
350 strncpy(retval->X3D_SFString.strptr,s,n);
351 retval->X3D_SFString.len = strlen(s);
353 case FIELDTYPE_SFNode:
354 retval = X3D_newSFNode();
break;
355 case FIELDTYPE_SFRotation:
356 f = node->X3D_SFRotation.r;
357 retval = X3D_newSFRotation(f[0],f[1],f[2],f[3]);
break;
358 case FIELDTYPE_SFVec2f:
359 f = node->X3D_SFVec2f.c;
360 retval = X3D_newSFVec2f(f[0],f[1]);
break;
361 case FIELDTYPE_SFVec3f:
362 f = node->X3D_SFVec3f.c;
363 retval = X3D_newSFVec3f(f[0],f[1],f[2]);
break;
364 case FIELDTYPE_SFColorRGBA:
365 f = node->X3D_SFColorRGBA.r;
366 retval = X3D_newSFColorRGBA(f[0],f[1],f[2],f[3]);
break;
367 case FIELDTYPE_SFBool:
368 retval = X3D_newSFBool(node->X3D_SFBool.value);
break;
369 case FIELDTYPE_SFVec3d:
372 case FIELDTYPE_SFVec2d:
373 d = node->X3D_SFVec2d.c;
374 retval = X3D_newSFVec2d(d[0],d[1]);
break;
385 if( !isSF(value->type) )
return;
386 if( node->type != value->type+1 )
return;
387 if( item < 0 || item >= node->X3D_MFNode.n )
return;
388 if( value->type == FIELDTYPE_SFString)
390 int len = min(value->X3D_SFString.len +1,STRLEN);
392 FREE_IF_NZ(node->X3D_MFString.p[item].strptr);
393 newstr = malloc(len*
sizeof(
char));
394 strncpy(newstr,value->X3D_SFString.strptr,len);
396 sz = X3D_sizeof(value->type);
397 target = ((
char *)(node->X3D_MFNode.p)) + sz*item;
398 memcpy(target,value,sz);
399 if( value->type == FIELDTYPE_SFString)
401 node->X3D_MFString.p[item].strptr = newstr;
402 node->X3D_MFString.p[item].len = strnlen(newstr,STRLEN);
408 if( item < 0 || item >= node->X3D_MFNode.n )
return NULL;
412 retval = X3D_deepcopySF((
X3DNode*)(((
char *)(node->X3D_MFNode.p)) + item*X3D_sizeof(node->X3D_MFNode.p[0].type)));
419 retval = X3D_newSF(node->type -1);
420 if( retval->type == FIELDTYPE_SFString) free(retval->X3D_SFString.strptr);
421 memcpy(retval,&(node->X3D_MFNode.p[item]),X3D_sizeof(retval->type));
422 if( retval->type == FIELDTYPE_SFString)
424 int len = min(node->X3D_SFString.len+1,STRLEN);
425 retval->X3D_SFString.strptr = malloc(len);
426 strncpy(retval->X3D_SFString.strptr,node->X3D_SFString.strptr,len);
434 if(isMF(node->type)) _X3D_setItemMF(node,item,value);
435 else if( isSF(value->type) )_X3D_setItemSF(node,item,value);
439 if(isMF(node->type))
return _X3D_getItemMF(node,item);
440 else if( isSF(node->type) )
return _X3D_getItemSF(node,item);
443 void _grow(
X3DNode *node,
int num,
int more)
446 tmp = node->X3D_MFNode.p;
447 p = malloc(
sizeof (
X3DNode) * (num+more));
448 bzero(p,
sizeof (
X3DNode) * (num+more));
451 memcpy(p,tmp,
sizeof(
X3DNode)*num);
454 node->X3D_MFNode.p = p;
455 node->X3D_MFNode.n = num + more;
460 if( node != NULL && value != NULL )
462 if(isMF(node->type) && isSF(value->type))
464 if(node->type == value->type+1)
466 num = node->X3D_MFNode.n;
468 item = node->X3D_MFNode.n -1;
469 _X3D_setItemMF(node,item,value);
475 int getnumtokens(
char* str,
char *delim)
480 tokens = strtok(str,delim);
481 while(tokens != NULL)
484 tokens = strtok(NULL,delim);
488 char * _x3ditoa(
int ival,
char* bigbuf)
492 sprintf(bigbuf,
"%d ",ival);
493 len = strlen(bigbuf);
494 retbuf = MALLOC(
char *, len+1);
495 strcpy(retbuf,bigbuf);
498 char * _x3dftoa(
float fval,
char* bigbuf)
502 sprintf(bigbuf,
"%f ",fval);
503 len = strlen(bigbuf);
504 retbuf = MALLOC(
char *, len+1);
505 strcpy(retbuf,bigbuf);
508 char * _x3ddtoa(
double dval,
char* bigbuf)
512 sprintf(bigbuf,
"%f ",dval);
513 len = strlen(bigbuf);
514 retbuf = MALLOC(
char *, len+1);
515 strcpy(retbuf,bigbuf);
518 char * _x3datoa(
char *aval,
char* bigbuf)
524 retbuf = MALLOC(
char *, len+4);
525 sprintf(retbuf,
"\"%s\" ",aval);
526 retbuf[len+3] =
'\0';
529 char * X3D_swigStringFromField(
X3DNode* field)
541 int type, ismf, count, i, size;
546 if(type < 0 || type > 41 )
551 count = count + field->X3D_MFNode.n;
554 tokens = (
char** )malloc(count*
sizeof(
char*));
558 case FIELDTYPE_SFFloat:
559 tokens[0] = _x3ditoa(FIELDTYPE_SFFloat, buf);
560 tokens[1] = _x3ditoa(1,buf);
561 tokens[2] = _x3dftoa(field->X3D_SFFloat.value, buf);
563 case FIELDTYPE_MFFloat:
564 tokens[0] = _x3ditoa(FIELDTYPE_MFFloat,buf);
565 tokens[1] = _x3ditoa(field->X3D_MFNode.n,buf);
566 for(i=0;i<count-2;i++)
567 tokens[i+2] = _x3dftoa(field->X3D_MFFloat.p[i].value,buf);
569 case FIELDTYPE_MFString:
570 tokens[0] = _x3ditoa(FIELDTYPE_MFString,buf);
571 tokens[1] = _x3ditoa(field->X3D_MFString.n,buf);
572 for(i=0;i<count-2;i++)
573 tokens[i+2] = _x3datoa(field->X3D_MFString.p[i].strptr,buf);
577 for(i=0;i<count;i++) size = size + strlen(tokens[i]);
579 string = MALLOC(
char *, (size+1)*
sizeof(
char));
583 strcat(
string,tokens[i]);
584 FREE_IF_NZ(tokens[i]);
590 X3DNode* X3D_swigFieldFromString(
char* fieldtype,
char* values)
599 int len,i,n,start,end, inum;
600 float f, *farray, **f2,**f3,**f4;
601 double d,*darray, **d2,**d3,**d4;
605 if(fieldtype == NULL || values == NULL)
return NULL;
606 type = findFieldInFIELDTYPES(fieldtype);
609 len = strlen(values);
610 vals = (
char*) malloc(len);
611 memcpy(vals,values,len);
614 case FIELDTYPE_SFFloat:
621 case FIELDTYPE_MFFloat:
622 case FIELDTYPE_SFVec2f:
623 case FIELDTYPE_MFVec2f:
624 case FIELDTYPE_SFVec3f:
625 case FIELDTYPE_MFVec3f:
626 case FIELDTYPE_SFRotation:
627 case FIELDTYPE_MFRotation:
628 case FIELDTYPE_SFColorRGBA:
629 case FIELDTYPE_MFColorRGBA:
630 case FIELDTYPE_SFColor:
631 case FIELDTYPE_MFColor:
633 count = getnumtokens(vals,delim);
634 farray = MALLOC(
float *, count*
sizeof(
float));
635 memcpy(vals,values,len);
636 token = strtok(vals,delim);
638 while (token != NULL) {
639 if( sscanf(token,
"%f",&f)==1 )
644 token = strtok(NULL,delim);
646 f2 = MALLOC(
float **, count*
sizeof(
float*));
647 f3 = MALLOC(
float **, count*
sizeof(
float*));
648 f4 = MALLOC(
float **, count*
sizeof(
float*));
651 f2[i] = &farray[i*2];
652 f3[i] = &farray[i*3];
653 f4[i] = &farray[i*4];
657 case FIELDTYPE_SFFloat:
658 retval = X3D_newSFFloat(farray[0]);
659 case FIELDTYPE_MFFloat:
660 retval = X3D_newMFFloat(count, farray);
break;
661 case FIELDTYPE_SFVec2f:
662 retval = X3D_newSFVec2f(farray[0],farray[1]);
break;
663 case FIELDTYPE_SFVec3f:
664 retval = X3D_newSFVec3f(farray[0],farray[1],farray[2]);
break;
665 case FIELDTYPE_MFVec3f:
666 retval = X3D_newMFVec3f(count,f3);
break;
667 case FIELDTYPE_SFRotation:
668 retval = X3D_newSFRotation(farray[0],farray[1],farray[2],farray[3]);
break;
669 case FIELDTYPE_MFRotation:
670 retval = X3D_newMFRotation(count,f4);
break;
671 case FIELDTYPE_SFColorRGBA:
672 retval = X3D_newSFColorRGBA(farray[0],farray[1],farray[2],farray[3]);
break;
673 case FIELDTYPE_MFColorRGBA:
674 retval = X3D_newMFColorRGBA(count,f4);
break;
675 case FIELDTYPE_MFColor:
676 retval = X3D_newMFColor(count,f3);
break;
684 case FIELDTYPE_SFBool:
685 case FIELDTYPE_SFInt32:
686 token = strtok(values,delim);
687 if( sscanf(token,
"%d",&inum) == 1)
689 if(type == FIELDTYPE_SFInt32) retval = X3D_newSFInt32(inum);
690 if(type == FIELDTYPE_SFBool) retval = X3D_newSFBool(inum);
693 case FIELDTYPE_SFTime:
694 case FIELDTYPE_SFVec2d:
695 case FIELDTYPE_SFVec3d:
696 count = getnumtokens(vals,delim);
697 darray = MALLOC(
double *, count*
sizeof(
double));
698 memcpy(vals,values,len);
699 token = strtok(vals,delim);
701 while (token != NULL) {
702 if( sscanf(token,
"%lf",&d)==1 )
707 token = strtok(NULL,delim);
709 d2 = MALLOC(
double **, count*
sizeof(
double*));
710 d3 = MALLOC(
double **, count*
sizeof(
double*));
711 d4 = MALLOC(
double **, count*
sizeof(
double*));
714 d2[i] = &darray[i*2];
715 d3[i] = &darray[i*3];
716 d4[i] = &darray[i*4];
720 case FIELDTYPE_SFTime:
721 retval = X3D_newSFTime(darray[0]);
break;
722 case FIELDTYPE_SFVec2d:
723 retval = X3D_newSFVec2d(darray[0],darray[1]);
break;
724 case FIELDTYPE_SFVec3d:
725 retval = X3D_newMFVec3d(count,d3);
break;
734 case FIELDTYPE_SFString:
743 retval = X3D_newSFString(values);
746 case FIELDTYPE_MFString:
747 retval = malloc(
sizeof(
X3DNode));
748 retval->X3D_MFString.type = FIELDTYPE_MFString;
750 for(i=0;i<(int)strlen(vals);i++)
751 if( vals[i] ==
'\"' )n++;
759 retval->X3D_MFString.n = n;
760 retval->X3D_MFString.p = malloc(
sizeof(
X3DNode)*retval->X3D_MFString.n);
762 for(i=0,n=0;i<(int)strlen(vals);i++)
764 if( vals[i] ==
'\"' )
772 retval->X3D_MFString.p[count].strptr = MALLOC(
char *, len*
sizeof(
char));
773 strncpy(retval->X3D_MFString.p[count].strptr,&vals[start+1],len-1);
776 retval->X3D_MFString.p[count].strptr[len-1] =
'\0';
777 retval->X3D_MFString.p[count].len = len-1;
801 retval = X3D_newSF(type);
804 case FIELDTYPE_SFInt32:
805 retval->X3D_SFInt32.value = node->sfint32;
break;
806 case FIELDTYPE_SFBool:
807 retval->X3D_SFBool.value = node->sfbool;
break;
808 case FIELDTYPE_SFFloat:
809 retval->X3D_SFFloat.value = node->sffloat;
break;
810 case FIELDTYPE_SFTime:
811 retval->X3D_SFTime.value = node->sftime;
break;
812 case FIELDTYPE_SFColorRGBA:
813 case FIELDTYPE_SFRotation:
815 retval->X3D_SFRotation.r[i] = node->sfrotation.r[i];
817 case FIELDTYPE_SFVec2f:
819 retval->X3D_SFVec2f.c[i] = node->sfvec2f.c[i];
821 case FIELDTYPE_SFVec3f:
822 case FIELDTYPE_SFColor:
824 retval->X3D_SFVec3f.c[i] = node->sfvec3f.c[i];
826 case FIELDTYPE_SFVec3d:
828 retval->X3D_SFVec3d.c[i] = node->sfvec3d.c[i];
830 case FIELDTYPE_SFVec2d:
832 retval->X3D_SFVec2d.c[i] = node->sfvec2d.c[i];
834 case FIELDTYPE_SFString:
835 retval->X3D_SFString.len = node->sfstring->len;
836 retval->X3D_SFString.strptr = (
char*)malloc(node->sfstring->len + 1);
837 strncpy(retval->X3D_SFString.strptr,node->sfstring->strptr,node->sfstring->len+1);
846 retval = _swigNewMF(type, n);
850 case FIELDTYPE_SFInt32:
852 retval->X3D_MFInt32.p[j].value = node->mfint32.p[j];
854 case FIELDTYPE_SFBool:
856 retval->X3D_MFBool.p[j].value = node->mfbool.p[j];
858 case FIELDTYPE_SFFloat:
860 retval->X3D_MFFloat.p[j].value = node->mffloat.p[j];
862 case FIELDTYPE_SFTime:
864 retval->X3D_MFTime.p[j].value = node->mftime.p[j];
866 case FIELDTYPE_SFColorRGBA:
867 case FIELDTYPE_SFRotation:
870 retval->X3D_MFRotation.p[j].r[i] = node->mfrotation.p[j].r[i];
872 case FIELDTYPE_SFVec2f:
875 retval->X3D_MFVec2f.p[j].c[i] = node->mfvec2f.p[j].c[i];
877 case FIELDTYPE_SFVec3f:
878 case FIELDTYPE_SFColor:
881 retval->X3D_MFVec3f.p[j].c[i] = node->mfvec3f.p[j].c[i];
883 case FIELDTYPE_SFVec3d:
886 retval->X3D_MFVec3d.p[j].c[i] = node->mfvec3d.p[j].c[i];
888 case FIELDTYPE_SFString:
891 retval->X3D_MFString.p[j].len = node->mfstring.p[j]->len;
892 retval->X3D_MFString.p[j].strptr = (
char*)malloc(node->mfstring.p[j]->len + 1);
893 strncpy(retval->X3D_MFString.p[j].strptr,node->mfstring.p[j]->strptr,node->mfstring.p[j]->len+1);
900 union anyVrml* getListenerData(
int index);
901 int getListenerType(
int index);
902 X3DNode* X3D_swigCallbackDataFetch(
char *ListenerTableIndex)
926 if( sscanf(ListenerTableIndex,
"%d",&index) < 1)
930 anynode = getListenerData(index);
931 type = getListenerType(index);
932 retval = anyVrml2X3DNode(type, anynode);