]> granicus.if.org Git - graphviz/commitdiff
remove commented out code in lib/common
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Jun 2021 02:26:28 +0000 (19:26 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 30 Jun 2021 02:32:59 +0000 (19:32 -0700)
lib/common/emit.c
lib/common/labels.c
lib/common/routespl.c
lib/common/shapes.c
lib/common/splines.c
lib/common/taper.c

index a08b5c2869cb7ac2045c3d25cdc24862cfddf417..16140810a4100e3a374a6c5f05462bcf3ffa1f19 100644 (file)
@@ -1698,24 +1698,6 @@ static void setup_page(GVJ_t * job, graph_t * g)
         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)
@@ -2757,48 +2739,22 @@ static void nodeIntersect (GVJ_t * job, pointf p,
 {
     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
     }
 }
 
@@ -3282,12 +3238,6 @@ static void init_job_viewport(GVJ_t * job, graph_t * g)
     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)
@@ -3552,10 +3502,6 @@ void emit_graph(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);
@@ -3858,13 +3804,6 @@ static int style_token(char **s, agxbuf * xb)
 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
@@ -3886,9 +3825,6 @@ char **parse_style(char *s)
 
     if (is_first) {
        agxbinit(&ps_xb, SMALLBUF, outbuf);
-#if 0
-       atexit(cleanup);
-#endif
        is_first = FALSE;
     }
 
index b327b10a943e6cec85ffe425a3ecb0fc2db40eb3..d9ea71c86bf7367f8081b1b93d73023a680d770b 100644 (file)
@@ -523,9 +523,6 @@ char *xml_url_string(char *s)
     static char *buf = NULL;
     static int bufsize = 0;
     char *p, *sub;
-#if 0
-    char *prev = NULL;
-#endif
     int len, pos = 0;
 
     if (!buf) {
@@ -555,17 +552,6 @@ char *xml_url_string(char *s)
            sub = "&gt;";
            len = 4;
        }
-#if 0
-       else if (*s == '-') {   /* can't be used in xml comment strings */
-           sub = "&#45;";
-           len = 5;
-       }
-       else if (*s == ' ' && prev && *prev == ' ') {
-           /* substitute 2nd and subsequent spaces with required_spaces */
-           sub = "&#160;";  /* inkscape doesn't recognise &nbsp; */
-           len = 6;
-       }
-#endif
        else if (*s == '"') {
            sub = "&quot;";
            len = 6;
@@ -582,9 +568,6 @@ char *xml_url_string(char *s)
            *p++ = *sub++;
            pos++;
        }
-#if 0
-       prev = s;
-#endif
        s++;
     }
     *p = '\0';
index fedfa2cda988fbfd2a4e5b08497024f0664618a7..da70501a907f026de0f927715ca7e92f47c5d974 100644 (file)
@@ -243,19 +243,7 @@ simpleSplineRoute (pointf tp, pointf hp, Ppoly_t poly, int* n_spl_pts,
            edges[i].a = poly.ps[i];
            edges[i].b = poly.ps[(i + 1) % poly.pn];
        }
-#if 0
-       if (pp->start.constrained) {
-           evs[0].x = cos(pp->start.theta);
-           evs[0].y = sin(pp->start.theta);
-       } else
-#endif
            evs[0].x = evs[0].y = 0;
-#if 0
-       if (pp->end.constrained) {
-           evs[1].x = -cos(pp->end.theta);
-           evs[1].y = -sin(pp->end.theta);
-       } else
-#endif
            evs[1].x = evs[1].y = 0;
        if (Proutespline(edges, poly.pn, pl, evs, &spl) < 0)
             return NULL;
index 78af16254b8fe8600daf27c972dbe67cf45a26c6..1aca97d02b295be2150b323c0a799f677e0eb5b6 100644 (file)
@@ -4034,20 +4034,6 @@ static void cylinder_draw(GVJ_t * job, pointf * AF, int sides, int style, int fi
     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)
index c262494b977c5e1bed7d757d24cc16400b4a653d..d0f8cd98cc2813ec8f61ec241b53ce398ba48a77 100644 (file)
@@ -1340,62 +1340,6 @@ edgeMidpoint (graph_t* g, edge_t * e)
  */
 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);
 }
 
index d101d981cc4ccce9bcae9a2071bfc9fafff682e9..6da4acb4ebd3a9a4e1cb8f1c0da4226a067f2cd7 100644 (file)
@@ -69,17 +69,6 @@ static void arcn (stroke_t* p, double x, double y, double r, double a1, double a
        addto (p, x+r*cos(a1-i*theta), y+r*sin(a1-i*theta));
 }
 
-#if 0
-static void closepath (stroke_t* p)
-{
-    pointf pt = p->vertices[0];
-
-    addto (p, pt.x, pt.y);
-    if (p->flags > p->nvertices)
-       p->vertices = RALLOC(p->nvertices,p->vertices,pointf);
-}
-#endif
-
 /*
  * handle zeros
  */