~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to display/d.vect.chart/bar.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <grass/gis.h>
2
 
#include <grass/Vect.h>
 
2
#include <grass/vector.h>
3
3
#include <grass/dbmi.h>
4
4
#include <grass/display.h>
5
 
#include <grass/raster.h>
6
5
#include <grass/symbol.h>
7
6
#include "global.h"
8
7
 
10
9
bar(double cx, double cy, int size, double scale, double *val, int ncols,
11
10
    COLOR * ocolor, COLOR * colors, int y_center, double *max_reference)
12
11
{
13
 
    int i, j;
 
12
    int i;
14
13
    double max;
15
14
    double x0, y0;
16
15
    double bw;                  /* bar width */
59
58
            Vect_append_point(max_Points, x0 + i * bw, y0, 0);
60
59
 
61
60
            /* the outline color : default is black */
62
 
            R_RGB_color(ocolor->r, ocolor->g, ocolor->b);
63
 
            for (j = 1; j < max_Points->n_points; j++) {
64
 
                G_plot_line(max_Points->x[j], max_Points->y[j],
65
 
                            max_Points->x[j - 1], max_Points->y[j - 1]);
66
 
            }
 
61
            D_RGB_color(ocolor->r, ocolor->g, ocolor->b);
 
62
            D_polyline_abs(max_Points->x, max_Points->y, max_Points->n_points);
67
63
        }
68
64
    }
69
65
 
79
75
        Vect_append_point(Points, x0 + i * bw, y0, 0);
80
76
 
81
77
        if (!colors[i].none) {
82
 
            R_RGB_color(colors[i].r, colors[i].g, colors[i].b);
83
 
            D_polygon(Points->x, Points->y, Points->n_points);
 
78
            D_RGB_color(colors[i].r, colors[i].g, colors[i].b);
 
79
            D_polygon_abs(Points->x, Points->y, Points->n_points);
84
80
        }
85
81
 
86
 
        R_RGB_color(ocolor->r, ocolor->g, ocolor->b);
87
 
        for (j = 1; j < Points->n_points; j++) {
88
 
            G_plot_line(Points->x[j], Points->y[j], Points->x[j - 1],
89
 
                        Points->y[j - 1]);
90
 
        }
 
82
        D_RGB_color(ocolor->r, ocolor->g, ocolor->b);
 
83
        D_polyline_abs(Points->x, Points->y, Points->n_points);
91
84
    }
92
85
 
93
86
    /* tidy up */