32 /Y exch %.5g sub def\n\
33 /X exch %.5g sub def\n\
34 /y exch %.5g sub def\n\
35 /x exch %.5g sub def\n\
42/dbgstart { gsave %.5g %.5g translate } def\n\
44/arrowwidth arrowlength 2 div def\n\
51 arrowlength arrowwidth 2 div rlineto\n\
52 0 arrowwidth neg rlineto\n\
57 currentpoint exch pop sub exch currentpoint pop sub atan\n\
77 /X exch neg %.5g sub def\n\
78 /Y exch %.5g sub def\n\
79 /x exch neg %.5g sub def\n\
80 /y exch %.5g sub def\n\
106 for (
size_t j = 0; j <
ED_spl(e)->size; j++) {
108 for (
size_t k = 0; k < bz.
size; k++)
209 p.
x += xlp->
sz.
x / 2.0;
210 p.
y += xlp->
sz.
y / 2.0;
219 " xlabels force=%d bb=(%.02f,%.02f) (%.02f,%.02f)\n",
223 fprintf(stderr,
"objects\n");
224 for (
size_t i = 0; i < n_objs; i++) {
226 fprintf(stderr,
" [%" PRISIZE_T "] (%.02f,%.02f) (%.02f,%.02f) %p \"%s\"\n",
231 fprintf(stderr,
"xlabels\n");
232 for (
size_t i = 0; i < n_lbls; i++) {
233 fprintf(stderr,
" [%" PRISIZE_T "] %p set %d (%.02f,%.02f) (%.02f,%.02f) %s\n",
337 objp->
pos.
x -= objp->
sz.
x / 2.0;
338 objp->
pos.
y -= objp->
sz.
y / 2.0;
360 objp->
pos.
x -= objp->
sz.
x / 2.0;
361 objp->
pos.
y -= objp->
sz.
y / 2.0;
397#define HAVE_EDGE(ep) ((et != EDGETYPE_NONE) && (ED_spl(ep) != NULL))
409 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",
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)
type-generic dynamically expanding list
#define LIST_PREPEND(list, item)
#define LIST_IS_EMPTY(list)
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)
splines * getsplinepoints(edge_t *e)
pointf edgeMidpoint(graph_t *g, edge_t *e)
bool force
if true, all labels must be placed
int placeLabels(object_t *objs, size_t n_objs, xlabel_t *lbls, size_t n_lbls, label_params_t *params)