~ubuntu-branches/ubuntu/lucid/graphviz/lucid-updates

« back to all changes in this revision

Viewing changes to plugin/gd/gvrender_gd_vrml.c

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2008-06-19 20:23:23 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080619202323-ls23h96ntj9ny94m
Tags: 2.18-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Build depend on liblualib50-dev instead of liblua5.1-0-dev.
  - Drop libttf-dev (libttf-dev is in universe) (LP: #174749).
  - Replace gs-common with ghostscript.
  - Build-depend on python-dev instead of python2.4-dev or python2.5-dev.
  - Mention the correct python version for the python bindings in the
    package description.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: gvrender_gd_vrml.c,v 1.25 2007/10/04 20:20:46 ellson Exp $ $Revision: 1.25 $ */
 
1
/* $Id: gvrender_gd_vrml.c,v 1.26 2008/03/03 23:01:52 ellson Exp $ $Revision: 1.26 $ */
2
2
/* vim:set shiftwidth=4 ts=8: */
3
3
 
4
4
/**********************************************************
226
226
    box bb = job->boundingBox;
227
227
 
228
228
    d = MAX(bb.UR.x - bb.LL.x,bb.UR.y - bb.LL.y);
229
 
    /* Roughly fill 3/4 view assuming FOV angle of PI/4.
 
229
    /* Roughly fill 3/4 view assuming FOV angle of M_PI/4.
230
230
     * Small graphs and non-square aspect ratios will upset this.
231
231
     */
232
 
    z = (0.6667*d)/tan(PI/8.0) + MinZ;  /* fill 3/4 of view */
 
232
    z = (0.6667*d)/tan(M_PI/8.0) + MinZ;  /* fill 3/4 of view */
233
233
 
234
234
    if (!Saw_skycolor)
235
235
        fprintf(out, " Background { skyColor 1 1 1 }\n");
317
317
    y -= o_y;
318
318
    z -= o_z;
319
319
    if (p0.y > p1.y)
320
 
        theta = acos(2*y/EdgeLen) + PI;
 
320
        theta = acos(2*y/EdgeLen) + M_PI;
321
321
    else
322
322
        theta = acos(2*y/EdgeLen);
323
323
    if (!x && !z)   /* parallel  to y-axis */
369
369
        color_index(im, obj->pencolor),
370
370
        para->fontsize,
371
371
        DEFAULT_DPI,
372
 
        job->rotation ? (PI / 2) : 0,
 
372
        job->rotation ? (M_PI / 2) : 0,
373
373
        para->fontname,
374
374
        para->str);
375
375
}
537
537
    if (DIST2(A[1], tp) < DIST2(A[1], hp)) {
538
538
        TailHt = ht;
539
539
        fprintf(out, "  translation 0 %.3f 0\n", -y);
540
 
        fprintf(out, "  rotation 0 0 1 %.3f\n", PI);
 
540
        fprintf(out, "  rotation 0 0 1 %.3f\n", M_PI);
541
541
    }
542
542
    else {
543
543
        HeadHt = ht;
649
649
        /* it is bad to know that A[1] is the aiming point, but we do */
650
650
        theta =
651
651
            atan2((A[0].y + A[2].y) / 2.0 - A[1].y,
652
 
                  (A[0].x + A[2].x) / 2.0 - A[1].x) + PI / 2.0;
 
652
                  (A[0].x + A[2].x) / 2.0 - A[1].x) + M_PI / 2.0;
653
653
 
654
654
        /* this is gruesome, but how else can we get z coord */
655
655
        if (DIST2(p, ND_coord_i(e->tail)) < DIST2(p, ND_coord_i(e->head)))