Debian Codegraph @

src/sp.h

raw symbols SCIP
1 #ifndef R_SP_H
2 #define R_SP_H
3
4 #ifndef R_NO_REMAP
5 # define R_NO_REMAP
6 #endif
7
8 #include <R.h>
9 /* RSB 091203 */
10 #include <Rdefines.h>
11 #define R_OFFSET 1
12 #include <Rinternals.h>
13 #include <Rmath.h>
14
15 /* from insiders.c
16
17 int pipbb(double pt1, double pt2, double *bbs);
18 int between(double x, double low, double up);
19 SEXP insiders(SEXP n1, SEXP bbs); */
20
21 /* from pip.c */
22
23 #ifndef MIN
24 # define MIN(a,b) ((a)>(b)?(b):(a))
25 #endif
26 #ifndef MAX
27 # define MAX(a,b) ((a)>(b)?(a):(b))
28 #endif
29
30 #define BUFSIZE 8192
31
32 /* polygon structs: */
33 typedef struct {
34 double x, y;
35 } PLOT_POINT;
36
37 typedef struct {
38 PLOT_POINT min, max;
39 } MBR;
40
41 typedef struct polygon {
42 MBR mbr;
43 int lines;
44 PLOT_POINT *p;
45 int close; /* 1 - is closed polygon */
46 } POLYGON;
47
48 void setup_poly_minmax(POLYGON *pl);
49 char InPoly(PLOT_POINT q, POLYGON *Poly);
50 SEXP R_point_in_polygon_sp(SEXP px, SEXP py, SEXP polx, SEXP poly); /* point.in.polygon.R */
51 void sarea(double *heights, int *nx, int *ny, double *w, double *h,
52 double *sa, int *bycell); /* surfaceArea.R */
53 void spRFindCG( int *n, double *x, double *y, double *xc, double *yc,
54 double *area ); /* SpatialPolygons-internals.R */
55 void sp_gcdist(double *lon1, double *lon2, double *lat1, double *lat2,
56 double *dist);
57 void sp_dists(double *u, double *v, double *uout, double *vout,
58 int *n, double *dists, int *lonlat); /* spdists.R */
59 void sp_dists_NN(double *u1, double *v1, double *u2, double *v2,
60 int *n, double *dists, int *lonlat); /* spdists.R */
61 void sp_lengths(double *u, double *v, int *n, double *lengths, int *lonlat); /* SpatialLines-methods.R */
62 SEXP sp_zerodist(SEXP pp, SEXP pncol, SEXP zero, SEXP lonlat, SEXP mcmp); /* zerodist.R */
63 SEXP sp_duplicates(SEXP pp, SEXP pncol, SEXP zero, SEXP lonlat, SEXP mcmp); /* zerodist.R */
64 SEXP pointsInBox(SEXP lb, SEXP px, SEXP py); /* point.in.polygon.R */
65 SEXP tList(SEXP nl, SEXP m); /* point.in.polygon.R */
66
67 /* RSB 091203 */
68
69 #define DIM 2 /* Dimension of points */
70 typedef double tPointd[DIM]; /* type double point */
71
72 double Area2(const tPointd a, const tPointd b, const tPointd c);
73 void FindCG(int n, tPointd *P, tPointd CG, double *Areasum2);
74 void Centroid3(const tPointd p1, const tPointd p2,
75 const tPointd p3, tPointd c);
76 void spRFindCG_c(const SEXP n, const SEXP coords,
77 double *xc, double *yc, double *area );
78 void comm2comment(char *buf, int bufsiz, int *comm, int nps);
79
80 SEXP Polygon_c(const SEXP coords, const SEXP n, const SEXP hole); /* SpatialPolygons-methods.R */
81 SEXP Polygons_c(const SEXP pls, const SEXP ID); /* SpatialPolygons-methods.R */
82 SEXP SpatialPolygons_c(const SEXP pls, const SEXP pO, const SEXP p4s); /* SpatialPolygons-methods.R */
83 SEXP bboxCalcR_c(const SEXP pls); /* SpatialPolygonsDataFrame-methods.R */
84 SEXP Polygon_validate_c(const SEXP obj); /* Class-SpatialPolygons.R */
85 SEXP Polygons_validate_c(const SEXP obj); /* Class-SpatialPolygons.R */
86 SEXP SpatialPolygons_validate_c(const SEXP obj); /* Class-SpatialPolygons.R */
87 SEXP SpatialPolygons_getIDs_c(const SEXP obj); /* chfids.R Class-SpatialPolygons.R SpatialPolygonsDataFrame-methods.R */
88 SEXP SpatialPolygons_plotOrder_c(const SEXP pls); /* SpatialPolygonsDataFrame-methods.R SpatialPolygons-methods.R */
89 SEXP comment2comm(const SEXP obj);
90 // SEXP sp_linkingTo_version(void);
91 #endif
92