else
job->translation.y = - job->clip.LL.y + job->canvasBox.LL.y / job->zoom;
}
-
-#if 0
-fprintf(stderr,"width=%d height=%d dpi=%g,%g\npad=%g,%g focus=%g,%g view=%g,%g zoom=%g\npageBox=%g,%g,%g,%g pagesArraySize=%d,%d pageSize=%g,%g canvasBox=%g,%g,%g,%g pageOffset=%g,%g\ntranslation=%g,%g clip=%g,%g,%g,%g margin=%g,%g\n",
- job->width, job->height,
- job->dpi.x, job->dpi.y,
- job->pad.x, job->pad.y,
- job->focus.x, job->focus.y,
- job->view.x, job->view.y,
- job->zoom,
- job->pageBox.LL.x, job->pageBox.LL.y, job->pageBox.UR.x, job->pageBox.UR.y,
- job->pagesArraySize.x, job->pagesArraySize.y,
- job->pageSize.x, job->pageSize.y,
- job->canvasBox.LL.x, job->canvasBox.LL.y, job->canvasBox.UR.x, job->canvasBox.UR.y,
- job->pageOffset.x, job->pageOffset.y,
- job->translation.x, job->translation.y,
- job->clip.LL.x, job->clip.LL.y, job->clip.UR.x, job->clip.UR.y,
- job->margin.x, job->margin.y);
-#endif
}
static boolean node_in_layer(GVJ_t *job, graph_t * g, node_t * n)
{
obj_state_t *obj = job->obj;
char* url;
-#if 0
- char* tooltip;
- char* target;
-#endif
boolean explicit;
if (explicit_iurl) url = iurl;
else url = obj->url;
if (explicit_itooltip) {
-#if 0
- tooltip = itooltip;
-#endif
explicit = TRUE;
}
else if (obj->explicit_tooltip) {
-#if 0
- tooltip = obj->tooltip;
-#endif
explicit = TRUE;
}
else {
-#if 0
- tooltip = itooltip;
-#endif
explicit = FALSE;
}
-#if 0
- if (explicit_itarget)
- target = itarget;
- else if (obj->explicit_edgetarget)
- target = obj->target;
- else
- target = itarget;
-#endif
if (url || explicit) {
map_point(job, p);
-#if 0
-/* this doesn't work because there is nothing contained in the anchor */
- gvrender_begin_anchor(job, url, tooltip, target, obj->id);
- gvrender_end_anchor(job);
-#endif
}
}
job->zoom = Z; /* scaling factor */
job->focus.x = x;
job->focus.y = y;
-#if 0
-fprintf(stderr, "view=%g,%g, zoom=%g, focus=%g,%g\n",
- job->view.x, job->view.y,
- job->zoom,
- job->focus.x, job->focus.y);
-#endif
}
static void emit_cluster_colors(GVJ_t * job, graph_t * g)
job->view.x = job->width / job->scale.x;
job->view.y = job->height / job->scale.y;
}
-#if 0
-fprintf(stderr,"focus=%g,%g view=%g,%g\n",
- job->focus.x, job->focus.y, job->view.x, job->view.y);
-#endif
s = late_string(g, agattr(g, AGRAPH, "comment", 0), "");
gvrender_comment(job, s);
static unsigned char outbuf[SMALLBUF];
static agxbuf ps_xb;
-#if 0
-static void cleanup(void)
-{
- agxbfree(&ps_xb);
-}
-#endif
-
/* parse_style:
* This is one of the worst internal designs in graphviz.
* The use of '\0' characters within strings seems cute but it
if (is_first) {
agxbinit(&ps_xb, SMALLBUF, outbuf);
-#if 0
- atexit(cleanup);
-#endif
is_first = FALSE;
}
gvrender_beziercurve(job, vertices, 7, FALSE, FALSE, FALSE);
}
-#if 0
-/* cylinder_inside:
- * At present, we use just the polygonal outline provided by vertices.
- * This cold be made more precise by using a finer-grained polyline path
- * to the spline top and bottom. Another approach might be to approximate
- * the top and bottom by ellipses. Then the test would involve a check if
- * the point is in the rectangle or one of the two ellipses.
- */
-static boolean cylinder_inside(inside_t * inside_context, pointf p)
-{
- return TRUE;
-}
-#endif
-
static char *side_port[] = { "s", "e", "n", "w" };
static point cvtPt(pointf p, int rankdir)
*/
void addEdgeLabels(graph_t* g, edge_t * e, pointf rp, pointf rq)
{
-#if 0
- int et = EDGE_TYPE (g);
- pointf p, q;
- pointf d; /* midpoint of segment p-q */
- point ld;
- point del;
- pointf spf;
- double f, ht, wd, dist2;
- int leftOf;
-
- if (ED_label(e) && !ED_label(e)->set) {
- endPoints(ED_spl(e), &p, &q);
- if (APPROXEQPT(p, q, MILLIPOINT)) { /* degenerate spline */
- p = rp;
- q = rq;
- spf = p;
- }
- else if (et == ET_SPLINE) {
- d.x = (q.x + p.x) / 2.;
- d.y = (p.y + q.y) / 2.;
- spf = dotneato_closest(ED_spl(e), d);
- }
- else { /* ET_PLINE, ET_ORTHO or ET_LINE */
- spf = polylineMidpoint (ED_spl(e), &p, &q);
- }
- del.x = q.x - p.x;
- del.y = q.y - p.y;
- dist2 = del.x*del.x + del.y*del.y;
- ht = (ED_label(e)->dimen.y + 2)/2.0;
- if (dist2) {
- wd = (MIN(ED_label(e)->dimen.x + 2, MAXLABELWD))/2.0;
- leftOf = LEFTOF(p, q, spf);
- if ((leftOf && (del.y >= 0)) || (!leftOf && (del.y < 0))) {
- if (del.x*del.y >= 0)
- ht *= -1;
- }
- else {
- wd *= -1;
- if (del.x*del.y < 0)
- ht *= -1;
- }
- f = (del.y*wd - del.x*ht)/dist2;
- ld.x = -f*del.y;
- ld.y = f*del.x;
- }
- else { /* end points the same */
- ld.x = 0;
- ld.y = -ht;
- }
-
- ED_label(e)->pos.x = spf.x + ld.x;
- ED_label(e)->pos.y = spf.y + ld.y;
- ED_label(e)->set = TRUE;
- updateBB(agraphof(agtail(e)), ED_label(e));
- }
-#endif
makePortLabels(e);
}