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

« back to all changes in this revision

Viewing changes to vector/lidar/lidarlib/PolimiFunct.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
 
 
2
 
/***********************************************************************
3
 
 *
4
 
 * MODULE:       lidarlib
5
 
 *
6
 
 * AUTHOR(S):    Roberto Antolin
7
 
 *
8
 
 * PURPOSE:      LIDAR library
9
 
 *
10
 
 * COPYRIGHT:    (C) 2006 by Politecnico di Milano -
11
 
 *                           Polo Regionale di Como
12
 
 *
13
 
 *               This program is free software under the
14
 
 *               GNU General Public License (>=v2).
15
 
 *               Read the file COPYING that comes with GRASS
16
 
 *               for details.
17
 
 *
18
 
 **************************************************************************/
19
 
 
20
 
#ifndef _POLIMIFUNCT_H_
21
 
#define _POLIMIFUNCT_H_
22
 
 
23
 
#include <grass/config.h>
24
 
#include <grass/gis.h>
25
 
#include <grass/Vect.h>
26
 
#include <grass/dbmi.h>
27
 
#include <grass/glocale.h>
28
 
#include <grass/gmath.h>
29
 
 
30
 
/*----------------------------------------------------------------------------------------------------------*/
31
 
/*CONSTANTS DECLARATION */
32
 
 
33
 
#define NSPLX_MAX             150       /* Maximum number of splines along East direction used in the subregions interpolation */
34
 
#define NSPLY_MAX             150       /* Maximum number of splines along North direction used in the subregions interpolation */
35
 
#define OVERLAP_SIZE           10       /* Subregions overlapping size. */
36
 
#define LATO                 1000       /* Side's size for v.lidar.growing. */
37
 
#define CONTOUR                15       /**/
38
 
#define GENERAL_ROW             0
39
 
#define GENERAL_COLUMN          1
40
 
#define FIRST_ROW               2
41
 
#define LAST_ROW                3
42
 
#define FIRST_COLUMN            4
43
 
#define LAST_COLUMN             5
44
 
    /* FIELDS ID */
45
 
#define F_EDGE_DETECTION_CLASS  1
46
 
#define F_CLASSIFICATION        2
47
 
#define F_INTERPOLATION         3
48
 
#define F_COUNTER_OBJ           4
49
 
    /* PRE-CLASSIFICATION */
50
 
#define PRE_TERRAIN             1
51
 
#define PRE_EDGE                2
52
 
#define PRE_UNKNOWN             3
53
 
    /* FINAL CLASSIFICATION */
54
 
#define TERRAIN_SINGLE          1
55
 
#define TERRAIN_DOUBLE          2
56
 
#define OBJECT_DOUBLE           3
57
 
#define OBJECT_SINGLE           4
58
 
    /* SINGLE OR DOUBLE PULSE */
59
 
#define SINGLE_PULSE            1
60
 
#define DOUBLE_PULSE            2
61
 
    /* INTERPOLATOR */
62
 
#define P_BILINEAR              1
63
 
#define P_BICUBIC               0
64
 
    /* Boolean definitions */
65
 
#define TRUE                    1
66
 
#define FALSE                   0
67
 
 
68
 
/*----------------------------------------------------------------------------------------------------------*/
69
 
    /*STRUCTS DECLARATION */
70
 
    struct Reg_dimens
71
 
{
72
 
    double orlo_h;              /*Horizontal tile edge */
73
 
    double orlo_v;              /*Vertical tile edge */
74
 
    double overlap;             /*Tile's overlapping size */
75
 
    double latoN;               /*South-North side size */
76
 
    double latoE;               /*East-West side size */
77
 
};
78
 
 
79
 
struct Point
80
 
{
81
 
    double coordX;
82
 
    double coordY;
83
 
    double coordZ;
84
 
    int lineID;
85
 
    int cat;
86
 
};
87
 
 
88
 
struct element
89
 
{
90
 
    double value;
91
 
    double residual;
92
 
    int freq;
93
 
};
94
 
 
95
 
/*----------------------------------------------------------------------------------------------------------*/
96
 
/*FUNCTIONS DECLARATION */
97
 
/*zones */
98
 
void P_zero_dim(struct Reg_dimens * /**/);
99
 
int P_set_dim(struct Reg_dimens *, double, double, int *, int *);
100
 
 
101
 
int P_set_regions(struct Cell_head *, /**/
102
 
                  BOUND_BOX *, /**/
103
 
                  BOUND_BOX *, /**/ struct Reg_dimens, /**/ int /**/);
104
 
 
105
 
int P_get_orlo(int, /**/ struct Reg_dimens *, /**/ double, /**/ double /**/);
106
 
 
107
 
int P_get_BandWidth(int, /**/ int /**/);
108
 
 
109
 
double P_estimate_splinestep(struct Map_info *, double *, double *);
110
 
 
111
 
struct Point *P_Read_Vector_Region_Map(struct Map_info *, /**/
112
 
                                       struct Cell_head *, /**/
113
 
                                       int *, /**/ int, /**/ int /**/);
114
 
 
115
 
double P_Mean_Calc(struct Cell_head *, /**/ struct Point *, /**/ int /**/);
116
 
 
117
 
/*----------------------------------------------------------------------------------------------------------*/
118
 
void
119
 
P_Sparse_Points(struct Map_info *, /**/
120
 
                struct Cell_head *, /**/
121
 
                BOUND_BOX, /**/
122
 
                BOUND_BOX, /**/
123
 
                double **, /**/
124
 
                double *, /**/
125
 
                int *, /**/
126
 
                double, /**/
127
 
                double, /**/
128
 
                double, /**/
129
 
                int, /**/
130
 
                int, /**/
131
 
                int, /**/
132
 
                int, /**/
133
 
                struct line_cats *, /**/
134
 
                dbDriver *, /**/ double, /**/ char * /**/);
135
 
 
136
 
double **P_Regular_Points(struct Cell_head *, /**/
137
 
                          BOUND_BOX, /**/
138
 
                          BOUND_BOX, /**/
139
 
                          double **, /**/
140
 
                          double *, /**/
141
 
                          double, /**/
142
 
                          double, /**/
143
 
                          double, /**/
144
 
                          double, /**/
145
 
                          int, /**/ int, /**/ int, /**/ int, /**/ int /**/);
146
 
 
147
 
/*----------------------------------------------------------------------------------------------------------*/
148
 
int P_Create_Aux2_Table(dbDriver *, /**/ char * /**/);
149
 
 
150
 
int P_Create_Aux4_Table(dbDriver *, /**/ char * /**/);
151
 
 
152
 
int P_Drop_Aux_Table(dbDriver *, /**/ char * /**/);
153
 
 
154
 
/*----------------------------------------------------------------------------------------------------------*/
155
 
void P_Aux_to_Raster(double **, /**/ int /**/);
156
 
 
157
 
void P_Aux_to_Vector(struct Map_info *, /**/
158
 
                     struct Map_info *, /**/ dbDriver *, /**/ char * /**/);
159
 
 
160
 
double **P_Null_Matrix(double ** /**/);
161
 
 
162
 
/*----------------------------------------------------------------------------------------------------------*/
163
 
/*tcholBand */
164
 
void tcholDec(double **N, double **T, int n, int BW);
165
 
void tcholSolve(double **N, double *TN, double *parVect, int n, int BW);
166
 
void tcholSolve2(double **N, double *TN, double **T, double *parVect, int n,
167
 
                 int BW);
168
 
void tcholInv(double **N, double *invNdiag, int n, int BW);
169
 
void tcholSolveInv(double **N, double *TN, double *invNdiag, double *parVect,
170
 
                   int n, int BW);
171
 
 
172
 
/*---------------------------------------------------------------------------------------*/
173
 
/*interpSpline */
174
 
void normalDefBicubic(double **N, double *TN, double *Q, double **obsVect,
175
 
                      double deltaX, double deltaY, int xNum, int yNum,
176
 
                      double xMin, double yMin, int obsNum, int parNum,
177
 
                      int BW);
178
 
 
179
 
void normalDefBilin(double **N, double *TN, double *Q, double **obsVect,
180
 
                    double deltaX, double deltaY, int xNum, int yNum,
181
 
                    double xMin, double yMin, int obsNum, int parNum, int BW);
182
 
 
183
 
void nCorrectLapl(double **N,   /* Normal Matrix () */
184
 
                  double lambda,        /*  */
185
 
                  int xNum,     /*  */
186
 
                  int yNum,     /*  */
187
 
                  double deltaX,        /*  */
188
 
                  double deltaY);       /*  */
189
 
 
190
 
void nCorrectGrad(double **N, double lambda, int xNum, int yNum,
191
 
                  double deltaX, double deltaY);
192
 
 
193
 
void obsEstimateBicubic(double **obsV,  /*  */
194
 
                        double *obsE,   /*  */
195
 
                        double *parV,   /*  */
196
 
                        double deltX,   /*  */
197
 
                        double deltY,   /*  */
198
 
                        int xNm,        /*  */
199
 
                        int yNm,        /*  */
200
 
                        double xMi,     /*  */
201
 
                        double yMi,     /*  */
202
 
                        int obsN);      /*  */
203
 
 
204
 
double dataInterpolateBicubic(double x, /*  */
205
 
                              double y, /*  */
206
 
                              double deltaX,    /*  */
207
 
                              double deltaY,    /*  */
208
 
                              int xNum, /*  */
209
 
                              int yNum, /*  */
210
 
                              double xMin,      /*  */
211
 
                              double yMin,      /*  */
212
 
                              double *parVect); /*  */
213
 
 
214
 
void obsEstimateBilin(double **obsV, double *obsE, double *parV, double deltX,
215
 
                      double deltY, int xNm, int yNm, double xMi, double yMi,
216
 
                      int obsN);
217
 
 
218
 
double dataInterpolateBilin(double x, double y, double deltaX, double deltaY,
219
 
                            int xNum, int yNum, double xMin, double yMin,
220
 
                            double *parVect);
221
 
 
222
 
#endif