30 /Y exch %.5g sub def\n\
31 /X exch %.5g sub def\n\
32 /y exch %.5g sub def\n\
33 /x exch %.5g sub def\n\
40/dbgstart { gsave %.5g %.5g translate } def\n\
42/arrowwidth arrowlength 2 div def\n\
49 arrowlength arrowwidth 2 div rlineto\n\
50 0 arrowwidth neg rlineto\n\
55 currentpoint exch pop sub exch currentpoint pop sub atan\n\
75 /X exch neg %.5g sub def\n\
76 /Y exch %.5g sub def\n\
77 /x exch neg %.5g sub def\n\
78 /y exch %.5g sub def\n\
104 for (
size_t j = 0; j <
ED_spl(e)->size; j++) {
106 for (
size_t k = 0; k < bz.
size; k++)
207 p.
x += xlp->
sz.
x / 2.0;
208 p.
y += xlp->
sz.
y / 2.0;
217 " xlabels force=%d bb=(%.02f,%.02f) (%.02f,%.02f)\n",
221 fprintf(stderr,
"objects\n");
222 for (
size_t i = 0; i < n_objs; i++) {
224 fprintf(stderr,
" [%" PRISIZE_T "] (%.02f,%.02f) (%.02f,%.02f) %p \"%s\"\n",
229 fprintf(stderr,
"xlabels\n");
230 for (
size_t i = 0; i < n_lbls; i++) {
231 fprintf(stderr,
" [%" PRISIZE_T "] %p set %d (%.02f,%.02f) (%.02f,%.02f) %s\n",
335 objp->
pos.
x -= objp->
sz.
x / 2.0;
336 objp->
pos.
y -= objp->
sz.
y / 2.0;
358 objp->
pos.
x -= objp->
sz.
x / 2.0;
359 objp->
pos.
y -= objp->
sz.
y / 2.0;
395#define HAVE_EDGE(ep) ((et != EDGETYPE_NONE) && (ED_spl(ep) != NULL))
407 size_t n_set_lbls = 0;
462 size_t n_lbls = n_nlbls + n_elbls;
463 if (n_lbls == 0)
return;
468 size_t n_objs = (size_t)
agnnodes(gp) + n_set_lbls + n_clbls + n_elbls;
472 bb.
UR = (
pointf){-INT_MAX, -INT_MAX};
483 pointf ignored = { 0.0, 0.0 };
499 agwarningf(
"no position for edge with label %s\n",
514 agwarningf(
"no position for edge with tail label %s\n",
529 agwarningf(
"no position for edge with head label %s\n",
544 agwarningf(
"no position for edge with xlabel %s\n",
566 printData(objs, n_objs, lbls, n_lbls, ¶ms);
570 for (
size_t i = 0; i < n_lbls; i++) {
583 else if (
cnt != n_lbls)
600 pointf dimen = { 0., 0. };
630 GD_bb(g).LL.y -= diff;
631 GD_bb(g).UR.y += diff;
649 GD_bb(g).LL.x -= diff;
650 GD_bb(g).UR.x += diff;
654 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)