5
int add_line(struct dxf_file *dxf, struct Map_info *Map)
5
void add_line(struct dxf_file *dxf, struct Map_info *Map)
8
char layer[DXF_BUF_SIZE];
8
char handle[DXF_BUF_SIZE]; /* entity handle, 16 hexadecimal digits */
9
char layer[DXF_BUF_SIZE]; /* layer name */
9
10
int layer_flag = 0; /* indicates if a layer name has been found */
10
11
int xflag = 0; /* indicates if a x value has been found */
11
12
int yflag = 0; /* indicates if a y value has been found */
12
13
int zflag = 0; /* indicates if a z value has been found */
15
17
strcpy(layer, UNIDENTIFIED_LAYER);
17
19
/* read in lines and process information until a 0 is read in */
18
20
while ((code = dxf_get_code(dxf)) != 0) {
25
case 5: /* entity handle */
26
strcpy(handle, dxf_buf);
23
28
case 8: /* layer name */
24
29
if (!layer_flag && *dxf_buf) {
26
if (!is_layer_in_list(dxf_buf)) {
27
add_layer_to_list(dxf_buf);
28
fprintf(stdout, _("Layer %d: %s\n"), num_layers,
31
if (!is_layer_in_list(dxf_buf))
32
add_layer_to_list(dxf_buf, 1);
33
/* skip if layers != NULL && (
35
/* skip if (opt_layers != NULL && (
34
36
* (flag_invert == 0 && is_layer_in_list == 0) ||
35
37
* (flag_invert == 1 && is_layer_in_list == 1)
38
if (layers && flag_invert == is_layer_in_list(dxf_buf))
40
if (opt_layers && flag_invert == is_layer_in_list(dxf_buf))
40
42
strcpy(layer, dxf_buf);
79
if (arr_size == 2) /* have both start and stop */
80
write_line(Map, layer, arr_size);
81
if (arr_size == 2) /* have both start and stop */
82
write_vect(Map, layer, "LINE", handle, "", arr_size, GV_LINE);