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

« back to all changes in this revision

Viewing changes to display/d.vect/vert.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 <grass/gis.h>
 
2
#include <grass/vector.h>
 
3
#include <grass/display.h>
 
4
#include <grass/glocale.h>
 
5
#include "local_proto.h"
 
6
#include "plot.h"
 
7
 
 
8
int display_vert(struct Map_info *Map, int type, LATTR *lattr, double dsize)
 
9
{
 
10
    int ltype, i;
 
11
    double msize;
 
12
    struct line_pnts *Points;
 
13
 
 
14
    msize = dsize * (D_d_to_u_col(2.0) - D_d_to_u_col(1.0));    /* do it better */
 
15
    
 
16
    G_debug(1, "display vertices:");
 
17
    Points = Vect_new_line_struct();
 
18
 
 
19
    D_RGB_color(lattr->color.R, lattr->color.G, lattr->color.B);
 
20
 
 
21
    Vect_rewind(Map);
 
22
    Vect_set_constraint_type(Map, type);
 
23
    while(TRUE) {
 
24
        ltype = Vect_read_next_line(Map, Points, NULL);
 
25
        switch (ltype) {
 
26
        case -1:
 
27
            G_fatal_error(_("Unable to read vector map"));
 
28
        case -2:                /* EOF */
 
29
            return 0;
 
30
        }
 
31
 
 
32
        if (!(ltype & GV_LINES))
 
33
            continue;
 
34
        
 
35
        for (i = 0; i < Points->n_points; i++) {
 
36
            D_plot_icon(Points->x[i], Points->y[i], G_ICON_CROSS, 0, msize);
 
37
        }
 
38
    }
 
39
    Vect_remove_constraints(Map);
 
40
 
 
41
    Vect_destroy_line_struct(Points);
 
42
 
 
43
    return 0;
 
44
}