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

« back to all changes in this revision

Viewing changes to imagery/i.vpoints/points.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
 
#include "globals.h"
2
 
#include <grass/raster.h>
3
 
 
4
 
/* overlay ground control points on the display */
5
 
 
6
 
int display_points(int in_color)
7
 
{
8
 
 
9
 
    display_points_in_view(VIEW_MAP1, in_color,
10
 
                           group.points.e1, group.points.n1,
11
 
                           group.points.status, group.points.count);
12
 
 
13
 
    display_points_in_view(VIEW_MAP1_ZOOM, in_color,
14
 
                           group.points.e1, group.points.n1,
15
 
                           group.points.status, group.points.count);
16
 
 
17
 
    display_points_in_view(VIEW_MAP2, in_color,
18
 
                           group.points.e2, group.points.n2,
19
 
                           group.points.status, group.points.count);
20
 
 
21
 
    display_points_in_view(VIEW_MAP2_ZOOM, in_color,
22
 
                           group.points.e2, group.points.n2,
23
 
                           group.points.status, group.points.count);
24
 
 
25
 
    return 0;
26
 
}
27
 
 
28
 
int display_points_in_view(View * view, int in_color,
29
 
                           double *east, double *north, int *status,
30
 
                           int count)
31
 
{
32
 
    if (!view->cell.configured)
33
 
        return 1;
34
 
    while (count-- > 0) {
35
 
        if (in_color && (*status > 0))
36
 
            R_standard_color(GREEN);
37
 
        else if (in_color && (*status == 0))
38
 
            R_standard_color(RED);
39
 
        else
40
 
            R_standard_color(GREY);
41
 
        status++;
42
 
        display_one_point(view, *east++, *north++);
43
 
    }
44
 
 
45
 
    return 0;
46
 
}
47
 
 
48
 
int display_one_point(View * view, double east, double north)
49
 
{
50
 
    int row, col, x, y;
51
 
 
52
 
    row = northing_to_row(&view->cell.head, north) + .5;
53
 
    col = easting_to_col(&view->cell.head, east) + .5;
54
 
    y = row_to_view(view, row);
55
 
    x = col_to_view(view, col);
56
 
    if (In_view(view, x, y))
57
 
        dot(x, y);
58
 
 
59
 
    return 0;
60
 
}