File: dlg.h

package info (click to toggle)
drawmap 2.5-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,176 kB
  • ctags: 681
  • sloc: ansic: 13,087; makefile: 90; sh: 38
file content (129 lines) | stat: -rw-r--r-- 3,795 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
 * =========================================================================
 * dlg.h - A header file to define parameters for DLG files.
 * Copyright (c) 2000  Fred M. Erickson
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 * =========================================================================
 */


#define DLG_RECORD_LENGTH		80
#define MAX_ATTRIB_RECORD_LENGTH	1000


#define	HYPSOGRAPHY		20
#define	HYDROGRAPHY		50
#define	VEG_SURFACE_COVER	70
#define	NON_VEG_FEATURES	80
#define	BOUNDARIES		90
#define	SURVEY_CONTROL		150
#define	ROADS_AND_TRAILS	170
#define	RAILROADS		180
#define	PIPE_TRANS_LINES	190
#define	MANMADE_FEATURES	200
#define	PUBLIC_LAND_SURVEYS	300

#define MAX_A_ATTRIB		100		// Maximum number of Area attributes
#define MAX_L_ATTRIB		100		// Maximum number of Line attributes
#define MAX_POLY_NUM		MAX_AREAS	// Maximum number of stored polygon attribute references
#define MAX_LINE_LIST		2000		// Maximum size of a line list for output.
#define MAX_EXTRA		8		// Maximum number of attributes per line, area, or node entry
#define MAX_ATTRIB_FILES	10		// Maximum number of SDTS attribute files that we can read in

#define MAX_LINES 25938		// Theoretical maximum number of lines in a 100K DLG file.  This number may be out of date.
#define MAX_AREAS 25960		// Theoretical maximum number of areas in a 100K DLG file.  This number may be out of date.
#define MAX_NODES 25960		// Theoretical maximum number of nodes in a 100K DLG file.  This number may be out of date.


/*
 * For storing linked lists of points.
 */
struct point  {
	double x;
	double y;
	struct point *point;
};


/*
 * Storage for attribute types.
 */
struct maj_min {
	short major;
	short minor;
};
struct attribute  {
	short major;
	short minor;
	struct attribute *attribute;
};

/*
 * The sizes of the nodes, areas, and lines arrays are their theoretical maximum values.
 * It would probably be cooler to malloc() these as we go, but coolness was not an
 * objective of this program.  It would still be cool to read the maximum values from
 * the DLG file headers and check them against the values below to verify that
 * the standards haven't changed and left this program behind.
 */
struct nodes  {
	short id;
	double x;
	double y;
	short number_attrib;
	struct attribute *attribute;
};

struct areas  {
	short id;
	double x;
	double y;
	short number_attrib;
	struct attribute *attribute;
};

struct lines  {
	short id;
	short start_node;
	short end_node;
	short left_area;
	short right_area;
	short number_coords;
	struct point *point;
	short number_attrib;
	struct attribute *attribute;
};


/*
 * Arrays to keep track of attributes from various SDTS files.
 */
struct attribute_list  {
	short major[MAX_EXTRA];
	short minor[MAX_EXTRA];
};
struct polygon_attrib  {
	short poly_id;
	long attrib;
	char module_num;
};



void fill_area(struct datum *, double, double, long, struct image_corners *);
void process_dlg_optional(int, int, struct image_corners *, long);
long process_dlg_sdts(char *, char *, long, struct image_corners *, long, long);
void draw_lines(struct datum *, struct point *, long, struct image_corners *);
void process_attrib(char *);