Graphviz 12.0.1~dev.20240715.2254
Loading...
Searching...
No Matches
postproc.c File Reference
#include <cgraph/alloc.h>
#include <cgraph/agxbuf.h>
#include <cgraph/prisize_t.h>
#include <cgraph/unreachable.h>
#include <common/render.h>
#include <label/xlabels.h>
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for postproc.c:

Go to the source code of this file.

Data Structures

struct  cinfo_t
 

Macros

#define M1   "/pathbox {\n\ /Y exch %.5g sub def\n\ /X exch %.5g sub def\n\ /y exch %.5g sub def\n\ /x exch %.5g sub def\n\ newpath x y moveto\n\ X y lineto\n\ X Y lineto\n\ x Y lineto\n\ closepath stroke\n \} def\n\/dbgstart { gsave %.5g %.5g translate } def\n\/arrowlength 10 def\n\/arrowwidth arrowlength 2 div def\n\/arrowhead {\n\ gsave\n\ rotate\n\ currentpoint\n\ newpath\n\ moveto\n\ arrowlength arrowwidth 2 div rlineto\n\ 0 arrowwidth neg rlineto\n\ closepath fill\n\ grestore\n\} bind def\n\/makearrow {\n\ currentpoint exch pop sub exch currentpoint pop sub atan\n\ arrowhead\n\} bind def\n\/point {\ newpath\ 2 0 360 arc fill\} def\/makevec {\n\ /Y exch def\n\ /X exch def\n\ /y exch def\n\ /x exch def\n\ newpath x y moveto\n\ X Y lineto stroke\n\ X Y moveto\n\ x y makearrow\n\} def\n"
 
#define M2   "/pathbox {\n\ /X exch neg %.5g sub def\n\ /Y exch %.5g sub def\n\ /x exch neg %.5g sub def\n\ /y exch %.5g sub def\n\ newpath x y moveto\n\ X y lineto\n\ X Y lineto\n\ x Y lineto\n\ closepath stroke\n\} def\n"
 
#define HAVE_EDGE(ep)   ((et != EDGETYPE_NONE) && (ED_spl(ep) != NULL))
 

Functions

static void place_flip_graph_label (graph_t *g)
 
static pointf map_point (pointf p)
 
static void map_edge (edge_t *e)
 
void translate_bb (graph_t *g, int rankdir)
 
static void translate_drawing (graph_t *g)
 
static void place_root_label (graph_t *g, pointf d)
 
static pointf centerPt (xlabel_t *xlp)
 
static void printData (object_t *objs, size_t n_objs, xlabel_t *lbls, size_t n_lbls, label_params_t *params)
 
static pointf edgeTailpoint (Agedge_t *e)
 
static pointf edgeHeadpoint (Agedge_t *e)
 
static boxf adjustBB (object_t *objp, boxf bb)
 
static void addXLabel (textlabel_t *lp, object_t *objp, xlabel_t *xlp, int initObj, pointf pos)
 
static boxf addLabelObj (textlabel_t *lp, object_t *objp, boxf bb)
 
static boxf addNodeObj (node_t *np, object_t *objp, boxf bb)
 
static cinfo_t addClusterObj (Agraph_t *g, cinfo_t info)
 
static size_t countClusterLabels (Agraph_t *g)
 
static void addXLabels (Agraph_t *gp)
 
void gv_postprocess (Agraph_t *g, int allowTranslation)
 
void dotneato_postprocess (Agraph_t *g)
 
void place_graph_label (graph_t *g)
 

Variables

static int Rankdir
 
static bool Flip
 
static pointf Offset
 

Macro Definition Documentation

◆ HAVE_EDGE

#define HAVE_EDGE (   ep)    ((et != EDGETYPE_NONE) && (ED_spl(ep) != NULL))

Definition at line 403 of file postproc.c.

◆ M1

#define M1   "/pathbox {\n\ /Y exch %.5g sub def\n\ /X exch %.5g sub def\n\ /y exch %.5g sub def\n\ /x exch %.5g sub def\n\ newpath x y moveto\n\ X y lineto\n\ X Y lineto\n\ x Y lineto\n\ closepath stroke\n \} def\n\/dbgstart { gsave %.5g %.5g translate } def\n\/arrowlength 10 def\n\/arrowwidth arrowlength 2 div def\n\/arrowhead {\n\ gsave\n\ rotate\n\ currentpoint\n\ newpath\n\ moveto\n\ arrowlength arrowwidth 2 div rlineto\n\ 0 arrowwidth neg rlineto\n\ closepath fill\n\ grestore\n\} bind def\n\/makearrow {\n\ currentpoint exch pop sub exch currentpoint pop sub atan\n\ arrowhead\n\} bind def\n\/point {\ newpath\ 2 0 360 arc fill\} def\/makevec {\n\ /Y exch def\n\ /X exch def\n\ /y exch def\n\ /x exch def\n\ newpath x y moveto\n\ X Y lineto stroke\n\ X Y moveto\n\ x y makearrow\n\} def\n"

Definition at line 28 of file postproc.c.

◆ M2

#define M2   "/pathbox {\n\ /X exch neg %.5g sub def\n\ /Y exch %.5g sub def\n\ /x exch neg %.5g sub def\n\ /y exch %.5g sub def\n\ newpath x y moveto\n\ X y lineto\n\ X Y lineto\n\ x Y lineto\n\ closepath stroke\n\} def\n"

Definition at line 73 of file postproc.c.

Function Documentation

◆ addClusterObj()

static cinfo_t addClusterObj ( Agraph_t g,
cinfo_t  info 
)
static

Definition at line 372 of file postproc.c.

References addClusterObj(), addLabelObj(), agroot(), info::bb, GD_clust, GD_label, and GD_n_cluster.

Referenced by addClusterObj(), and addXLabels().

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

◆ addLabelObj()

static boxf addLabelObj ( textlabel_t lp,
object_t objp,
boxf  bb 
)
static

Definition at line 326 of file postproc.c.

References adjustBB(), textlabel_t::dimen, Flip, textlabel_t::pos, object_t::pos, object_t::sz, pointf_s::x, and pointf_s::y.

Referenced by addClusterObj(), and addXLabels().

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

◆ addNodeObj()

static boxf addNodeObj ( node_t np,
object_t objp,
boxf  bb 
)
static

Definition at line 349 of file postproc.c.

References adjustBB(), Flip, INCH2PS, ND_coord, ND_height, ND_width, object_t::pos, object_t::sz, pointf_s::x, and pointf_s::y.

Referenced by addXLabels().

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

◆ addXLabel()

static void addXLabel ( textlabel_t lp,
object_t objp,
xlabel_t xlp,
int  initObj,
pointf  pos 
)
static

Definition at line 299 of file postproc.c.

References textlabel_t::dimen, Flip, xlabel_t::lbl, object_t::lbl, object_t::pos, xlabel_t::set, xlabel_t::sz, object_t::sz, pointf_s::x, and pointf_s::y.

Referenced by addXLabels().

Here is the caller graph for this function:

◆ addXLabels()

static void addXLabels ( Agraph_t gp)
static

Definition at line 405 of file postproc.c.

References addClusterObj(), addLabelObj(), addNodeObj(), addXLabel(), agfindgraphattr, agfstnode(), agfstout(), agnnodes(), agnxtnode(), agnxtout(), agwarningf(), label_params_t::bb, info::bb, centerPt(), cnt(), countClusterLabels(), ED_head_label, ED_label, ED_tail_label, ED_xlabel, EDGE_LABEL, EDGE_TYPE, EDGE_XLABEL, edgeHeadpoint(), EdgeLabelsDone, edgeMidpoint(), edgeTailpoint(), label_params_t::force, free(), GD_has_labels, GRAPH_LABEL, gv_calloc(), HAVE_EDGE, HEAD_LABEL, late_bool(), xlabel_t::lbl, boxf::LL, ND_xlabel, NODE_XLABEL, placeLabels(), textlabel_t::pos, printData(), PRISIZE_T, textlabel_t::set, xlabel_t::set, TAIL_LABEL, updateBB(), boxf::UR, and Verbose.

Referenced by gv_postprocess().

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

◆ adjustBB()

static boxf adjustBB ( object_t objp,
boxf  bb 
)
static

Definition at line 279 of file postproc.c.

References boxf::LL, MAX, MIN, object_t::pos, object_t::sz, boxf::UR, pointf_s::x, and pointf_s::y.

Referenced by addLabelObj(), and addNodeObj().

Here is the caller graph for this function:

◆ centerPt()

static pointf centerPt ( xlabel_t xlp)
static

Definition at line 203 of file postproc.c.

References xlabel_t::pos, xlabel_t::sz, pointf_s::x, and pointf_s::y.

Referenced by addXLabels().

Here is the caller graph for this function:

◆ countClusterLabels()

static size_t countClusterLabels ( Agraph_t g)
static

Definition at line 387 of file postproc.c.

References agroot(), countClusterLabels(), GD_clust, GD_label, and GD_n_cluster.

Referenced by addXLabels(), and countClusterLabels().

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

◆ dotneato_postprocess()

void dotneato_postprocess ( Agraph_t g)

Definition at line 693 of file postproc.c.

References gv_postprocess().

Referenced by circo_layout(), dot_layout(), main(), make_flat_adj_edges(), osage_layout(), pack_graph(), patchwork_layout(), sfdp_layout(), and twopi_layout().

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

◆ edgeHeadpoint()

static pointf edgeHeadpoint ( Agedge_t e)
static

Definition at line 258 of file postproc.c.

References bezier::eflag, bezier::ep, getsplinepoints(), bezier::list, splines::list, NULL, bezier::size, splines::size, pointf_s::x, and pointf_s::y.

Referenced by addXLabels().

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

◆ edgeTailpoint()

static pointf edgeTailpoint ( Agedge_t e)
static

Definition at line 239 of file postproc.c.

References getsplinepoints(), bezier::list, splines::list, NULL, bezier::sflag, bezier::sp, pointf_s::x, and pointf_s::y.

Referenced by addXLabels().

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

◆ gv_postprocess()

void gv_postprocess ( Agraph_t g,
int  allowTranslation 
)

Definition at line 601 of file postproc.c.

References addXLabels(), agxbdisown(), agxbprint(), Flip, GD_bb, GD_flip, GD_label, GD_label_pos, GD_rankdir, LABEL_AT_TOP, M1, M2, Offset, PAD, place_flip_graph_label(), place_graph_label(), place_root_label(), Rankdir, RANKDIR_BT, RANKDIR_LR, RANKDIR_RL, RANKDIR_TB, Show_boxes, translate_drawing(), UNREACHABLE, pointf_s::x, and pointf_s::y.

Referenced by dotneato_postprocess(), fdp_layout(), and neato_layout().

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

◆ map_edge()

static void map_edge ( edge_t e)
static

Definition at line 94 of file postproc.c.

References agerrorf(), aghead, agnameof(), agtail, Concentrate, ED_edge_type, ED_head_label, ED_label, ED_spl, ED_tail_label, ED_xlabel, bezier::eflag, IGNORED, bezier::list, map_point(), NULL, bezier::sflag, and bezier::size.

Referenced by translate_drawing().

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

◆ map_point()

static pointf map_point ( pointf  p)
static

Definition at line 86 of file postproc.c.

References ccwrotatepf(), Offset, Rankdir, pointf_s::x, and pointf_s::y.

Referenced by map_edge(), translate_bb(), and translate_drawing().

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

◆ place_flip_graph_label()

static void place_flip_graph_label ( graph_t g)
static

Definition at line 701 of file postproc.c.

References agroot(), GD_bb, GD_border, GD_clust, GD_label, GD_label_pos, GD_n_cluster, LABEL_AT_LEFT, LABEL_AT_RIGHT, LABEL_AT_TOP, LEFT_IX, place_flip_graph_label(), RIGHT_IX, pointf_s::x, and pointf_s::y.

Referenced by gv_postprocess(), and place_flip_graph_label().

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

◆ place_graph_label()

void place_graph_label ( graph_t g)

Definition at line 736 of file postproc.c.

References agroot(), BOTTOM_IX, GD_bb, GD_border, GD_clust, GD_label, GD_label_pos, GD_n_cluster, LABEL_AT_LEFT, LABEL_AT_RIGHT, LABEL_AT_TOP, place_graph_label(), TOP_IX, pointf_s::x, and pointf_s::y.

Referenced by gv_postprocess(), and place_graph_label().

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

◆ place_root_label()

static void place_root_label ( graph_t g,
pointf  d 
)
static

Definition at line 176 of file postproc.c.

References GD_bb, GD_label, GD_label_pos, LABEL_AT_LEFT, LABEL_AT_RIGHT, LABEL_AT_TOP, pointf_s::x, and pointf_s::y.

Referenced by gv_postprocess().

Here is the caller graph for this function:

◆ printData()

static void printData ( object_t objs,
size_t  n_objs,
xlabel_t lbls,
size_t  n_lbls,
label_params_t params 
)
static

Definition at line 213 of file postproc.c.

References label_params_t::bb, label_params_t::force, xlabel_t::lbl, object_t::lbl, boxf::LL, xlabel_t::pos, object_t::pos, PRISIZE_T, xlabel_t::set, xlabel_t::sz, object_t::sz, boxf::UR, Verbose, pointf_s::x, and pointf_s::y.

Referenced by addXLabels().

Here is the caller graph for this function:

◆ translate_bb()

void translate_bb ( graph_t g,
int  rankdir 
)

Definition at line 123 of file postproc.c.

References GD_bb, GD_clust, GD_label, GD_n_cluster, boxf::LL, map_point(), RANKDIR_BT, RANKDIR_LR, translate_bb(), boxf::UR, pointf_s::x, and pointf_s::y.

Referenced by translate_bb(), and translate_drawing().

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

◆ translate_drawing()

static void translate_drawing ( graph_t g)
static

Definition at line 149 of file postproc.c.

References agfstnode(), agfstout(), agnxtnode(), agnxtout(), GD_rankdir, gv_nodesize(), GVSPLINES, map_edge(), map_point(), ND_coord, ND_xlabel, Offset, Rankdir, State, translate_bb(), pointf_s::x, and pointf_s::y.

Referenced by gv_postprocess().

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

Variable Documentation

◆ Flip

bool Flip
static

Definition at line 23 of file postproc.c.

Referenced by addLabelObj(), addNodeObj(), addXLabel(), and gv_postprocess().

◆ Offset

pointf Offset
static

Definition at line 24 of file postproc.c.

Referenced by gv_postprocess(), map_point(), and translate_drawing().

◆ Rankdir

int Rankdir
static

Definition at line 22 of file postproc.c.

Referenced by gv_postprocess(), map_point(), and translate_drawing().