示例#1
0
void Term_NodeInit(void *_is, SFNode *node)
{
	InlineScene *is = (InlineScene *)_is;
	if (!node || !is) return;
	
	switch (Node_GetTag(node)) {
	case TAG_MPEG4_Inline: 
	case TAG_X3D_Inline: 
		Node_SetRenderFunction(node, IS_Render); break;
	case TAG_MPEG4_MediaBuffer: break;
	case TAG_MPEG4_MediaControl: InitMediaControl(is, node); break;
	case TAG_MPEG4_MediaSensor: InitMediaSensor(is, node); break;
	case TAG_MPEG4_InputSensor: InitInputSensor(is, node); break;

	/*BIFS nodes, get back to codec, but filter externProtos*/
	case TAG_MPEG4_Conditional: break;
	case TAG_MPEG4_QuantizationParameter: break;
	/*world info is stored at the inline scene level*/
	case TAG_MPEG4_WorldInfo:
	case TAG_X3D_WorldInfo:
		Node_SetPreDestroyFunction(node, Destroy_WorldInfo);
		Node_SetRenderFunction(node, Render_WorldInfo);
		Node_SetPrivate(node, is);
		break;

	case TAG_X3D_KeySensor: InitKeySensor(is, node); break;
	case TAG_X3D_StringSensor: InitStringSensor(is, node); break;

	default: SR_NodeInit(is->root_od->term->renderer, node); break;
	}
}
示例#2
0
void gf_term_on_node_init(void *_scene, GF_Node *node)
{
	GF_Scene *scene = (GF_Scene *)_scene;
	if (!node || !scene) return;
	
	switch (gf_node_get_tag(node)) {
#ifndef GPAC_DISABLE_VRML

	case TAG_MPEG4_Inline: 
#ifndef GPAC_DISABLE_X3D
	case TAG_X3D_Inline: 
#endif
		gf_init_inline(scene, node); break;
	case TAG_MPEG4_MediaBuffer: break;
	case TAG_MPEG4_MediaControl: InitMediaControl(scene, node); break;
	case TAG_MPEG4_MediaSensor: InitMediaSensor(scene, node); break;
	case TAG_MPEG4_InputSensor: InitInputSensor(scene, node); break;

	/*BIFS nodes, get back to codec, but filter externProtos*/
	case TAG_MPEG4_Conditional: break;
	case TAG_MPEG4_QuantizationParameter: break;
	/*world info is stored at the inline scene level*/
	case TAG_MPEG4_WorldInfo:
#ifndef GPAC_DISABLE_X3D
	case TAG_X3D_WorldInfo:
#endif
		gf_node_set_callback_function(node, TraverseWorldInfo);
		gf_node_set_private(node, scene);
		break;

#ifndef GPAC_DISABLE_X3D
	case TAG_X3D_KeySensor: InitKeySensor(scene, node); break;
	case TAG_X3D_StringSensor: InitStringSensor(scene, node); break;
#endif

	case TAG_MPEG4_TermCap: 
		InitTermCap(scene, node); break;

	case TAG_MPEG4_Storage: 
		gf_scene_init_storage(scene, node); break;

	case TAG_MPEG4_KeyNavigator:
		gf_node_set_callback_function(node, TraverseKeyNavigator);
		gf_node_set_private(node, scene);
		gf_list_add(scene->keynavigators, node);
		((M_KeyNavigator*)node)->on_setFocus = on_kn_set_focus;
		break;
		
#endif


#ifndef GPAC_DISABLE_SVG
	case TAG_SVG_title: 
		gf_node_set_callback_function(node, svg_traverse_title);
		gf_node_set_private(node, scene);
		break;
#endif

	default: gf_sc_on_node_init(scene->root_od->term->compositor, node); break;
	}
}