Mapper
change_topo_legend.c
Go to the documentation of this file.
1 
2 #include "prototypes_new.h"
3 
4 void change_topo_legend(int win_x,int win_y)
5 
6 {
7 
8 extern int tlegend_save;
9 extern Window window;
10 extern Widget drawing_area;
11 extern unsigned long tmap[50];
12 extern unsigned long vmap[50];
13 extern int rs;
14 extern change_map_flag;
15 extern change_topo_flag;
16 extern int legendysize;
17 extern int contour_topo_flag;
18 int k,i,j,maxtopo=6;
19 Dimension width,height;
20 Arg args[10];
21 int legendystart;
22 
24 
25 XtSetArg(args[0],XtNwidth,&width);
26 XtSetArg(args[1],XtNheight,&height);
27 XtGetValues(drawing_area,args,2);
28 
29 if(win_y >= (legendystart + (maxtopo+5)*rs) &&
30  win_y < (legendystart + (maxtopo+6)*rs)) {
31 
32  change_topo_flag=-1;
33 
35 
36  return;
37 
38  }
39 
40 /* contour */
41 
42 if(win_y >= (legendystart + (maxtopo+4)*rs) &&
43  win_y < (legendystart + (maxtopo+5)*rs)) {
44 
48 
49  write_screen();
50 
51  return;
52 
53  }
54 
55 /* raster*/
56 
57 if(win_y >= (legendystart + (maxtopo+3)*rs) &&
58  win_y < (legendystart + (maxtopo+4)*rs)) {
59 
62 
64 
65  write_screen();
66 
67  return;
68 
69  }
70 
71 if(win_y >= (legendystart + (maxtopo+2)*rs) &&
72  win_y < (legendystart + (maxtopo+3)*rs)) {
73 
74  for(i=0; i < 45;i++)
75  tmap[i]=vmap[i];
76 
77  tlegend_save=-1;
78 
81 
82  write_screen();
83 
84  return;
85 
86  }
87 
88 /*filter up*/
89 
90 if(win_y >= (legendystart + (maxtopo+1)*rs) &&
91  win_y < (legendystart + (maxtopo+2)*rs)) {
92 
93  if(tlegend_save >= 0) {
94 
95  for(i=0; i < 45;i++)
96  tmap[i]=vmap[i];
97 
98  for(i=tlegend_save; i < 45;i++)
100  change_map_flag=1;
102 
103  write_screen();
104 
105  }
106 
107  return;
108 
109  }
110 
111 /*filter down */
112 
113 if(win_y >= (legendystart + maxtopo*rs) &&
114  win_y < (legendystart + (maxtopo+1)*rs)) {
115 
116  if(tlegend_save >= 0) {
117 
118  for(i=0; i < 45;i++)
119  tmap[i]=vmap[i];
120  for(i=0;i<=tlegend_save+3;i++)
121  tmap[i]=0;
122  change_map_flag=1;
124 
125  write_screen();
126 
127  }
128 
129  return;
130 
131  }
132 
133 /*filter levels */
134 
135 j=1;
136 
137 for(k=3;k<32;k=k+7) {
138 
139  if(win_y >= (legendystart + j * rs) &&
140  win_y < (legendystart + (j+1) * rs)) {
141 
142  tlegend_save=k;
143 
145 
146 
147  return;
148 
149  }
150 
151  j++;
152 
153  }
154 
155 
156 
157 }
158 
159 
160 
static int i
void change_topo_legend(int win_x, int win_y)
void write_screen(void)
Definition: mapper.c:1082
void clear_drawable(Drawable)
Definition: mapper.c:1067
void redraw_legend_display(Drawable)
void redraw_topo_legend(Drawable)
int j
Definition: mapp2h.h:48
int k
Definition: mapp2h.h:48
int rs
Definition: mapper.c:103
int legendysize
Definition: mapper.c:103
unsigned long vmap[50]
Definition: mapper.c:116
int tlegend_save
Definition: mapper.c:97
unsigned long tmap[50]
Definition: mapper.c:116
Window window
Definition: mapper.c:190
int change_map_flag
Definition: mapper.c:86
int contour_topo_flag
Definition: mapper.c:88
int legendystart
Definition: mapper.c:103
Dimension height
Dimension width
Arg args[10]
Widget drawing_area
Definition: mapper.c:185