⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 x3d_nodes.c

📁 一个用于智能手机的多媒体库适合S60 WinCE的跨平台开发库
💻 C
📖 第 1 页 / 共 5 页
字号:
/* *			GPAC - Multimedia Framework C SDK * *			Copyright (c) Jean Le Feuvre 2000-2005 *					All rights reserved * *  This file is part of GPAC / X3D Scene Graph sub-project * *  GPAC is free software; you can redistribute it and/or modify *  it under the terms of the GNU Lesser General Public License as published by *  the Free Software Foundation; either version 2, or (at your option) *  any later version. * *  GPAC is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU Lesser General Public License for more details.	 * *  You should have received a copy of the GNU Lesser General Public *  License along with this library; see the file COPYING.  If not, write to *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * *//*	DO NOT MOFIFY - File generated on GMT Fri Dec 22 19:22:55 2006	BY X3DGen for GPAC Version 0.4.3-DEV*/#include <gpac/nodes_x3d.h>#include <gpac/internal/scenegraph_dev.h>/*for NDT tag definitions*/#include <gpac/nodes_mpeg4.h>/*	Anchor Node deletion*/static void Anchor_Del(GF_Node *node){	X_Anchor *p = (X_Anchor *) node;	gf_sg_vrml_parent_destroy(node);		gf_sg_sfstring_del(p->description);	gf_sg_mfstring_del(p->parameter);	gf_sg_mfurl_del(p->url);	gf_node_unregister((GF_Node *) p->metadata, node);		gf_node_free((GF_Node *)p);}static u32 Anchor_get_field_count(GF_Node *node, u8 dummy){	return 7;}static GF_Err Anchor_get_field(GF_Node *node, GF_FieldInfo *info){	switch (info->fieldIndex) {	case 0:		info->name = "addChildren";		info->eventType = GF_SG_EVENT_IN;		info->on_event_in = ((X_Anchor *)node)->on_addChildren;		info->fieldType = GF_SG_VRML_MFNODE;		info->NDTtype = NDT_SF3DNode;		info->far_ptr = & ((X_Anchor *)node)->addChildren;		return GF_OK;	case 1:		info->name = "removeChildren";		info->eventType = GF_SG_EVENT_IN;		info->on_event_in = ((X_Anchor *)node)->on_removeChildren;		info->fieldType = GF_SG_VRML_MFNODE;		info->NDTtype = NDT_SF3DNode;		info->far_ptr = & ((X_Anchor *)node)->removeChildren;		return GF_OK;	case 2:		info->name = "children";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_MFNODE;		info->NDTtype = NDT_SF3DNode;		info->far_ptr = & ((X_Anchor *)node)->children;		return GF_OK;	case 3:		info->name = "description";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFSTRING;		info->far_ptr = & ((X_Anchor *) node)->description;		return GF_OK;	case 4:		info->name = "parameter";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_MFSTRING;		info->far_ptr = & ((X_Anchor *) node)->parameter;		return GF_OK;	case 5:		info->name = "url";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_MFURL;		info->far_ptr = & ((X_Anchor *) node)->url;		return GF_OK;	case 6:		info->name = "metadata";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFNODE;		info->NDTtype = NDT_SFMetadataNode;		info->far_ptr = & ((X_Anchor *)node)->metadata;		return GF_OK;	default:		return GF_BAD_PARAM;	}}static s32 Anchor_get_field_index_by_name(char *name){	if (!strcmp("addChildren", name)) return 0;	if (!strcmp("removeChildren", name)) return 1;	if (!strcmp("children", name)) return 2;	if (!strcmp("description", name)) return 3;	if (!strcmp("parameter", name)) return 4;	if (!strcmp("url", name)) return 5;	if (!strcmp("metadata", name)) return 6;	return -1;	}static GF_Node *Anchor_Create(){	X_Anchor *p;	GF_SAFEALLOC(p, X_Anchor);	if(!p) return NULL;	gf_node_setup((GF_Node *)p, TAG_X3D_Anchor);	gf_sg_vrml_parent_setup((GF_Node *) p);#ifdef GF_NODE_USE_POINTERS	((GF_Node *)p)->sgprivate->name = "Anchor";	((GF_Node *)p)->sgprivate->node_del = Anchor_Del;	((GF_Node *)p)->sgprivate->get_field_count = Anchor_get_field_count;	((GF_Node *)p)->sgprivate->get_field = Anchor_get_field;#endif	/*default field values*/	return (GF_Node *)p;}/*	Appearance Node deletion*/static void Appearance_Del(GF_Node *node){	X_Appearance *p = (X_Appearance *) node;	gf_node_unregister((GF_Node *) p->material, node);		gf_node_unregister((GF_Node *) p->texture, node);		gf_node_unregister((GF_Node *) p->textureTransform, node);		gf_node_unregister((GF_Node *) p->fillProperties, node);		gf_node_unregister((GF_Node *) p->lineProperties, node);		gf_node_unregister((GF_Node *) p->metadata, node);		gf_node_free((GF_Node *)p);}static u32 Appearance_get_field_count(GF_Node *node, u8 dummy){	return 6;}static GF_Err Appearance_get_field(GF_Node *node, GF_FieldInfo *info){	switch (info->fieldIndex) {	case 0:		info->name = "material";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFNODE;		info->NDTtype = NDT_SFMaterialNode;		info->far_ptr = & ((X_Appearance *)node)->material;		return GF_OK;	case 1:		info->name = "texture";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFNODE;		info->NDTtype = NDT_SFTextureNode;		info->far_ptr = & ((X_Appearance *)node)->texture;		return GF_OK;	case 2:		info->name = "textureTransform";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFNODE;		info->NDTtype = NDT_SFTextureTransformNode;		info->far_ptr = & ((X_Appearance *)node)->textureTransform;		return GF_OK;	case 3:		info->name = "fillProperties";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFNODE;		info->NDTtype = NDT_SFFillPropertiesNode;		info->far_ptr = & ((X_Appearance *)node)->fillProperties;		return GF_OK;	case 4:		info->name = "lineProperties";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFNODE;		info->NDTtype = NDT_SFX3DLinePropertiesNode;		info->far_ptr = & ((X_Appearance *)node)->lineProperties;		return GF_OK;	case 5:		info->name = "metadata";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFNODE;		info->NDTtype = NDT_SFMetadataNode;		info->far_ptr = & ((X_Appearance *)node)->metadata;		return GF_OK;	default:		return GF_BAD_PARAM;	}}static s32 Appearance_get_field_index_by_name(char *name){	if (!strcmp("material", name)) return 0;	if (!strcmp("texture", name)) return 1;	if (!strcmp("textureTransform", name)) return 2;	if (!strcmp("fillProperties", name)) return 3;	if (!strcmp("lineProperties", name)) return 4;	if (!strcmp("metadata", name)) return 5;	return -1;	}static GF_Node *Appearance_Create(){	X_Appearance *p;	GF_SAFEALLOC(p, X_Appearance);	if(!p) return NULL;	gf_node_setup((GF_Node *)p, TAG_X3D_Appearance);#ifdef GF_NODE_USE_POINTERS	((GF_Node *)p)->sgprivate->name = "Appearance";	((GF_Node *)p)->sgprivate->node_del = Appearance_Del;	((GF_Node *)p)->sgprivate->get_field_count = Appearance_get_field_count;	((GF_Node *)p)->sgprivate->get_field = Appearance_get_field;#endif	/*default field values*/	return (GF_Node *)p;}/*	Arc2D Node deletion*/static void Arc2D_Del(GF_Node *node){	X_Arc2D *p = (X_Arc2D *) node;	gf_node_unregister((GF_Node *) p->metadata, node);		gf_node_free((GF_Node *)p);}static u32 Arc2D_get_field_count(GF_Node *node, u8 dummy){	return 4;}static GF_Err Arc2D_get_field(GF_Node *node, GF_FieldInfo *info){	switch (info->fieldIndex) {	case 0:		info->name = "endAngle";		info->eventType = GF_SG_EVENT_FIELD;		info->fieldType = GF_SG_VRML_SFFLOAT;		info->far_ptr = & ((X_Arc2D *) node)->endAngle;		return GF_OK;	case 1:		info->name = "radius";		info->eventType = GF_SG_EVENT_FIELD;		info->fieldType = GF_SG_VRML_SFFLOAT;		info->far_ptr = & ((X_Arc2D *) node)->radius;		return GF_OK;	case 2:		info->name = "startAngle";		info->eventType = GF_SG_EVENT_FIELD;		info->fieldType = GF_SG_VRML_SFFLOAT;		info->far_ptr = & ((X_Arc2D *) node)->startAngle;		return GF_OK;	case 3:		info->name = "metadata";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFNODE;		info->NDTtype = NDT_SFMetadataNode;		info->far_ptr = & ((X_Arc2D *)node)->metadata;		return GF_OK;	default:		return GF_BAD_PARAM;	}}static s32 Arc2D_get_field_index_by_name(char *name){	if (!strcmp("endAngle", name)) return 0;	if (!strcmp("radius", name)) return 1;	if (!strcmp("startAngle", name)) return 2;	if (!strcmp("metadata", name)) return 3;	return -1;	}static GF_Node *Arc2D_Create(){	X_Arc2D *p;	GF_SAFEALLOC(p, X_Arc2D);	if(!p) return NULL;	gf_node_setup((GF_Node *)p, TAG_X3D_Arc2D);#ifdef GF_NODE_USE_POINTERS	((GF_Node *)p)->sgprivate->name = "Arc2D";	((GF_Node *)p)->sgprivate->node_del = Arc2D_Del;	((GF_Node *)p)->sgprivate->get_field_count = Arc2D_get_field_count;	((GF_Node *)p)->sgprivate->get_field = Arc2D_get_field;#endif	/*default field values*/	p->endAngle = FLT2FIX(1.5707963);	p->radius = FLT2FIX(1);	p->startAngle = FLT2FIX(0);	return (GF_Node *)p;}/*	ArcClose2D Node deletion*/static void ArcClose2D_Del(GF_Node *node){	X_ArcClose2D *p = (X_ArcClose2D *) node;	gf_sg_sfstring_del(p->closureType);	gf_node_unregister((GF_Node *) p->metadata, node);		gf_node_free((GF_Node *)p);}static u32 ArcClose2D_get_field_count(GF_Node *node, u8 dummy){	return 5;}static GF_Err ArcClose2D_get_field(GF_Node *node, GF_FieldInfo *info){	switch (info->fieldIndex) {	case 0:		info->name = "closureType";		info->eventType = GF_SG_EVENT_FIELD;		info->fieldType = GF_SG_VRML_SFSTRING;		info->far_ptr = & ((X_ArcClose2D *) node)->closureType;		return GF_OK;	case 1:		info->name = "endAngle";		info->eventType = GF_SG_EVENT_FIELD;		info->fieldType = GF_SG_VRML_SFFLOAT;		info->far_ptr = & ((X_ArcClose2D *) node)->endAngle;		return GF_OK;	case 2:		info->name = "radius";		info->eventType = GF_SG_EVENT_FIELD;		info->fieldType = GF_SG_VRML_SFFLOAT;		info->far_ptr = & ((X_ArcClose2D *) node)->radius;		return GF_OK;	case 3:		info->name = "startAngle";		info->eventType = GF_SG_EVENT_FIELD;		info->fieldType = GF_SG_VRML_SFFLOAT;		info->far_ptr = & ((X_ArcClose2D *) node)->startAngle;		return GF_OK;	case 4:		info->name = "metadata";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFNODE;		info->NDTtype = NDT_SFMetadataNode;		info->far_ptr = & ((X_ArcClose2D *)node)->metadata;		return GF_OK;	default:		return GF_BAD_PARAM;	}}static s32 ArcClose2D_get_field_index_by_name(char *name){	if (!strcmp("closureType", name)) return 0;	if (!strcmp("endAngle", name)) return 1;	if (!strcmp("radius", name)) return 2;	if (!strcmp("startAngle", name)) return 3;	if (!strcmp("metadata", name)) return 4;	return -1;	}static GF_Node *ArcClose2D_Create(){	X_ArcClose2D *p;	GF_SAFEALLOC(p, X_ArcClose2D);	if(!p) return NULL;	gf_node_setup((GF_Node *)p, TAG_X3D_ArcClose2D);#ifdef GF_NODE_USE_POINTERS	((GF_Node *)p)->sgprivate->name = "ArcClose2D";	((GF_Node *)p)->sgprivate->node_del = ArcClose2D_Del;	((GF_Node *)p)->sgprivate->get_field_count = ArcClose2D_get_field_count;	((GF_Node *)p)->sgprivate->get_field = ArcClose2D_get_field;#endif	/*default field values*/	p->closureType.buffer = (char*) malloc(sizeof(char) * 4);	strcpy(p->closureType.buffer, "PIE");	p->endAngle = FLT2FIX(1.5707963);	p->radius = FLT2FIX(1);	p->startAngle = FLT2FIX(0);	return (GF_Node *)p;}/*	AudioClip Node deletion*/static void AudioClip_Del(GF_Node *node){	X_AudioClip *p = (X_AudioClip *) node;	gf_sg_sfstring_del(p->description);	gf_sg_mfurl_del(p->url);	gf_node_unregister((GF_Node *) p->metadata, node);		gf_node_free((GF_Node *)p);}static u32 AudioClip_get_field_count(GF_Node *node, u8 dummy){	return 13;}static GF_Err AudioClip_get_field(GF_Node *node, GF_FieldInfo *info){	switch (info->fieldIndex) {	case 0:		info->name = "description";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFSTRING;		info->far_ptr = & ((X_AudioClip *) node)->description;		return GF_OK;	case 1:		info->name = "loop";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFBOOL;		info->far_ptr = & ((X_AudioClip *) node)->loop;		return GF_OK;	case 2:		info->name = "pitch";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFFLOAT;		info->far_ptr = & ((X_AudioClip *) node)->pitch;		return GF_OK;	case 3:		info->name = "startTime";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFTIME;		info->far_ptr = & ((X_AudioClip *) node)->startTime;		return GF_OK;	case 4:		info->name = "stopTime";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFTIME;		info->far_ptr = & ((X_AudioClip *) node)->stopTime;		return GF_OK;	case 5:		info->name = "url";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_MFURL;		info->far_ptr = & ((X_AudioClip *) node)->url;		return GF_OK;	case 6:		info->name = "duration_changed";		info->eventType = GF_SG_EVENT_OUT;		info->fieldType = GF_SG_VRML_SFTIME;		info->far_ptr = & ((X_AudioClip *) node)->duration_changed;		return GF_OK;	case 7:		info->name = "isActive";		info->eventType = GF_SG_EVENT_OUT;		info->fieldType = GF_SG_VRML_SFBOOL;		info->far_ptr = & ((X_AudioClip *) node)->isActive;		return GF_OK;	case 8:		info->name = "metadata";		info->eventType = GF_SG_EVENT_EXPOSED_FIELD;		info->fieldType = GF_SG_VRML_SFNODE;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -