31 /Y exch %.5g sub def\n\
32 /X exch %.5g sub def\n\
33 /y exch %.5g sub def\n\
34 /x exch %.5g sub def\n\
41/dbgstart { gsave %.5g %.5g translate } def\n\
43/arrowwidth arrowlength 2 div def\n\
50 arrowlength arrowwidth 2 div rlineto\n\
51 0 arrowwidth neg rlineto\n\
56 currentpoint exch pop sub exch currentpoint pop sub atan\n\
76 /X exch neg %.5g sub def\n\
77 /Y exch %.5g sub def\n\
78 /x exch neg %.5g sub def\n\
79 /y exch %.5g sub def\n\
105 for (
size_t j = 0; j <
ED_spl(e)->size; j++) {
107 for (
size_t k = 0; k < bz.
size; k++)
208 p.
x += xlp->
sz.
x / 2.0;
209 p.
y += xlp->
sz.
y / 2.0;
218 " xlabels force=%d bb=(%.02f,%.02f) (%.02f,%.02f)\n",
222 fprintf(stderr,
"objects\n");
223 for (
size_t i = 0; i < n_objs; i++) {
225 fprintf(stderr,
" [%" PRISIZE_T "] (%.02f,%.02f) (%.02f,%.02f) %p \"%s\"\n",
230 fprintf(stderr,
"xlabels\n");
231 for (
size_t i = 0; i < n_lbls; i++) {
232 fprintf(stderr,
" [%" PRISIZE_T "] %p set %d (%.02f,%.02f) (%.02f,%.02f) %s\n",
336 objp->
pos.
x -= objp->
sz.
x / 2.0;
337 objp->
pos.
y -= objp->
sz.
y / 2.0;
359 objp->
pos.
x -= objp->
sz.
x / 2.0;
360 objp->
pos.
y -= objp->
sz.
y / 2.0;
396#define HAVE_EDGE(ep) ((et != EDGETYPE_NONE) && (ED_spl(ep) != NULL))
408 size_t n_set_lbls = 0;
463 size_t n_lbls = n_nlbls + n_elbls;
464 if (n_lbls == 0)
return;
469 size_t n_objs = (size_t)
agnnodes(gp) + n_set_lbls + n_clbls + n_elbls;
473 bb.
UR = (
pointf){-DBL_MAX, -DBL_MAX};
484 pointf ignored = { 0.0, 0.0 };
500 agwarningf(
"no position for edge with label %s\n",
515 agwarningf(
"no position for edge with tail label %s\n",
530 agwarningf(
"no position for edge with head label %s\n",
545 agwarningf(
"no position for edge with xlabel %s\n",
567 printData(objs, n_objs, lbls, n_lbls, ¶ms);
571 for (
size_t i = 0; i < n_lbls; i++) {
584 else if (
cnt != n_lbls)
601 pointf dimen = { 0., 0. };
631 GD_bb(g).LL.y -= diff;
632 GD_bb(g).UR.y += diff;
650 GD_bb(g).LL.x -= diff;
651 GD_bb(g).UR.x += diff;
655 if (allowTranslation) {
static int agxbprint(agxbuf *xb, const char *fmt,...)
Printf-style output to an agxbuf.
static char * agxbdisown(agxbuf *xb)
Memory allocation wrappers that exit on failure.
static void * gv_calloc(size_t nmemb, size_t size)
void updateBB(graph_t *g, textlabel_t *lp)
void gv_nodesize(node_t *n, bool flip)
bool late_bool(void *obj, attrsym_t *attr, bool defaultValue)
pointf ccwrotatepf(pointf p, int ccwrot)
#define INCH2PS(a_inches)
static int cnt(Dict_t *d, Dtlink_t **set)
int agnnodes(Agraph_t *g)
Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
void agwarningf(const char *fmt,...)
void agerrorf(const char *fmt,...)
#define agfindgraphattr(g, a)
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Agnode_t * agfstnode(Agraph_t *g)
char * agnameof(void *)
returns a string descriptor for the object.
Agraph_t * agroot(void *obj)
static pointf edgeTailpoint(Agedge_t *e)
static boxf adjustBB(object_t *objp, boxf bb)
void translate_bb(graph_t *g, int rankdir)
static void place_root_label(graph_t *g, pointf d)
static void place_flip_graph_label(graph_t *g)
static boxf addNodeObj(node_t *np, object_t *objp, boxf bb)
static void map_edge(edge_t *e)
void place_graph_label(graph_t *g)
static size_t countClusterLabels(Agraph_t *g)
static cinfo_t addClusterObj(Agraph_t *g, cinfo_t info)
static pointf centerPt(xlabel_t *xlp)
void dotneato_postprocess(Agraph_t *g)
static void printData(object_t *objs, size_t n_objs, xlabel_t *lbls, size_t n_lbls, label_params_t *params)
static pointf edgeHeadpoint(Agedge_t *e)
static void addXLabels(Agraph_t *gp)
void gv_postprocess(Agraph_t *g, int allowTranslation)
static void translate_drawing(graph_t *g)
static boxf addLabelObj(textlabel_t *lp, object_t *objp, boxf bb)
static pointf map_point(pointf p)
static void addXLabel(textlabel_t *lp, object_t *objp, xlabel_t *xlp, int initObj, pointf pos)
#define PRISIZE_T
PRIu64 alike for printing size_t
splines * getsplinepoints(edge_t *e)
pointf edgeMidpoint(graph_t *g, edge_t *e)
int placeLabels(object_t *objs, size_t n_objs, xlabel_t *lbls, size_t n_lbls, label_params_t *params)