local_proto.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #ifndef __LOCAL_PROTO_H__
  2. #define __LOCAL_PROTO_H__
  3. #include <grass/raster.h>
  4. #include "flag.h"
  5. #include "seg.h"
  6. #define GW_LARGE_INT off_t
  7. #define INDEX(r, c) ((r) * ncols + (c))
  8. #define MAXDEPTH 1000 /* maximum supported tree depth of stream network */
  9. #define POINT struct a_point
  10. POINT {
  11. int r, c;
  12. };
  13. #define HEAP_PNT struct heap_point
  14. HEAP_PNT {
  15. GW_LARGE_INT added;
  16. CELL ele;
  17. POINT pnt;
  18. };
  19. #define WAT_ALT struct wat_altitude
  20. WAT_ALT {
  21. CELL ele;
  22. DCELL wat;
  23. };
  24. #define ASP_FLAG struct aspect_flag
  25. ASP_FLAG {
  26. char asp;
  27. char flag;
  28. };
  29. struct snode
  30. {
  31. int r, c;
  32. int id;
  33. int n_trib; /* number of tributaries */
  34. int n_trib_total; /* number of all upstream stream segments */
  35. int n_alloc; /* n allocated tributaries */
  36. int *trib;
  37. };
  38. /* extern variables */
  39. extern int nrows, ncols;
  40. extern GW_LARGE_INT n_search_points, n_points, nxt_avail_pt;
  41. extern GW_LARGE_INT heap_size;
  42. extern GW_LARGE_INT n_stream_nodes, n_alloc_nodes;
  43. extern POINT *outlets;
  44. extern struct snode *stream_node;
  45. extern GW_LARGE_INT n_outlets, n_alloc_outlets;
  46. extern char drain[3][3];
  47. extern char sides;
  48. extern int c_fac;
  49. extern int ele_scale;
  50. extern int have_depressions;
  51. extern SSEG search_heap;
  52. extern SSEG astar_pts;
  53. extern SSEG watalt, aspflag;
  54. /* extern BSEG bitflags, asp; */
  55. extern CSEG stream;
  56. /* load.c */
  57. int load_maps(int, int);
  58. /* init_search.c */
  59. int init_search(int);
  60. /* do_astar.c */
  61. int do_astar(void);
  62. GW_LARGE_INT heap_add(int, int, CELL);
  63. /* streams.c */
  64. int do_accum(double);
  65. int extract_streams(double, double, int);
  66. /* thin.c */
  67. int thin_streams(void);
  68. /* basins.c */
  69. int basin_borders(void);
  70. /* del_streams.c */
  71. int del_streams(int);
  72. /* close.c */
  73. int close_maps(char *, char *, char *);
  74. #endif /* __LOCAL_PROTO_H__ */