📄 x3d_nodes.c
字号:
}/* ColorInterpolator Node deletion*/static void ColorInterpolator_Del(GF_Node *node){ X_ColorInterpolator *p = (X_ColorInterpolator *) node; gf_sg_mffloat_del(p->key); gf_sg_mfcolor_del(p->keyValue); gf_node_unregister((GF_Node *) p->metadata, node); gf_node_free((GF_Node *)p);}static u32 ColorInterpolator_get_field_count(GF_Node *node, u8 dummy){ return 5;}static GF_Err ColorInterpolator_get_field(GF_Node *node, GF_FieldInfo *info){ switch (info->fieldIndex) { case 0: info->name = "set_fraction"; info->eventType = GF_SG_EVENT_IN; info->on_event_in = ((X_ColorInterpolator *)node)->on_set_fraction; info->fieldType = GF_SG_VRML_SFFLOAT; info->far_ptr = & ((X_ColorInterpolator *) node)->set_fraction; return GF_OK; case 1: info->name = "key"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_MFFLOAT; info->far_ptr = & ((X_ColorInterpolator *) node)->key; return GF_OK; case 2: info->name = "keyValue"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_MFCOLOR; info->far_ptr = & ((X_ColorInterpolator *) node)->keyValue; return GF_OK; case 3: info->name = "value_changed"; info->eventType = GF_SG_EVENT_OUT; info->fieldType = GF_SG_VRML_SFCOLOR; info->far_ptr = & ((X_ColorInterpolator *) node)->value_changed; 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_ColorInterpolator *)node)->metadata; return GF_OK; default: return GF_BAD_PARAM; }}static s32 ColorInterpolator_get_field_index_by_name(char *name){ if (!strcmp("set_fraction", name)) return 0; if (!strcmp("key", name)) return 1; if (!strcmp("keyValue", name)) return 2; if (!strcmp("value_changed", name)) return 3; if (!strcmp("metadata", name)) return 4; return -1; }static GF_Node *ColorInterpolator_Create(){ X_ColorInterpolator *p; GF_SAFEALLOC(p, X_ColorInterpolator); if(!p) return NULL; gf_node_setup((GF_Node *)p, TAG_X3D_ColorInterpolator);#ifdef GF_NODE_USE_POINTERS ((GF_Node *)p)->sgprivate->name = "ColorInterpolator"; ((GF_Node *)p)->sgprivate->node_del = ColorInterpolator_Del; ((GF_Node *)p)->sgprivate->get_field_count = ColorInterpolator_get_field_count; ((GF_Node *)p)->sgprivate->get_field = ColorInterpolator_get_field;#endif /*default field values*/ return (GF_Node *)p;}/* ColorRGBA Node deletion*/static void ColorRGBA_Del(GF_Node *node){ X_ColorRGBA *p = (X_ColorRGBA *) node; gf_node_unregister((GF_Node *) p->metadata, node); gf_node_free((GF_Node *)p);}static u32 ColorRGBA_get_field_count(GF_Node *node, u8 dummy){ return 2;}static GF_Err ColorRGBA_get_field(GF_Node *node, GF_FieldInfo *info){ switch (info->fieldIndex) { case 0: info->name = "color"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_MFCOLORRGBA; info->far_ptr = & ((X_ColorRGBA *) node)->color; return GF_OK; case 1: info->name = "metadata"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_SFNODE; info->NDTtype = NDT_SFMetadataNode; info->far_ptr = & ((X_ColorRGBA *)node)->metadata; return GF_OK; default: return GF_BAD_PARAM; }}static s32 ColorRGBA_get_field_index_by_name(char *name){ if (!strcmp("color", name)) return 0; if (!strcmp("metadata", name)) return 1; return -1; }static GF_Node *ColorRGBA_Create(){ X_ColorRGBA *p; GF_SAFEALLOC(p, X_ColorRGBA); if(!p) return NULL; gf_node_setup((GF_Node *)p, TAG_X3D_ColorRGBA);#ifdef GF_NODE_USE_POINTERS ((GF_Node *)p)->sgprivate->name = "ColorRGBA"; ((GF_Node *)p)->sgprivate->node_del = ColorRGBA_Del; ((GF_Node *)p)->sgprivate->get_field_count = ColorRGBA_get_field_count; ((GF_Node *)p)->sgprivate->get_field = ColorRGBA_get_field;#endif /*default field values*/ return (GF_Node *)p;}/* Cone Node deletion*/static void Cone_Del(GF_Node *node){ X_Cone *p = (X_Cone *) node; gf_node_unregister((GF_Node *) p->metadata, node); gf_node_free((GF_Node *)p);}static u32 Cone_get_field_count(GF_Node *node, u8 dummy){ return 5;}static GF_Err Cone_get_field(GF_Node *node, GF_FieldInfo *info){ switch (info->fieldIndex) { case 0: info->name = "bottomRadius"; info->eventType = GF_SG_EVENT_FIELD; info->fieldType = GF_SG_VRML_SFFLOAT; info->far_ptr = & ((X_Cone *) node)->bottomRadius; return GF_OK; case 1: info->name = "height"; info->eventType = GF_SG_EVENT_FIELD; info->fieldType = GF_SG_VRML_SFFLOAT; info->far_ptr = & ((X_Cone *) node)->height; return GF_OK; case 2: info->name = "side"; info->eventType = GF_SG_EVENT_FIELD; info->fieldType = GF_SG_VRML_SFBOOL; info->far_ptr = & ((X_Cone *) node)->side; return GF_OK; case 3: info->name = "bottom"; info->eventType = GF_SG_EVENT_FIELD; info->fieldType = GF_SG_VRML_SFBOOL; info->far_ptr = & ((X_Cone *) node)->bottom; 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_Cone *)node)->metadata; return GF_OK; default: return GF_BAD_PARAM; }}static s32 Cone_get_field_index_by_name(char *name){ if (!strcmp("bottomRadius", name)) return 0; if (!strcmp("height", name)) return 1; if (!strcmp("side", name)) return 2; if (!strcmp("bottom", name)) return 3; if (!strcmp("metadata", name)) return 4; return -1; }static GF_Node *Cone_Create(){ X_Cone *p; GF_SAFEALLOC(p, X_Cone); if(!p) return NULL; gf_node_setup((GF_Node *)p, TAG_X3D_Cone);#ifdef GF_NODE_USE_POINTERS ((GF_Node *)p)->sgprivate->name = "Cone"; ((GF_Node *)p)->sgprivate->node_del = Cone_Del; ((GF_Node *)p)->sgprivate->get_field_count = Cone_get_field_count; ((GF_Node *)p)->sgprivate->get_field = Cone_get_field;#endif /*default field values*/ p->bottomRadius = FLT2FIX(1); p->height = FLT2FIX(2); p->side = 1; p->bottom = 1; return (GF_Node *)p;}/* Contour2D Node deletion*/static void Contour2D_Del(GF_Node *node){ X_Contour2D *p = (X_Contour2D *) node; gf_sg_vrml_parent_destroy(node); gf_node_unregister((GF_Node *) p->metadata, node); gf_node_free((GF_Node *)p);}static u32 Contour2D_get_field_count(GF_Node *node, u8 dummy){ return 4;}static GF_Err Contour2D_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_Contour2D *)node)->on_addChildren; info->fieldType = GF_SG_VRML_MFNODE; info->NDTtype = NDT_SFNurbsControlCurveNode; info->far_ptr = & ((X_Contour2D *)node)->addChildren; return GF_OK; case 1: info->name = "removeChildren"; info->eventType = GF_SG_EVENT_IN; info->on_event_in = ((X_Contour2D *)node)->on_removeChildren; info->fieldType = GF_SG_VRML_MFNODE; info->NDTtype = NDT_SFNurbsControlCurveNode; info->far_ptr = & ((X_Contour2D *)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_SFNurbsControlCurveNode; info->far_ptr = & ((X_Contour2D *)node)->children; 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_Contour2D *)node)->metadata; return GF_OK; default: return GF_BAD_PARAM; }}static s32 Contour2D_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("metadata", name)) return 3; return -1; }static GF_Node *Contour2D_Create(){ X_Contour2D *p; GF_SAFEALLOC(p, X_Contour2D); if(!p) return NULL; gf_node_setup((GF_Node *)p, TAG_X3D_Contour2D); gf_sg_vrml_parent_setup((GF_Node *) p);#ifdef GF_NODE_USE_POINTERS ((GF_Node *)p)->sgprivate->name = "Contour2D"; ((GF_Node *)p)->sgprivate->node_del = Contour2D_Del; ((GF_Node *)p)->sgprivate->get_field_count = Contour2D_get_field_count; ((GF_Node *)p)->sgprivate->get_field = Contour2D_get_field;#endif /*default field values*/ return (GF_Node *)p;}/* ContourPolyline2D Node deletion*/static void ContourPolyline2D_Del(GF_Node *node){ X_ContourPolyline2D *p = (X_ContourPolyline2D *) node; gf_sg_mfvec2f_del(p->point); gf_node_unregister((GF_Node *) p->metadata, node); gf_node_free((GF_Node *)p);}static u32 ContourPolyline2D_get_field_count(GF_Node *node, u8 dummy){ return 2;}static GF_Err ContourPolyline2D_get_field(GF_Node *node, GF_FieldInfo *info){ switch (info->fieldIndex) { case 0: info->name = "point"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_MFVEC2F; info->far_ptr = & ((X_ContourPolyline2D *) node)->point; return GF_OK; case 1: info->name = "metadata"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_SFNODE; info->NDTtype = NDT_SFMetadataNode; info->far_ptr = & ((X_ContourPolyline2D *)node)->metadata; return GF_OK; default: return GF_BAD_PARAM; }}static s32 ContourPolyline2D_get_field_index_by_name(char *name){ if (!strcmp("point", name)) return 0; if (!strcmp("metadata", name)) return 1; return -1; }static GF_Node *ContourPolyline2D_Create(){ X_ContourPolyline2D *p; GF_SAFEALLOC(p, X_ContourPolyline2D); if(!p) return NULL; gf_node_setup((GF_Node *)p, TAG_X3D_ContourPolyline2D);#ifdef GF_NODE_USE_POINTERS ((GF_Node *)p)->sgprivate->name = "ContourPolyline2D"; ((GF_Node *)p)->sgprivate->node_del = ContourPolyline2D_Del; ((GF_Node *)p)->sgprivate->get_field_count = ContourPolyline2D_get_field_count; ((GF_Node *)p)->sgprivate->get_field = ContourPolyline2D_get_field;#endif /*default field values*/ return (GF_Node *)p;}/* Coordinate Node deletion*/static void Coordinate_Del(GF_Node *node){ X_Coordinate *p = (X_Coordinate *) node; gf_sg_mfvec3f_del(p->point); gf_node_unregister((GF_Node *) p->metadata, node); gf_node_free((GF_Node *)p);}static u32 Coordinate_get_field_count(GF_Node *node, u8 dummy){ return 2;}static GF_Err Coordinate_get_field(GF_Node *node, GF_FieldInfo *info){ switch (info->fieldIndex) { case 0: info->name = "point"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_MFVEC3F; info->far_ptr = & ((X_Coordinate *) node)->point; return GF_OK; case 1: info->name = "metadata"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_SFNODE; info->NDTtype = NDT_SFMetadataNode; info->far_ptr = & ((X_Coordinate *)node)->metadata; return GF_OK; default: return GF_BAD_PARAM; }}static s32 Coordinate_get_field_index_by_name(char *name){ if (!strcmp("point", name)) return 0; if (!strcmp("metadata", name)) return 1; return -1; }static GF_Node *Coordinate_Create(){ X_Coordinate *p; GF_SAFEALLOC(p, X_Coordinate); if(!p) return NULL; gf_node_setup((GF_Node *)p, TAG_X3D_Coordinate);#ifdef GF_NODE_USE_POINTERS ((GF_Node *)p)->sgprivate->name = "Coordinate"; ((GF_Node *)p)->sgprivate->node_del = Coordinate_Del; ((GF_Node *)p)->sgprivate->get_field_count = Coordinate_get_field_count; ((GF_Node *)p)->sgprivate->get_field = Coordinate_get_field;#endif /*default field values*/ return (GF_Node *)p;}/* CoordinateDouble Node deletion*/static void CoordinateDouble_Del(GF_Node *node){ X_CoordinateDouble *p = (X_CoordinateDouble *) node; gf_sg_mfvec3d_del(p->point); gf_node_unregister((GF_Node *) p->metadata, node); gf_node_free((GF_Node *)p);}static u32 CoordinateDouble_get_field_count(GF_Node *node, u8 dummy){ return 2;}static GF_Err CoordinateDouble_get_field(GF_Node *node, GF_FieldInfo *info){ switch (info->fieldIndex) { case 0: info->name = "point"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_MFVEC3D; info->far_ptr = & ((X_CoordinateDouble *) node)->point; return GF_OK;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -