~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to vector/v.digit/global.h

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <tcl.h>
2
 
#include <tk.h>
3
 
#include <grass/Vect.h>
4
 
 
5
 
#ifdef MAIN
6
 
#define Global
7
 
#else
8
 
#define Global extern
9
 
#endif
10
 
 
11
 
/*      tool in c:         name in Tk */
12
 
typedef enum
13
 
{
14
 
    TOOL_NOTHING,
15
 
    TOOL_EXIT,
16
 
    TOOL_NEW_POINT,
17
 
    TOOL_NEW_LINE,
18
 
    TOOL_NEW_BOUNDARY,
19
 
    TOOL_NEW_CENTROID,
20
 
    TOOL_MOVE_VERTEX,
21
 
    TOOL_ADD_VERTEX,            /* add vertex on line */
22
 
    TOOL_RM_VERTEX,             /* remove vertex from line */
23
 
    TOOL_SPLIT_LINE,
24
 
    TOOL_EDIT_LINE,             /* continue editing a line or boundary */
25
 
    TOOL_MOVE_LINE,
26
 
    TOOL_DELETE_LINE,
27
 
    TOOL_DISPLAY_CATS,
28
 
    TOOL_COPY_CATS,
29
 
    TOOL_DISPLAY_ATTRIBUTES,
30
 
    TOOL_ZOOM_WINDOW,           /* zoom by window */
31
 
    TOOL_ZOOM_OUT_CENTRE,
32
 
    TOOL_ZOOM_PAN,
33
 
    TOOL_ZOOM_DEFAULT,
34
 
    TOOL_ZOOM_REGION,
35
 
    TOOL_REDRAW,
36
 
    TOOL_DISPLAY_SETTINGS
37
 
} ToolNumber;
38
 
 
39
 
/* Xdriver coordinate value considered to bu null */
40
 
#define COOR_NULL PORT_INT_MAX
41
 
 
42
 
/* SYMBOLOGY */
43
 
typedef enum
44
 
{
45
 
    SYMB_DEFAULT,               /* line color acording to real line/node type from Line/NodeSymb */
46
 
    SYMB_BACKGROUND,
47
 
    SYMB_HIGHLIGHT,
48
 
    SYMB_POINT,
49
 
    SYMB_LINE,
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 */
60
 
} SymbNumber;
61
 
 
62
 
typedef struct
63
 
{
64
 
    int on;                     /* 1 - on, 0 - off */
65
 
    int r, g, b;                /* color 0-255 */
66
 
} SYMB;
67
 
 
68
 
/* Message type */
69
 
#define MSG_OK 0
70
 
#define MSG_YESNO 1
71
 
 
72
 
/* Message icon */
73
 
#define MSGI_ERROR 0
74
 
#define MSGI_QUESTION 1
75
 
 
76
 
/* Snapping modes */
77
 
#define SNAP_SCREEN 0           /* Snap in screen pixels */
78
 
#define SNAP_MAP    1           /* Snap in map units */
79
 
 
80
 
/* Variables */
81
 
#define VART_INT    0
82
 
#define VART_DOUBLE 1
83
 
#define VART_CHAR   2
84
 
 
85
 
typedef struct
86
 
{
87
 
    int code;
88
 
    char *name;
89
 
    int type;
90
 
    int i;
91
 
    double d;
92
 
    char *c;
93
 
} VAR;
94
 
 
95
 
#define VAR_CAT       0         /* category for next line */
96
 
#define VARN_CAT      "cat"
97
 
#define VAR_FIELD     1
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 */
101
 
#define VAR_INSERT    3
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 */
105
 
#define VAR_SNAP      5
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 */
119
 
 
120
 
#ifdef MAIN
121
 
VAR Variable[] = {
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}
135
 
};
136
 
#else
137
 
extern VAR Variable[];
138
 
#endif
139
 
 
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 */
145
 
#ifdef MAIN
146
 
char *CatModeLab[] = { "No category", "Manual entry", "Next not used" };
147
 
#else
148
 
extern char *CatModeLab[];
149
 
#endif
150
 
 
151
 
/* Maximum value for field */
152
 
Global int (*MaxFieldCat)[2];
153
 
Global int nMaxFieldCat, aMaxFieldCat;
154
 
 
155
 
Global SYMB Symb[SYMB_COUNT];
156
 
 
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 */
162
 
 
163
 
Global struct Cell_head window;
164
 
 
165
 
Global double Scale;            /* Map / xdriver */
166
 
 
167
 
 
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) */
173
 
 
174
 
/* Background commands */
175
 
typedef struct
176
 
{
177
 
    char *cmd;                  /* command */
178
 
    int on;                     /* 1 display, 0 do not display */
179
 
} BGCMD;
180
 
 
181
 
#ifdef MAIN
182
 
BGCMD *Bgcmd = NULL;
183
 
int nbgcmd = 0;
184
 
int abgcmd = 0;
185
 
#else
186
 
extern BGCMD *Bgcmd;
187
 
extern int nbgcmd;
188
 
extern int abgcmd;
189
 
#endif
190
 
 
191
 
#define MOUSE_POINT     1
192
 
#define MOUSE_LINE      2
193
 
#define MOUSE_BOX       3