3
#include <grass/Vect.h>
11
/* tool in c: name in Tk */
21
TOOL_ADD_VERTEX, /* add vertex on line */
22
TOOL_RM_VERTEX, /* remove vertex from line */
24
TOOL_EDIT_LINE, /* continue editing a line or boundary */
29
TOOL_DISPLAY_ATTRIBUTES,
30
TOOL_ZOOM_WINDOW, /* zoom by window */
39
/* Xdriver coordinate value considered to bu null */
40
#define COOR_NULL PORT_INT_MAX
45
SYMB_DEFAULT, /* line color acording to real line/node type from Line/NodeSymb */
50
SYMB_BOUNDARY_0, /* No areas */
51
SYMB_BOUNDARY_1, /* 1 area */
52
SYMB_BOUNDARY_2, /* 2 areas */
53
SYMB_CENTROID_IN, /* Centroid in area */
54
SYMB_CENTROID_OUT, /* Centroid outside area */
55
SYMB_CENTROID_DUPL, /* Duplicate centroid in area */
56
SYMB_NODE_0, /* Node without lines (points or centroids) */
57
SYMB_NODE_1, /* Node with 1 line */
58
SYMB_NODE_2, /* Node with 2 lines */
59
SYMB_COUNT /* MUST BE LAST, number of symbology layers */
64
int on; /* 1 - on, 0 - off */
65
int r, g, b; /* color 0-255 */
74
#define MSGI_QUESTION 1
77
#define SNAP_SCREEN 0 /* Snap in screen pixels */
78
#define SNAP_MAP 1 /* Snap in map units */
95
#define VAR_CAT 0 /* category for next line */
96
#define VARN_CAT "cat"
98
#define VARN_FIELD "field" /* field for next line */
99
#define VAR_CAT_MODE 2
100
#define VARN_CAT_MODE "cat_mode" /* mode of cat imput */
102
#define VARN_INSERT "insert" /* insert new row to table for next line (1) or not (0) */
103
#define VAR_MESSAGE 4
104
#define VARN_MESSAGE "message" /* text of message to be displayed in popup window */
106
#define VARN_SNAP "snap" /* If to snap to nearest node (1) or not (0) */
107
#define VAR_SNAP_MODE 6
108
#define VARN_SNAP_MODE "snap_mode" /* Snapping mode (screen pixels / map units) */
109
#define VAR_SNAP_SCREEN 7
110
#define VARN_SNAP_SCREEN "snap_screen" /* Snapping threshold in screen pixels */
111
#define VAR_SNAP_MAP 8
112
#define VARN_SNAP_MAP "snap_map" /* Snapping threshold in map units */
113
#define VAR_ZOOM_REGION 9
114
#define VARN_ZOOM_REGION "zoom_region" /* Name of region to zoom in */
115
#define VAR_ANSWER 10
116
#define VARN_ANSWER "answer" /* Answer from dialog */
117
#define VAR_LINEWIDTH 11
118
#define VARN_LINEWIDTH "linewidth" /* Width for lines and boundaries */
122
{VAR_CAT, VARN_CAT, VART_INT, 0, 0, NULL},
123
{VAR_FIELD, VARN_FIELD, VART_INT, 0, 0, NULL},
124
{VAR_CAT_MODE, VARN_CAT_MODE, VART_INT, 0, 0, NULL},
125
{VAR_INSERT, VARN_INSERT, VART_INT, 0, 0, NULL},
126
{VAR_MESSAGE, VARN_MESSAGE, VART_CHAR, 0, 0, NULL},
127
{VAR_SNAP, VARN_SNAP, VART_INT, 0, 0, NULL},
128
{VAR_SNAP_MODE, VARN_SNAP_MODE, VART_INT, 0, 0, NULL},
129
{VAR_SNAP_SCREEN, VARN_SNAP_SCREEN, VART_INT, 0, 0, NULL},
130
{VAR_SNAP_MAP, VARN_SNAP_MAP, VART_DOUBLE, 0, 0, NULL},
131
{VAR_ZOOM_REGION, VARN_ZOOM_REGION, VART_CHAR, 0, 0, NULL},
132
{VAR_ANSWER, VARN_ANSWER, VART_INT, 0, 0, NULL},
133
{VAR_LINEWIDTH, VARN_LINEWIDTH, VART_INT, 2, 0, NULL},
134
{0, NULL, 0, 0, 0, NULL}
137
extern VAR Variable[];
140
/* Category and field set for current line to be written */
141
#define CAT_MODE_NO 0 /* No category */
142
#define CAT_MODE_MAN 1 /* Manual imput */
143
#define CAT_MODE_NEXT 2 /* Next not yet used category of given field */
144
#define CAT_MODE_COUNT 3 /* Count of modes */
146
char *CatModeLab[] = { "No category", "Manual entry", "Next not used" };
148
extern char *CatModeLab[];
151
/* Maximum value for field */
152
Global int (*MaxFieldCat)[2];
153
Global int nMaxFieldCat, aMaxFieldCat;
155
Global SYMB Symb[SYMB_COUNT];
157
Global struct Map_info Map;
158
Global struct Cell_head GRegion; /* Current region (synchronized with GRASS WIND) */
159
Global Tcl_Interp *Toolbox;
160
Global int Tool_next; /* Next tool to be run */
161
Global double Xscale, Yscale; /* Scale factors = size_in_map / size_on_screen */
163
Global struct Cell_head window;
165
Global double Scale; /* Map / xdriver */
168
/* Display symbology for lines and nodes */
169
Global int *LineSymb; /* array of line symbology codes, starts from index 1 */
170
Global int aLineSymb; /* number of lines / allocated space (array size + 1) */
171
Global int *NodeSymb; /* array of nodes' symbology codes, start from index 1 */
172
Global int aNodeSymb; /* number of nodes / allocated space (array size + 1) */
174
/* Background commands */
177
char *cmd; /* command */
178
int on; /* 1 display, 0 do not display */
191
#define MOUSE_POINT 1