📄 x3d_nodes.c
字号:
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_CoordinateDouble *)node)->metadata; return GF_OK; default: return GF_BAD_PARAM; }}static s32 CoordinateDouble_get_field_index_by_name(char *name){ if (!strcmp("point", name)) return 0; if (!strcmp("metadata", name)) return 1; return -1; }static GF_Node *CoordinateDouble_Create(){ X_CoordinateDouble *p; GF_SAFEALLOC(p, X_CoordinateDouble); if(!p) return NULL; gf_node_setup((GF_Node *)p, TAG_X3D_CoordinateDouble);#ifdef GF_NODE_USE_POINTERS ((GF_Node *)p)->sgprivate->name = "CoordinateDouble"; ((GF_Node *)p)->sgprivate->node_del = CoordinateDouble_Del; ((GF_Node *)p)->sgprivate->get_field_count = CoordinateDouble_get_field_count; ((GF_Node *)p)->sgprivate->get_field = CoordinateDouble_get_field;#endif /*default field values*/ return (GF_Node *)p;}/* Coordinate2D Node deletion*/static void Coordinate2D_Del(GF_Node *node){ X_Coordinate2D *p = (X_Coordinate2D *) node; gf_sg_mfvec2f_del(p->point); gf_node_unregister((GF_Node *) p->metadata, node); gf_node_free((GF_Node *)p);}static u32 Coordinate2D_get_field_count(GF_Node *node, u8 dummy){ return 2;}static GF_Err Coordinate2D_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_Coordinate2D *) 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_Coordinate2D *)node)->metadata; return GF_OK; default: return GF_BAD_PARAM; }}static s32 Coordinate2D_get_field_index_by_name(char *name){ if (!strcmp("point", name)) return 0; if (!strcmp("metadata", name)) return 1; return -1; }static GF_Node *Coordinate2D_Create(){ X_Coordinate2D *p; GF_SAFEALLOC(p, X_Coordinate2D); if(!p) return NULL; gf_node_setup((GF_Node *)p, TAG_X3D_Coordinate2D);#ifdef GF_NODE_USE_POINTERS ((GF_Node *)p)->sgprivate->name = "Coordinate2D"; ((GF_Node *)p)->sgprivate->node_del = Coordinate2D_Del; ((GF_Node *)p)->sgprivate->get_field_count = Coordinate2D_get_field_count; ((GF_Node *)p)->sgprivate->get_field = Coordinate2D_get_field;#endif /*default field values*/ return (GF_Node *)p;}/* CoordinateInterpolator Node deletion*/static void CoordinateInterpolator_Del(GF_Node *node){ X_CoordinateInterpolator *p = (X_CoordinateInterpolator *) node; gf_sg_mffloat_del(p->key); gf_sg_mfvec3f_del(p->keyValue); gf_sg_mfvec3f_del(p->value_changed); gf_node_unregister((GF_Node *) p->metadata, node); gf_node_free((GF_Node *)p);}static u32 CoordinateInterpolator_get_field_count(GF_Node *node, u8 dummy){ return 5;}static GF_Err CoordinateInterpolator_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_CoordinateInterpolator *)node)->on_set_fraction; info->fieldType = GF_SG_VRML_SFFLOAT; info->far_ptr = & ((X_CoordinateInterpolator *) 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_CoordinateInterpolator *) node)->key; return GF_OK; case 2: info->name = "keyValue"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_MFVEC3F; info->far_ptr = & ((X_CoordinateInterpolator *) node)->keyValue; return GF_OK; case 3: info->name = "value_changed"; info->eventType = GF_SG_EVENT_OUT; info->fieldType = GF_SG_VRML_MFVEC3F; info->far_ptr = & ((X_CoordinateInterpolator *) 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_CoordinateInterpolator *)node)->metadata; return GF_OK; default: return GF_BAD_PARAM; }}static s32 CoordinateInterpolator_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 *CoordinateInterpolator_Create(){ X_CoordinateInterpolator *p; GF_SAFEALLOC(p, X_CoordinateInterpolator); if(!p) return NULL; gf_node_setup((GF_Node *)p, TAG_X3D_CoordinateInterpolator);#ifdef GF_NODE_USE_POINTERS ((GF_Node *)p)->sgprivate->name = "CoordinateInterpolator"; ((GF_Node *)p)->sgprivate->node_del = CoordinateInterpolator_Del; ((GF_Node *)p)->sgprivate->get_field_count = CoordinateInterpolator_get_field_count; ((GF_Node *)p)->sgprivate->get_field = CoordinateInterpolator_get_field;#endif /*default field values*/ return (GF_Node *)p;}/* CoordinateInterpolator2D Node deletion*/static void CoordinateInterpolator2D_Del(GF_Node *node){ X_CoordinateInterpolator2D *p = (X_CoordinateInterpolator2D *) node; gf_sg_mffloat_del(p->key); gf_sg_mfvec2f_del(p->keyValue); gf_sg_mfvec2f_del(p->value_changed); gf_node_unregister((GF_Node *) p->metadata, node); gf_node_free((GF_Node *)p);}static u32 CoordinateInterpolator2D_get_field_count(GF_Node *node, u8 dummy){ return 5;}static GF_Err CoordinateInterpolator2D_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_CoordinateInterpolator2D *)node)->on_set_fraction; info->fieldType = GF_SG_VRML_SFFLOAT; info->far_ptr = & ((X_CoordinateInterpolator2D *) 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_CoordinateInterpolator2D *) node)->key; return GF_OK; case 2: info->name = "keyValue"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_MFVEC2F; info->far_ptr = & ((X_CoordinateInterpolator2D *) node)->keyValue; return GF_OK; case 3: info->name = "value_changed"; info->eventType = GF_SG_EVENT_OUT; info->fieldType = GF_SG_VRML_MFVEC2F; info->far_ptr = & ((X_CoordinateInterpolator2D *) 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_CoordinateInterpolator2D *)node)->metadata; return GF_OK; default: return GF_BAD_PARAM; }}static s32 CoordinateInterpolator2D_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 *CoordinateInterpolator2D_Create(){ X_CoordinateInterpolator2D *p; GF_SAFEALLOC(p, X_CoordinateInterpolator2D); if(!p) return NULL; gf_node_setup((GF_Node *)p, TAG_X3D_CoordinateInterpolator2D);#ifdef GF_NODE_USE_POINTERS ((GF_Node *)p)->sgprivate->name = "CoordinateInterpolator2D"; ((GF_Node *)p)->sgprivate->node_del = CoordinateInterpolator2D_Del; ((GF_Node *)p)->sgprivate->get_field_count = CoordinateInterpolator2D_get_field_count; ((GF_Node *)p)->sgprivate->get_field = CoordinateInterpolator2D_get_field;#endif /*default field values*/ return (GF_Node *)p;}/* Cylinder Node deletion*/static void Cylinder_Del(GF_Node *node){ X_Cylinder *p = (X_Cylinder *) node; gf_node_unregister((GF_Node *) p->metadata, node); gf_node_free((GF_Node *)p);}static u32 Cylinder_get_field_count(GF_Node *node, u8 dummy){ return 6;}static GF_Err Cylinder_get_field(GF_Node *node, GF_FieldInfo *info){ switch (info->fieldIndex) { case 0: info->name = "bottom"; info->eventType = GF_SG_EVENT_FIELD; info->fieldType = GF_SG_VRML_SFBOOL; info->far_ptr = & ((X_Cylinder *) node)->bottom; return GF_OK; case 1: info->name = "height"; info->eventType = GF_SG_EVENT_FIELD; info->fieldType = GF_SG_VRML_SFFLOAT; info->far_ptr = & ((X_Cylinder *) node)->height; return GF_OK; case 2: info->name = "radius"; info->eventType = GF_SG_EVENT_FIELD; info->fieldType = GF_SG_VRML_SFFLOAT; info->far_ptr = & ((X_Cylinder *) node)->radius; return GF_OK; case 3: info->name = "side"; info->eventType = GF_SG_EVENT_FIELD; info->fieldType = GF_SG_VRML_SFBOOL; info->far_ptr = & ((X_Cylinder *) node)->side; return GF_OK; case 4: info->name = "top"; info->eventType = GF_SG_EVENT_FIELD; info->fieldType = GF_SG_VRML_SFBOOL; info->far_ptr = & ((X_Cylinder *) node)->top; 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_Cylinder *)node)->metadata; return GF_OK; default: return GF_BAD_PARAM; }}static s32 Cylinder_get_field_index_by_name(char *name){ if (!strcmp("bottom", name)) return 0; if (!strcmp("height", name)) return 1; if (!strcmp("radius", name)) return 2; if (!strcmp("side", name)) return 3; if (!strcmp("top", name)) return 4; if (!strcmp("metadata", name)) return 5; return -1; }static GF_Node *Cylinder_Create(){ X_Cylinder *p; GF_SAFEALLOC(p, X_Cylinder); if(!p) return NULL; gf_node_setup((GF_Node *)p, TAG_X3D_Cylinder);#ifdef GF_NODE_USE_POINTERS ((GF_Node *)p)->sgprivate->name = "Cylinder"; ((GF_Node *)p)->sgprivate->node_del = Cylinder_Del; ((GF_Node *)p)->sgprivate->get_field_count = Cylinder_get_field_count; ((GF_Node *)p)->sgprivate->get_field = Cylinder_get_field;#endif /*default field values*/ p->bottom = 1; p->height = FLT2FIX(2); p->radius = FLT2FIX(1); p->side = 1; p->top = 1; return (GF_Node *)p;}/* CylinderSensor Node deletion*/static void CylinderSensor_Del(GF_Node *node){ X_CylinderSensor *p = (X_CylinderSensor *) node; gf_node_unregister((GF_Node *) p->metadata, node); gf_sg_sfstring_del(p->description); gf_node_free((GF_Node *)p);}static u32 CylinderSensor_get_field_count(GF_Node *node, u8 dummy){ return 12;}static GF_Err CylinderSensor_get_field(GF_Node *node, GF_FieldInfo *info){ switch (info->fieldIndex) { case 0: info->name = "autoOffset"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_SFBOOL; info->far_ptr = & ((X_CylinderSensor *) node)->autoOffset; return GF_OK; case 1: info->name = "diskAngle"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_SFFLOAT; info->far_ptr = & ((X_CylinderSensor *) node)->diskAngle; return GF_OK; case 2: info->name = "enabled"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_SFBOOL; info->far_ptr = & ((X_CylinderSensor *) node)->enabled; return GF_OK; case 3: info->name = "maxAngle"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_SFFLOAT; info->far_ptr = & ((X_CylinderSensor *) node)->maxAngle; return GF_OK; case 4: info->name = "minAngle"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_SFFLOAT; info->far_ptr = & ((X_CylinderSensor *) node)->minAngle; return GF_OK; case 5: info->name = "offset"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_SFFLOAT; info->far_ptr = & ((X_CylinderSensor *) node)->offset; return GF_OK; case 6: info->name = "isActive"; info->eventType = GF_SG_EVENT_OUT; info->fieldType = GF_SG_VRML_SFBOOL; info->far_ptr = & ((X_CylinderSensor *) node)->isActive; return GF_OK; case 7: info->name = "rotation_changed"; info->eventType = GF_SG_EVENT_OUT; info->fieldType = GF_SG_VRML_SFROTATION; info->far_ptr = & ((X_CylinderSensor *) node)->rotation_changed; return GF_OK; case 8: info->name = "trackPoint_changed"; info->eventType = GF_SG_EVENT_OUT; info->fieldType = GF_SG_VRML_SFVEC3F; info->far_ptr = & ((X_CylinderSensor *) node)->trackPoint_changed; return GF_OK; case 9: info->name = "metadata"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_SFNODE; info->NDTtype = NDT_SFMetadataNode; info->far_ptr = & ((X_CylinderSensor *)node)->metadata; return GF_OK; case 10: info->name = "description"; info->eventType = GF_SG_EVENT_EXPOSED_FIELD; info->fieldType = GF_SG_VRML_SFSTRING; info->far_ptr = & ((X_CylinderSensor *) node)->description; return GF_OK; case 11: info->name = "isOver"; info->eventType = GF_SG_EVENT_OUT; info->fieldType = GF_SG_VRML_SFBOOL; info->far_ptr = & ((X_CylinderSensor *) node)->isOver; return GF_OK; default: return GF_BAD_PARAM; }}static s32 CylinderSensor_get_field_index_by_name(char *name){ if (!strcmp("autoOffset", name)) return 0; if (!strcmp("diskAngle", name)) return 1; if (!strcmp("enabled", name)) return 2; if (!strcmp("maxAngle", name)) return 3; if (!strcmp("minAngle", name)) return 4; if (!strcmp("offset", name)) return 5; if (!strcmp("isActive", name)) return 6; if (!strcmp("rotation_changed",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -