vedit.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #ifndef GRASS_VEDIT_H
  2. #define GRASS_VEDIT_H
  3. #include <grass/gis.h>
  4. #include <grass/vector.h>
  5. #define NO_SNAP 0 /* snapping disabled */
  6. #define SNAP 1 /* snapping enabled for nodes */
  7. #define SNAPVERTEX 2 /* snapping enabled for vertex also */
  8. #define QUERY_UNKNOWN -1
  9. #define QUERY_LENGTH 0 /* select by line length */
  10. #define QUERY_DANGLE 1 /* select dangles */
  11. /* used by Vedit_render_map() */
  12. #define TYPE_POINT 0x01
  13. #define TYPE_LINE 0x02
  14. #define TYPE_BOUNDARYNO 0x04
  15. #define TYPE_BOUNDARYTWO 0x08
  16. #define TYPE_BOUNDARYONE 0x10
  17. #define TYPE_CENTROIDIN 0x20
  18. #define TYPE_CENTROIDOUT 0x40
  19. #define TYPE_CENTROIDDUP 0x80
  20. #define TYPE_NODEONE 0x100
  21. #define TYPE_NODETWO 0x200
  22. #define TYPE_VERTEX 0x400
  23. #define TYPE_AREA 0x800
  24. #define TYPE_ISLE 0x1000
  25. #define TYPE_DIRECTION 0x2000
  26. #define DRAW_POINT 0x01
  27. #define DRAW_LINE 0x02
  28. #define DRAW_BOUNDARYNO 0x04
  29. #define DRAW_BOUNDARYTWO 0x08
  30. #define DRAW_BOUNDARYONE 0x10
  31. #define DRAW_CENTROIDIN 0x20
  32. #define DRAW_CENTROIDOUT 0x40
  33. #define DRAW_CENTROIDDUP 0x80
  34. #define DRAW_NODEONE 0x100
  35. #define DRAW_NODETWO 0x200
  36. #define DRAW_VERTEX 0x400
  37. #define DRAW_AREA 0x800
  38. #define DRAW_DIRECTION 0x1000
  39. struct rpoint {
  40. /* screen coordinates */
  41. int x, y;
  42. };
  43. struct robject {
  44. /* object to be rendered */
  45. int fid; /* feature id */
  46. int type;
  47. int npoints;
  48. struct rpoint *point; /* list of points */
  49. };
  50. struct robject_list {
  51. /* list of objects to be rendered */
  52. int nitems;
  53. struct robject **item;
  54. };
  55. /* break.c */
  56. int Vedit_split_lines(struct Map_info *, struct ilist *,
  57. struct line_pnts *, double, struct ilist *);
  58. int Vedit_connect_lines(struct Map_info *, struct ilist *, double);
  59. /* cats.c */
  60. int Vedit_modify_cats(struct Map_info *, struct ilist *,
  61. int, int, struct cat_list *);
  62. /* copy.c */
  63. int Vedit_copy_lines(struct Map_info *, struct Map_info *, struct ilist *);
  64. /* chtype.c */
  65. int Vedit_chtype_lines(struct Map_info *, struct ilist *);
  66. /* delete.c */
  67. int Vedit_delete_lines(struct Map_info *, struct ilist *);
  68. /* distance.c */
  69. double Vedit_get_min_distance(struct line_pnts *, struct line_pnts *,
  70. int, int *);
  71. /* flip.c */
  72. int Vedit_flip_lines(struct Map_info *, struct ilist *);
  73. /* merge.c */
  74. int Vedit_merge_lines(struct Map_info *, struct ilist *);
  75. /* move.c */
  76. int Vedit_move_lines(struct Map_info *, struct Map_info **, int,
  77. struct ilist *, double, double, double, int, double);
  78. /* render.c */
  79. struct robject_list *Vedit_render_map(struct Map_info *, struct bound_box *, int,
  80. double, double, int, int, double);
  81. /* select.c */
  82. int Vedit_select_by_query(struct Map_info *,
  83. int, int, double, int, struct ilist *);
  84. /* snap.c */
  85. int Vedit_snap_point(struct Map_info *,
  86. int, double *, double *, double *, double, int);
  87. int Vedit_snap_line(struct Map_info *, struct Map_info **, int,
  88. int, struct line_pnts *, double, int);
  89. int Vedit_snap_lines(struct Map_info *, struct Map_info **, int,
  90. struct ilist *, double, int);
  91. /* vertex.c */
  92. int Vedit_move_vertex(struct Map_info *, struct Map_info **, int,
  93. struct ilist *,
  94. struct line_pnts *, double, double,
  95. double, double, double, int, int);
  96. int Vedit_add_vertex(struct Map_info *Map, struct ilist *,
  97. struct line_pnts *, double);
  98. int Vedit_remove_vertex(struct Map_info *, struct ilist *,
  99. struct line_pnts *, double);
  100. /* zbulk.c */
  101. int Vedit_bulk_labeling(struct Map_info *, struct ilist *,
  102. double, double, double, double, double, double);
  103. #endif /* GRASS_VEDIT_H */