Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
topviewfuncs.c File Reference
#include <assert.h>
#include "topviewfuncs.h"
#include <cgraph/cgraph.h>
#include "smyrna_utils.h"
#include <common/colorprocs.h>
#include "draw.h"
#include "frmobjectui.h"
#include <xdot/xdot.h>
#include <glcomp/glutils.h>
#include "selectionfuncs.h"
#include <common/types.h>
#include <common/utils.h>
#include <limits.h>
#include <float.h>
#include <math.h>
#include <stdbool.h>
#include <stdlib.h>
#include <util/alloc.h>
#include <util/gv_ctype.h>
Include dependency graph for topviewfuncs.c:

Go to the source code of this file.

Typedefs

typedef void(* edgefn) (Agraph_t *, Agedge_t *, glCompColor)
 

Functions

static xdotparseXdotwithattrs (void *e)
 
static void set_boundaries (Agraph_t *g)
 
static void draw_xdot (xdot *x, double base_z)
 
static glCompPoint getEdgeHead (Agedge_t *edge)
 
static glCompPoint getEdgeTail (Agedge_t *edge)
 
static float getEdgeLength (Agedge_t *edge)
 
static void glCompColorxlate (glCompColor *c, const char *str)
 
static int visible (Agsym_t *attr, void *obj)
 
static int object_color (void *obj, glCompColor *c)
 
static void draw_edge (glCompPoint *posT, glCompPoint *posH, float length, int deg)
 
static char * labelOf (Agraph_t *g, Agnode_t *v)
 
static void renderSelectedNodes (Agraph_t *g)
 
static void renderNodes (Agraph_t *g)
 
static void renderSelectedEdges (Agraph_t *g)
 
static char * skipWS (char *p)
 
static char * skipNWS (char *p)
 
static char * readPoint (char *p, xdot_point *pt)
 
static char * countPoints (char *pos, int *have_sp, xdot_point *sp, int *have_ep, xdot_point *ep, size_t *cntp)
 
static int storePoints (char *pos, xdot_point *ps)
 
static xdotmakeXDotSpline (char *pos)
 
static void renderEdgesFn (Agraph_t *g, edgefn ef, int skipSelected)
 
static void edge_xdot (Agraph_t *g, Agedge_t *e, glCompColor c)
 
static void edge_seg (Agraph_t *g, Agedge_t *e, glCompColor c)
 
static void edge_spline (Agraph_t *g, Agedge_t *e, glCompColor c)
 
static void renderEdges (Agraph_t *g)
 
static void renderNodeLabels (Agraph_t *g)
 
static void renderEdgeLabels (Agraph_t *g)
 
static void cacheNodes (Agraph_t *g, topview *t)
 
static void cacheEdges (Agraph_t *g, topview *t)
 
void cacheSelectedEdges (Agraph_t *g, topview *t)
 
void cacheSelectedNodes (Agraph_t *g, topview *t)
 
static void cacheNodeLabels (Agraph_t *g, topview *t)
 
static void cacheEdgeLabels (Agraph_t *g, topview *t)
 
void updateSmGraph (Agraph_t *g, topview *t)
 
void initSmGraph (Agraph_t *g, topview *rv)
 
void renderSmGraph (topview *t)
 

Typedef Documentation

◆ edgefn

typedef void(* edgefn) (Agraph_t *, Agedge_t *, glCompColor)

Definition at line 602 of file topviewfuncs.c.

Function Documentation

◆ cacheEdgeLabels()

static void cacheEdgeLabels ( Agraph_t g,
topview t 
)
static

Definition at line 802 of file topviewfuncs.c.

References topview::cache, topviewcache::edgelabel_id, and renderEdgeLabels().

Referenced by updateSmGraph().

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

◆ cacheEdges()

static void cacheEdges ( Agraph_t g,
topview t 
)
static

Definition at line 762 of file topviewfuncs.c.

References topview::cache, topviewcache::edge_id, and renderEdges().

Referenced by updateSmGraph().

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

◆ cacheNodeLabels()

static void cacheNodeLabels ( Agraph_t g,
topview t 
)
static

Definition at line 793 of file topviewfuncs.c.

References topview::cache, topviewcache::nodelabel_id, and renderNodeLabels().

Referenced by updateSmGraph().

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

◆ cacheNodes()

static void cacheNodes ( Agraph_t g,
topview t 
)
static

Definition at line 749 of file topviewfuncs.c.

References topview::cache, topviewcache::node_id, and renderNodes().

Referenced by updateSmGraph().

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

◆ cacheSelectedEdges()

void cacheSelectedEdges ( Agraph_t g,
topview t 
)

Definition at line 773 of file topviewfuncs.c.

References topview::cache, renderSelectedEdges(), and topviewcache::seledge_id.

Referenced by deselect_all(), pick_object_xyz(), pick_objects_rect(), and updateSmGraph().

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

◆ cacheSelectedNodes()

void cacheSelectedNodes ( Agraph_t g,
topview t 
)

Definition at line 784 of file topviewfuncs.c.

References topview::cache, renderSelectedNodes(), and topviewcache::selnode_id.

Referenced by deselect_all(), pick_object_xyz(), pick_objects_rect(), select_polygon(), and updateSmGraph().

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

◆ countPoints()

static char * countPoints ( char *  pos,
int *  have_sp,
xdot_point sp,
int *  have_ep,
xdot_point ep,
size_t *  cntp 
)
static

Definition at line 494 of file topviewfuncs.c.

References cnt(), readPoint(), skipNWS(), and skipWS().

Referenced by makeXDotSpline().

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

◆ draw_edge()

static void draw_edge ( glCompPoint posT,
glCompPoint posH,
float  length,
int  deg 
)
static

Definition at line 199 of file topviewfuncs.c.

References alpha, DEG2RAD, glCompPoint::x, glCompPoint::y, and glCompPoint::z.

Referenced by edge_seg(), and renderSelectedEdges().

Here is the caller graph for this function:

◆ draw_xdot()

static void draw_xdot ( xdot x,
double  base_z 
)
static

Definition at line 75 of file topviewfuncs.c.

References xdot::cnt, _xdot_op::drawfunc, topview::global_z, sdot_op::op, xdot::ops, _ViewInfo::Topview, and view.

Referenced by edge_spline(), edge_xdot(), renderNodes(), renderSelectedEdges(), and renderSelectedNodes().

Here is the caller graph for this function:

◆ edge_seg()

static void edge_seg ( Agraph_t g,
Agedge_t e,
glCompColor  c 
)
static

Definition at line 640 of file topviewfuncs.c.

References glCompColor::A, aghead, agtail, agxget(), glCompColor::B, draw_edge(), ED_posHead, ED_posTail, glCompColor::G, getEdgeLength(), getPointFromStr(), GN_pos, and glCompColor::R.

Referenced by renderEdges().

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

◆ edge_spline()

static void edge_spline ( Agraph_t g,
Agedge_t e,
glCompColor  c 
)
static

Definition at line 654 of file topviewfuncs.c.

References glCompColor::A, agxget(), glCompColor::B, draw_xdot(), freeXDot(), glCompColor::G, GE_pos, makeXDotSpline(), and glCompColor::R.

Referenced by renderEdges().

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

◆ edge_xdot()

static void edge_xdot ( Agraph_t g,
Agedge_t e,
glCompColor  c 
)
static

Definition at line 628 of file topviewfuncs.c.

References draw_xdot(), freeXDot(), and parseXdotwithattrs().

Referenced by renderEdges().

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

◆ getEdgeHead()

static glCompPoint getEdgeHead ( Agedge_t edge)
static

Definition at line 95 of file topviewfuncs.c.

References agget(), aghead, edge, and getPointFromStr().

Referenced by getEdgeLength().

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

◆ getEdgeLength()

static float getEdgeLength ( Agedge_t edge)
static

Definition at line 104 of file topviewfuncs.c.

References A, B, edge, getEdgeHead(), and getEdgeTail().

Referenced by edge_seg(), object_color(), renderSelectedEdges(), and updateSmGraph().

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

◆ getEdgeTail()

static glCompPoint getEdgeTail ( Agedge_t edge)
static

Definition at line 99 of file topviewfuncs.c.

References agget(), agtail, edge, and getPointFromStr().

Referenced by getEdgeLength().

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

◆ glCompColorxlate()

static void glCompColorxlate ( glCompColor c,
const char *  str 
)
static

Definition at line 113 of file topviewfuncs.c.

References glCompColor::A, glCompColor::B, colorxlate(), glCompColor::G, glCompColor::R, color_s::RGBA, RGBA_DOUBLE, str, and color_s::u.

Referenced by renderEdgeLabels(), renderNodeLabels(), and renderSelectedNodes().

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

◆ initSmGraph()

void initSmGraph ( Agraph_t g,
topview rv 
)

Definition at line 858 of file topviewfuncs.c.

References topview::active, _ViewInfo::activeGraph, topview::attributes, topview::cache, topviewcache::edge_id, topview::fisheyeParams, _ViewInfo::g, topview::h, load_attr_list(), topviewcache::node_id, NULL, topview::sel, _selection::selectEdges, _selection::selectNodes, topviewcache::seledge_id, topviewcache::selnode_id, updateSmGraph(), and view.

Referenced by refreshViewport().

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

◆ labelOf()

static char * labelOf ( Agraph_t g,
Agnode_t v 
)
static

Definition at line 233 of file topviewfuncs.c.

References agget(), agnameof(), agxget(), GG_labelattribute, and GN_labelattribute.

Referenced by renderSelectedNodes().

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

◆ makeXDotSpline()

static xdot * makeXDotSpline ( char *  pos)
static

Definition at line 558 of file topviewfuncs.c.

References _xdot_op::bezier, cnt(), xdot_polyline::cnt, countPoints(), _xdot_op::drawfunc, free(), gv_alloc(), gv_calloc(), _xdot_op::kind, NULL, OpFns, xdot_polyline::pts, storePoints(), _xdot_op::u, xd, xd_unfilled_bezier, and xop_bezier.

Referenced by edge_spline().

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

◆ object_color()

static int object_color ( void *  obj,
glCompColor c 
)
static

Definition at line 137 of file topviewfuncs.c.

References glCompColor::A, _ViewInfo::activeGraph, AGEDGE, agget(), AGNODE, agraphof(), AGTYPE, glCompColor::B, colorxlate(), _ViewInfo::colschms, free(), _ViewInfo::g, glCompColor::G, GE_visible, getAttrFloat(), getAttrStr(), getcolorfromschema(), getEdgeLength(), GN_visible, topview::maxedgelen, NULL, glCompColor::R, color_s::RGBA, RGBA_DOUBLE, setColorScheme(), _ViewInfo::Topview, color_s::u, view, and visible().

Referenced by renderEdgesFn(), renderNodes(), and renderSelectedEdges().

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

◆ parseXdotwithattrs()

static xdot * parseXdotwithattrs ( void *  e)
static

Definition at line 31 of file topviewfuncs.c.

References agget(), agobjkind(), AGRAPH, cnt(), xdot::cnt, NULL, OpFns, xdot::ops, and parseXDotFOn().

Referenced by edge_xdot(), renderNodes(), renderSelectedEdges(), and renderSelectedNodes().

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

◆ readPoint()

static char * readPoint ( char *  p,
xdot_point pt 
)
static

Definition at line 455 of file topviewfuncs.c.

References xdot_point::x, xdot_point::y, and xdot_point::z.

Referenced by countPoints(), and storePoints().

Here is the caller graph for this function:

◆ renderEdgeLabels()

static void renderEdgeLabels ( Agraph_t g)
static

Definition at line 710 of file topviewfuncs.c.

References glCompColor::A, agfstnode(), agfstout(), agnxtnode(), agnxtout(), agxget(), glCompColor::B, ED_posHead, ED_posTail, glCompColor::G, GE_labelattribute, GG_edgelabelcolor, glCompColorxlate(), glprintfglut(), _ViewInfo::glutfont, ND_visible, glCompColor::R, view, glCompPoint::x, glCompPoint::y, glCompPoint::z, and z.

Referenced by cacheEdgeLabels().

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

◆ renderEdges()

static void renderEdges ( Agraph_t g)
static

Definition at line 667 of file topviewfuncs.c.

References _ViewInfo::drawSplines, edge_seg(), edge_spline(), edge_xdot(), GE_pos, renderEdgesFn(), and view.

Referenced by cacheEdges().

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

◆ renderEdgesFn()

static void renderEdgesFn ( Agraph_t g,
edgefn  ef,
int  skipSelected 
)
static

Definition at line 604 of file topviewfuncs.c.

References agfstnode(), agfstout(), aghead, agnxtnode(), agnxtout(), agtail, ED_selected, ND_visible, and object_color().

Referenced by renderEdges().

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

◆ renderNodeLabels()

static void renderNodeLabels ( Agraph_t g)
static

Definition at line 684 of file topviewfuncs.c.

References glCompColor::A, agfstnode(), agnameof(), agnxtnode(), agxget(), glCompColor::B, glCompColor::G, GG_nodelabelcolor, glCompColorxlate(), glprintfglut(), _ViewInfo::glutfont, GN_labelattribute, ND_A, ND_selected, ND_visible, glCompColor::R, view, glCompPoint::x, glCompPoint::y, and glCompPoint::z.

Referenced by cacheNodeLabels().

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

◆ renderNodes()

static void renderNodes ( Agraph_t g)
static

Definition at line 308 of file topviewfuncs.c.

References glCompColor::A, agfstnode(), agnxtnode(), agxget(), glCompColor::B, draw_xdot(), drawCircle(), freeXDot(), glCompColor::G, getAttrInt(), getPointFromStr(), GN_pos, GN_selected, GN_size, l_float(), l_int(), ND_A, ND_selected, ND_size, ND_TVref, ND_visible, _ViewInfo::nodeScale, object_color(), parseXdotwithattrs(), glCompColor::R, view, glCompPoint::x, glCompPoint::y, and glCompPoint::z.

Referenced by cacheNodes(), and updateSmGraph().

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

◆ renderSelectedEdges()

static void renderSelectedEdges ( Agraph_t g)
static

Definition at line 383 of file topviewfuncs.c.

References agfstnode(), agfstout(), agnxtnode(), agnxtout(), draw_edge(), draw_xdot(), ED_posHead, ED_posTail, ED_selected, freeXDot(), getEdgeLength(), object_color(), parseXdotwithattrs(), and glCompPoint::z.

Referenced by cacheSelectedEdges().

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

◆ renderSelectedNodes()

static void renderSelectedNodes ( Agraph_t g)
static

Definition at line 252 of file topviewfuncs.c.

References glCompColor::A, agfstnode(), agnxtnode(), agxget(), glCompColor::B, draw_xdot(), drawCircle(), freeXDot(), glCompColor::G, getAttrBool(), GG_nodelabelcolor, glCompColorxlate(), glprintfglut(), _ViewInfo::glutfont, labelOf(), ND_A, ND_printLabel, ND_selected, ND_size, parseXdotwithattrs(), glCompColor::R, _ViewInfo::selectedNodeColor, view, glCompPoint::x, glCompPoint::y, and glCompPoint::z.

Referenced by cacheSelectedNodes().

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

◆ renderSmGraph()

void renderSmGraph ( topview t)

◆ set_boundaries()

static void set_boundaries ( Agraph_t g)
static

Definition at line 53 of file topviewfuncs.c.

References agfstnode(), agnxtnode(), agxget(), _ViewInfo::bdxLeft, _ViewInfo::bdxRight, _ViewInfo::bdyBottom, _ViewInfo::bdyTop, getPointFromStr(), GN_pos, left, right, top(), view, glCompPoint::x, and glCompPoint::y.

Referenced by updateSmGraph().

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

◆ skipNWS()

static char * skipNWS ( char *  p)
static

Definition at line 443 of file topviewfuncs.c.

References gv_isspace().

Referenced by countPoints().

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

◆ skipWS()

static char * skipWS ( char *  p)
static

Definition at line 434 of file topviewfuncs.c.

References gv_isspace().

Referenced by countPoints(), and storePoints().

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

◆ storePoints()

static int storePoints ( char *  pos,
xdot_point ps 
)
static

Definition at line 541 of file topviewfuncs.c.

References ps, readPoint(), and skipWS().

Referenced by makeXDotSpline().

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

◆ updateSmGraph()

void updateSmGraph ( Agraph_t g,
topview t 
)

Definition at line 812 of file topviewfuncs.c.

References AGEDGE, agfstnode(), agfstout(), aginit(), AGNODE, agnxtnode(), agnxtout(), cacheEdgeLabels(), cacheEdges(), cacheNodeLabels(), cacheNodes(), cacheSelectedEdges(), cacheSelectedNodes(), getEdgeLength(), topview::global_z, topview::maxedgelen, topview::minedgelen, topview::Nodecount, renderNodes(), topview::sel, _selection::selPoly, set_boundaries(), _ViewInfo::Topview, and view.

Referenced by initSmGraph(), on_settingsApplyBtn_clicked(), tv_hide_all(), and tv_show_all().

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

◆ visible()

static int visible ( Agsym_t attr,
void *  obj 
)
static

Definition at line 125 of file topviewfuncs.c.

References agxget(), and mapbool().

Referenced by object_color().

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