GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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/Vect.h>
6 #include <grass/bitmap.h>
7 #include <grass/dataquad.h>
8 #include <grass/qtree.h>
9 #include <grass/dbmi.h>
10 
11 /* for resample program */
13 {
14  double x;
15  double y;
16  FCELL z;
17  double smooth;
18 };
19 
20 #ifdef POINT2D_C
21 struct line_pnts *Pnts;
22 struct line_cats *Cats2;
23 dbDriver *driver2;
24 dbString sql2;
25 struct Map_info Map2;
26 struct field_info *ff;
27 int count;
28 #else
29 extern struct line_pnts *Pnts;
30 extern struct line_cats *Cats2;
31 extern dbDriver *driver2;
32 extern dbString sql2;
33 extern struct Map_info Map2;
34 extern struct field_info *ff;
35 extern int count;
36 #endif
37 
39 {
40  double zmult; /* multiplier for z-values */
41  FILE *fdinp; /* input stream */
42  int elatt; /* which floating point attr to use? first = 1, second = 2, etc */
43  int smatt; /* which floating point attr to use for smoothing? first = 1, second = 2, etc */
44  int kmin; /* min number of points per segment for interpolation */
45  int kmax; /* max number of points per segment */
46  char *maskmap; /* name of mask */
47  int nsizr, nsizc; /* number of rows and columns */
48  DCELL *az, *adx, *ady, *adxx, *adyy, *adxy; /* array for interpolated values */
49  double fi; /* tension */
50  int KMAX2; /* max num. of points for interp. */
51  int scik1, scik2, scik3; /* multipliers for interp. values */
52  double rsm; /* smoothing */
53  char *elev, *slope, *aspect, *pcurv, *tcurv, *mcurv; /* output files */
54  double dmin; /* min distance between points */
55  double x_orig, y_orig; /* origin */
56  int deriv, cv; /* 1 if compute partial derivs */
57  double theta; /* anisotropy angle, 0=East,counter-clockwise */
58  double scalex; /* anisotropy scaling factor */
59  struct TimeStamp *ts; /* timestamp for raster files */
60  FILE *Tmp_fd_z, *Tmp_fd_dx, *Tmp_fd_dy, /* temp files for writing interp. */
61  *Tmp_fd_xx, *Tmp_fd_yy, *Tmp_fd_xy; /* values */
62  FILE *fddevi; /* pointer to deviations file */
63 
64  int (*grid_calc) (); /*calculates grid for given segm */
65  int (*matrix_create) (); /*creates matrix for a given segm */
66  int (*check_points) (); /*checks interp. func. at points */
67  int (*secpar) (); /* calculates aspect,slope,curv. */
68  double (*interp) (); /* radial based interp. function */
69  int (*interpder) (); /* interp. func. for derivatives */
70  int (*wr_temp) (); /* writes temp files */
71  char *wheresql; /* SQL statement to select input points */
72 };
73 
74 /* distance.c */
75 double IL_dist_square(double *, double *, int);
76 
77 /* func2d.c */
78 double IL_crst(double, double);
79 int IL_crstg(double, double, double *, double *);
80 
81 /* init2d.c */
82 void IL_init_params_2d(struct interp_params *, FILE *, int, int, double,
83  int, int, char *, int, int,
84  DCELL *, DCELL *, DCELL *, DCELL *, DCELL *, DCELL *,
85  double, int, int, int, int, double,
86  char *, char *, char *, char *, char *, char *,
87  double, double, double, int, double, double,
88  FILE *, FILE *, FILE *, FILE *, FILE *, FILE *, FILE *,
89  struct TimeStamp *, int, char *);
90 
91 void IL_init_func_2d(struct interp_params *, int (*)(), int (*)(), int (*)(),
92  int (*)(), double (*)(), int (*)(), int (*)());
93 /* input2d.c */
94 int IL_input_data_2d(struct interp_params *, struct tree_info *, double *,
95  double *, double *, double *, double *, double *, int *);
96 struct BM *IL_create_bitmask(struct interp_params *);
97 int translate_quad(struct multtree *, double, double, double, int);
98 
99 /* interp2d.c */
100 int IL_grid_calc_2d(struct interp_params *, struct quaddata *, struct BM *,
101  double, double, double *, double *, double *, double *,
102  double *, double *, double *, double *, double *,
103  double *, int, double);
104 /* matrix.c */
105 int IL_matrix_create(struct interp_params *, struct triple *, int, double **,
106  int *);
107 /* minmax.c */
108 int min1(int, int);
109 int max1(int, int);
110 double amax1(double, double);
111 double amin1(double, double);
112 
113 /* newsegm2d.c */
114 int IL_interp_segments_new_2d(struct interp_params *, struct tree_info *,
115  struct multtree *, struct BM *, double, double,
116  double *, double *, double *, double *,
117  double *, double *, double *, double *,
118  double *, int, int, double);
119 /* output2d.c */
120 int IL_output_2d(struct interp_params *, struct Cell_head *, double, double,
121  double, double, double, double, double, double, double,
122  double, double, char *, double, int, int, int);
123 /* point2d.c */
124 int IL_check_at_points_2d(struct interp_params *, struct quaddata *, double *,
125  double *, double, double, struct triple);
126 /* resout2d.c */
127 /* resout2dmod.c */
128 int IL_resample_output_2d(struct interp_params *, double, double, double,
129  double, double, double, double, double, double,
130  double, double, char *, double *,
131  struct Cell_head *, struct Cell_head *, char *,
132  int);
133 /* ressegm2d.c */
134 int IL_resample_interp_segments_2d(struct interp_params *, struct BM *,
135  double, double, double *, double *,
136  double *, double *, double *, double *,
137  double *, double *, double *, int,
138  double *, int, int, int, int, int, double,
139  double, double, double, int);
140 /* secpar2d.c */
141 int IL_secpar_loop_2d(struct interp_params *, int, int, int, struct BM *,
142  double *, double *, double *, double *, double *,
143  double *, int, int);
144 /* segmen2d.c */
145 int IL_interp_segments_2d(struct interp_params *, struct tree_info *,
146  struct multtree *, struct BM *, double, double,
147  double *, double *, double *, double *, double *,
148  double *, double *, double *, double *, int, int,
149  double);
150 /* vinput2d.c */
151 int IL_vector_input_data_2d(struct interp_params *, struct Map_info *, int,
152  char *, char *, struct tree_info *, double *,
153  double *, double *, double *, double *, double *,
154  int *, double *);
155 int process_point(double, double, double, double, struct tree_info *, double,
156  double *, double *, double *, double *, double *, double *,
157  int *, int *, int *);
158 /* write2d.c */
159 int IL_write_temp_2d(struct interp_params *, int, int, int);
int IL_crstg(double r, double fi, double *gd1, double *gd2)
Definition: func2d.c:85
double y
Definition: interpf.h:15
double rsm
Definition: interpf.h:52
int(* secpar)()
Definition: interpf.h:67
double scalex
Definition: interpf.h:58
dbString sql2
char * mcurv
Definition: interpf.h:53
FILE * Tmp_fd_xy
Definition: interpf.h:60
FILE * Tmp_fd_yy
Definition: interpf.h:60
int(* wr_temp)()
Definition: interpf.h:70
int count
double theta
Definition: interpf.h:57
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, int, double)
Definition: segmen2d.c:16
int IL_matrix_create(struct interp_params *, struct triple *, int, double **, int *)
Definition: matrix.c:30
double amax1(double, double)
Definition: minmax.c:54
DCELL * adxx
Definition: interpf.h:48
double y_orig
Definition: interpf.h:55
char * elev
Definition: interpf.h:53
char * pcurv
Definition: interpf.h:53
int process_point(double, double, double, double, struct tree_info *, double, double *, double *, double *, double *, double *, double *, int *, int *, int *)
Definition: vinput2d.c:364
int(* interpder)()
Definition: interpf.h:69
int IL_input_data_2d(struct interp_params *, struct tree_info *, double *, double *, double *, double *, double *, double *, int *)
void IL_init_params_2d(struct interp_params *params, FILE *inp, int elatt, int smatt, double zm, int k1, int k2, char *msk, int rows, int cols, DCELL *ar1, DCELL *ar2, DCELL *ar3, DCELL *ar4, DCELL *ar5, DCELL *ar6, double tension, int k3, int sc1, int sc2, int sc3, double sm, char *f1, char *f2, char *f3, char *f4, char *f5, char *f6, double dm, double x_or, double y_or, int der, double tet, double scl, FILE *t1, FILE *t2, FILE *t3, FILE *t4, FILE *t5, FILE *t6, FILE *dev, struct TimeStamp *ts, int c, char *wheresql)
Definition: init2d.c:19
double(* interp)()
Definition: interpf.h:68
struct BM * IL_create_bitmask(struct interp_params *params)
Definition: input2d.c:27
FILE * Tmp_fd_xx
Definition: interpf.h:60
int translate_quad(struct multtree *tree, double numberx, double numbery, double numberz, int n_leafs)
Definition: input2d.c:77
int IL_check_at_points_2d(struct interp_params *, struct quaddata *, double *, double *, double, double, struct triple)
Definition: point2d.c:41
DCELL * adx
Definition: interpf.h:48
void IL_init_func_2d(struct interp_params *params, int(*grid_f)(void), int(*matr_f)(void), int(*point_f)(void), int(*secp_f)(void), double(*interp_f)(void), int(*interpder_f)(void), int(*temp_f)(void))
Definition: init2d.c:93
double IL_crst(double r, double fi)
Definition: func2d.c:29
int IL_secpar_loop_2d(struct interp_params *, int, int, int, struct BM *, double *, double *, double *, double *, double *, double *, int, int)
Definition: secpar2d.c:22
FILE * fddevi
Definition: interpf.h:62
dbDriver * driver2
FILE * Tmp_fd_dx
Definition: interpf.h:60
int(* matrix_create)()
Definition: interpf.h:65
char * aspect
Definition: interpf.h:53
double IL_dist_square(double *pt1, double *pt2, int dim)
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:29
struct field_info * ff
DCELL * az
Definition: interpf.h:48
double x
Definition: interpf.h:14
int
Definition: g3dcolor.c:48
double fi
Definition: interpf.h:49
double x_orig
Definition: interpf.h:55
int IL_resample_interp_segments_2d(struct interp_params *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, int, double *, int, int, int, int, int, double, double, double, double, int)
Definition: ressegm2d.c:33
double amin1(double, double)
Definition: minmax.c:67
char * tcurv
Definition: interpf.h:53
DCELL * ady
Definition: interpf.h:48
FILE * Tmp_fd_dy
Definition: interpf.h:60
int IL_grid_calc_2d(struct interp_params *params, struct quaddata *data, struct BM *bitmask, double zmin, double zmax, double *zminac, double *zmaxac, double *gmin, double *gmax, double *c1min, double *c1max, double *c2min, double *c2max, double *ertot, double *b, int offset1, double dnorm)
Definition: interp2d.c:39
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:27
int max1(int, int)
Definition: minmax.c:32
char * maskmap
Definition: interpf.h:46
double dmin
Definition: interpf.h:54
FILE * fdinp
Definition: interpf.h:41
FILE * Tmp_fd_z
Definition: interpf.h:60
double zmult
Definition: interpf.h:40
Definition: qtree.h:38
int IL_write_temp_2d(struct interp_params *, int, int, int)
Definition: write2d.c:21
DCELL * adxy
Definition: interpf.h:48
struct TimeStamp * ts
Definition: interpf.h:59
struct line_pnts * Pnts
double smooth
Definition: interpf.h:17
int(* check_points)()
Definition: interpf.h:66
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:27
int(* grid_calc)()
Definition: interpf.h:64
char * wheresql
Definition: interpf.h:71
int min1(int, int)
Definition: minmax.c:18
struct Map_info Map2
char * slope
Definition: interpf.h:53
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:16
DCELL * adyy
Definition: interpf.h:48