fermisurfer Git
Revision | 1c37b026f68cdf027926d7879a4ecfe5951bf1a7 (tree) |
---|---|
Zeit | 2019-06-05 01:01:11 |
Autor | ![]() |
Commiter | mitsuaki1987 |
Menu -> control
@@ -159,6 +159,7 @@ GLfloat **clrnl;//!< Color of nodeline [::nb][::nnl*2*4] | ||
159 | 159 | 2D Fermi line |
160 | 160 | */ |
161 | 161 | GLfloat secvec[3]; //!< @f$k@f$-vector to define section |
162 | +GLfloat secvec_fr[3]; //!< @f$k@f$-vector to define section | |
162 | 163 | GLfloat secscale; //!< 0.0 (across @f$\Gamma@f$) or 1.0 |
163 | 164 | GLfloat axis2d[2][3]; //!< @f$k@f$-vector to define section |
164 | 165 | int *n2d; //!< Number of line segment |
@@ -172,6 +173,7 @@ GLfloat bzl2d_proj[26][3]; //!< Lines of 1st BZ [::nbzl2d (max:26)][3], projecte | ||
172 | 173 | Equator |
173 | 174 | */ |
174 | 175 | GLfloat eqvec[3]; //!< @f$k@f$-vector for equator |
176 | +GLfloat eqvec_fr[3]; //!< @f$k@f$-vector for equator | |
175 | 177 | int *nequator; //!< The number of equator |
176 | 178 | GLfloat ****kveq; //!< @f$k@f$-vector of equator [::nb][::nequator][2][3] |
177 | 179 | GLfloat **kveq_rot; //!< @f$k@f$-vector of equator [::nb][::nequator*2*3] |
@@ -68,90 +68,78 @@ void refresh_patch_segment() { | ||
68 | 68 | |
69 | 69 | enum |
70 | 70 | { |
71 | - menu_bz_radio1, | |
72 | - menu_bz_radio2, | |
73 | - menu_background_radio1, | |
74 | - menu_background_radio2, | |
75 | - menu_lighting_radio1, | |
76 | - menu_lighting_radio2, | |
77 | - menu_lighting_radio3, | |
78 | - menu_mouse_radio1, | |
79 | - menu_mouse_radio2, | |
80 | - menu_mouse_radio3, | |
81 | - menu_stereo_radio1, | |
82 | - menu_stereo_radio2, | |
83 | - menu_stereo_radio3, | |
84 | - menu_tetra_radio1, | |
85 | - menu_tetra_radio2, | |
86 | - menu_tetra_radio3, | |
87 | - menu_tetra_radio4, | |
88 | - menu_tetra_radio5, | |
89 | - menu_tetra_radio6, | |
90 | - menu_tetra_radio7, | |
91 | - menu_tetra_radio8, | |
92 | - menu_tetra_radio9, | |
93 | - menu_tetra_radio10, | |
94 | - menu_tetra_radio11, | |
95 | - menu_tetra_radio12, | |
96 | - menu_tetra_radio13, | |
97 | - menu_tetra_radio14, | |
98 | - menu_tetra_radio15, | |
99 | - menu_tetra_radio16, | |
100 | - menu_view_radio1, | |
101 | - menu_view_radio2, | |
102 | - menu_view_radio3, | |
103 | - menu_nodeline_check, | |
104 | - menu_colorbar_check, | |
105 | - imenu_line, | |
106 | - imenu_shift, | |
107 | - colorscale_maxmin, | |
108 | - colorscale_radio1, | |
109 | - colorscale_radio2, | |
110 | - colorscale_radio3, | |
111 | - colorscale_radio4, | |
112 | - colorscale_radio5, | |
113 | - colorscale_radio6, | |
114 | - colorscale_radio7, | |
115 | - equator_check, | |
116 | - equator_modify, | |
117 | - menu_section_check, | |
118 | - menu_section_modify, | |
119 | - menu_section_gamma, | |
120 | - menu_view_scale, | |
121 | - menu_view_position, | |
122 | - menu_view_rotation, | |
123 | - imenu_interpol, | |
124 | - menu_band_check | |
71 | + ibutton_reflesh, | |
72 | + ibutton_compute, | |
73 | + iradio_background, | |
74 | + iradio_brillouinzone, | |
75 | + iradio_lighting, | |
76 | + iradio_mouse, | |
77 | + iradio_stereo, | |
78 | + iradio_tetra, | |
79 | + iradio_colorscale, | |
80 | + itext_colorscalemin, | |
81 | + itext_colorscalemax, | |
82 | + iradio_section, | |
83 | + itext_sectionx, | |
84 | + itext_sectiony, | |
85 | + itext_sectionz, | |
86 | + icheck_nodeline, | |
87 | + icheck_colorbar, | |
88 | + icheck_equator, | |
89 | + itext_equatorx, | |
90 | + itext_equatory, | |
91 | + itext_equatorz, | |
92 | + itext_line, | |
93 | + itext_shift, | |
94 | + itext_interpol, | |
95 | + itext_scale, | |
96 | + itext_positionx, | |
97 | + itext_positiony, | |
98 | + itext_rotx, | |
99 | + itext_roty, | |
100 | + itext_rotz, | |
101 | + icheck_band | |
125 | 102 | }; |
126 | 103 | |
104 | +void MyFrame::button_refresh( | |
105 | + wxCommandEvent& event//!<[in] Selected menu | |
106 | +) { | |
107 | + Refresh(false); | |
108 | +} | |
109 | + | |
110 | +void MyFrame::button_compute( | |
111 | + wxCommandEvent& event//!<[in] Selected menu | |
112 | +) { | |
113 | + free_patch(); | |
114 | + compute_patch_segment(); | |
115 | + Refresh(false); | |
116 | +} | |
127 | 117 | /** |
128 | 118 | @brief Change background color (::blackback) |
129 | 119 | */ |
130 | -void MyFrame::menu_background( | |
120 | +void MyFrame::radio_background( | |
131 | 121 | wxCommandEvent& event //!<[in] Selected menu |
132 | 122 | ) |
133 | 123 | { |
134 | - if (event.GetId() == menu_background_radio1 && blackback != 1) { | |
124 | + if (event.GetString().Cmp(wxT("Black")) == 0 && blackback != 1) { | |
135 | 125 | glClearColor(0.0, 0.0, 0.0, 0.0); |
136 | 126 | blackback = 1; |
137 | - if (color_scale == 2 || color_scale == 3) paint(); | |
138 | - Refresh(false); | |
127 | + // debug if (color_scale == 2 || color_scale == 3) paint(); | |
139 | 128 | } |
140 | - else if (event.GetId() == menu_background_radio2 && blackback != 0) { | |
129 | + else if (event.GetString().Cmp(wxT("White")) == 0 && blackback != 0) { | |
141 | 130 | glClearColor(1.0, 1.0, 1.0, 0.0); |
142 | 131 | blackback = 0; |
143 | - if (color_scale == 2 || color_scale == 3) paint(); | |
144 | - Refresh(false); | |
132 | + // debug if (color_scale == 2 || color_scale == 3) paint(); | |
145 | 133 | } |
146 | 134 | }/* bgcolor change*/ |
147 | 135 | /** |
148 | 136 | @brief Toggle the appearance of each band (::draw_band) |
149 | 137 | */ |
150 | -void MyFrame::menu_band( | |
138 | +void MyFrame::check_band( | |
151 | 139 | wxCommandEvent& event //!<[in] Selected menu |
152 | 140 | ) |
153 | 141 | { |
154 | - int ib = event.GetId() - menu_band_check; | |
142 | + int ib = wxAtoi(event.GetString()); | |
155 | 143 | if (draw_band[ib] == 0) { |
156 | 144 | draw_band[ib] = 1; |
157 | 145 | } |
@@ -163,16 +151,16 @@ void MyFrame::menu_band( | ||
163 | 151 | /** |
164 | 152 | @brief Change Brillouin zone (::fbz) |
165 | 153 | */ |
166 | -void MyFrame::menu_brillouinzone( | |
154 | +void MyFrame::radio_brillouinzone( | |
167 | 155 | wxCommandEvent& event //!<[in] Selected menu |
168 | 156 | ) |
169 | 157 | { |
170 | - if (event.GetId() == menu_bz_radio1 && fbz != 1) { | |
158 | + if (event.GetString().Cmp(wxT("First Brillouin zone")) == 0 && fbz != 1) { | |
171 | 159 | fbz = 1; |
172 | 160 | refresh_patch_segment(); |
173 | 161 | Refresh(false); |
174 | 162 | } |
175 | - else if (event.GetId() == menu_bz_radio2 && fbz != -1) { | |
163 | + else if (event.GetString().Cmp(wxT("Primitive Brillouin zone")) == 0 && fbz != -1) { | |
176 | 164 | fbz = -1; |
177 | 165 | lsection = 0; |
178 | 166 | refresh_patch_segment(); |
@@ -182,7 +170,7 @@ void MyFrame::menu_brillouinzone( | ||
182 | 170 | /** |
183 | 171 | @brief Toggle Colorbar (::lcolorbar) |
184 | 172 | */ |
185 | -void MyFrame::menu_colorbar( | |
173 | +void MyFrame::check_colorbar( | |
186 | 174 | wxCommandEvent& event //!<[in] Selected menu |
187 | 175 | ) |
188 | 176 | { |
@@ -193,71 +181,74 @@ void MyFrame::menu_colorbar( | ||
193 | 181 | /** |
194 | 182 | @brief Change color scale mode (::color_scale) |
195 | 183 | */ |
196 | -void MyFrame::menu_colorscale( | |
184 | +void MyFrame::radiovalue_colorscale( | |
197 | 185 | wxCommandEvent& event //!<[in] Selected menu |
198 | 186 | ) |
199 | 187 | { |
200 | 188 | int ierr, ii; |
189 | + double dminmax; | |
201 | 190 | |
202 | - if (event.GetId() == colorscale_maxmin) { | |
203 | - max_and_min(); | |
204 | - if (color_scale == 1 || color_scale == 4 | |
205 | - || color_scale == 6 || color_scale == 7) { | |
206 | - printf(" Set min. and max. value for scale : "); | |
207 | - ierr = scanf("%f%f", &patch_min[0], &patch_max[0]); | |
208 | - if (ierr == 0) printf("error ! reading min or max"); | |
209 | - } | |
210 | - else if (color_scale == 2) { | |
211 | - printf(" Set max. value for scale: "); | |
212 | - ierr = scanf("%f", &patch_max[0]); | |
213 | - if (ierr == 0) printf("error ! reading max"); | |
214 | - } | |
215 | - else if (color_scale == 3) { | |
216 | - for (ii = 0; ii < 3; ii++) { | |
217 | - printf(" Set min. and max. value for scale %d : ", ii); | |
218 | - ierr = scanf("%f%f", &patch_min[ii], &patch_max[ii]); | |
219 | - if (ierr == 0) printf("error ! reading min or max"); | |
220 | - } | |
221 | - } | |
222 | - else { | |
223 | - printf(" No color scale in this case.\n"); | |
224 | - } | |
191 | + if (event.GetId() == itext_colorscalemin) { | |
192 | + max_and_min(); | |
193 | + if (event.GetString().ToDouble(&dminmax)) | |
194 | + patch_min[0] = (GLfloat)dminmax; | |
225 | 195 | paint(); |
226 | 196 | Refresh(false); |
227 | 197 | } |
228 | - else if (event.GetId() - colorscale_radio1 + 1 != color_scale) { | |
229 | - color_scale = event.GetId() - colorscale_radio1 + 1; | |
230 | - max_and_min(); | |
198 | + else if (event.GetId() == itext_colorscalemax) { | |
199 | + max_and_min(); | |
200 | + if (event.GetString().ToDouble(&dminmax)) | |
201 | + patch_max[0] = (GLfloat)dminmax; | |
231 | 202 | paint(); |
232 | 203 | Refresh(false); |
233 | 204 | } |
205 | + else if (event.GetString().Cmp(wxT("Input (Real)")) == 0) | |
206 | + color_scale = 1; | |
207 | + else if (event.GetString().Cmp(wxT("Input (Complex)")) == 0) | |
208 | + color_scale = 2; | |
209 | + else if (event.GetString().Cmp(wxT("Input (Tri-number)")) == 0) | |
210 | + color_scale = 3; | |
211 | + else if (event.GetString().Cmp(wxT("Fermi Velocity")) == 0) | |
212 | + color_scale = 4; | |
213 | + else if (event.GetString().Cmp(wxT("Band Index")) == 0) | |
214 | + color_scale = 5; | |
215 | + else if (event.GetString().Cmp(wxT("Input (Real, Gray Scale)")) == 0) | |
216 | + color_scale = 6; | |
217 | + else if (event.GetString().Cmp(wxT("Fermi Velocity (Gray Scale)")) == 0) | |
218 | + color_scale = 7; | |
234 | 219 | } /* menu_colorscale */ |
235 | 220 | /** |
236 | 221 | @brief Modify and toggle appearance of equator (::lequator) |
237 | 222 | */ |
238 | -void MyFrame::menu_equator( | |
223 | +void MyFrame::checkvalue_equator( | |
239 | 224 | wxCommandEvent& event //!<[in] Selected menu |
240 | 225 | ) |
241 | 226 | { |
242 | 227 | int ierr, ii, jj, ib; |
243 | - GLfloat vec[3]; | |
228 | + double deqvec; | |
244 | 229 | |
245 | - if (event.GetId() == equator_check) { | |
230 | + if (event.GetId() == icheck_equator) { | |
246 | 231 | if (lequator != 1) lequator = 1; |
247 | 232 | else lequator = 0; |
248 | 233 | Refresh(false); |
249 | 234 | }/*if (event.GetId() == 1)*/ |
250 | 235 | else { |
251 | - | |
252 | - printf(" New Miller index : "); | |
253 | - ierr = scanf("%f %f %f", &vec[0], &vec[1], &vec[2]); | |
236 | + if (event.GetId() == itext_equatorx) { | |
237 | + if (event.GetString().ToDouble(&deqvec)) eqvec_fr[0] = (GLfloat)deqvec; | |
238 | + } | |
239 | + else if (event.GetId() == itext_equatory) { | |
240 | + if (event.GetString().ToDouble(&deqvec)) eqvec_fr[1] = (GLfloat)deqvec; | |
241 | + } | |
242 | + else if (event.GetId() == itext_equatorz) { | |
243 | + if (event.GetString().ToDouble(&deqvec)) eqvec_fr[2] = (GLfloat)deqvec; | |
244 | + } | |
254 | 245 | /* |
255 | 246 | Fractional -> Cartecian |
256 | 247 | */ |
257 | 248 | for (ii = 0; ii < 3; ii++) { |
258 | 249 | eqvec[ii] = 0.0; |
259 | 250 | for (jj = 0; jj < 3; jj++) { |
260 | - eqvec[ii] += vec[jj] * bvec[jj][ii]; | |
251 | + eqvec[ii] += eqvec_fr[jj] * bvec[jj][ii]; | |
261 | 252 | }/*for (jj = 0; jj < 3; jj++)*/ |
262 | 253 | }/*for (ii = 0; ii < 3; ii++)*/ |
263 | 254 | /* |
@@ -291,45 +282,41 @@ void MyFrame::menu_equator( | ||
291 | 282 | This routine modify interpolation ratio (::interpol) |
292 | 283 | then compute Fermi surfaces, etc. |
293 | 284 | */ |
294 | -void MyFrame::menu_interpol( | |
285 | +void MyFrame::textctrl_interpol( | |
295 | 286 | wxCommandEvent& event //!<[in] Selected menu |
296 | 287 | ) |
297 | 288 | { |
298 | 289 | int ierr; |
290 | + long int long_interpol; | |
299 | 291 | |
300 | - if (event.GetId() == imenu_interpol) { | |
301 | - printf(" Old interpolation ratio : %d\n", interpol); | |
302 | - printf(" New interpolation ratio : "); | |
303 | - // | |
304 | - ierr = scanf("%d", &interpol); | |
305 | - if (ierr != 1) printf("error ! reading interpol"); | |
306 | - /**/ | |
307 | - interpol_energy(); | |
308 | - refresh_patch_segment(); | |
309 | - /**/ | |
310 | - Refresh(false); | |
311 | - } | |
292 | + if (event.GetString().ToLong(&long_interpol)) | |
293 | + interpol = (int)long_interpol; | |
294 | + /**/ | |
295 | + interpol_energy(); | |
296 | + refresh_patch_segment(); | |
297 | + /**/ | |
298 | + Refresh(false); | |
312 | 299 | }/*static void menu_interpol*/ |
313 | 300 | /** |
314 | 301 | @brief Toggle Lighting (::lside) |
315 | 302 | */ |
316 | -void MyFrame::menu_lighting( | |
303 | +void MyFrame::radio_lighting( | |
317 | 304 | wxCommandEvent& event //!<[in] Selected menu |
318 | 305 | ) |
319 | 306 | { |
320 | - if (event.GetId() == menu_lighting_radio1 && lside != 1) { | |
307 | + if (event.GetString().Cmp(wxT("Both side")) == 0 && lside != 1) { | |
321 | 308 | lside = 1; |
322 | 309 | side = 1.0; |
323 | 310 | glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); |
324 | 311 | Refresh(false); |
325 | 312 | } |
326 | - if (event.GetId() == menu_lighting_radio2 && lside != 2) { | |
313 | + if (event.GetString().Cmp(wxT("Unoccupied side")) == 0 && lside != 2) { | |
327 | 314 | lside = 2; |
328 | 315 | side = 1.0; |
329 | 316 | glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); |
330 | 317 | Refresh(false); |
331 | 318 | } |
332 | - if (event.GetId() == menu_lighting_radio3 && lside != 3) { | |
319 | + if (event.GetString().Cmp(wxT("Occupied side")) == 0 && lside != 3) { | |
333 | 320 | lside = 3; |
334 | 321 | side = -1.0; |
335 | 322 | glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); |
@@ -339,33 +326,33 @@ void MyFrame::menu_lighting( | ||
339 | 326 | /** |
340 | 327 | @brief Line width (::lside) |
341 | 328 | */ |
342 | -void MyFrame::menu_line( | |
329 | +void MyFrame::textctrl_line( | |
343 | 330 | wxCommandEvent& event //!<[in] Selected menu |
344 | 331 | ) |
345 | 332 | { |
346 | 333 | int ierr; |
347 | - printf(" Current line width : %f\n", linewidth); | |
348 | - printf(" New line width : "); | |
349 | - ierr = scanf("%f", &linewidth); | |
334 | + double dlinewidth; | |
350 | 335 | |
336 | + ierr = scanf("%f", &linewidth); | |
337 | + if (event.GetString().ToDouble(&dlinewidth)) linewidth = (GLfloat)dlinewidth; | |
351 | 338 | Refresh(false); |
352 | 339 | } /* menu_line */ |
353 | 340 | /** |
354 | 341 | @brief Change the function associated to the mouse movement(::lmouse) |
355 | 342 | */ |
356 | -void MyFrame::menu_mouse( | |
343 | +void MyFrame::radio_mouse( | |
357 | 344 | wxCommandEvent& event //!<[in] Selected menu |
358 | 345 | ) |
359 | 346 | { |
360 | - if (event.GetId() == menu_mouse_radio1 && lmouse != 1) { | |
347 | + if (event.GetString().Cmp(wxT("Rotate")) == 0 && lmouse != 1) { | |
361 | 348 | lmouse = 1; |
362 | 349 | Refresh(false); |
363 | 350 | } |
364 | - if (event.GetId() == menu_mouse_radio2 && lmouse != 2) { | |
351 | + if (event.GetString().Cmp(wxT("Scale")) == 0 && lmouse != 2) { | |
365 | 352 | lmouse = 2; |
366 | 353 | Refresh(false); |
367 | 354 | } |
368 | - if (event.GetId() == menu_mouse_radio3 && lmouse != 3) { | |
355 | + if (event.GetString().Cmp(wxT("Translate")) == 0 && lmouse != 3) { | |
369 | 356 | lmouse = 3; |
370 | 357 | Refresh(false); |
371 | 358 | } |
@@ -373,7 +360,7 @@ void MyFrame::menu_mouse( | ||
373 | 360 | /** |
374 | 361 | @brief Toggle apearance of nodale-line |
375 | 362 | */ |
376 | -void MyFrame::menu_nodeline( | |
363 | +void MyFrame::check_nodeline( | |
377 | 364 | wxCommandEvent& event //!<[in] Selected menu |
378 | 365 | ) |
379 | 366 | { |
@@ -384,36 +371,45 @@ void MyFrame::menu_nodeline( | ||
384 | 371 | /** |
385 | 372 | @brief Modify and toggle appearance of 2D Fermi lines (::lsection) |
386 | 373 | */ |
387 | -void MyFrame::menu_section( | |
374 | +void MyFrame::radiovalue_section( | |
388 | 375 | wxCommandEvent& event //!<[in] Selected menu |
389 | 376 | ) |
390 | 377 | { |
391 | 378 | int ierr, ii, jj, ib; |
392 | - GLfloat vec[3]; | |
379 | + double dsecvec; | |
393 | 380 | |
394 | - if (event.GetId() == menu_section_check) { | |
395 | - if (lsection != 1) { | |
381 | + if (event.GetId() == iradio_section) { | |
382 | + if (event.GetString().Cmp(wxT("None")) == 0) { | |
383 | + lsection = 0; | |
384 | + secscale = 1.0; | |
385 | + } | |
386 | + else if (event.GetString().Cmp(wxT("Off Gamma")) == 0) { | |
396 | 387 | lsection = 1; |
397 | - Refresh(false); | |
388 | + secscale = 1.0; | |
398 | 389 | } |
399 | - else { | |
400 | - lsection = 0; | |
401 | - Refresh(false); | |
390 | + else if (event.GetString().Cmp(wxT("On Gamma")) == 0) { | |
391 | + lsection = 1; | |
392 | + secscale = 0.0; | |
402 | 393 | } |
403 | 394 | }/*if (event.GetId() == 1)*/ |
404 | 395 | else { |
405 | - if (event.GetId() == menu_section_modify) secscale = 1.0; | |
406 | - else secscale = 0.0; | |
396 | + if (event.GetId() == itext_equatorx) { | |
397 | + if (event.GetString().ToDouble(&dsecvec)) secvec_fr[0] = (GLfloat)dsecvec; | |
398 | + } | |
399 | + else if (event.GetId() == itext_equatory) { | |
400 | + if (event.GetString().ToDouble(&dsecvec)) secvec_fr[1] = (GLfloat)dsecvec; | |
401 | + } | |
402 | + else if (event.GetId() == itext_equatorz) { | |
403 | + if (event.GetString().ToDouble(&dsecvec)) secvec_fr[2] = (GLfloat)dsecvec; | |
404 | + } | |
407 | 405 | |
408 | - printf(" New Miller index : "); | |
409 | - ierr = scanf("%f %f %f", &vec[0], &vec[1], &vec[2]); | |
410 | 406 | /* |
411 | 407 | Fractional -> Cartecian |
412 | 408 | */ |
413 | 409 | for (ii = 0; ii < 3; ii++) { |
414 | 410 | secvec[ii] = 0.0; |
415 | 411 | for (jj = 0; jj < 3; jj++) { |
416 | - secvec[ii] += vec[jj] * bvec[jj][ii]; | |
412 | + secvec[ii] += secvec_fr[jj] * bvec[jj][ii]; | |
417 | 413 | }/*for (jj = 0; jj < 3; jj++)*/ |
418 | 414 | }/*for (ii = 0; ii < 3; ii++)*/ |
419 | 415 | /* |
@@ -437,12 +433,13 @@ void MyFrame::menu_section( | ||
437 | 433 | /** |
438 | 434 | @brief Shift Fermi energy |
439 | 435 | */ |
440 | -void MyFrame::menu_shift( | |
436 | +void MyFrame::textctrl_shift( | |
441 | 437 | wxCommandEvent& event //!<[in] Selected menu |
442 | 438 | ) |
443 | 439 | { |
444 | 440 | int ib, i0, i1, i2, ierr; |
445 | 441 | GLfloat emin, emax; |
442 | + double dEF; | |
446 | 443 | |
447 | 444 | emin = 100000.0; |
448 | 445 | emax = -100000.0; |
@@ -460,8 +457,7 @@ void MyFrame::menu_shift( | ||
460 | 457 | printf(" %f %f %f \n", emin, emax, EF); |
461 | 458 | printf(" New Fermi energy : "); |
462 | 459 | // |
463 | - ierr = scanf("%f", &EF); | |
464 | - if (ierr != 1) printf("error ! reading ef"); | |
460 | + if (event.GetString().ToDouble(&dEF)) EF = (GLfloat)dEF; | |
465 | 461 | /**/ |
466 | 462 | refresh_patch_segment(); |
467 | 463 | /**/ |
@@ -470,18 +466,18 @@ void MyFrame::menu_shift( | ||
470 | 466 | /** |
471 | 467 | @brief Tern stereogram (::lstereo) |
472 | 468 | */ |
473 | -void MyFrame::menu_stereo( | |
469 | +void MyFrame::radio_stereo( | |
474 | 470 | wxCommandEvent& event //!<[in] Selected menu |
475 | 471 | ) { |
476 | - if (event.GetId() == menu_stereo_radio1 && lstereo != 1) { | |
472 | + if (event.GetString().Cmp(wxT("None")) == 0 && lstereo != 1) { | |
477 | 473 | lstereo = 1; |
478 | 474 | Refresh(false); |
479 | 475 | } |
480 | - if (event.GetId() == menu_stereo_radio2 && lstereo != 2) { | |
476 | + if (event.GetString().Cmp(wxT("Parallel")) == 0 && lstereo != 2) { | |
481 | 477 | lstereo = 2; |
482 | 478 | Refresh(false); |
483 | 479 | } |
484 | - if (event.GetId() == menu_stereo_radio3 && lstereo != 3) { | |
480 | + if (event.GetString().Cmp(wxT("Cross")) == 0 && lstereo != 3) { | |
485 | 481 | lstereo = 3; |
486 | 482 | Refresh(false); |
487 | 483 | } |
@@ -489,17 +485,14 @@ void MyFrame::menu_stereo( | ||
489 | 485 | /** |
490 | 486 | @brief Change tetrahedron (::itet) |
491 | 487 | */ |
492 | -void MyFrame::menu_tetra( | |
488 | +void MyFrame::radio_tetra( | |
493 | 489 | wxCommandEvent& event //!<[in] Selected menu |
494 | 490 | ) |
495 | 491 | { |
496 | - if (event.GetId() - menu_tetra_radio1 != itet) { | |
497 | - printf(" Tetra patern %d \n", event.GetId()- menu_tetra_radio1 + 1); | |
498 | - itet = event.GetId() - menu_tetra_radio1; | |
499 | - init_corner(); | |
500 | - refresh_patch_segment(); | |
501 | - Refresh(false); | |
502 | - } | |
492 | + itet = wxAtoi(event.GetString()); | |
493 | + init_corner(); | |
494 | + refresh_patch_segment(); | |
495 | + Refresh(false); | |
503 | 496 | }/*menu_tetra*/ |
504 | 497 | /** |
505 | 498 | @brief Setting of view |
@@ -507,28 +500,27 @@ void MyFrame::menu_tetra( | ||
507 | 500 | This modify scale (::scl) & tarnslation (::trans) & |
508 | 501 | rotation (::thetax, ::thetay, ::thetaz, ::rot), |
509 | 502 | */ |
510 | -void MyFrame::menu_view( | |
503 | +void MyFrame::textctrl_view( | |
511 | 504 | wxCommandEvent& event //!<[in] Selected menu |
512 | 505 | ) |
513 | 506 | { |
514 | 507 | int ierr; |
508 | + double dvalue; | |
515 | 509 | |
516 | - if (event.GetId() == menu_view_scale) { | |
517 | - | |
518 | - printf(" Current Scale : %f\n", scl); | |
519 | - printf(" New Scale : "); | |
520 | - ierr = scanf("%f", &scl); | |
510 | + if (event.GetId() == itext_scale) { | |
511 | + if (event.GetString().ToDouble(&dvalue)) scl = (GLfloat)dvalue; | |
521 | 512 | |
522 | 513 | } |
523 | - else if (event.GetId() == menu_view_position) { | |
524 | - | |
525 | - printf(" Current Position(x y) : %f %f\n", trans[0], trans[1]); | |
526 | - printf(" New Position(x y) : "); | |
527 | - ierr = scanf("%f %f", &trans[0], &trans[1]); | |
514 | + else if (event.GetId() == itext_positionx) { | |
515 | + if (event.GetString().ToDouble(&dvalue)) trans[0] = (GLfloat)dvalue; | |
528 | 516 | |
529 | 517 | } |
530 | - else if (event.GetId() == menu_view_rotation) { | |
531 | - | |
518 | + else if (event.GetId() == itext_positiony) { | |
519 | + if (event.GetString().ToDouble(&dvalue)) trans[1] = (GLfloat)dvalue; | |
520 | + } | |
521 | + else if (event.GetId() == itext_rotx|| | |
522 | + event.GetId() == itext_roty|| | |
523 | + event.GetId() == itext_rotz) { | |
532 | 524 | /**/ |
533 | 525 | thetay = asinf(rot[0][2]); |
534 | 526 | if (cosf(thetay) != 0.0) { |
@@ -547,7 +539,15 @@ void MyFrame::menu_view( | ||
547 | 539 | thetaz = 180.0f / 3.14159265f * thetaz; |
548 | 540 | printf(" Current Rotation (theta_x theta_y teta_z) in degree : %f %f %f\n", thetax, thetay, thetaz); |
549 | 541 | printf(" New Rotation (theta_x theta_y teta_z) in degree : "); |
550 | - ierr = scanf("%f %f %f", &thetax, &thetay, &thetaz); | |
542 | + if (event.GetId() == itext_rotx) { | |
543 | + if (event.GetString().ToDouble(&dvalue)) thetax = (GLfloat)dvalue; | |
544 | + } | |
545 | + else if (event.GetId() == itext_roty) { | |
546 | + if (event.GetString().ToDouble(&dvalue)) thetay = (GLfloat)dvalue; | |
547 | + } | |
548 | + else if (event.GetId() == itext_rotz) { | |
549 | + if (event.GetString().ToDouble(&dvalue)) thetaz = (GLfloat)dvalue; | |
550 | + } | |
551 | 551 | thetax = 3.14159265f / 180.0f * thetax; |
552 | 552 | thetay = 3.14159265f / 180.0f * thetay; |
553 | 553 | thetaz = 3.14159265f / 180.0f * thetaz; |
@@ -561,9 +561,7 @@ void MyFrame::menu_view( | ||
561 | 561 | rot[2][0] = -cosf(thetax)* cosf(thetaz)* sinf(thetay) + sinf(thetax)* sinf(thetaz); |
562 | 562 | rot[2][1] = cosf(thetaz)* sinf(thetax) + cosf(thetax)* sinf(thetay)* sinf(thetaz); |
563 | 563 | rot[2][2] = cosf(thetax)* cosf(thetay); |
564 | - | |
565 | 564 | } |
566 | - | |
567 | 565 | Refresh(false); |
568 | 566 | } |
569 | 567 |
@@ -577,128 +575,151 @@ MyFrame::MyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, | ||
577 | 575 | |
578 | 576 | // debug SetIcon(wxICON(sample)); |
579 | 577 | |
580 | - wxMenu* imenu_bzmode = new wxMenu; | |
581 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_brillouinzone, this, menu_bz_radio1); | |
582 | - imenu_bzmode->AppendRadioItem(menu_bz_radio1, wxT("First Brillouin zone")); | |
583 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_brillouinzone, this, menu_bz_radio2); | |
584 | - imenu_bzmode->AppendRadioItem(menu_bz_radio2, wxT("Primitive Brillouin zone")); | |
578 | + // Make a menubar | |
579 | + wxMenu* fileMenu = new wxMenu; | |
580 | + wxMenuBar* menuBar = new wxMenuBar; | |
581 | + menuBar->Append(fileMenu, wxT("File")); | |
582 | + SetMenuBar(menuBar); | |
585 | 583 | |
586 | - wxMenu* imenu_background = new wxMenu; | |
587 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_background, this, menu_background_radio1); | |
588 | - imenu_background->AppendRadioItem(menu_background_radio1, wxT("Black")); | |
589 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_background, this, menu_background_radio2); | |
590 | - imenu_background->AppendRadioItem(menu_background_radio2, wxT("White")); | |
584 | + wxPanel* panel = new wxPanel(this); | |
585 | + Bind(wxEVT_COMMAND_BUTTON_CLICKED, &MyFrame::button_refresh, this, ibutton_reflesh); | |
586 | + new wxButton(panel, ibutton_reflesh, wxT("Reflesh"), wxPoint(180, 30)); | |
587 | + Bind(wxEVT_COMMAND_BUTTON_CLICKED, &MyFrame::button_compute, this, ibutton_compute); | |
588 | + new wxButton(panel, ibutton_compute, wxT("Compute"), wxPoint(150, 30)); | |
589 | + | |
590 | + new wxStaticText(panel, wxID_ANY, wxT("Scale"), | |
591 | + wxPoint(250, 60), wxDefaultSize, wxALIGN_RIGHT); | |
592 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_view, this, itext_scale); | |
593 | + new wxTextCtrl(this, itext_scale, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
594 | + | |
595 | + new wxStaticText(panel, wxID_ANY, wxT("Position"), | |
596 | + wxPoint(250, 60), wxDefaultSize, wxALIGN_RIGHT); | |
597 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_view, this, itext_positionx); | |
598 | + new wxTextCtrl(this, itext_positionx, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
599 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_view, this, itext_positiony); | |
600 | + new wxTextCtrl(this, itext_positiony, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
601 | + | |
602 | + new wxStaticText(panel, wxID_ANY, wxT("Rotation"), | |
603 | + wxPoint(250, 60), wxDefaultSize, wxALIGN_RIGHT); | |
604 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_view, this, itext_rotx); | |
605 | + new wxTextCtrl(this, itext_rotx, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
606 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_view, this, itext_roty); | |
607 | + new wxTextCtrl(this, itext_roty, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
608 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_view, this, itext_rotz); | |
609 | + new wxTextCtrl(this, itext_rotz, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
610 | + | |
611 | + new wxStaticText(panel, wxID_ANY, wxT("Interpol ratio"), | |
612 | + wxPoint(250, 60), wxDefaultSize, wxALIGN_RIGHT); | |
613 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_interpol, this, itext_interpol); | |
614 | + new wxTextCtrl(this, itext_interpol, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
615 | + | |
616 | + new wxStaticText(panel, wxID_ANY, wxT("Fermi energy"), | |
617 | + wxPoint(250, 60), wxDefaultSize, wxALIGN_RIGHT); | |
618 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_shift, this, itext_shift); | |
619 | + new wxTextCtrl(this, itext_shift, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
620 | + | |
621 | + new wxStaticText(panel, wxID_ANY, wxT("Line width"), | |
622 | + wxPoint(250, 60), wxDefaultSize, wxALIGN_RIGHT ); | |
623 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_line, this, itext_line); | |
624 | + new wxTextCtrl(this, itext_line, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
591 | 625 | |
592 | 626 | nb = 10;// debug |
593 | - wxMenu* imenu_band = new wxMenu; | |
594 | 627 | for (ib = 0; ib < nb; ib++) { |
595 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_band, this, menu_band_check + ib); | |
596 | - imenu_band->AppendCheckItem(menu_band_check + ib, wxString::Format(wxT("Band %d"), ib)); | |
597 | - imenu_band->Check(menu_band_check + ib, true); | |
598 | - } | |
599 | - | |
600 | - wxMenu* imenu_colorscale = new wxMenu; | |
601 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_colorscale, this, colorscale_maxmin); | |
602 | - imenu_colorscale->Append(colorscale_maxmin, wxT("Max/Min of Scale")); | |
603 | - imenu_colorscale->AppendSeparator(); | |
604 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_colorscale, this, colorscale_radio1); | |
605 | - imenu_colorscale->AppendRadioItem(colorscale_radio1, wxT("Input (Real)")); | |
606 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_colorscale, this, colorscale_radio2); | |
607 | - imenu_colorscale->AppendRadioItem(colorscale_radio2, wxT("Input (Complex)")); | |
608 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_colorscale, this, colorscale_radio3); | |
609 | - imenu_colorscale->AppendRadioItem(colorscale_radio3, wxT("Input (Tri-number)")); | |
610 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_colorscale, this, colorscale_radio4); | |
611 | - imenu_colorscale->AppendRadioItem(colorscale_radio4, wxT("Fermi Velocity")); | |
612 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_colorscale, this, colorscale_radio5); | |
613 | - imenu_colorscale->AppendRadioItem(colorscale_radio5, wxT("Band Index")); | |
614 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_colorscale, this, colorscale_radio6); | |
615 | - imenu_colorscale->AppendRadioItem(colorscale_radio6, wxT("Input (Real, Gray Scale)")); | |
616 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_colorscale, this, colorscale_radio7); | |
617 | - imenu_colorscale->AppendRadioItem(colorscale_radio7, wxT("Fermi Velocity (Gray Scale)")); | |
618 | - | |
619 | - wxMenu* imenu_equator = new wxMenu; | |
620 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_equator, this, equator_check); | |
621 | - imenu_equator->AppendCheckItem(equator_check, wxT("Equator")); | |
622 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_equator, this, equator_modify); | |
623 | - imenu_equator->Append(equator_modify, wxT("Modify euqtor")); | |
624 | - | |
625 | - wxMenu* imenu_light = new wxMenu; | |
626 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_lighting, this, menu_lighting_radio1); | |
627 | - imenu_light->AppendRadioItem(menu_lighting_radio1, wxT("Both side")); | |
628 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_lighting, this, menu_lighting_radio2); | |
629 | - imenu_light->AppendRadioItem(menu_lighting_radio2, wxT("Unoccupied side")); | |
630 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_lighting, this, menu_lighting_radio3); | |
631 | - imenu_light->AppendRadioItem(menu_lighting_radio3, wxT("Occupied side")); | |
632 | - | |
633 | - wxMenu* imenu_mouse = new wxMenu; | |
634 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_mouse, this, menu_mouse_radio1); | |
635 | - imenu_mouse->AppendRadioItem(menu_mouse_radio1, wxT("Rotate")); | |
636 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_mouse, this, menu_mouse_radio2); | |
637 | - imenu_mouse->AppendRadioItem(menu_mouse_radio2, wxT("Scale")); | |
638 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_mouse, this, menu_mouse_radio3); | |
639 | - imenu_mouse->AppendRadioItem(menu_mouse_radio3, wxT("Translate")); | |
640 | - | |
641 | - wxMenu* imenu_section = new wxMenu; | |
642 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_section, this, menu_section_check); | |
643 | - imenu_section->AppendCheckItem(menu_section_check, wxT("Section")); | |
644 | - imenu_section->AppendSeparator(); | |
645 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_section, this, menu_section_modify); | |
646 | - imenu_section->Append(menu_section_modify, wxT("Modify section")); | |
647 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_section, this, menu_section_gamma); | |
648 | - imenu_section->Append(menu_section_gamma, wxT("Modify section (across Gamma)")); | |
649 | - | |
650 | - wxMenu* imenu_stereo = new wxMenu; | |
651 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_stereo, this, menu_stereo_radio1); | |
652 | - imenu_stereo->AppendRadioItem(menu_stereo_radio1, wxT("None")); | |
653 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_stereo, this, menu_stereo_radio2); | |
654 | - imenu_stereo->AppendRadioItem(menu_stereo_radio2, wxT("Parallel")); | |
655 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_stereo, this, menu_stereo_radio3); | |
656 | - imenu_stereo->AppendRadioItem(menu_stereo_radio3, wxT("Cross")); | |
657 | - | |
658 | - wxMenu* imenu_tetra = new wxMenu; | |
659 | - for (itet = 0; itet < 16; itet++) { | |
660 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_tetra, this, menu_tetra_radio1 + itet); | |
661 | - imenu_tetra->AppendRadioItem(menu_tetra_radio1 + itet, | |
662 | - wxString::Format(wxT("tetra # %d"), itet)); | |
628 | + Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::check_band, this, icheck_band + ib); | |
629 | + new wxCheckBox(panel, icheck_band + ib, wxString::Format(wxT("Band %d"), ib), wxPoint(20, 170)); | |
630 | + // debug imenu_band->Check(icheck_band + ib, true); | |
663 | 631 | } |
664 | 632 | |
665 | - wxMenu* imenu_view = new wxMenu; | |
666 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_view, this, menu_view_scale); | |
667 | - imenu_view->Append(menu_view_scale, wxT("Scale")); | |
668 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_view, this, menu_view_position); | |
669 | - imenu_view->Append(menu_view_position, wxT("Position")); | |
670 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_view, this, menu_view_rotation); | |
671 | - imenu_view->Append(menu_view_rotation, wxT("Rotation")); | |
672 | - | |
673 | - // Make a menubar | |
674 | - wxMenu* fileMenu = new wxMenu; | |
675 | - | |
676 | - fileMenu->AppendSubMenu(imenu_background, wxT("Background color")); | |
677 | - fileMenu->AppendSubMenu(imenu_band, wxT("Band")); | |
678 | - fileMenu->AppendSubMenu(imenu_bzmode, wxT("Brillouin zone")); | |
679 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_colorbar, this, menu_colorbar_check); | |
680 | - fileMenu->AppendCheckItem(menu_colorbar_check, wxT("Color bar")); | |
681 | - fileMenu->Check(menu_colorbar_check, true); | |
682 | - fileMenu->AppendSubMenu(imenu_colorscale, wxT("Color scale mode")); | |
683 | - fileMenu->AppendSubMenu(imenu_equator, wxT("Equator")); | |
684 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_interpol, this, imenu_interpol); | |
685 | - fileMenu->Append(imenu_interpol, wxT("Interpol ratio")); | |
686 | - fileMenu->AppendSubMenu(imenu_light, wxT("Lighting")); | |
687 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_line, this, imenu_line); | |
688 | - fileMenu->Append(imenu_line, wxT("Line width")); | |
689 | - fileMenu->AppendSubMenu(imenu_mouse, wxT("Mouse Drag")); | |
690 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_nodeline, this, menu_nodeline_check); | |
691 | - fileMenu->AppendCheckItem(menu_nodeline_check, wxT("Nodal line")); | |
692 | - fileMenu->AppendSubMenu(imenu_section, wxT("Section")); | |
693 | - Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::menu_shift, this, imenu_shift); | |
694 | - fileMenu->Append(imenu_shift, wxT("Shift Fermi energy")); | |
695 | - fileMenu->AppendSubMenu(imenu_stereo, wxT("Stereogram")); | |
696 | - fileMenu->AppendSubMenu(imenu_tetra, wxT("Tetrahedron")); | |
697 | - fileMenu->AppendSubMenu(imenu_view, wxT("View point")); | |
698 | - | |
699 | - wxMenuBar* menuBar = new wxMenuBar; | |
700 | - menuBar->Append(fileMenu, wxT("File")); | |
701 | - SetMenuBar(menuBar); | |
633 | + Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &MyFrame::checkvalue_equator, this, icheck_equator); | |
634 | + new wxCheckBox(panel, icheck_equator, wxT("Equator"), wxPoint(20, 170)); | |
635 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::checkvalue_equator, this, itext_equatorx); | |
636 | + new wxTextCtrl(this, itext_equatorx, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
637 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::checkvalue_equator, this, itext_equatory); | |
638 | + new wxTextCtrl(this, itext_equatory, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
639 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::checkvalue_equator, this, itext_equatorz); | |
640 | + new wxTextCtrl(this, itext_equatorz, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
641 | + | |
642 | + Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &MyFrame::check_colorbar, this, icheck_colorbar); | |
643 | + new wxCheckBox(panel, icheck_colorbar, wxT("Color bar"), wxPoint(20, 170)); | |
644 | + // debug fileMenu->Check(menu_colorbar_check, true); | |
645 | + | |
646 | + Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &MyFrame::check_nodeline, this, icheck_nodeline); | |
647 | + new wxCheckBox(panel, icheck_nodeline, wxT("Nodal line"), wxPoint(20, 170)); | |
648 | + | |
649 | + wxString choices_section[] = { | |
650 | + wxT("None"), wxT("Off Gamma"), wxT("On Gamma") }; | |
651 | + Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radiovalue_section, this, iradio_section); | |
652 | + new wxRadioBox(panel, iradio_section, wxT("Section"), | |
653 | + wxPoint(10, 10), wxDefaultSize, | |
654 | + WXSIZEOF(choices_section), choices_section, | |
655 | + 1, wxRA_SPECIFY_COLS); | |
656 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::radiovalue_section, this, itext_sectionx); | |
657 | + new wxTextCtrl(this, itext_sectionx, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
658 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::radiovalue_section, this, itext_sectiony); | |
659 | + new wxTextCtrl(this, itext_sectiony, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
660 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::radiovalue_section, this, itext_sectionz); | |
661 | + new wxTextCtrl(this, itext_sectionz, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
662 | + | |
663 | + new wxStaticText(panel, wxID_ANY, wxT("Min of Scale"), | |
664 | + wxPoint(250, 60), wxDefaultSize, wxALIGN_RIGHT); | |
665 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::radiovalue_colorscale, this, itext_colorscalemin); | |
666 | + new wxTextCtrl(this, itext_colorscalemin, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
667 | + new wxStaticText(panel, wxID_ANY, wxT("Max of Scale"), | |
668 | + wxPoint(250, 60), wxDefaultSize, wxALIGN_RIGHT); | |
669 | + Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::radiovalue_colorscale, this, itext_colorscalemax); | |
670 | + new wxTextCtrl(this, itext_colorscalemax, wxT(""), wxPoint(0, 250), wxSize(100, 50)); | |
671 | + wxString choices_colorscale[] = { wxT("Input (Real)"), wxT("Input (Complex)"), | |
672 | + wxT("Input (Tri-number)"), wxT("Fermi Velocity"), wxT("Band Index"), | |
673 | + wxT("Input (Real, Gray Scale)"), wxT("Fermi Velocity (Gray Scale)") }; | |
674 | + Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radiovalue_colorscale, this, iradio_colorscale); | |
675 | + new wxRadioBox(panel, iradio_colorscale, wxT("Color scale mode"), | |
676 | + wxPoint(10, 10), wxDefaultSize, | |
677 | + WXSIZEOF(choices_colorscale), choices_colorscale, | |
678 | + 1, wxRA_SPECIFY_COLS); | |
679 | + | |
680 | + wxString choices_tetra[] = { wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5"), wxT("6"), wxT("7") , | |
681 | + wxT("8"), wxT("9"), wxT("10"), wxT("11"), wxT("12"), wxT("13"), wxT("14"), | |
682 | + wxT("15"), wxT("16") }; | |
683 | + Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radio_tetra, this, iradio_tetra); | |
684 | + new wxRadioBox(panel, iradio_tetra, wxT("Tetrahedron"), | |
685 | + wxPoint(10, 10), wxDefaultSize, | |
686 | + WXSIZEOF(choices_tetra), choices_tetra, | |
687 | + 1, wxRA_SPECIFY_COLS); | |
688 | + | |
689 | + wxString choices_stereo[] = { wxT("None"), wxT("Parallel"), wxT("Cross") }; | |
690 | + Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radio_stereo, this, iradio_stereo); | |
691 | + new wxRadioBox(panel, iradio_stereo, wxT("Stereogram"), | |
692 | + wxPoint(10, 10), wxDefaultSize, | |
693 | + WXSIZEOF(choices_stereo), choices_stereo, | |
694 | + 1, wxRA_SPECIFY_COLS); | |
695 | + | |
696 | + wxString choices_mouse[] = { wxT("Rotate"), wxT("Scale"), wxT("Translate") }; | |
697 | + Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radio_mouse, this, iradio_mouse); | |
698 | + new wxRadioBox(panel, iradio_mouse, wxT("Mouse Drag"), | |
699 | + wxPoint(10, 10), wxDefaultSize, | |
700 | + WXSIZEOF(choices_mouse), choices_mouse, | |
701 | + 1, wxRA_SPECIFY_COLS); | |
702 | + | |
703 | + wxString choices_light[] = { wxT("Both side"), wxT("Unoccupied side"), wxT("Occupied side") }; | |
704 | + Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radio_lighting, this, iradio_lighting); | |
705 | + new wxRadioBox(panel, iradio_lighting, wxT("Lighting"), | |
706 | + wxPoint(10, 10), wxDefaultSize, | |
707 | + WXSIZEOF(choices_light), choices_light, | |
708 | + 1, wxRA_SPECIFY_COLS); | |
709 | + | |
710 | + wxString choices_bg[] = { wxT("Black"), wxT("White") }; | |
711 | + Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radio_background, this, iradio_background); | |
712 | + new wxRadioBox(panel, iradio_background, wxT("Background color"), | |
713 | + wxPoint(10, 10), wxDefaultSize, | |
714 | + WXSIZEOF(choices_bg), choices_bg, | |
715 | + 1, wxRA_SPECIFY_COLS); | |
716 | + | |
717 | + wxString choices_bz[] = { wxT("First Brillouin zone"), wxT("Primitive Brillouin zone") }; | |
718 | + Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radio_brillouinzone, this, iradio_brillouinzone); | |
719 | + new wxRadioBox(panel, iradio_brillouinzone, wxT("Brillouin zone"), | |
720 | + wxPoint(10, 10), wxDefaultSize, | |
721 | + WXSIZEOF(choices_bz), choices_bz, | |
722 | + 1, wxRA_SPECIFY_COLS); | |
702 | 723 | |
703 | 724 | // Make a TestGLCanvas |
704 | 725 |
@@ -730,9 +751,6 @@ MyFrame::MyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, | ||
730 | 751 | wxBoxSizer* outsizer = new wxBoxSizer(wxHORIZONTAL); |
731 | 752 | outsizer->Add(insizer, 1, wxEXPAND, 1); |
732 | 753 | |
733 | - wxPanel* panel = new wxPanel(this); | |
734 | - wxButton* select_two = new wxButton(panel, menu_nodeline_check, wxT("Select #&2")); | |
735 | - | |
736 | 754 | outsizer->Add(panel, 1, wxEXPAND, 1); |
737 | 755 | SetSizer(outsizer); |
738 | 756 | SetAutoLayout(true); |
@@ -43,21 +43,23 @@ public: | ||
43 | 43 | |
44 | 44 | private: |
45 | 45 | void OnExit(wxCommandEvent& event); |
46 | - void menu_brillouinzone(wxCommandEvent& event); | |
47 | - void menu_background(wxCommandEvent& event); | |
48 | - void menu_band(wxCommandEvent& event); | |
49 | - void menu_colorbar(wxCommandEvent& event); | |
50 | - void menu_colorscale(wxCommandEvent& event); | |
51 | - void menu_equator(wxCommandEvent& event); | |
52 | - void menu_interpol(wxCommandEvent& event); | |
53 | - void menu_lighting(wxCommandEvent& event); | |
54 | - void menu_line(wxCommandEvent& event); | |
55 | - void menu_mouse(wxCommandEvent& event); | |
56 | - void menu_nodeline(wxCommandEvent& event); | |
57 | - void menu_section(wxCommandEvent& event); | |
58 | - void menu_shift(wxCommandEvent& event); | |
59 | - void menu_stereo(wxCommandEvent& event); | |
60 | - void menu_tetra(wxCommandEvent& event); | |
61 | - void menu_view(wxCommandEvent& event); | |
46 | + void radio_brillouinzone(wxCommandEvent& event); | |
47 | + void radio_background(wxCommandEvent& event); | |
48 | + void check_band(wxCommandEvent& event); | |
49 | + void check_colorbar(wxCommandEvent& event); | |
50 | + void radiovalue_colorscale(wxCommandEvent& event); | |
51 | + void checkvalue_equator(wxCommandEvent& event); | |
52 | + void textctrl_interpol(wxCommandEvent& event); | |
53 | + void radio_lighting(wxCommandEvent& event); | |
54 | + void textctrl_line(wxCommandEvent& event); | |
55 | + void radio_mouse(wxCommandEvent& event); | |
56 | + void check_nodeline(wxCommandEvent& event); | |
57 | + void radiovalue_section(wxCommandEvent& event); | |
58 | + void textctrl_shift(wxCommandEvent& event); | |
59 | + void radio_stereo(wxCommandEvent& event); | |
60 | + void radio_tetra(wxCommandEvent& event); | |
61 | + void textctrl_view(wxCommandEvent& event); | |
62 | + void button_refresh(wxCommandEvent& event); | |
63 | + void button_compute(wxCommandEvent& event); | |
62 | 64 | //wxDECLARE_EVENT_TABLE(); |
63 | 65 | }; |
@@ -132,7 +132,11 @@ int read_file() | ||
132 | 132 | for (i = 0; i < 3; ++i) { |
133 | 133 | secvec[i] = bvec[2][i]; |
134 | 134 | eqvec[i] = bvec[2][i]; |
135 | + eqvec_fr[i] = 0.0; | |
136 | + secvec_fr[i] = 0.0; | |
135 | 137 | } |
138 | + eqvec_fr[2] = 1.0; | |
139 | + secvec_fr[2] = 1.0; | |
136 | 140 | secscale = 0.0; |
137 | 141 | /* |
138 | 142 | Allocation of Kohn-Sham energies $ matrix elements |
@@ -106,6 +106,7 @@ extern GLfloat **clrnl;//!< Color of nodeline [::nb][::nnl*2*4] | ||
106 | 106 | 2D Fermi line |
107 | 107 | */ |
108 | 108 | extern GLfloat secvec[3]; //!< @f$k@f$-vector to define section |
109 | +extern GLfloat secvec_fr[3]; //!< @f$k@f$-vector to define section | |
109 | 110 | extern GLfloat secscale; //!< 0.0 (across @f$\Gamma@f$) or 1.0 |
110 | 111 | extern GLfloat axis2d[2][3]; //!< @f$k@f$-vector to define section |
111 | 112 | extern int *n2d; //!< Number of line segment |
@@ -119,6 +120,7 @@ extern GLfloat bzl2d_proj[26][3]; //!< Lines of 1st BZ [::nbzl2d (max:26)][3], p | ||
119 | 120 | Equator |
120 | 121 | */ |
121 | 122 | extern GLfloat eqvec[3]; //!< @f$k@f$-vector for equator |
123 | +extern GLfloat eqvec_fr[3]; //!< @f$k@f$-vector for equator | |
122 | 124 | extern int *nequator; //!< The number of equator |
123 | 125 | extern GLfloat ****kveq; //!< @f$k@f$-vector of equator [::nb][::nequator][2][3] |
124 | 126 | extern GLfloat **kveq_rot; //!< @f$k@f$-vector of equator [::nb][::nequator*2*3] |