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

« back to all changes in this revision

Viewing changes to vector/v.distance/local_proto.h

  • 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/vector.h>
 
2
#include <grass/dbmi.h>
 
3
 
 
4
#ifndef _LOCAL_PROTO_
 
5
#define _LOCAL_PROTO_
 
6
 
 
7
/* define codes for characteristics of relation between two nearest features */
 
8
#define CAT        1            /* category of nearest feature */
 
9
#define FROM_X     2            /* x coordinate of nearest point on 'from' feature */
 
10
#define FROM_Y     3            /* y coordinate of nearest point on 'from' feature */
 
11
#define TO_X       4            /* x coordinate of nearest point on 'to' feature */
 
12
#define TO_Y       5            /* y coordinate of nearest point on 'to' feature */
 
13
#define FROM_ALONG 6            /* distance to nearest point on 'from' along linear feature */
 
14
#define TO_ALONG   7            /* distance to nearest point on 'to' along linear feature */
 
15
#define DIST       8            /* minimum distance to nearest feature */
 
16
#define TO_ANGLE   9            /* angle of linear feature in nearest point */
 
17
#define TO_ATTR   10            /* attribute of nearest feature */
 
18
#define END       11            /* end of list */
 
19
 
 
20
/* Structure to store info about nearest feature for each category */
 
21
typedef struct
 
22
{
 
23
    int from_cat;               /* category (from) */
 
24
    int count;                  /* number of features already found */
 
25
    int to_cat;                 /* category (to) */
 
26
    double from_x, from_y, from_z; /* coordinates of nearest 'from' point */
 
27
    double to_x, to_y, to_z;    /* coordinates of nearest 'to' point */
 
28
    double from_along, to_along;        /* distance along a linear feature to the nearest point */
 
29
    double from_angle;          /* angle of linear feature in nearest point */
 
30
    double to_angle;            /* angle of linear feature in nearest point */
 
31
    double dist;                /* distance to nearest feature */
 
32
} NEAR;
 
33
 
 
34
/* Upload and column store */
 
35
typedef struct
 
36
{
 
37
    int upload;                 /* code */
 
38
    char *column;               /* column name */
 
39
} UPLOAD;
 
40
 
 
41
 
 
42
typedef int dist_func(const struct line_pnts *, double, double, double, int,
 
43
                       double *, double *, double *, double *, double *,
 
44
                       double *);
 
45
extern dist_func *line_distance;
 
46
 
 
47
/* cmp.c */
 
48
int cmp_near(const void *, const void *);
 
49
int cmp_near_to(const void *, const void *);
 
50
int cmp_exist(const void *, const void *);
 
51
 
 
52
/* distance.c */
 
53
int get_line_box(const struct line_pnts *Points, 
 
54
                 struct bound_box *box);
 
55
int line2line(struct line_pnts *FPoints, int ftype,
 
56
              struct line_pnts *TPoints, int ttype,
 
57
              double *fx, double *fy, double *fz,
 
58
              double *falong, double *fangle,
 
59
              double *tx, double *ty, double *tz,
 
60
              double *talong, double *tangle,
 
61
              double *dist,
 
62
              int with_z);
 
63
int line2area(const struct Map_info *To,
 
64
              struct line_pnts *Points, int type,
 
65
              int area, const struct bound_box *abox,
 
66
              double *fx, double *fy, double *fz,
 
67
              double *falong, double *fangle,
 
68
              double *tx, double *ty, double *tz,
 
69
              double *talong, double *tangle,
 
70
              double *dist,
 
71
              int with_z);
 
72
 
 
73
/* print.c */
 
74
int print_upload(NEAR *, UPLOAD *, int, dbCatValArray *, dbCatVal *, char *);
 
75
 
 
76
#endif