growing.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #include <grass/gis.h>
  2. #include <grass/vector.h>
  3. #include <grass/dbmi.h>
  4. #include <grass/raster.h>
  5. #include <grass/glocale.h>
  6. #include <grass/lidar.h>
  7. /*--------------------------------------------------------------------------*/
  8. /* Definitions for Convex-Hull algorithm */
  9. #define NR_END 1
  10. #define FREE_ARG char*
  11. #define CMPM(c,A,B) \
  12. v = (*(double**)A)[c] - (*(double**)B)[c];\
  13. if (v>0) return 1;\
  14. if (v<0) return -1;
  15. /*--------------------------------------------------------------------------*/
  16. /*STRUCTS DECLARATION */
  17. struct element_grow
  18. {
  19. double interp; /* Interpolated value */
  20. int fi; /* Interpolated value counter */
  21. int bordo; /* Border point */
  22. int dueImp; /* Double impulse point */
  23. double orig; /* Original value */
  24. int fo; /* Original value counter */
  25. double clas; /* Classification */
  26. int fc; /* Classification counter */
  27. int obj; /* Object counter */
  28. };
  29. /*--------------------------------------------------------------------------*/
  30. /*FUNCTIONS DECLARATION */
  31. void P_Aux_to_Coor(struct Map_info *, /**/
  32. struct Map_info *, /**/ dbDriver *, /**/ FILE * /**/);
  33. /* Convex-Hull */
  34. struct element_grow **P_alloc_element(int, int);
  35. double **Pvector(long, long);
  36. double pianOriz(double **, int, double *, double *, double *, double *,
  37. struct element_grow **, int);
  38. void nrerror(char error_text[]);
  39. void regGrow8(struct Cell_head, struct element_grow **, double **, int *, int,
  40. int, int, double, int);
  41. int checkHull(int, int, double **, int);
  42. int ch2d(double **, int);
  43. int ccw(double **, int, int, int);
  44. int cmpl(const void *, const void *);
  45. int cmph(const void *, const void *);
  46. struct element_grow **structMatrix(long, long, long, long);
  47. void free_Pvector(double **, long, long);
  48. void free_structmatrix(struct element_grow **, long, long, long, long);