GRASS GIS 7 Programmer's Manual  7.0.3(2016)-r00000
interpf.h
Go to the documentation of this file.
1 /*
2  * modified by Brown in June 1999 - added elatt & smatt
3  * modified by Mitasova Nov. 9, 1999 - added parameter for dtens to output2d
4  */
5 #include <grass/config.h>
6 #include <stdio.h>
7 #include <grass/gis.h>
8 #include <grass/raster.h>
9 #include <grass/vector.h>
10 #include <grass/bitmap.h>
11 #include <grass/dataquad.h>
12 #include <grass/qtree.h>
13 #include <grass/dbmi.h>
14 
15 /* for resample program */
17 {
18  double x;
19  double y;
20  FCELL z;
21  double smooth;
22 };
23 
24 #ifdef POINT2D_C
25 struct line_pnts *Pnts;
26 struct line_cats *Cats2;
27 dbDriver *driver2;
28 dbString sql2;
29 struct Map_info Map2;
30 struct field_info *ff;
31 int count;
32 #else
33 extern struct line_pnts *Pnts;
34 extern struct line_cats *Cats2;
35 extern dbDriver *driver2;
36 extern dbString sql2;
37 extern struct Map_info Map2;
38 extern struct field_info *ff;
39 extern int count;
40 #endif
41 
42 struct interp_params;
43 
44 typedef int grid_calc_fn(
45  struct interp_params *, struct quaddata *, struct BM *,
46  double, double, double *, double *, double *, double *,
47  double *, double *, double *, double *, double *,
48  double *, off_t, double);
49 
50 typedef int matrix_create_fn(
51  struct interp_params *, struct triple *, int, double **, int *);
52 
53 typedef int check_points_fn(
54  struct interp_params *, struct quaddata *, double *,
55  double *, double, double, struct triple);
56 
57 typedef int secpar_fn(
58  struct interp_params *, int, int, int, struct BM *,
59  double *, double *, double *, double *, double *,
60  double *, int, int);
61 
62 typedef double interp_fn(double, double);
63 
64 typedef int interpder_fn(double, double, double *, double *);
65 
66 typedef int wr_temp_fn(struct interp_params *, int, int, off_t);
67 
69 {
70  double zmult;
71  FILE *fdinp;
72  int elatt;
73  int smatt;
74  int kmin;
75  int kmax;
76  char *maskmap;
77  int nsizr, nsizc;
78  DCELL *az, *adx, *ady,
79  *adxx, *adyy, *adxy;
80  double fi;
81  int KMAX2;
82  int scik1, scik2, scik3;
83  double rsm;
84  char *elev, *slope, *aspect,
85  *pcurv, *tcurv, *mcurv;
86  double dmin;
87  double x_orig, y_orig;
88  int deriv, cv;
89  double theta;
90  double scalex;
91  struct TimeStamp *ts;
92  FILE *Tmp_fd_z, *Tmp_fd_dx,
93  *Tmp_fd_dy, *Tmp_fd_xx,
94  *Tmp_fd_yy, *Tmp_fd_xy;
95  FILE *fddevi;
104  const char *wheresql;
105 };
106 
107 /* distance.c */
108 double IL_dist_square(double *, double *, int);
109 
110 /* func2d.c */
111 double IL_crst(double, double);
112 int IL_crstg(double, double, double *, double *);
113 
114 /* init2d.c */
115 void IL_init_params_2d(struct interp_params *, FILE *, int, int, double,
116  int, int, char *, int, int,
117  DCELL *, DCELL *, DCELL *, DCELL *, DCELL *, DCELL *,
118  double, int, int, int, int, double,
119  char *, char *, char *, char *, char *, char *,
120  double, double, double, int, double, double,
121  FILE *, FILE *, FILE *, FILE *, FILE *, FILE *, FILE *,
122  struct TimeStamp *, int, const char *);
123 
127 /* input2d.c */
128 int IL_input_data_2d(struct interp_params *, struct tree_info *, double *,
129  double *, double *, double *, double *, double *, int *);
130 struct BM *IL_create_bitmask(struct interp_params *);
131 int translate_quad(struct multtree *, double, double, double, int);
132 
133 /* interp2d.c */
134 int IL_grid_calc_2d(struct interp_params *, struct quaddata *, struct BM *,
135  double, double, double *, double *, double *, double *,
136  double *, double *, double *, double *, double *,
137  double *, off_t, double);
138 /* matrix.c */
139 int IL_matrix_create(struct interp_params *, struct triple *, int, double **,
140  int *);
141 /* minmax.c */
142 int min1(int, int);
143 int max1(int, int);
144 double amax1(double, double);
145 double amin1(double, double);
146 
147 /* newsegm2d.c */
148 int IL_interp_segments_new_2d(struct interp_params *, struct tree_info *,
149  struct multtree *, struct BM *, double, double,
150  double *, double *, double *, double *,
151  double *, double *, double *, double *,
152  double *, int, int, double);
153 /* output2d.c */
154 int IL_output_2d(struct interp_params *, struct Cell_head *, double, double,
155  double, double, double, double, double, double, double,
156  double, double, char *, double, int, int, int);
157 /* point2d.c */
158 int IL_check_at_points_2d(struct interp_params *, struct quaddata *, double *,
159  double *, double, double, struct triple);
160 /* resout2d.c */
161 /* resout2dmod.c */
162 int IL_resample_output_2d(struct interp_params *, double, double, double,
163  double, double, double, double, double, double,
164  double, double, char *, double *,
165  struct Cell_head *, struct Cell_head *, char *,
166  int);
167 /* ressegm2d.c */
168 int IL_resample_interp_segments_2d(struct interp_params *, struct BM *,
169  double, double, double *, double *,
170  double *, double *, double *, double *,
171  double *, double *, double *, off_t,
172  double *, int, int, int, int, int, double,
173  double, double, double, int);
174 /* secpar2d.c */
175 int IL_secpar_loop_2d(struct interp_params *, int, int, int, struct BM *,
176  double *, double *, double *, double *, double *,
177  double *, int, int);
178 /* segmen2d.c */
179 int IL_interp_segments_2d(struct interp_params *, struct tree_info *,
180  struct multtree *, struct BM *, double, double,
181  double *, double *, double *, double *, double *,
182  double *, double *, double *, double *, int, off_t,
183  double);
184 /* vinput2d.c */
185 int IL_vector_input_data_2d(struct interp_params *, struct Map_info *, int,
186  char *, char *, struct tree_info *, double *,
187  double *, double *, double *, double *, double *,
188  int *, double *);
189 int process_point(double, double, double, double, struct tree_info *, double,
190  double *, double *, double *, double *, double *, double *,
191  int *, int *, int *);
192 /* write2d.c */
193 int IL_write_temp_2d(struct interp_params *, int, int, off_t);
interp_fn * interp
Definition: interpf.h:101
double y
Definition: interpf.h:19
void IL_init_params_2d(struct interp_params *, FILE *, int, int, double, int, int, char *, int, int, DCELL *, DCELL *, DCELL *, DCELL *, DCELL *, DCELL *, double, int, int, int, int, double, char *, char *, char *, char *, char *, char *, double, double, double, int, double, double, FILE *, FILE *, FILE *, FILE *, FILE *, FILE *, FILE *, struct TimeStamp *, int, const char *)
Definition: init2d.c:31
int interpder_fn(double, double, double *, double *)
Definition: interpf.h:64
double rsm
Definition: interpf.h:83
interpder_fn * interpder
Definition: interpf.h:102
double scalex
Definition: interpf.h:90
dbString sql2
int count
double theta
Definition: interpf.h:89
matrix_create_fn * matrix_create
Definition: interpf.h:98
int IL_matrix_create(struct interp_params *, struct triple *, int, double **, int *)
Creates system of linear equations from interpolated points.
Definition: matrix.c:53
double amax1(double, double)
Definition: minmax.c:54
double y_orig
Definition: interpf.h:87
int process_point(double, double, double, double, struct tree_info *, double, double *, double *, double *, double *, double *, double *, int *, int *, int *)
Definition: vinput2d.c:306
int IL_crstg(double, double, double *, double *)
Definition: func2d.c:106
int IL_input_data_2d(struct interp_params *, struct tree_info *, double *, double *, double *, double *, double *, double *, int *)
int IL_check_at_points_2d(struct interp_params *, struct quaddata *, double *, double *, double, double, struct triple)
Definition: point2d.c:53
const char * wheresql
Definition: interpf.h:104
int wr_temp_fn(struct interp_params *, int, int, off_t)
Definition: interpf.h:66
secpar_fn * secpar
Definition: interpf.h:100
int IL_secpar_loop_2d(struct interp_params *, int, int, int, struct BM *, double *, double *, double *, double *, double *, double *, int, int)
Definition: secpar2d.c:39
int translate_quad(struct multtree *, double, double, double, int)
Definition: input2d.c:92
int check_points_fn(struct interp_params *, struct quaddata *, double *, double *, double, double, struct triple)
Definition: interpf.h:53
int IL_interp_segments_2d(struct interp_params *, struct tree_info *, struct multtree *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, int, off_t, double)
Definition: segmen2d.c:49
FILE * fddevi
Definition: interpf.h:95
grid_calc_fn * grid_calc
Definition: interpf.h:97
dbDriver * driver2
int IL_write_temp_2d(struct interp_params *, int, int, off_t)
Definition: write2d.c:36
check_points_fn * check_points
Definition: interpf.h:99
int grid_calc_fn(struct interp_params *, struct quaddata *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, off_t, double)
Definition: interpf.h:44
int IL_grid_calc_2d(struct interp_params *, struct quaddata *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, off_t, double)
Definition: interp2d.c:65
int IL_output_2d(struct interp_params *, struct Cell_head *, double, double, double, double, double, double, double, double, double, double, double, char *, double, int, int, int)
Definition: output2d.c:59
struct field_info * ff
DCELL * az
Definition: interpf.h:78
double x
Definition: interpf.h:18
double fi
Definition: interpf.h:80
int secpar_fn(struct interp_params *, int, int, int, struct BM *, double *, double *, double *, double *, double *, double *, int, int)
Definition: interpf.h:57
int IL_resample_interp_segments_2d(struct interp_params *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, off_t, double *, int, int, int, int, int, double, double, double, double, int)
Definition: ressegm2d.c:35
int matrix_create_fn(struct interp_params *, struct triple *, int, double **, int *)
Definition: interpf.h:50
double amin1(double, double)
Definition: minmax.c:67
char * tcurv
Definition: interpf.h:84
double IL_crst(double, double)
Definition: func2d.c:48
int IL_resample_output_2d(struct interp_params *, double, double, double, double, double, double, double, double, double, double, double, char *, double *, struct Cell_head *, struct Cell_head *, char *, int)
Definition: resout2d.c:45
int max1(int, int)
Definition: minmax.c:32
char * maskmap
Definition: interpf.h:76
double dmin
Definition: interpf.h:86
FILE * fdinp
Definition: interpf.h:71
wr_temp_fn * wr_temp
Definition: interpf.h:103
FILE * Tmp_fd_z
Definition: interpf.h:92
double zmult
Definition: interpf.h:70
Definition: qtree.h:56
void IL_init_func_2d(struct interp_params *, grid_calc_fn *, matrix_create_fn *, check_points_fn *, secpar_fn *, interp_fn *, interpder_fn *, wr_temp_fn *)
Definition: init2d.c:109
struct TimeStamp * ts
Definition: interpf.h:91
struct line_pnts * Pnts
double smooth
Definition: interpf.h:21
int IL_vector_input_data_2d(struct interp_params *, struct Map_info *, int, char *, char *, struct tree_info *, double *, double *, double *, double *, double *, double *, int *, double *)
Definition: vinput2d.c:51
struct BM * IL_create_bitmask(struct interp_params *)
Definition: input2d.c:40
double IL_dist_square(double *, double *, int)
int min1(int, int)
Definition: minmax.c:18
double interp_fn(double, double)
Definition: interpf.h:62
struct Map_info Map2
int IL_interp_segments_new_2d(struct interp_params *, struct tree_info *, struct multtree *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, int, int, double)
struct line_cats * Cats2
FCELL z
Definition: interpf.h:20