3
#include "local_proto.h"
6
static int cancel(void);
7
static int plot(int, int);
8
static int choose_cellfile(char *, char *);
10
int plotcell(int x, int y)
12
static Objects objects[] = {
13
MENU("CANCEL", cancel, &use),
14
INFO("Indicate which side should be plotted", &use),
19
* if the target raster map list is ready, ask the user which side
20
* should be plotted, otherwise can only plot group files
22
if (access(cell_list, 0) == 0)
23
Input_pointer(objects);
25
plot(VIEW_MAP1->left + 1, 0);
29
static int cancel(void)
35
static int plot(int x, int y)
37
char name[40], mapset[40];
38
struct Cell_head cellhd;
40
if (x > VIEW_MAP1->left && x < VIEW_MAP1->right) {
41
/* must close and reopen elev layer buffer */
42
/* G_close_cell (elev); */
45
if (!choose_groupfile(name, mapset))
47
if (G_get_cellhd(name, mapset, &cellhd) < 0)
50
Erase_view(VIEW_MAP1_ZOOM);
51
Erase_view(VIEW_TITLE1_ZOOM);
52
VIEW_MAP1_ZOOM->cell.configured = 0;
54
G_adjust_window_to_box(&cellhd, &VIEW_MAP1->cell.head,
55
VIEW_MAP1->nrows, VIEW_MAP1->ncols);
56
Configure_view(VIEW_MAP1, name, mapset, cellhd.ns_res, cellhd.ew_res);
60
else if (x > VIEW_MAP2->left && x < VIEW_MAP2->right) {
61
/* must close and reopen elev layer buffer */
62
/* G_close_cell (elev); */
65
if (!choose_cellfile(name, mapset))
68
if (G_get_cellhd(name, mapset, &cellhd) < 0) {
73
Erase_view(VIEW_MAP2_ZOOM);
74
Erase_view(VIEW_TITLE2_ZOOM);
75
VIEW_MAP2_ZOOM->cell.configured = 0;
77
G_adjust_window_to_box(&cellhd, &VIEW_MAP2->cell.head,
78
VIEW_MAP2->nrows, VIEW_MAP2->ncols);
79
Configure_view(VIEW_MAP2, name, mapset, cellhd.ns_res, cellhd.ew_res);
84
if (from_screen < 0) {
87
if (from_keyboard < 0) {
94
return 0; /* ignore mouse click */
96
display_conz_points(1);
100
static int choose_cellfile(char *name, char *mapset)
102
return ask_gis_files("cell", cell_list, name, mapset, 1);