libgpac
Documentation of the core library of GPAC
scenegraph.h File Reference

Scenegraph used for manipulating scenes (parsing, traversing, cleaning node status, ...) More...

#include <gpac/list.h>
#include <gpac/maths.h>
+ Include dependency graph for scenegraph.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  GF_Node
 
struct  GF_ChildNodeItem
 
struct  GF_ParentNode
 
struct  GF_FieldInfo
 
struct  GF_JSAPIURI
 
struct  GF_JSAPIOPT
 
struct  GF_JSAPIINFO
 
union  GF_JSAPIParam
 
struct  GF_CommandField
 
struct  GF_Command
 
union  GF_Command.__unnamed104__
 
union  GF_Command.__unnamed106__
 
union  GF_Command.__unnamed108__
 
union  GF_Command.__unnamed110__
 
union  GF_Command.__unnamed112__
 
union  GF_Command.__unnamed114__
 
union  GF_Command.__unnamed116__
 

Macros

#define BASE_NODE   struct _nodepriv *sgprivate;
 
#define CHILDREN    struct _child_node *children;
 

Typedefs

typedef void(* gf_sg_node_callback) (GF_Node *n, void *traverse_state, Bool is_destroy)
 
typedef struct _route GF_Route
 
typedef struct __tag_scene_graph GF_SceneGraph
 
typedef void(* gf_sg_node_init_callback) (void *udta, GF_SGNodeCbkType type, GF_Node *node, void *ctxdata)
 
typedef Bool(* gf_sg_script_action) (void *callback, GF_JSAPIActionType type, GF_Node *node, GF_JSAPIParam *param)
 
typedef struct _xml_node * GF_DOMXMLNODE
 

Enumerations

enum  {
  TAG_UndefinedNode = 0 , TAG_ProtoNode , GF_NODE_RANGE_FIRST_MPEG4 , GF_NODE_RANGE_LAST_MPEG4 = GF_NODE_RANGE_FIRST_MPEG4+512 ,
  GF_NODE_RANGE_FIRST_X3D , GF_NODE_RANGE_LAST_X3D = GF_NODE_RANGE_FIRST_X3D+512 , GF_NODE_RANGE_LAST_VRML , TAG_DOMUpdates ,
  GF_NODE_FIRST_PARENT_NODE_TAG , TAG_DOMText , GF_NODE_FIRST_DOM_NODE_TAG , TAG_DOMFullNode = GF_NODE_FIRST_DOM_NODE_TAG ,
  GF_NODE_RANGE_FIRST_SVG , GF_NODE_RANGE_LAST_SVG = GF_NODE_RANGE_FIRST_SVG+100
}
 
enum  {
  GF_SG_NODE_DIRTY = 1 , GF_SG_CHILD_DIRTY = 1<<1 , GF_SG_VRML_BINDABLE_DIRTY = 1<<2 , GF_SG_VRML_COLOR_DIRTY = 1<<3 ,
  GF_SG_SVG_GEOMETRY_DIRTY = GF_SG_NODE_DIRTY , GF_SG_SVG_COLOR_DIRTY = 1<<2 , GF_SG_SVG_DISPLAYALIGN_DIRTY = 1<<3 , GF_SG_SVG_FILL_DIRTY = 1<<4 ,
  GF_SG_SVG_FILLOPACITY_DIRTY = 1<<5 , GF_SG_SVG_FILLRULE_DIRTY = 1<<6 , GF_SG_SVG_FONTFAMILY_DIRTY = 1<<7 , GF_SG_SVG_FONTSIZE_DIRTY = 1<<8 ,
  GF_SG_SVG_FONTSTYLE_DIRTY = 1<<9 , GF_SG_SVG_FONTVARIANT_DIRTY = 1<<10 , GF_SG_SVG_FONTWEIGHT_DIRTY = 1<<11 , GF_SG_SVG_LINEINCREMENT_DIRTY = 1<<12 ,
  GF_SG_SVG_OPACITY_DIRTY = 1<<13 , GF_SG_SVG_SOLIDCOLOR_OR_OPACITY_DIRTY = 1<<14 , GF_SG_SVG_STOPCOLOR_OR_OPACITY_DIRTY = 1<<15 , GF_SG_SVG_STROKE_DIRTY = 1<<16 ,
  GF_SG_SVG_STROKEDASHARRAY_DIRTY = 1<<17 , GF_SG_SVG_STROKEDASHOFFSET_DIRTY = 1<<18 , GF_SG_SVG_STROKELINECAP_DIRTY = 1<<19 , GF_SG_SVG_STROKELINEJOIN_DIRTY = 1<<20 ,
  GF_SG_SVG_STROKEMITERLIMIT_DIRTY = 1<<21 , GF_SG_SVG_STROKEOPACITY_DIRTY = 1<<22 , GF_SG_SVG_STROKEWIDTH_DIRTY = 1<<23 , GF_SG_SVG_TEXTPOSITION_DIRTY = 1<<24 ,
  GF_SG_SVG_DISPLAY_DIRTY = 1<<25 , GF_SG_SVG_VECTOREFFECT_DIRTY = 1<<26 , GF_SG_SVG_XLINK_HREF_DIRTY = 1<<27
}
 
enum  GF_SGNodeCbkType { GF_SG_CALLBACK_INIT = 0 , GF_SG_CALLBACK_MODIFIED , GF_SG_CALLBACK_GRAPH_DIRTY , GF_SG_CALLBACK_NODE_DESTROY }
 
enum  {
  GF_SG_FOCUS_AUTO = 1 , GF_SG_FOCUS_NEXT , GF_SG_FOCUS_PREV , GF_SG_FOCUS_NORTH ,
  GF_SG_FOCUS_NORTH_EAST , GF_SG_FOCUS_EAST , GF_SG_FOCUS_SOUTH_EAST , GF_SG_FOCUS_SOUTH ,
  GF_SG_FOCUS_SOUTH_WEST , GF_SG_FOCUS_WEST , GF_SG_FOCUS_NORTH_WEST
}
 
enum  GF_JSAPIActionType {
  GF_JSAPI_OP_MESSAGE , GF_JSAPI_OP_RESOLVE_URI , GF_JSAPI_OP_GET_SCALE , GF_JSAPI_OP_SET_SCALE ,
  GF_JSAPI_OP_GET_ROTATION , GF_JSAPI_OP_SET_ROTATION , GF_JSAPI_OP_GET_TRANSLATE , GF_JSAPI_OP_SET_TRANSLATE ,
  GF_JSAPI_OP_GET_TIME , GF_JSAPI_OP_SET_TIME , GF_JSAPI_OP_GET_VIEWPORT , GF_JSAPI_OP_GET_LOCAL_BBOX ,
  GF_JSAPI_OP_GET_SCREEN_BBOX , GF_JSAPI_OP_GET_TRANSFORM , GF_JSAPI_OP_MOVE_FOCUS , GF_JSAPI_OP_GET_FOCUS ,
  GF_JSAPI_OP_SET_FOCUS , GF_JSAPI_OP_LOAD_URL , GF_JSAPI_OP_GET_OPT , GF_JSAPI_OP_SET_OPT ,
  GF_JSAPI_OP_GET_DOWNLOAD_MANAGER , GF_JSAPI_OP_GET_SPEED , GF_JSAPI_OP_GET_FPS , GF_JSAPI_OP_SET_TITLE ,
  GF_JSAPI_OP_GET_SUBSCENE , GF_JSAPI_OP_RESOLVE_XLINK , GF_JSAPI_OP_GET_COMPOSITOR , GF_JSAPI_OP_PAUSE_SVG ,
  GF_JSAPI_OP_RESUME_SVG , GF_JSAPI_OP_RESTART_SVG , GF_JSAPI_OP_SET_SCENE_SPEED , GF_JSAPI_OP_GET_DPI_X ,
  GF_JSAPI_OP_GET_DPI_Y
}
 
enum  {
  GF_SG_RESERVED = 0 , GF_SG_SCENE_REPLACE , GF_SG_NODE_REPLACE , GF_SG_FIELD_REPLACE ,
  GF_SG_INDEXED_REPLACE , GF_SG_ROUTE_REPLACE , GF_SG_NODE_DELETE , GF_SG_INDEXED_DELETE ,
  GF_SG_ROUTE_DELETE , GF_SG_NODE_INSERT , GF_SG_INDEXED_INSERT , GF_SG_ROUTE_INSERT ,
  GF_SG_PROTO_INSERT , GF_SG_PROTO_DELETE , GF_SG_PROTO_DELETE_ALL , GF_SG_MULTIPLE_REPLACE ,
  GF_SG_MULTIPLE_INDEXED_REPLACE , GF_SG_GLOBAL_QUANTIZER , GF_SG_NODE_DELETE_EX , GF_SG_XREPLACE ,
  GF_SG_LAST_BIFS_COMMAND , GF_SG_LSR_NEW_SCENE , GF_SG_LSR_REFRESH_SCENE , GF_SG_LSR_ADD ,
  GF_SG_LSR_CLEAN , GF_SG_LSR_REPLACE , GF_SG_LSR_DELETE , GF_SG_LSR_INSERT ,
  GF_SG_LSR_RESTORE , GF_SG_LSR_SAVE , GF_SG_LSR_SEND_EVENT , GF_SG_LSR_ACTIVATE ,
  GF_SG_LSR_DEACTIVATE , GF_SG_UNDEFINED
}
 

Functions

GF_Err gf_node_list_add_child (GF_ChildNodeItem **list, GF_Node *n)
 
GF_Err gf_node_list_add_child_last (GF_ChildNodeItem **list, GF_Node *n, GF_ChildNodeItem **last_child)
 
GF_Err gf_node_list_insert_child (GF_ChildNodeItem **list, GF_Node *n, u32 pos)
 
Bool gf_node_list_del_child (GF_ChildNodeItem **list, GF_Node *n)
 
s32 gf_node_list_find_child (GF_ChildNodeItem *list, GF_Node *n)
 
GF_Nodegf_node_list_get_child (GF_ChildNodeItem *list, s32 pos)
 
u32 gf_node_list_get_count (GF_ChildNodeItem *list)
 
GF_Nodegf_node_list_del_child_idx (GF_ChildNodeItem **list, u32 pos)
 
u32 gf_node_get_tag (GF_Node *n)
 
GF_Err gf_node_set_id (GF_Node *n, u32 nodeID, const char *nodeDEFName)
 
const char * gf_node_get_name (GF_Node *n)
 
const char * gf_node_get_log_name (GF_Node *n)
 
u32 gf_node_get_id (GF_Node *n)
 
const char * gf_node_get_class_name (GF_Node *n)
 
GF_Err gf_node_remove_id (GF_Node *n)
 
void * gf_node_get_private (GF_Node *n)
 
void gf_node_set_private (GF_Node *n, void *udta)
 
GF_Err gf_node_set_callback_function (GF_Node *n, gf_sg_node_callback NodeFunction)
 
GF_Err gf_node_register (GF_Node *n, GF_Node *parent_node)
 
GF_Err gf_node_unregister (GF_Node *n, GF_Node *parent_node)
 
void gf_node_unregister_children (GF_Node *node, GF_ChildNodeItem *childrenlist)
 
GF_Err gf_node_replace (GF_Node *old_node, GF_Node *new_node, Bool updateOrderedGroup)
 
u32 gf_node_get_num_instances (GF_Node *n)
 
void gf_node_traverse (GF_Node *n, void *udta)
 
void gf_node_allow_cyclic_traverse (GF_Node *n)
 
Bool gf_node_set_cyclic_traverse_flag (GF_Node *n, Bool on)
 
void gf_node_traverse_children (GF_Node *n, void *udta)
 
u32 gf_node_get_parent_count (GF_Node *n)
 
GF_Nodegf_node_get_parent (GF_Node *n, u32 idx)
 
Bool gf_node_parent_of (GF_Node *parent, GF_Node *target)
 
void gf_node_dirty_set (GF_Node *n, u32 flags, Bool dirty_parents)
 
void gf_node_dirty_parents (GF_Node *n)
 
void gf_node_dirty_clear (GF_Node *n, u32 flags)
 
void gf_node_dirty_reset (GF_Node *n, Bool reset_children)
 
u32 gf_node_dirty_get (GF_Node *n)
 
u32 gf_node_get_field_count (GF_Node *n)
 
GF_Err gf_node_get_field (GF_Node *n, u32 FieldIndex, GF_FieldInfo *info)
 
GF_Err gf_node_get_field_by_name (GF_Node *n, char *name, GF_FieldInfo *field)
 
GF_SceneGraphgf_sg_new ()
 
GF_SceneGraphgf_sg_new_subscene (GF_SceneGraph *scene)
 
void gf_sg_del (GF_SceneGraph *sg)
 
void gf_sg_reset (GF_SceneGraph *sg)
 
void gf_sg_set_private (GF_SceneGraph *sg, void *udta)
 
void * gf_sg_get_private (GF_SceneGraph *sg)
 
void gf_sg_set_scene_time_callback (GF_SceneGraph *sg, Double(*GetSceneTime)(void *user_priv))
 
GF_SceneGraphgf_sg_get_parent (GF_SceneGraph *sg)
 
void gf_sg_set_node_callback (GF_SceneGraph *sg, gf_sg_node_init_callback NodeCallback)
 
GF_Nodegf_sg_get_root_node (GF_SceneGraph *sg)
 
void gf_sg_set_root_node (GF_SceneGraph *sg, GF_Node *node)
 
GF_Nodegf_sg_find_node (GF_SceneGraph *sg, u32 nodeID)
 
GF_Nodegf_sg_find_node_by_name (GF_SceneGraph *sg, char *name)
 
void gf_node_changed (GF_Node *n, GF_FieldInfo *fieldChanged)
 
GF_SceneGraphgf_node_get_graph (GF_Node *n)
 
void gf_sg_set_scene_size_info (GF_SceneGraph *sg, u32 width, u32 height, Bool usePixelMetrics)
 
Bool gf_sg_use_pixel_metrics (GF_SceneGraph *sg)
 
Bool gf_sg_get_scene_size_info (GF_SceneGraph *sg, u32 *width, u32 *height)
 
GF_Nodegf_node_new (GF_SceneGraph *sg, u32 tag)
 
void gf_node_init (GF_Node *n)
 
GF_Nodegf_node_clone (GF_SceneGraph *inScene, GF_Node *orig, GF_Node *cloned_parent, char *id_suffix, Bool deep)
 
Double gf_node_get_scene_time (GF_Node *n)
 
u32 gf_sg_get_next_available_node_id (GF_SceneGraph *sg)
 
u32 gf_sg_get_max_node_id (GF_SceneGraph *sg)
 
const char * gf_node_get_name_and_id (GF_Node *n, u32 *ID)
 
void gf_sg_set_script_action (GF_SceneGraph *sg, gf_sg_script_action script_act, void *cbk)
 
void gf_sg_script_load (GF_Node *script)
 
Bool gf_sg_has_scripting ()
 
GF_Commandgf_sg_command_new (GF_SceneGraph *sg, u32 tag)
 
void gf_sg_command_del (GF_Command *com)
 
GF_Err gf_sg_command_apply (GF_SceneGraph *sg, GF_Command *com, Double time_offset)
 
GF_Err gf_sg_command_apply_list (GF_SceneGraph *sg, GF_List *comList, Double time_offset)
 
GF_CommandFieldgf_sg_command_field_new (GF_Command *com)
 
GF_Err gf_sg_init_from_xml_node (GF_SceneGraph *document, GF_DOMXMLNODE root_node)
 

Detailed Description

>