dlg.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. struct dlg_node
  2. {
  3. double x;
  4. double y;
  5. int n_lines;
  6. int n_atts;
  7. int n_lines_alloc;
  8. int n_atts_alloc;
  9. int *lines;
  10. int *atts;
  11. };
  12. struct dlg_area
  13. {
  14. double x;
  15. double y;
  16. int n_lines;
  17. int n_atts;
  18. int n_isles;
  19. int n_lines_alloc;
  20. int n_atts_alloc;
  21. int *lines;
  22. int *atts;
  23. };
  24. struct dlg_line
  25. {
  26. int start_node;
  27. int end_node;
  28. int left_area;
  29. int right_area;
  30. int n_coors;
  31. int n_atts;
  32. int n_coors_alloc;
  33. int n_atts_alloc;
  34. int *atts;
  35. double *coors;
  36. double N;
  37. double S;
  38. double E;
  39. double W;
  40. };
  41. struct dlg_head
  42. {
  43. int nlines;
  44. char banner[73];
  45. char cart_unit[41];
  46. char source_date[11];
  47. char orig_scale[9];
  48. char line_3[73];
  49. int level_code;
  50. int plani_code;
  51. int plani_zone;
  52. int plani_units;
  53. double resolution;
  54. int trans_param;
  55. int misc_records;
  56. int num_sides;
  57. int num_cats;
  58. };
  59. struct dlg_coors
  60. {
  61. double lat[4];
  62. double lon[4];
  63. double utm_n[4];
  64. double utm_e[4];
  65. };
  66. struct dlg_proj
  67. {
  68. double params[15];
  69. double int_params[4];
  70. };
  71. struct dlg_cats
  72. {
  73. int read;
  74. char name[21];
  75. int form_code;
  76. int num_nodes;
  77. int act_nodes;
  78. int nta_link;
  79. int ntl_link;
  80. int num_areas;
  81. int act_areas;
  82. int atn_link;
  83. int atl_link;
  84. int area_list;
  85. int num_lines;
  86. int act_lines;
  87. int line_list;
  88. };
  89. struct dlg
  90. {
  91. struct dlg_head head;
  92. struct dlg_cats cats;
  93. struct dlg_coors coors;
  94. struct dlg_proj proj;
  95. struct dlg_line line;
  96. struct dlg_area area;
  97. struct dlg_node node;
  98. long *node_off;
  99. long *area_off;
  100. long *line_off;
  101. int node_alloc;
  102. int area_alloc;
  103. int line_alloc;
  104. int max_nodes;
  105. int max_areas;
  106. int max_lines;
  107. };
  108. #define SW 0
  109. #define NW 1
  110. #define NE 2
  111. #define SE 3
  112. /* this will be stored as a double on mass, sun and 3b2's */
  113. #define ISLAND_MARKER -99999999.
  114. /* Need a definition for FILE */
  115. #include <stdio.h>
  116. int dlg_init(FILE *, struct dlg *);
  117. int dlg_read(FILE *, struct dlg *);
  118. int _dlg_read_node(struct dlg_node *, FILE *);
  119. int _dlg_read_area(struct dlg_area *, FILE *);
  120. int _dlg_read_line(struct dlg_line *, FILE *);
  121. int _dlg_write_area(struct dlg_area *, FILE *);
  122. int dlg_write_header(FILE *, struct dlg *);
  123. int _dlg_write_line(struct dlg_line *, FILE *);
  124. int _dlg_write_node(struct dlg_node *, FILE *);
  125. int dlg_read_whole_area(FILE *, struct dlg *, int, double **, double **,
  126. int *, int *);
  127. int dlg_read_area(FILE *, struct dlg *, int);
  128. int dlg_read_line(FILE *, struct dlg *, int);
  129. int dlg_read_node(FILE *, struct dlg *, int);
  130. int dlg_read_int(FILE *, int, int **);
  131. int dlg_write_int(FILE *, int, int *);
  132. int dlg_write_double(FILE *, int, double *);
  133. int dlg_write_area(FILE *, struct dlg *, int);
  134. int dlg_write_line(FILE *, struct dlg *, int);
  135. int dlg_write_node(FILE *, struct dlg *, int);