Graphviz 12.0.1~dev.20240715.2254
Loading...
Searching...
No Matches

parent for graphs, nodes, and edges. More...

Collaboration diagram for objects:

Modules

 nodes
 
 graphs
 
 edges
 

Files

file  obj.c
 generic manipulations with Agobj_t and derived objects graphs, nodes and edges
 

Data Structures

struct  Agtag_s
 tag in Agobj_s for graphs, nodes, and edges. More...
 
struct  Agobj_s
 a generic header of Agraph_s, Agnode_s and Agedge_s More...
 

Macros

#define AGTAG(obj)   (((Agobj_t *)(obj))->tag)
 
#define AGTYPE(obj)   (AGTAG(obj).objtype)
 returns AGRAPH, AGNODE, or AGEDGE depending on the type of the object
 
#define AGID(obj)   (AGTAG(obj).id)
 returns the unique integer ID associated with the object
 
#define AGSEQ(obj)   (AGTAG(obj).seq)
 
#define AGATTRWF(obj)   (AGTAG(obj).attrwf)
 
#define AGDATA(obj)   (((Agobj_t *)(obj))->data)
 returns Agrec_t
 

Typedefs

typedef uint64_t IDTYPE
 unique per main graph ID
 
typedef struct Agtag_s Agtag_t
 
typedef struct Agobj_s Agobj_t
 generic object header
 

Enumerations

enum  {
  AGRAPH , AGNODE , AGEDGE , AGOUTEDGE = AGEDGE ,
  AGINEDGE
}
 Object tags. Can't exceed 2 bits. See Agtag_s. More...
 

Functions

Agraph_tagraphof (void *obj)
 
Agraph_tagroot (void *obj)
 
int agcontains (Agraph_t *, void *obj)
 returns non-zero if obj is a member of (sub)graph
 
char * agnameof (void *)
 returns a string descriptor for the object.
 
int agdelete (Agraph_t *g, void *obj)
 deletes object. Equivalent to agclose, agdelnode, and agdeledge for obj being a graph, node or edge, respectively.
 
int agobjkind (void *obj)
 

Detailed Description

Common parameter for functions obj is generic pointer to Agraph_t, Agnode_t, or Agedge_t

AGDATA, AGID, AGTYPE, and others are macros returning the specified fields of the argument object.

Macro Definition Documentation

◆ AGATTRWF

#define AGATTRWF (   obj)    (AGTAG(obj).attrwf)

Definition at line 226 of file cgraph.h.

◆ AGDATA

#define AGDATA (   obj)    (((Agobj_t *)(obj))->data)

Definition at line 229 of file cgraph.h.

◆ AGID

#define AGID (   obj)    (AGTAG(obj).id)

Definition at line 223 of file cgraph.h.

◆ AGSEQ

#define AGSEQ (   obj)    (AGTAG(obj).seq)

Definition at line 225 of file cgraph.h.

◆ AGTAG

#define AGTAG (   obj)    (((Agobj_t *)(obj))->tag)

Definition at line 215 of file cgraph.h.

◆ AGTYPE

#define AGTYPE (   obj)    (AGTAG(obj).objtype)

Definition at line 219 of file cgraph.h.

Typedef Documentation

◆ Agobj_t

typedef struct Agobj_s Agobj_t

Definition at line 75 of file cgraph.h.

◆ Agtag_t

typedef struct Agtag_s Agtag_t

Definition at line 74 of file cgraph.h.

◆ IDTYPE

typedef uint64_t IDTYPE

Definition at line 73 of file cgraph.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
AGRAPH 
AGNODE 
AGEDGE 
AGOUTEDGE 
AGINEDGE 

Definition at line 207 of file cgraph.h.

Function Documentation

◆ agcontains()

int agcontains ( Agraph_t g,
void *  obj 
)

Definition at line 234 of file obj.c.

References AGID, agidnode(), AGNODE, agparent(), AGRAPH, agroot(), agsubedge(), and AGTYPE.

Referenced by checkCompound(), flat_search(), getval(), interclexp(), is_a_normal_node_of(), is_a_vnode_of_an_edge_of(), node_induce(), rebuild_vlists(), twopi_layout(), vnode_not_related_to(), write_edge_test(), and write_node_test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ agdelete()

int agdelete ( Agraph_t g,
void *  obj 
)
Returns
-1 if obj does not belong to graph g.

Definition at line 19 of file obj.c.

References agclose(), agdeledge(), agdelnode(), agerrorf(), AGINEDGE, AGNODE, AGOUTEDGE, agparent(), AGRAPH, AGTYPE, FAILURE, and SUCCESS.

Referenced by cccomps(), deleteEdge(), deleteNode(), deleteObj(), dfs(), dfs(), dfs(), doDot(), find_pair_edges(), gvpr_core(), layout(), main(), mark_clusters(), neato_layout(), node_induce(), process(), processClusterEdges(), processClusters(), prune(), remove_pair_edges(), reverse_edge2(), rm(), rm(), scan_graph_mode(), sfdp_layout(), twopi_layout(), and undoClusterEdges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ agnameof()

char * agnameof ( void *  obj)

Return string representation of object. In general, returns the name of node or graph, and the key of an edge. If edge is anonymous, returns NULL. Uses static buffer for anonymous graphs.

Definition at line 158 of file id.c.

References AGCLOS, AGDISC, AGEDGE, AGID, aginternalmapprint(), agraphof(), AGTYPE, LOCALNAMEPREFIX, NULL, and print().

Referenced by addCutPts(), addGrid(), addRevEdge(), attachOrthoEdges(), bundle(), cccomps(), checkCompound(), chkGraphName(), chkPos(), circleLayout(), circomps(), clarify(), cleanup2(), clone_graph(), cloneG(), cloneGraph(), cloneGraph(), cloneNode(), cloneO(), cloneSubg(), cloneSubg(), clustNode(), compile_nodes(), compile_samerank(), contain_nodes(), copy(), deleteObj(), deriveClusters(), deriveGraph(), deriveGraph(), dfs(), dfs(), dfs(), dfs(), do_ordering_for_nodes(), edgecmd(), emit(), emit_clusters(), emit_edge(), emit_node(), emitNode(), emitNodeAttrs(), epsf_init(), fdp_initParams(), fig_begin_graph(), fillMap(), find_blocks(), findCComp(), finishEdge(), genPoly(), genroute(), getsplinepoints(), graphcmd(), graphviz_tred(), gvToolTred(), htmlEntityUTF8(), Import_coord_clusters_from_dot(), init_graph(), init_gvc(), init_nop(), init_params(), init_rank(), init_xdot(), initialPositions(), install_in_rank(), irrelevant_subgraph(), is_a_cluster(), IS_CLUSTER(), iterateBody(), iterateHdr(), kkNeato(), label_subgs(), labelOf(), lasi_begin_cluster(), lasi_begin_graph(), layout(), layout(), loadGraph(), lookup(), main(), main(), make_flat_adj_edges(), make_label(), makeCompoundEdge(), makePolyline(), makeSpline(), map_begin_page(), map_edge(), mapc(), mapN(), mark_clusters(), merge2(), mkBlock(), mkClusters(), mkClusters(), mkClusters(), mkConstraintG(), mkNConstraintG(), move_node(), multicolor(), nameof(), nameof(), nameOf(), nameOf(), neatoMode(), neatoModel(), nodecmd(), nodeID(), pic_begin_graph(), poly_gencode(), poly_init(), poly_port(), polyGraphs(), populate_data(), portName(), post(), pov_begin_graph(), pov_begin_node(), printSorted(), process(), process(), processClusters(), projectG(), psgen_begin_cluster(), psgen_begin_graph(), quartzgen_begin_page(), readGraphs(), rebuild_vlists(), record_port(), removeOverlapWith(), renderNodeLabels(), reposition(), rm(), rm(), routesplines_(), scan_graph_mode(), setEdgeLen(), setval(), solve_model(), SparseMatrix_import_dot(), strdup_and_subst_obj0(), strong(), svg_begin_cluster(), svg_begin_graph(), svg_begin_node(), svg_begin_page(), tkgen_begin_graph(), twopi_layout(), unrecognized(), user_pos(), user_spline(), walkTree(), write_edge_name(), write_graph(), write_hdr(), write_hdr(), write_node(), write_nodename(), write_plain(), writeEdgeName(), writeHdr(), writeNode(), and writenodeandport().

Here is the call graph for this function:

◆ agobjkind()

int agobjkind ( void *  obj)

returns AGRAPH, AGNODE, or AGEDGE depending on the type of the object. Synonym for AGTYPE.

Definition at line 253 of file obj.c.

References AGTYPE.

Referenced by getObjId(), gvevent_enter_obj(), gvevent_leave_obj(), gvevent_select_current_obj(), kindOf(), make_html_label(), make_label(), nameOf(), parseXdotwithattrs(), pick_object_xyz(), setAttr(), and strdup_and_subst_obj0().

Here is the caller graph for this function:

◆ agraphof()

Agraph_t * agraphof ( void *  obj)

Definition at line 184 of file obj.c.

References agerrorf(), AGINEDGE, AGNODE, AGOUTEDGE, AGRAPH, AGTYPE, NULL, and Agraph_s::root.

Referenced by agbindrec(), agcopyattr(), agdelrec(), agmakeattrs(), agnameof(), agrecclose(), agrelabel_node(), agrename(), agsafeset(), agxset(), arrow_flags(), beginpath(), clip_and_install(), cloneEdge(), closestSide(), clustNode(), common_init_edge(), common_init_node(), compassPoint(), compassPort(), copyAttr(), deleteObj(), dict_relabel(), dot_init_node(), edge(), edge(), edge(), edgecmd(), emit_begin_edge(), emit_begin_node(), emit_edge(), emit_node(), endpath(), epsf_inside(), findedge(), firstattr(), firstattr(), firstedge(), firsthead(), firstin(), firstout(), firsttail(), freeattr(), genroute(), getv(), getv(), getval(), graphcmd(), graphof(), graphof(), gv_edge_state(), gv_node_state(), gvevent_enter_obj(), init_node(), initGraphAttrs(), lookup(), make_html_label(), make_label(), makeGraph(), makeLineEdge(), makePortLabels(), makeSelfArcs(), mapN(), multicolor(), myagxset(), myagxset(), nameOf(), nameOf(), neato_init_node(), nextattr(), nextattr(), nextedge(), nexthead(), nextin(), nextout(), nexttail(), nodecmd(), object_color(), place_vnlabel(), point_inside(), poly_init(), poly_inside(), record_init(), record_inside(), record_path(), rm(), rm(), routesplines_(), sameG(), sameport(), selfBottom(), selfLeft(), selfRight(), selfRightSpace(), selfTop(), setattr(), setv(), setv(), star_inside(), strdup_and_subst_obj0(), subedge_search(), subnode_search(), taperfun(), topdictsize(), visit(), walkTree(), write_edge(), write_edge_name(), write_node(), write_nodename(), write_nondefault_attrs(), write_plain(), write_port(), and writenodeandport().

Here is the call graph for this function:

◆ agroot()

Agraph_t * agroot ( void *  obj)

takes any graph object (graph, subgraph, node, edge) and returns the root graph in which it lives

Definition at line 167 of file obj.c.

References agerrorf(), AGINEDGE, AGNODE, AGOUTEDGE, AGRAPH, AGTYPE, and NULL.

Referenced by addClusterObj(), addOutputGraph(), agcontains(), agdeledge(), agdelnode(), agdelrec(), agedge(), agidedge(), agidnode(), agmakeattrs(), agnode(), agnodebefore(), agopen1(), agrelabel_node(), agrename(), agsubnode(), build_ranks(), circo_init_graph(), cloneAttrs(), cloneGraph(), clust_ht(), clustNode(), countClusterLabels(), deleteGraph(), deleteObj(), deriveGraph(), do_graph_label(), dot_cleanup_graph(), dot_init_subg(), dot_root(), edgecmd(), fdp_init_graph(), firstattr(), getv(), getv(), getval(), graphcmd(), graphof(), graphviz_node_induce(), gvLayoutJobs(), init_all_attrs(), initnode(), installnode(), irrelevant_subgraph(), isEdge(), label_subgs(), label_vnode(), lockGraph(), lookup(), make_label(), make_lrvn(), merge_ranks(), mkClusters(), neato_init_graph(), newnode(), nextattr(), nodecmd(), nodeInduce(), place_flip_graph_label(), place_graph_label(), posOf(), preprocessTooltip(), rm(), rootof(), sameG(), setattr(), setattr(), setedgeattributes(), setgraphattributes(), setnodeattributes(), setv(), setv(), setv(), setval(), sfdp_init_graph(), strdup_and_subst_obj0(), topdictsize(), twopi_init_graph(), unviewsubgraphsattr(), virtual_node(), write_attrs(), x_layout(), and xinit_params().

Here is the call graph for this function:
Here is the caller graph for this function: