fermisurfer  2.0.0
fermisurfer
menu.cpp
Go to the documentation of this file.
1 /*
2 The MIT License (MIT)
3 
4 Copyright (c) 2014 Mitsuaki KAWAMURA
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 THE SOFTWARE.
23 */
24 /**@file
25 @brief Create & modify right-click menu. And operate their function.
26 */
27 #include "free_patch.hpp"
28 #include "fermi_patch.hpp"
29 #include "calc_nodeline.hpp"
30 #include "kumo.hpp"
31 #include "initialize.hpp"
32 #include "section.hpp"
33 #include "equator.hpp"
34 #include "draw.hpp"
35 #include "variable.hpp"
36 #include "menu.hpp"
37 #include "operation.hpp"
38 #include "fermisurfer.xpm"
39 #include <wx/splitter.h>
40 #include <wx/gbsizer.h>
41 #if defined(HAVE_CONFIG_H)
42 #include <config.h>
43 #endif
44 #if defined(HAVE_GL_GL_H)
45 #include <GL/gl.h>
46 #elif defined(HAVE_OPENGL_GL_H)
47 #include <OpenGL/gl.h>
48 #endif
49 #include <cstdlib>
50 #include <cstdio>
51 #include <cmath>
52 
54  if (refresh_interpol == 1){
56  refresh_patch = 1;
57  refresh_interpol = 0;
58  }
59  if (refresh_patch == 1) {
60  fermi_patch();
61  refresh_color = 1;
62  refresh_section = 1;
63  refresh_equator = 1;
64  refresh_nodeline = 1;
65  refresh_patch = 0;
66  }
67  if (refresh_color == 1) {
68  if (skip_minmax == 1) skip_minmax = 0;
69  else max_and_min();
70  paint();
71  refresh_section = 1;
72  refresh_color = 0;
73  }
74  if (refresh_nodeline == 1) {
75  calc_nodeline();
76  refresh_nodeline = 0;
77  }
78  if (refresh_section == 1) {
79  calc_2dbz();
80  calc_section();
81  refresh_section = 0;
82  }
83  if (refresh_equator == 1) {
84  equator();
85  refresh_equator = 0;
86  }
87 }
88 
90  free_patch();
92 }
93 
94 enum
95 {
156 };
157 
159  wxCommandEvent& event//!<[in] Selected menu
160 ) {
161  Refresh(false);
162 }
163 
165  wxCommandEvent& event//!<[in] Selected menu
166 ) {
167  free_patch();
169  Refresh(false);
170 }
172  wxCommandEvent& event//!<[in] Selected menu
173 ) {
174  int ib, i2d, i;
175  FILE *fp;
176  fp = fopen("fermi_line.dat", "w");
177  for (ib = 0; ib < nb; ib++) {
178  if (draw_band[ib] == 1) {
179  for (i2d = 0; i2d < n2d[ib]; i2d++) {
180  for (i = 0; i < 2; i++) {
181  fprintf(fp, "%15.5e %15.5e\n",
182  kv2d[ib][i * 3 + 6 * i2d],
183  kv2d[ib][1 + i * 3 + 6 * i2d]);
184  }
185  fprintf(fp, "\n\n");
186  }
187  }/*if (draw_band[ib] == 1)*/
188  }/* for (ib = 0; ib < nb; ib++)*/
189  fclose(fp);
190  *terminal << wxT(" fermi_line.dat was written.\n");
191 
192  fp = fopen("bz_line.dat", "w");
193  for (i2d = 0; i2d < nbzl2d; i2d++) {
194  fprintf(fp, "%15.5e %15.5e\n",
195  bzl2d_proj[i2d][0], bzl2d_proj[i2d][1]);
196  }
197  fprintf(fp, "%15.5e %15.5e\n",
198  bzl2d_proj[0][0], bzl2d_proj[0][1]);
199  fclose(fp);
200  *terminal << wxT(" bz_line.dat was written.\n");
201 }
202 /**
203 @brief Change arrow (::blackback)
204 */
206  wxCommandEvent& event //!<[in] Selected menu
207 )
208 {
209  int ii, jj;
210  double dvalue, diff;
211 
212  if (event.GetId() == itext_ArrowStart0) {
213  if (event.GetString().ToDouble(&dvalue)) {
214  arrow[1][0] += (GLfloat)dvalue - arrow[0][0];
215  arrow[0][0] = (GLfloat)dvalue;
216  textbox_ArrowEnd0->ChangeValue(wxString::Format(wxT("%f"), arrow[1][0]));
217  }
218  }
219  else if (event.GetId() == itext_ArrowStart1) {
220  if (event.GetString().ToDouble(&dvalue)) {
221  arrow[1][1] += (GLfloat)dvalue - arrow[0][1];
222  arrow[0][1] = (GLfloat)dvalue;
223  textbox_ArrowEnd1->ChangeValue(wxString::Format(wxT("%f"), arrow[1][1]));
224  }
225  }
226  else if (event.GetId() == itext_ArrowStart2) {
227  if (event.GetString().ToDouble(&dvalue)) {
228  arrow[1][2] += (GLfloat)dvalue - arrow[0][2];
229  arrow[0][2] = (GLfloat)dvalue;
230  textbox_ArrowEnd2->ChangeValue(wxString::Format(wxT("%f"), arrow[1][2]));
231  }
232  }
233  else if (event.GetId() == itext_ArrowEnd0) {
234  if (event.GetString().ToDouble(&dvalue)) {
235  arrow[1][0] = (GLfloat)dvalue;
236  textbox_ArrowDiff0->ChangeValue(wxString::Format(wxT("%f"), arrow[1][0] - arrow[0][0]));
237  }
238  }
239  else if (event.GetId() == itext_ArrowEnd1) {
240  if (event.GetString().ToDouble(&dvalue)) {
241  arrow[1][1] = (GLfloat)dvalue;
242  textbox_ArrowDiff1->ChangeValue(wxString::Format(wxT("%f"), arrow[1][1] - arrow[0][1]));
243  }
244  }
245  else if (event.GetId() == itext_ArrowEnd2) {
246  if (event.GetString().ToDouble(&dvalue)) {
247  arrow[1][2] = (GLfloat)dvalue;
248  textbox_ArrowDiff2->ChangeValue(wxString::Format(wxT("%f"), arrow[1][2] - arrow[0][2]));
249  }
250  }
251  else if (event.GetId() == itext_ArrowDiff0) {
252  if (event.GetString().ToDouble(&dvalue)) {
253  arrow[1][0] = arrow[0][0] + (GLfloat)dvalue;
254  textbox_ArrowEnd0->ChangeValue(wxString::Format(wxT("%f"), arrow[1][0]));
255  }
256  }
257  else if (event.GetId() == itext_ArrowDiff1) {
258  if (event.GetString().ToDouble(&dvalue)) {
259  arrow[1][1] = arrow[0][1] + (GLfloat)dvalue;
260  textbox_ArrowEnd1->ChangeValue(wxString::Format(wxT("%f"), arrow[1][1]));
261  }
262  }
263  else if (event.GetId() == itext_ArrowDiff2) {
264  if (event.GetString().ToDouble(&dvalue)) {
265  arrow[1][2] = arrow[0][2] + (GLfloat)dvalue;
266  textbox_ArrowEnd2->ChangeValue(wxString::Format(wxT("%f"), arrow[1][2]));
267  }
268  }
269  //
270  Refresh(false);
271 }
272 /**
273 @brief Change Line color color (::blackback)
274 */
276  wxCommandEvent& event //!<[in] Selected menu
277 )
278 {
279  int ii, jj, icount;
280  double dvalue, diff, theta1, theta2, phi1, phi2;
281 
282  if (event.GetId() == itext_sphereX) {
283  if (event.GetString().ToDouble(&dvalue)) {
284  sphere_c[0] = (GLfloat)dvalue;
285  }
286  }
287  else if (event.GetId() == itext_sphereY) {
288  if (event.GetString().ToDouble(&dvalue)) {
289  sphere_c[1] = (GLfloat)dvalue;
290  }
291  }
292  else if (event.GetId() == itext_sphereZ) {
293  if (event.GetString().ToDouble(&dvalue)) {
294  sphere_c[2] = (GLfloat)dvalue;
295  }
296  }
297  else if (event.GetId() == itext_sphereR) {
298  if (event.GetString().ToDouble(&dvalue)) {
299  sphere_r = (GLfloat)dvalue;
300  }
301  }
302  //
303  // Vertex of wireflame sphere
304  //
305  icount = 0;
306  for (ii = 0; ii < 10; ii++) {
307  phi1 = 2.0 * M_PI * (double)ii * 0.1;
308  for (jj = 0; jj < 10; jj++) {
309  theta1 = M_PI * (double)jj * 0.1;
310  theta2 = M_PI * (double)(jj + 1) * 0.1;
311  sphere_v[icount][0][0] = sphere_c[0] + sphere_r * (GLfloat)(sin(theta1) * cos(phi1));
312  sphere_v[icount][0][1] = sphere_c[1] + sphere_r * (GLfloat)(sin(theta1) * sin(phi1));
313  sphere_v[icount][0][2] = sphere_c[2] + sphere_r * (GLfloat)cos(theta1);
314  sphere_v[icount][1][0] = sphere_c[0] + sphere_r * (GLfloat)(sin(theta2) * cos(phi1));
315  sphere_v[icount][1][1] = sphere_c[1] + sphere_r * (GLfloat)(sin(theta2) * sin(phi1));
316  sphere_v[icount][1][2] = sphere_c[2] + sphere_r * (GLfloat)cos(theta2);
317  icount += 1;
318  }
319  }
320  for (ii = 0; ii < 10; ii++) {
321  phi1 = 2.0 * M_PI * (double)ii * 0.1;
322  phi2 = 2.0 * M_PI * (double)(ii + 1) * 0.1;
323  for (jj = 1; jj < 10; jj++) {
324  theta1 = M_PI * (double)jj * 0.1;
325  sphere_v[icount][0][0] = sphere_c[0] + sphere_r * (GLfloat)(sin(theta1) * cos(phi1));
326  sphere_v[icount][0][1] = sphere_c[1] + sphere_r * (GLfloat)(sin(theta1) * sin(phi1));
327  sphere_v[icount][0][2] = sphere_c[2] + sphere_r * (GLfloat)cos(theta1);
328  sphere_v[icount][1][0] = sphere_c[0] + sphere_r * (GLfloat)(sin(theta1) * cos(phi2));
329  sphere_v[icount][1][1] = sphere_c[1] + sphere_r * (GLfloat)(sin(theta1) * sin(phi2));
330  sphere_v[icount][1][2] = sphere_c[2] + sphere_r * (GLfloat)cos(theta1);
331  icount += 1;
332  }
333  }
334  //
335  Refresh(false);
336 }
337 /**
338 @brief Change Line color color (::blackback)
339 */
341  wxCommandEvent& event //!<[in] Selected menu
342 )
343 {
344  double dvalue;
345 
346  if (event.GetId() == itext_LineColorR) {
347  if (event.GetString().ToDouble(&dvalue)) {
348  LineColor[0] = (GLfloat)dvalue;
349  Refresh(false);
350  }
351  }
352  else if (event.GetId() == itext_LineColorG) {
353  if (event.GetString().ToDouble(&dvalue)) {
354  LineColor[1] = (GLfloat)dvalue;
355  Refresh(false);
356  }
357  }
358  else if (event.GetId() == itext_LineColorB) {
359  if (event.GetString().ToDouble(&dvalue)) {
360  LineColor[2] = (GLfloat)dvalue;
361  Refresh(false);
362  }
363  }
364 }
365 /**
366 @brief Change section color (::blackback)
367 */
369  wxCommandEvent& event //!<[in] Selected menu
370 )
371 {
372  double dvalue;
373 
374  if (event.GetId() == itext_SectionR) {
375  if (event.GetString().ToDouble(&dvalue)) {
376  SectionColor[0] = (GLfloat)dvalue;
377  Refresh(false);
378  }
379  }
380  else if (event.GetId() == itext_SectionG) {
381  if (event.GetString().ToDouble(&dvalue)) {
382  SectionColor[1] = (GLfloat)dvalue;
383  Refresh(false);
384  }
385  }
386  else if (event.GetId() == itext_SectionB) {
387  if (event.GetString().ToDouble(&dvalue)) {
388  SectionColor[2] = (GLfloat)dvalue;
389  Refresh(false);
390  }
391  }
392 }
393 /**
394 @brief Change band color (::blackback)
395 */
397  wxCommandEvent& event //!<[in] Selected menu
398 )
399 {
400  double dvalue;
401  int ib = (event.GetId() - icheck_band) / 4;
402 
403  if (event.GetId() == icheck_band + 4 * ib + 1) {
404  if (event.GetString().ToDouble(&dvalue)) {
405  rgb_band[ib][0] = (GLfloat)dvalue;
406  paint();
407  Refresh(false);
408  }
409  }
410  else if (event.GetId() == icheck_band + 4 * ib + 2) {
411  if (event.GetString().ToDouble(&dvalue)) {
412  rgb_band[ib][1] = (GLfloat)dvalue;
413  paint();
414  Refresh(false);
415  }
416  }
417  else if (event.GetId() == icheck_band + 4 * ib + 3) {
418  if (event.GetString().ToDouble(&dvalue)) {
419  rgb_band[ib][2] = (GLfloat)dvalue;
420  paint();
421  Refresh(false);
422  }
423  }
424 }
425 /**
426 @brief Change background color (::blackback)
427 */
429  wxCommandEvent& event //!<[in] Selected menu
430 )
431 {
432  double dvalue;
433 
434  if (event.GetId() == itext_BackGroundR) {
435  if (event.GetString().ToDouble(&dvalue)) {
436  BackGroundColor[0] = (GLfloat)dvalue;
437  glClearColor(BackGroundColor[0], BackGroundColor[1],
439  Refresh(false);
440  }
441  }
442  else if (event.GetId() == itext_BackGroundG) {
443  if (event.GetString().ToDouble(&dvalue)) {
444  BackGroundColor[1] = (GLfloat)dvalue;
445  glClearColor(BackGroundColor[0], BackGroundColor[1],
447  Refresh(false);
448  }
449  }
450  else if (event.GetId() == itext_BackGroundB) {
451  if (event.GetString().ToDouble(&dvalue)) {
452  BackGroundColor[2] = (GLfloat)dvalue;
453  glClearColor(BackGroundColor[0], BackGroundColor[1],
455  Refresh(false);
456  }
457  }
458 }
459 /**
460 @brief Change Number of Brillouin zone
461 */
463  wxCommandEvent& event //!<[in] Selected menu
464 )
465 {
466  double dvalue;
467 
468  if (event.GetId() == itext_BZ_number0) {
469  if (event.GetString().ToDouble(&dvalue)) {
470  BZ_number[0] = (int)dvalue;
471  Refresh(false);
472  }
473  }
474  else if (event.GetId() == itext_BZ_number1) {
475  if (event.GetString().ToDouble(&dvalue)) {
476  BZ_number[1] = (int)dvalue;
477  Refresh(false);
478  }
479  }
480  else if (event.GetId() == itext_BZ_number2) {
481  if (event.GetString().ToDouble(&dvalue)) {
482  BZ_number[2] = (int)dvalue;
483  Refresh(false);
484  }
485  }
486 }
487  /**
488  @brief Toggle the appearance of each band (::draw_band)
489 */
491  wxCommandEvent& event //!<[in] Selected menu
492 )
493 {
494  int ib = (event.GetId() - icheck_band) / 4;
495  if (draw_band[ib] == 0) {
496  draw_band[ib] = 1;
497  }
498  else {
499  draw_band[ib] = 0;
500  }
501  Refresh(false);
502 } /* menu_band */
503 /**
504  @brief Change Brillouin zone (::fbz)
505 */
507  wxCommandEvent& event //!<[in] Selected menu
508 )
509 {
510  if (event.GetString().Cmp(wxT("First Brillouin zone")) == 0) {
511  fbz = 1;
512  }
513  else if (event.GetString().Cmp(wxT("Primitive Brillouin zone")) == 0) {
514  fbz = -1;
515  }
516  refresh_patch = 1;
517 } /* menu_brillouinzone */
518 /**
519  @brief Change Brillouin zone (::fbz)
520 */
522  wxCommandEvent& event //!<[in] Selected menu
523 )
524 {
525  int ii;
526  if (event.GetString().Cmp(wxT("BGR")) == 0) {
527  for (ii = 0; ii < 4; ii++) {
528  BarColor[0][ii] = blue[ii];
529  BarColor[1][ii] = cyan[ii];
530  BarColor[2][ii] = green[ii];
531  BarColor[3][ii] = yellow[ii];
532  BarColor[4][ii] = red[ii];
533  }
534  }
535  else if (event.GetString().Cmp(wxT("CMY")) == 0) {
536  for (ii = 0; ii < 4; ii++) {
537  BarColor[0][ii] = cyan[ii];
538  BarColor[1][ii] = blue[ii];
539  BarColor[2][ii] = magenta[ii];
540  BarColor[3][ii] = red[ii];
541  BarColor[4][ii] = yellow[ii];
542  }
543  }
544  else if (event.GetString().Cmp(wxT("MCY")) == 0) {
545  for (ii = 0; ii < 4; ii++) {
546  BarColor[0][ii] = magenta[ii];
547  BarColor[1][ii] = blue[ii];
548  BarColor[2][ii] = cyan[ii];
549  BarColor[3][ii] = green[ii];
550  BarColor[4][ii] = yellow[ii];
551  }
552  }
553  else if (event.GetString().Cmp(wxT("BWR")) == 0) {
554  for (ii = 0; ii < 4; ii++) {
555  BarColor[0][ii] = blue[ii];
556  BarColor[1][ii] = 0.5f * (blue[ii] + wgray[ii]);
557  BarColor[2][ii] = wgray[ii];
558  BarColor[3][ii] = 0.5f * (red[ii] + wgray[ii]);
559  BarColor[4][ii] = red[ii];
560  }
561  }
562  paint();
563  Refresh(false);
564 } /* menu_brillouinzone */
565 /**
566  @brief Toggle Colorbar (::lcolorbar)
567 */
569  wxCommandEvent& event //!<[in] Selected menu
570 )
571 {
572  if (lcolorbar != 1) lcolorbar = 1;
573  else lcolorbar = 0;
574  Refresh(false);
575 } /* menu_colorbar */
576 /**
577  @brief Change color scale mode (::color_scale)
578 */
580  wxCommandEvent& event //!<[in] Selected menu
581 )
582 {
583  double dminmax;
584 
585  if (event.GetId() == itext_colorscalemin) {
586  if (event.GetString().ToDouble(&dminmax))
587  patch_min = (GLfloat)dminmax;
588  skip_minmax = 1;
589  }
590  else if (event.GetId() == itext_colorscalemax) {
591  if (event.GetString().ToDouble(&dminmax))
592  patch_max = (GLfloat)dminmax;
593  skip_minmax = 1;
594  }
595  else if (event.GetString().Cmp(wxT("Input (1D)")) == 0)
596  color_scale = 1;
597  else if (event.GetString().Cmp(wxT("Input (2D)")) == 0)
598  color_scale = 2;
599  else if (event.GetString().Cmp(wxT("Input (3D)")) == 0)
600  color_scale = 3;
601  else if (event.GetString().Cmp(wxT("Fermi Velocity")) == 0)
602  color_scale = 4;
603  else if (event.GetString().Cmp(wxT("Band Index")) == 0)
604  color_scale = 5;
605  else if (event.GetString().Cmp(wxT("Input (1D, Gray Scale)")) == 0)
606  color_scale = 6;
607  else if (event.GetString().Cmp(wxT("Fermi Velocity (Gray Scale)")) == 0)
608  color_scale = 7;
609  refresh_color = 1;
610 } /* menu_colorscale */
611 /**
612  @brief Modify and toggle appearance of equator (::lequator)
613 */
615  wxCommandEvent& event //!<[in] Selected menu
616 )
617 {
618  int ii, jj;
619  double deqvec;
620 
621  if (event.GetId() == icheck_equator) {
622  if (lequator != 1) lequator = 1;
623  else lequator = 0;
624  Refresh(false);
625  }/*if (event.GetId() == 1)*/
626  else {
627  if (event.GetId() == itext_equatorx) {
628  if (event.GetString().ToDouble(&deqvec)) eqvec_fr[0] = (GLfloat)deqvec;
629  }
630  else if (event.GetId() == itext_equatory) {
631  if (event.GetString().ToDouble(&deqvec)) eqvec_fr[1] = (GLfloat)deqvec;
632  }
633  else if (event.GetId() == itext_equatorz) {
634  if (event.GetString().ToDouble(&deqvec)) eqvec_fr[2] = (GLfloat)deqvec;
635  }
636  /*
637  Fractional -> Cartecian
638  */
639  for (ii = 0; ii < 3; ii++) {
640  eqvec[ii] = 0.0;
641  for (jj = 0; jj < 3; jj++) {
642  eqvec[ii] += eqvec_fr[jj] * bvec[jj][ii];
643  }/*for (jj = 0; jj < 3; jj++)*/
644  }/*for (ii = 0; ii < 3; ii++)*/
645  refresh_equator = 1;
646  }/*else if (event.GetId() > 1)*/
647 } /*void menu_equator*/
648 /**
649  @brief Modify interpolation ratio
650 
651  This routine modify interpolation ratio (::interpol)
652  then compute Fermi surfaces, etc.
653 */
655  wxCommandEvent& event //!<[in] Selected menu
656 )
657 {
658  long int long_interpol;
659 
660  if (event.GetString().ToLong(&long_interpol)) {
661  interpol = (int)long_interpol;
662  refresh_interpol = 1;
663  }
664 }/*static void menu_interpol*/
665 /**
666  @brief Toggle Lighting
667 */
669  wxCommandEvent& event //!<[in] Selected menu
670 )
671 {
672  if (event.GetString().Cmp(wxT("Both")) == 0) {
673  side = 1.0;
674  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
675  }
676  if (event.GetString().Cmp(wxT("Unoccupy")) == 0) {
677  side = 1.0;
678  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
679  }
680  if (event.GetString().Cmp(wxT("Occupy")) == 0) {
681  side = -1.0;
682  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
683  }
684  Refresh(false);
685 } /* menu_lighting */
686 /**
687  @brief Line width
688 */
690  wxCommandEvent& event //!<[in] Selected menu
691 )
692 {
693  double dlinewidth;
694 
695  if (event.GetString().ToDouble(&dlinewidth)) linewidth = (GLfloat)dlinewidth;
696  Refresh(false);
697 } /* menu_line */
698 /**
699  @brief Change the function associated to the mouse movement(::lmouse)
700 */
702  wxCommandEvent& event //!<[in] Selected menu
703 )
704 {
705  if (event.GetString().Cmp(wxT("Rotate")) == 0) lmouse = 1;
706  else if (event.GetString().Cmp(wxT("Scale")) == 0) lmouse = 2;
707  else if (event.GetString().Cmp(wxT("Translate")) == 0) lmouse = 3;
708  Refresh(false);
709 } /* menu_mouse */
710 /**
711  @brief Toggle apearance of nodale-line
712 */
714  wxCommandEvent& event //!<[in] Selected menu
715 )
716 {
717  if (nodeline != 1) nodeline = 1;
718  else nodeline = 0;
719  Refresh(false);
720 }/*menu_nodeline*/
721 /**
722  @brief Modify and toggle appearance of 2D Fermi lines (::lsection)
723 */
725  wxCommandEvent& event //!<[in] Selected menu
726 )
727 {
728  int ii, jj;
729  double dsecvec;
730 
731  if (event.GetId() == icheck_section) {
732  if (lsection == 0)lsection = 1;
733  else lsection = 0;
734  Refresh(false);
735  }
736  else if(event.GetId() == icheck_gamma) {
737  if(secscale > 0.5) secscale = 0.0;
738  else secscale = 1.0;
739  refresh_section = 1;
740  }
741  else {
742  if (event.GetId() == itext_sectionx) {
743  if (event.GetString().ToDouble(&dsecvec)) secvec_fr[0] = (GLfloat)dsecvec;
744  }
745  else if (event.GetId() == itext_sectiony) {
746  if (event.GetString().ToDouble(&dsecvec)) secvec_fr[1] = (GLfloat)dsecvec;
747  }
748  else if (event.GetId() == itext_sectionz) {
749  if (event.GetString().ToDouble(&dsecvec)) secvec_fr[2] = (GLfloat)dsecvec;
750  }
751  /*
752  Fractional -> Cartecian
753  */
754  for (ii = 0; ii < 3; ii++) {
755  secvec[ii] = 0.0;
756  for (jj = 0; jj < 3; jj++) {
757  secvec[ii] += secvec_fr[jj] * bvec[jj][ii];
758  }/*for (jj = 0; jj < 3; jj++)*/
759  }/*for (ii = 0; ii < 3; ii++)*/
760  refresh_section = 1;
761  }/*else if (event.GetId() > 1)*/
762 } /*void menu_section*/
763 /**
764  @brief Shift Fermi energy
765 */
767  wxCommandEvent& event //!<[in] Selected menu
768 )
769 {
770  double dEF;
771  if (event.GetString().ToDouble(&dEF)) {
772  EF = (GLfloat)dEF;
773  refresh_patch = 1;
774  }
775 } /* menu_shift */
776 /**
777  @brief Tern stereogram (::lstereo)
778 */
780  wxCommandEvent& event //!<[in] Selected menu
781 ) {
782  if (event.GetString().Cmp(wxT("None")) == 0) lstereo = 1;
783  else if (event.GetString().Cmp(wxT("Parallel")) == 0) lstereo = 2;
784  else if (event.GetString().Cmp(wxT("Cross")) == 0) lstereo = 3;
785  Refresh(false);
786 } /* menu_stereo */
787 /**
788  @brief Change tetrahedron (::itet)
789 */
791  wxCommandEvent& event //!<[in] Selected menu
792 )
793 {
794  itet = wxAtoi(event.GetString()) - 1;
795  init_corner();
796  refresh_patch = 1;
797 }/*menu_tetra*/
798  /**
799  @brief Setting of view
800 
801  This modify scale (::scl) & tarnslation (::trans) &
802  rotation (::thetax, ::thetay, ::thetaz, ::rot),
803  */
805  wxCommandEvent& event //!<[in] Selected menu
806 )
807 {
808  double dvalue;
809 
810  if (event.GetId() == itext_scale) {
811  if (event.GetString().ToDouble(&dvalue)) {
812  linewidth *= (GLfloat)dvalue/scl;
813  scl = (GLfloat)dvalue;
814  textbox_linewidth->ChangeValue(wxString::Format(wxT("%f"), linewidth));
815  Refresh(false);
816  }
817  }
818  else if (event.GetId() == itext_positionx) {
819  if (event.GetString().ToDouble(&dvalue)) {
820  trans[0] = (GLfloat)dvalue;
821  Refresh(false);
822  }
823  }
824  else if (event.GetId() == itext_positiony) {
825  if (event.GetString().ToDouble(&dvalue)) {
826  trans[1] = (GLfloat)dvalue;
827  Refresh(false);
828  }
829  }
830  else if (event.GetId() == itext_rotx ||
831  event.GetId() == itext_roty ||
832  event.GetId() == itext_rotz) {
833  /*
834  thetay = asinf(rot[0][2]);
835  if (cosf(thetay) != 0.0) {
836  if (-rot[1][2] / cosf(thetay) >= 0.0) thetax = acosf(rot[2][2] / cosf(thetay));
837  else thetax = 6.283185307f - acosf(rot[2][2] / cosf(thetay));
838  if (-rot[0][1] / cosf(thetay) >= 0.0) thetaz = acosf(rot[0][0] / cosf(thetay));
839  else thetaz = 6.283185307f - acosf(rot[0][0] / cosf(thetay));
840  }
841  else {
842  thetax = 0.0;
843  if (rot[1][0] >= 0.0) thetaz = acosf(rot[1][1]);
844  else thetaz = 6.283185307f - acosf(rot[1][1]);
845  }
846  thetax = 180.0f / 3.14159265f * thetax;
847  thetay = 180.0f / 3.14159265f * thetay;
848  thetaz = 180.0f / 3.14159265f * thetaz;
849  printf(" Current Rotation (theta_x theta_y teta_z) in degree : %f %f %f\n", thetax, thetay, thetaz);
850  printf(" New Rotation (theta_x theta_y teta_z) in degree : ");
851  */
852  if (event.GetId() == itext_rotx) {
853  if (event.GetString().ToDouble(&dvalue))
854  thetax = (GLfloat)(dvalue) / 180.0f * 3.14159265f;
855  }
856  else if (event.GetId() == itext_roty) {
857  if (event.GetString().ToDouble(&dvalue))
858  thetay = (GLfloat)(dvalue) / 180.0f * 3.14159265f;
859  }
860  else if (event.GetId() == itext_rotz) {
861  if (event.GetString().ToDouble(&dvalue))
862  thetaz = (GLfloat)(dvalue) / 180.0f * 3.14159265f;
863  }
864  }
865  else if(event.GetId() == ibutton_rotate){
866  rot[0][0] = cosf(thetay)* cosf(thetaz);
867  rot[0][1] = -cosf(thetay)* sinf(thetaz);
868  rot[0][2] = sinf(thetay);
869  rot[1][0] = cosf(thetaz)* sinf(thetax)* sinf(thetay) + cosf(thetax)* sinf(thetaz);
870  rot[1][1] = cosf(thetax) * cosf(thetaz) - sinf(thetax)* sinf(thetay)* sinf(thetaz);
871  rot[1][2] = -cosf(thetay)* sinf(thetax);
872  rot[2][0] = -cosf(thetax)* cosf(thetaz)* sinf(thetay) + sinf(thetax)* sinf(thetaz);
873  rot[2][1] = cosf(thetaz)* sinf(thetax) + cosf(thetax)* sinf(thetay)* sinf(thetaz);
874  rot[2][2] = cosf(thetax)* cosf(thetay);
875  Refresh(false);
876  }
877 }
878 
879 MyFrame::MyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos,
880  const wxSize& size, long style)
881  : wxFrame(frame, wxID_ANY, title, pos, size, style),
882  m_canvas(NULL)
883 {
884  SetIcon(wxICON(fermisurfer));
885 
886  // Make a menubar
887  //wxMenu* fileMenu = new wxMenu;
888  //wxMenuBar* menuBar = new wxMenuBar;
889  //menuBar->Append(fileMenu, wxT("File"));
890  //SetMenuBar(menuBar);
891  // JACS
892 #ifdef __WXMSW__
893  int* gl_attrib = NULL;
894 #else
895  int gl_attrib[20] =
896  { WX_GL_RGBA, WX_GL_MIN_RED, 1, WX_GL_MIN_GREEN, 1,
897  WX_GL_MIN_BLUE, 1, WX_GL_DEPTH_SIZE, 1,
898  WX_GL_DOUBLEBUFFER,
899 # if defined(__WXMAC__) || defined(__WXCOCOA__)
900  GL_NONE };
901 # else
902  0
903 };
904 # endif
905 #endif
906 
907  wxBoxSizer* sizermain = new wxBoxSizer(wxVERTICAL);
908 
909  splitterV = new wxSplitterWindow(this, wxID_ANY);
910  splitterV->SetSashGravity(1.0);
911  splitterV->SetMinimumPaneSize(0);
912  sizermain->Add(splitterV, 1, wxEXPAND, 0);
913 
914  panel = new wxScrolledWindow(splitterV);
915 
916  gbsizer = new wxGridBagSizer();
917 
918  splitterH = new wxSplitterWindow(splitterV, wxID_ANY);
919  splitterH->SetSashGravity(1.0);
920  splitterH->SetMinimumPaneSize(0);
921 
922  m_canvas = new TestGLCanvas(splitterH, wxID_ANY, gl_attrib);
923 
924  terminal = new wxTextCtrl(splitterH, wxID_ANY, wxT(""),
925  wxPoint(0, 250), wxSize(100, 0), wxTE_MULTILINE);
926  if (lbatch == 1) splitterH->SplitHorizontally(m_canvas, terminal, -1);
927  else splitterH->SplitHorizontally(m_canvas, terminal, -200);
928  panel->SetSizer(gbsizer);
929  panel->SetScrollbars(20, 20, 50, 50);
930 
931  if (lbatch == 1)splitterV->SplitVertically(splitterH, panel, -1);
932  else splitterV->SplitVertically(splitterH, panel, 0);
933 
934  Bind(wxEVT_COMMAND_BUTTON_CLICKED, &MyFrame::button_compute, this, ibutton_compute);
935  gbsizer->Add(new wxButton(panel, ibutton_compute, wxT("Update")), wxGBPosition(0,0), wxGBSpan(1,1));
936 
937  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Line width : ")),
938  wxGBPosition(0, 1), wxGBSpan(1, 1), wxALIGN_RIGHT);
939  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_line, this, itext_line);
940  textbox_linewidth = new wxTextCtrl(panel, itext_line, wxT(""));
941  gbsizer->Add(textbox_linewidth, wxGBPosition(0, 2), wxGBSpan(1, 1));
942  textbox_linewidth->ChangeValue(wxString::Format(wxT("%f"), linewidth));
943 
944  Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &MyFrame::radiovalue_section, this, icheck_gamma);
945  wxCheckBox *check_ongamma = new wxCheckBox(panel, icheck_gamma, wxT("On Gamma"));
946  gbsizer->Add(check_ongamma, wxGBPosition(0, 3), wxGBSpan(1, 1));
947  check_ongamma->SetValue(true);
948 
949  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Section-v : ")),
950  wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
951  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::radiovalue_section, this, itext_sectionx);
952  wxTextCtrl* textbox_sectionx = new wxTextCtrl(panel, itext_sectionx, wxT(""));
953  gbsizer->Add(textbox_sectionx, wxGBPosition(1, 1), wxGBSpan(1, 1));
954  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::radiovalue_section, this, itext_sectiony);
955  wxTextCtrl* textbox_sectiony = new wxTextCtrl(panel, itext_sectiony, wxT(""));
956  gbsizer->Add(textbox_sectiony, wxGBPosition(1, 2), wxGBSpan(1, 1));
957  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::radiovalue_section, this, itext_sectionz);
958  wxTextCtrl* textbox_sectionz = new wxTextCtrl(panel, itext_sectionz, wxT(""));
959  gbsizer->Add(textbox_sectionz, wxGBPosition(1, 3), wxGBSpan(1, 1));
960  textbox_sectionx->ChangeValue(wxT("0"));
961  textbox_sectiony->ChangeValue(wxT("0"));
962  textbox_sectionz->ChangeValue(wxT("1"));
963 
964  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Equator-v : ")),
965  wxGBPosition(2, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
966  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::checkvalue_equator, this, itext_equatorx);
967  wxTextCtrl* textbox_equatorx = new wxTextCtrl(panel, itext_equatorx, wxT(""));
968  gbsizer->Add(textbox_equatorx, wxGBPosition(2, 1), wxGBSpan(1, 1));
969  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::checkvalue_equator, this, itext_equatory);
970  wxTextCtrl* textbox_equatory = new wxTextCtrl(panel, itext_equatory, wxT(""));
971  gbsizer->Add(textbox_equatory, wxGBPosition(2, 2), wxGBSpan(1, 1));
972  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::checkvalue_equator, this, itext_equatorz);
973  wxTextCtrl* textbox_equatorz = new wxTextCtrl(panel, itext_equatorz, wxT(""));
974  gbsizer->Add(textbox_equatorz, wxGBPosition(2, 3), wxGBSpan(1, 1));
975  textbox_equatorx->ChangeValue(wxT("0"));
976  textbox_equatory->ChangeValue(wxT("0"));
977  textbox_equatorz->ChangeValue(wxT("1"));
978 
979  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Interpol ratio : ")),
980  wxGBPosition(3, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
981  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_interpol, this, itext_interpol);
982  wxTextCtrl* textbox_interpol = new wxTextCtrl(panel, itext_interpol, wxT(""));
983  gbsizer->Add(textbox_interpol, wxGBPosition(3, 1), wxGBSpan(1, 1));
984  textbox_interpol->ChangeValue(wxT("1"));
985 
986  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Fermi energy : ")),
987  wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
988  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_shift, this, itext_shift);
989  wxTextCtrl* textbox_shift = new wxTextCtrl(panel, itext_shift, wxT(""));
990  gbsizer->Add(textbox_shift, wxGBPosition(4, 1), wxGBSpan(1, 1));
991  textbox_shift->ChangeValue(wxT("0"));
992 
993  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Min of Scale : ")),
994  wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
995  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::radiovalue_colorscale, this, itext_colorscalemin);
996  textbox_min = new wxTextCtrl(panel, itext_colorscalemin, wxT(""));
997  gbsizer->Add(textbox_min, wxGBPosition(5, 1), wxGBSpan(1, 1));
998  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Max of Scale : ")),
999  wxGBPosition(6, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1000  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::radiovalue_colorscale, this, itext_colorscalemax);
1001  textbox_max = new wxTextCtrl(panel, itext_colorscalemax, wxT(""));
1002  gbsizer->Add(textbox_max, wxGBPosition(6, 1), wxGBSpan(1, 1));
1003 
1004  wxString choices_tetra[] = { wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5"), wxT("6"), wxT("7") ,
1005 wxT("8"), wxT("9"), wxT("10"), wxT("11"), wxT("12"), wxT("13"), wxT("14"),
1006  wxT("15"), wxT("16") };
1007  radiobox_tetra = new wxRadioBox(panel, iradio_tetra, wxT("Tetrahedron"),
1008  wxDefaultPosition, wxDefaultSize,
1009  WXSIZEOF(choices_tetra), choices_tetra,
1010  4, wxRA_SPECIFY_COLS);
1011  Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radio_tetra, this, iradio_tetra);
1012  gbsizer->Add(radiobox_tetra, wxGBPosition(3,2), wxGBSpan(5, 2));
1013 
1014  wxString choices_colorscale[] = { wxT("Input (1D)"), wxT("Input (2D)"),
1015  wxT("Input (3D)"), wxT("Fermi Velocity"), wxT("Band Index"),
1016  wxT("Input (1D, Gray Scale)"), wxT("Fermi Velocity (Gray Scale)") };
1017  radiobox_color = new wxRadioBox(panel, iradio_colorscale,
1018  wxT("Color scale mode"),
1019  wxDefaultPosition, wxDefaultSize,
1020  WXSIZEOF(choices_colorscale), choices_colorscale,
1021  1, wxRA_SPECIFY_COLS);
1022  Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radiovalue_colorscale, this, iradio_colorscale);
1023  gbsizer->Add(radiobox_color, wxGBPosition(7, 0), wxGBSpan(3, 2));
1024 
1025  wxString choices_bz[] = { wxT("First Brillouin zone"), wxT("Primitive Brillouin zone") };
1026  Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radio_brillouinzone, this, iradio_brillouinzone);
1027  gbsizer->Add(new wxRadioBox(panel, iradio_brillouinzone, wxT("Brillouin zone"),
1028  wxDefaultPosition, wxDefaultSize,
1029  WXSIZEOF(choices_bz), choices_bz,
1030  1, wxRA_SPECIFY_COLS), wxGBPosition(8, 2), wxGBSpan(1, 2));
1031 
1032  wxString choices_stereo[] = { wxT("None"), wxT("Parallel"), wxT("Cross") };
1033  Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radio_stereo, this, iradio_stereo);
1034  gbsizer->Add(new wxRadioBox(panel, iradio_stereo, wxT("Stereogram"),
1035  wxDefaultPosition, wxDefaultSize,
1036  WXSIZEOF(choices_stereo), choices_stereo,
1037  1, wxRA_SPECIFY_COLS), wxGBPosition(9, 2), wxGBSpan(1, 1));
1038 
1039  wxString choices_mouse[] = { wxT("Rotate"), wxT("Scale"), wxT("Translate") };
1040  Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radio_mouse, this, iradio_mouse);
1041  gbsizer->Add(new wxRadioBox(panel, iradio_mouse, wxT("Mouse Drag"),
1042  wxDefaultPosition, wxDefaultSize,
1043  WXSIZEOF(choices_mouse), choices_mouse,
1044  1, wxRA_SPECIFY_COLS), wxGBPosition(9, 3), wxGBSpan(1, 1));
1045 
1046  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("BZ number : ")),
1047  wxGBPosition(10, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1048  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_BZ_number, this, itext_BZ_number0);
1049  textbox_BZ_number0 = new wxTextCtrl(panel, itext_BZ_number0, wxT(""));
1050  gbsizer->Add(textbox_BZ_number0, wxGBPosition(10, 1), wxGBSpan(1, 1));
1051  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_BZ_number, this, itext_BZ_number1);
1052  textbox_BZ_number1 = new wxTextCtrl(panel, itext_BZ_number1, wxT(""));
1053  gbsizer->Add(textbox_BZ_number1, wxGBPosition(10, 2), wxGBSpan(1, 1));
1054  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_BZ_number, this, itext_BZ_number2);
1055  textbox_BZ_number2 = new wxTextCtrl(panel, itext_BZ_number2, wxT(""));
1056  gbsizer->Add(textbox_BZ_number2, wxGBPosition(10, 3), wxGBSpan(1, 1));
1057  textbox_BZ_number0->ChangeValue(wxT("1"));
1058  textbox_BZ_number1->ChangeValue(wxT("1"));
1059  textbox_BZ_number2->ChangeValue(wxT("1"));
1060 
1061  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Background (RGB) : ")),
1062  wxGBPosition(11, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1063  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_BackGround, this, itext_BackGroundR);
1064  textbox_BackGroundR = new wxTextCtrl(panel, itext_BackGroundR, wxT(""));
1065  gbsizer->Add(textbox_BackGroundR, wxGBPosition(11, 1), wxGBSpan(1, 1));
1066  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_BackGround, this, itext_BackGroundG);
1067  textbox_BackGroundG = new wxTextCtrl(panel, itext_BackGroundG, wxT(""));
1068  gbsizer->Add(textbox_BackGroundG, wxGBPosition(11, 2), wxGBSpan(1, 1));
1069  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_BackGround, this, itext_BackGroundB);
1070  textbox_BackGroundB = new wxTextCtrl(panel, itext_BackGroundB, wxT(""));
1071  gbsizer->Add(textbox_BackGroundB, wxGBPosition(11, 3), wxGBSpan(1, 1));
1072  textbox_BackGroundR->ChangeValue(wxT("0"));
1073  textbox_BackGroundG->ChangeValue(wxT("0"));
1074  textbox_BackGroundB->ChangeValue(wxT("0"));
1075 
1076  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Line color (RGB) : ")),
1077  wxGBPosition(12, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1078  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_LineColor, this, itext_LineColorR);
1079  textbox_LineColorR = new wxTextCtrl(panel, itext_LineColorR, wxT(""));
1080  gbsizer->Add(textbox_LineColorR, wxGBPosition(12, 1), wxGBSpan(1, 1));
1081  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_LineColor, this, itext_LineColorG);
1082  textbox_LineColorG = new wxTextCtrl(panel, itext_LineColorG, wxT(""));
1083  gbsizer->Add(textbox_LineColorG, wxGBPosition(12, 2), wxGBSpan(1, 1));
1084  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_LineColor, this, itext_LineColorB);
1085  textbox_LineColorB = new wxTextCtrl(panel, itext_LineColorB, wxT(""));
1086  gbsizer->Add(textbox_LineColorB, wxGBPosition(12, 3), wxGBSpan(1, 1));
1087  textbox_LineColorR->ChangeValue(wxT("1"));
1088  textbox_LineColorG->ChangeValue(wxT("1"));
1089  textbox_LineColorB->ChangeValue(wxT("1"));
1090 
1091  Bind(wxEVT_COMMAND_BUTTON_CLICKED, &MyFrame::textctrl_view, this, ibutton_rotate);
1092  gbsizer->Add(new wxButton(panel, ibutton_rotate, wxT("Rotate")),
1093  wxGBPosition(13, 0), wxGBSpan(1, 1));
1094  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_view, this, itext_rotx);
1095  textbox_rotatex = new wxTextCtrl(panel, itext_rotx, wxT(""));
1096  gbsizer->Add(textbox_rotatex, wxGBPosition(13, 1), wxGBSpan(1, 1));
1097  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_view, this, itext_roty);
1098  textbox_rotatey = new wxTextCtrl(panel, itext_roty, wxT(""));
1099  gbsizer->Add(textbox_rotatey, wxGBPosition(13, 2), wxGBSpan(1, 1));
1100  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_view, this, itext_rotz);
1101  textbox_rotatez = new wxTextCtrl(panel, itext_rotz, wxT(""));
1102  gbsizer->Add(textbox_rotatez, wxGBPosition(13, 3), wxGBSpan(1, 1));
1103  textbox_rotatex->ChangeValue(wxT("0"));
1104  textbox_rotatey->ChangeValue(wxT("0"));
1105  textbox_rotatez->ChangeValue(wxT("0"));
1106 
1107  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Position : ")),
1108  wxGBPosition(14, 1), wxGBSpan(1, 1), wxALIGN_RIGHT);
1109  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_view, this, itext_positionx);
1110  textbox_positionx = new wxTextCtrl(panel, itext_positionx, wxT(""));
1111  gbsizer->Add(textbox_positionx, wxGBPosition(14, 2), wxGBSpan(1, 1));
1112  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_view, this, itext_positiony);
1113  textbox_positiony = new wxTextCtrl(panel, itext_positiony, wxT(""));
1114  gbsizer->Add(textbox_positiony, wxGBPosition(14, 3), wxGBSpan(1, 1));
1115  textbox_positionx->ChangeValue(wxT("0"));
1116  textbox_positiony->ChangeValue(wxT("0"));
1117 
1118  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Scale : ")),
1119  wxGBPosition(15, 2), wxGBSpan(1, 1), wxALIGN_RIGHT);
1120  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_view, this, itext_scale);
1121  textbox_scale = new wxTextCtrl(panel, itext_scale, wxT(""));
1122  gbsizer->Add(textbox_scale, wxGBPosition(15, 3), wxGBSpan(1, 1));
1123  textbox_scale->ChangeValue(wxString::Format(wxT("%f"), scl));
1124 
1125  Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &MyFrame::check_colorbar, this, icheck_colorbar);
1126  wxCheckBox* check = new wxCheckBox(panel, icheck_colorbar, wxT("Color bar"));
1127  gbsizer->Add(check, wxGBPosition(16, 2), wxGBSpan(1, 1));
1128  check->SetValue(true);
1129  // debug fileMenu->Check(menu_colorbar_check, true);
1130 
1131  Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &MyFrame::checkvalue_equator, this, icheck_equator);
1132  gbsizer->Add(new wxCheckBox(panel, icheck_equator, wxT("Equator")), wxGBPosition(17, 2), wxGBSpan(1, 1));
1133 
1134  Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &MyFrame::check_nodeline, this, icheck_nodeline);
1135  gbsizer->Add(new wxCheckBox(panel, icheck_nodeline, wxT("Nodal line")), wxGBPosition(18, 2), wxGBSpan(1, 1));
1136 
1137  Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &MyFrame::radiovalue_section, this, icheck_section);
1138  gbsizer->Add(new wxCheckBox(panel, icheck_section, wxT("Section")), wxGBPosition(16, 3), wxGBSpan(1, 1));
1139 
1140  Bind(wxEVT_COMMAND_BUTTON_CLICKED, &MyFrame::button_section, this, ibutton_section);
1141  gbsizer->Add(new wxButton(panel, ibutton_section, wxT("Section file")),
1142  wxGBPosition(17, 3), wxGBSpan(1, 1));
1143 
1144  wxString choices_light[] = { wxT("Both"), wxT("Unoccupy"), wxT("Occupy") };
1145  Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radio_lighting, this, iradio_lighting);
1146  gbsizer->Add(new wxRadioBox(panel, iradio_lighting, wxT("Lighting"),
1147  wxDefaultPosition, wxDefaultSize,
1148  WXSIZEOF(choices_light), choices_light,
1149  1, wxRA_SPECIFY_COLS), wxGBPosition(15, 1), wxGBSpan(4, 1));
1150 
1151  wxString choices_BarColor[] = { wxT("BGR"), wxT("CMY"), wxT("MCY"), wxT("BWR") };
1152  Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &MyFrame::radio_BarColor, this, iradio_BarColor);
1153  gbsizer->Add(new wxRadioBox(panel, iradio_BarColor, wxT("Bar Color"),
1154  wxDefaultPosition, wxDefaultSize,
1155  WXSIZEOF(choices_BarColor), choices_BarColor,
1156  1, wxRA_SPECIFY_COLS), wxGBPosition(14, 0), wxGBSpan(5, 1));
1157  //
1158  // Section color
1159  //
1160  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Section (RGB) : ")),
1161  wxGBPosition(19, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1162  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Section, this, itext_SectionR);
1163  textbox_SectionR = new wxTextCtrl(panel, itext_SectionR, wxT(""));
1164  gbsizer->Add(textbox_SectionR, wxGBPosition(19, 1), wxGBSpan(1, 1));
1165  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Section, this, itext_SectionG);
1166  textbox_SectionG = new wxTextCtrl(panel, itext_SectionG, wxT(""));
1167  gbsizer->Add(textbox_SectionG, wxGBPosition(19, 2), wxGBSpan(1, 1));
1168  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Section, this, itext_SectionB);
1169  textbox_SectionB = new wxTextCtrl(panel, itext_SectionB, wxT(""));
1170  gbsizer->Add(textbox_SectionB, wxGBPosition(19, 3), wxGBSpan(1, 1));
1171  textbox_SectionR->ChangeValue(wxT("0.5"));
1172  textbox_SectionG->ChangeValue(wxT("0.5"));
1173  textbox_SectionB->ChangeValue(wxT("0.5"));
1174  //
1175  // Arrow Start
1176  //
1177  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Arrow (Start) : ")),
1178  wxGBPosition(20, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1179  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Arrow, this, itext_ArrowStart0);
1180  textbox_ArrowStart0 = new wxTextCtrl(panel, itext_ArrowStart0, wxT(""));
1181  gbsizer->Add(textbox_ArrowStart0, wxGBPosition(20, 1), wxGBSpan(1, 1));
1182  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Arrow, this, itext_ArrowStart1);
1183  textbox_ArrowStart1 = new wxTextCtrl(panel, itext_ArrowStart1, wxT(""));
1184  gbsizer->Add(textbox_ArrowStart1, wxGBPosition(20, 2), wxGBSpan(1, 1));
1185  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Arrow, this, itext_ArrowStart2);
1186  textbox_ArrowStart2 = new wxTextCtrl(panel, itext_ArrowStart2, wxT(""));
1187  gbsizer->Add(textbox_ArrowStart2, wxGBPosition(20, 3), wxGBSpan(1, 1));
1188  textbox_ArrowStart0->ChangeValue(wxT("0.0"));
1189  textbox_ArrowStart1->ChangeValue(wxT("0.0"));
1190  textbox_ArrowStart2->ChangeValue(wxT("0.0"));
1191  //
1192  // Arrow End
1193  //
1194  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Arrow (End) : ")),
1195  wxGBPosition(21, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1196  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Arrow, this, itext_ArrowEnd0);
1197  textbox_ArrowEnd0 = new wxTextCtrl(panel, itext_ArrowEnd0, wxT(""));
1198  gbsizer->Add(textbox_ArrowEnd0, wxGBPosition(21, 1), wxGBSpan(1, 1));
1199  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Arrow, this, itext_ArrowEnd1);
1200  textbox_ArrowEnd1 = new wxTextCtrl(panel, itext_ArrowEnd1, wxT(""));
1201  gbsizer->Add(textbox_ArrowEnd1, wxGBPosition(21, 2), wxGBSpan(1, 1));
1202  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Arrow, this, itext_ArrowEnd2);
1203  textbox_ArrowEnd2 = new wxTextCtrl(panel, itext_ArrowEnd2, wxT(""));
1204  gbsizer->Add(textbox_ArrowEnd2, wxGBPosition(21, 3), wxGBSpan(1, 1));
1205  textbox_ArrowEnd0->ChangeValue(wxT("0.0"));
1206  textbox_ArrowEnd1->ChangeValue(wxT("0.0"));
1207  textbox_ArrowEnd2->ChangeValue(wxT("0.0"));
1208  //
1209  // Arrow Diff
1210  //
1211  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Arrow (Diff) : ")),
1212  wxGBPosition(22, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1213  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Arrow, this, itext_ArrowDiff0);
1214  textbox_ArrowDiff0 = new wxTextCtrl(panel, itext_ArrowDiff0, wxT(""));
1215  gbsizer->Add(textbox_ArrowDiff0, wxGBPosition(22, 1), wxGBSpan(1, 1));
1216  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Arrow, this, itext_ArrowDiff1);
1217  textbox_ArrowDiff1 = new wxTextCtrl(panel, itext_ArrowDiff1, wxT(""));
1218  gbsizer->Add(textbox_ArrowDiff1, wxGBPosition(22, 2), wxGBSpan(1, 1));
1219  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Arrow, this, itext_ArrowDiff2);
1220  textbox_ArrowDiff2 = new wxTextCtrl(panel, itext_ArrowDiff2, wxT(""));
1221  gbsizer->Add(textbox_ArrowDiff2, wxGBPosition(22, 3), wxGBSpan(1, 1));
1222  textbox_ArrowDiff0->ChangeValue(wxT("0.0"));
1223  textbox_ArrowDiff1->ChangeValue(wxT("0.0"));
1224  textbox_ArrowDiff2->ChangeValue(wxT("0.0"));
1225  //
1226  // Wireframe sphere
1227  //
1228  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Sphere center : ")),
1229  wxGBPosition(23, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1230  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_sphere, this, itext_sphereX);
1231  textbox_sphereX = new wxTextCtrl(panel, itext_sphereX, wxT(""));
1232  gbsizer->Add(textbox_sphereX, wxGBPosition(23, 1), wxGBSpan(1, 1));
1233  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_sphere, this, itext_sphereY);
1234  textbox_sphereY = new wxTextCtrl(panel, itext_sphereY, wxT(""));
1235  gbsizer->Add(textbox_sphereY, wxGBPosition(23, 2), wxGBSpan(1, 1));
1236  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_sphere, this, itext_sphereZ);
1237  textbox_sphereZ = new wxTextCtrl(panel, itext_sphereZ, wxT(""));
1238  gbsizer->Add(textbox_sphereZ, wxGBPosition(23, 3), wxGBSpan(1, 1));
1239  textbox_sphereX->ChangeValue(wxT("0.0"));
1240  textbox_sphereY->ChangeValue(wxT("0.0"));
1241  textbox_sphereZ->ChangeValue(wxT("0.0"));
1242  //
1243  gbsizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Sphere radius : ")),
1244  wxGBPosition(24, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1245  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_sphere, this, itext_sphereR);
1246  textbox_sphereR = new wxTextCtrl(panel, itext_sphereR, wxT(""));
1247  gbsizer->Add(textbox_sphereR, wxGBPosition(24, 1), wxGBSpan(1, 1));
1248  textbox_sphereR->ChangeValue(wxT("0.0"));
1249  SetSizer(sizermain);
1250  SetAutoLayout(true);
1251 
1252  // Show the frame
1253  Show(true);
1254  Raise();
1255 
1256  m_canvas->InitGL();
1257 }
1258 
1260 {
1261  delete m_canvas;
1262 }
1263 
1264 // Intercept menu commands
1265 void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event))
1266 {
1267  // true is to force the frame to close
1268  Close(true);
1269 }
1270 
1272  int ib, j;
1273  wxCheckBox** check;
1274  wxTextCtrl** textbox_BandR, ** textbox_BandG, ** textbox_BandB;
1275  GLfloat mat2;
1276 
1277  radiobox_color->SetSelection(color_scale - 1);
1278  radiobox_tetra->SetSelection(itet);
1279 
1280  check = new wxCheckBox * [nb];
1281  textbox_BandR = new wxTextCtrl * [nb];
1282  textbox_BandG = new wxTextCtrl * [nb];
1283  textbox_BandB = new wxTextCtrl * [nb];
1284 
1285  for (ib = 0; ib < nb; ib++) {
1286  Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &MyFrame::check_band, this, icheck_band + 4*ib);
1287  check[ib] = new wxCheckBox(panel, icheck_band + 4*ib,
1288  wxString::Format(wxT("Band %d, RGB :"), ib));
1289  gbsizer->Add(check[ib], wxGBPosition(25 + ib, 0), wxGBSpan(1, 1));
1290  check[ib]->SetValue(true);
1291 
1292  if (nb == 1) mat2 = 0.5f;
1293  else mat2 = 1.0f / (GLfloat)(nb - 1) * (GLfloat)ib;
1294  mat2 *= 4.0f;
1295  if (mat2 <= 1.0) {
1296  for (j = 0; j < 4; ++j) rgb_band[ib][j] = cyan[j] * mat2 + blue[j] * (1.0f - mat2);
1297  }
1298  else if (mat2 <= 2.0) {
1299  mat2 = mat2 - 1.0f;
1300  for (j = 0; j < 4; ++j) rgb_band[ib][j] = green[j] * mat2 + cyan[j] * (1.0f - mat2);
1301  }
1302  else if (mat2 <= 3.0) {
1303  mat2 = mat2 - 2.0f;
1304  for (j = 0; j < 4; ++j) rgb_band[ib][j] = yellow[j] * mat2 + green[j] * (1.0f - mat2);
1305  }
1306  else {
1307  mat2 = mat2 - 3.0f;
1308  for (j = 0; j < 4; ++j) rgb_band[ib][j] = red[j] * mat2 + yellow[j] * (1.0f - mat2);
1309  }
1310 
1311  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Band, this, icheck_band + 4 * ib+1);
1312  textbox_BandR[ib] = new wxTextCtrl(panel, icheck_band + 4 * ib+1, wxT(""));
1313  gbsizer->Add(textbox_BandR[ib], wxGBPosition(25 + ib, 1), wxGBSpan(1, 1));
1314  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Band, this, icheck_band + 4 * ib+2);
1315  textbox_BandG[ib] = new wxTextCtrl(panel, icheck_band + 4 * ib+2, wxT(""));
1316  gbsizer->Add(textbox_BandG[ib], wxGBPosition(25 + ib, 2), wxGBSpan(1, 1));
1317  Bind(wxEVT_COMMAND_TEXT_UPDATED, &MyFrame::textctrl_Band, this, icheck_band + 4 * ib+3);
1318  textbox_BandB[ib] = new wxTextCtrl(panel, icheck_band + 4 * ib+3, wxT(""));
1319  gbsizer->Add(textbox_BandB[ib], wxGBPosition(25 + ib, 3), wxGBSpan(1, 1));
1320  textbox_BandR[ib]->ChangeValue(wxString::Format(wxT("%f"), rgb_band[ib][0]));
1321  textbox_BandG[ib]->ChangeValue(wxString::Format(wxT("%f"), rgb_band[ib][1]));
1322  textbox_BandB[ib]->ChangeValue(wxString::Format(wxT("%f"), rgb_band[ib][2]));
1323  }
1324  gbsizer->Layout();
1325  if (lbatch == 1) {
1326  splitterH->Unsplit();
1327  splitterV->Unsplit();
1328  }
1329  else {
1330  splitterV->SetSashPosition(-gbsizer->CalcMin().GetX());
1331  }
1332  splitterV->Layout();
1333  splitterH->Layout();
1334  Refresh(false);
1335  Raise();
1336 }
itext_ArrowDiff1
@ itext_ArrowDiff1
Definition: menu.cpp:149
interpol_energy
void interpol_energy()
Interpolation of energy and matrix with the French-curve (Kumo) interpolation.
Definition: kumo.cpp:66
secvec
GLfloat secvec[3]
-vector to define section
Definition: fermisurfer.cpp:160
magenta
GLfloat magenta[4]
Magenta color code.
Definition: fermisurfer.cpp:203
operation.hpp
itext_sphereX
@ itext_sphereX
Definition: menu.cpp:151
itext_sphereZ
@ itext_sphereZ
Definition: menu.cpp:153
wgray
GLfloat wgray[4]
Gray color code.
Definition: fermisurfer.cpp:199
side
GLfloat side
Which side is lighted.
Definition: fermisurfer.cpp:148
icheck_gamma
@ icheck_gamma
Definition: menu.cpp:108
MyFrame::textctrl_Arrow
void textctrl_Arrow(wxCommandEvent &event)
Change arrow (::blackback)
Definition: menu.cpp:205
itext_shift
@ itext_shift
Definition: menu.cpp:119
MyFrame::textbox_ArrowEnd1
wxTextCtrl * textbox_ArrowEnd1
Definition: menu.hpp:82
refresh_section
int refresh_section
Definition: fermisurfer.cpp:243
MyFrame::radio_brillouinzone
void radio_brillouinzone(wxCommandEvent &event)
Change Brillouin zone (fbz)
Definition: menu.cpp:506
green
GLfloat green[4]
Green color code.
Definition: fermisurfer.cpp:206
MyFrame::radiovalue_colorscale
void radiovalue_colorscale(wxCommandEvent &event)
Change color scale mode (color_scale)
Definition: menu.cpp:579
refresh_equator
int refresh_equator
Definition: fermisurfer.cpp:242
n2d
int * n2d
Number of line segment.
Definition: fermisurfer.cpp:164
section.hpp
itext_sphereR
@ itext_sphereR
Definition: menu.cpp:154
MyFrame::textctrl_interpol
void textctrl_interpol(wxCommandEvent &event)
Modify interpolation ratio.
Definition: menu.cpp:654
eqvec_fr
GLfloat eqvec_fr[3]
-vector for equator
Definition: fermisurfer.cpp:174
itext_colorscalemax
@ itext_colorscalemax
Definition: menu.cpp:106
itext_interpol
@ itext_interpol
Definition: menu.cpp:120
itext_line
@ itext_line
Definition: menu.cpp:118
MyFrame::radiobox_color
wxRadioBox * radiobox_color
Definition: menu.hpp:50
MyFrame::textctrl_BackGround
void textctrl_BackGround(wxCommandEvent &event)
Change background color (::blackback)
Definition: menu.cpp:428
kv2d
GLfloat ** kv2d
-vector for 2D plot [nb][n2d*2*3]
Definition: fermisurfer.cpp:165
MyFrame::textctrl_shift
void textctrl_shift(wxCommandEvent &event)
Shift Fermi energy.
Definition: menu.cpp:766
MyFrame::textctrl_sphere
void textctrl_sphere(wxCommandEvent &event)
Change Line color color (::blackback)
Definition: menu.cpp:275
interpol
int interpol
Ratio of interpolation.
Definition: fermisurfer.cpp:111
linewidth
GLfloat linewidth
BZ/nodal-line/Fermiline width.
Definition: fermisurfer.cpp:193
itext_sectiony
@ itext_sectiony
Definition: menu.cpp:110
MyFrame::check_band
void check_band(wxCommandEvent &event)
Toggle the appearance of each band (draw_band)
Definition: menu.cpp:490
icheck_band
@ icheck_band
Definition: menu.cpp:155
secvec_fr
GLfloat secvec_fr[3]
-vector to define section
Definition: fermisurfer.cpp:161
MyFrame::radiovalue_section
void radiovalue_section(wxCommandEvent &event)
Modify and toggle appearance of 2D Fermi lines (lsection)
Definition: menu.cpp:724
trans
GLfloat trans[3]
Translation.
Definition: fermisurfer.cpp:186
iradio_colorscale
@ iradio_colorscale
Definition: menu.cpp:104
draw.hpp
itext_ArrowEnd1
@ itext_ArrowEnd1
Definition: menu.cpp:146
EF
GLfloat EF
Fermi energy.
Definition: fermisurfer.cpp:218
MyFrame::check_nodeline
void check_nodeline(wxCommandEvent &event)
Toggle apearance of nodale-line.
Definition: menu.cpp:713
MyFrame::button_section
void button_section(wxCommandEvent &event)
Definition: menu.cpp:171
equator
void equator()
Compute equator .
Definition: equator.cpp:47
iradio_tetra
@ iradio_tetra
Definition: menu.cpp:103
MyFrame::textctrl_line
void textctrl_line(wxCommandEvent &event)
Line width.
Definition: menu.cpp:689
lstereo
int lstereo
Switch for the stereogram.
Definition: fermisurfer.cpp:119
patch_max
GLfloat patch_max
Max value across patch.
Definition: fermisurfer.cpp:149
skip_minmax
int skip_minmax
Definition: fermisurfer.cpp:244
thetax
GLfloat thetax
Rotation angle.
Definition: fermisurfer.cpp:190
itext_positionx
@ itext_positionx
Definition: menu.cpp:122
ibutton_rotate
@ ibutton_rotate
Definition: menu.cpp:127
MyFrame::radio_tetra
void radio_tetra(wxCommandEvent &event)
Change tetrahedron (itet)
Definition: menu.cpp:790
itext_equatorx
@ itext_equatorx
Definition: menu.cpp:115
iradio_mouse
@ iradio_mouse
Definition: menu.cpp:101
refresh_patch
int refresh_patch
Definition: fermisurfer.cpp:239
ibutton_section
@ ibutton_section
Definition: menu.cpp:135
LineColor
GLfloat LineColor[4]
Line color code.
Definition: fermisurfer.cpp:209
sphere_c
GLfloat sphere_c[3]
Center of wireflame sphere.
Definition: fermisurfer.cpp:221
MyFrame::modify_band
void modify_band()
Definition: menu.cpp:1271
SectionColor
GLfloat SectionColor[4]
Line color code.
Definition: fermisurfer.cpp:210
iradio_BarColor
@ iradio_BarColor
Definition: menu.cpp:134
itext_equatorz
@ itext_equatorz
Definition: menu.cpp:117
itext_ArrowEnd2
@ itext_ArrowEnd2
Definition: menu.cpp:147
menu.hpp
color_scale
int color_scale
Switch for full color scale mode.
Definition: fermisurfer.cpp:115
variable.hpp
Global variables.
iradio_background
@ iradio_background
Definition: menu.cpp:98
itext_BZ_number0
@ itext_BZ_number0
Definition: menu.cpp:136
MyFrame::m_canvas
TestGLCanvas * m_canvas
Definition: menu.hpp:47
arrow
GLfloat arrow[2][3]
Definition: fermisurfer.cpp:213
iradio_lighting
@ iradio_lighting
Definition: menu.cpp:100
compute_patch_segment
void compute_patch_segment()
Definition: menu.cpp:53
free_patch.hpp
itext_BackGroundB
@ itext_BackGroundB
Definition: menu.cpp:130
calc_section
void calc_section()
Compute Fermi-line.
Definition: section.cpp:276
itext_SectionR
@ itext_SectionR
Definition: menu.cpp:139
itext_rotx
@ itext_rotx
Definition: menu.cpp:124
itext_BackGroundG
@ itext_BackGroundG
Definition: menu.cpp:129
MyFrame::gbsizer
wxGridBagSizer * gbsizer
Definition: menu.hpp:48
thetaz
GLfloat thetaz
Rotation angle.
Definition: fermisurfer.cpp:192
MyFrame::textbox_ArrowEnd2
wxTextCtrl * textbox_ArrowEnd2
Definition: menu.hpp:83
nodeline
int nodeline
Switch for node lines.
Definition: fermisurfer.cpp:117
itext_ArrowStart0
@ itext_ArrowStart0
Definition: menu.cpp:142
MyFrame::textbox_linewidth
wxTextCtrl * textbox_linewidth
Definition: menu.hpp:65
calc_nodeline.hpp
itext_ArrowStart2
@ itext_ArrowStart2
Definition: menu.cpp:144
BackGroundColor
GLfloat BackGroundColor[4]
BackGround color code.
Definition: fermisurfer.cpp:208
MyFrame::textctrl_Section
void textctrl_Section(wxCommandEvent &event)
Change section color (::blackback)
Definition: menu.cpp:368
kumo.hpp
fbz
int fbz
Switch for 1st Brillouin zone mode.
Definition: fermisurfer.cpp:116
itext_scale
@ itext_scale
Definition: menu.cpp:121
itext_positiony
@ itext_positiony
Definition: menu.cpp:123
itext_BZ_number1
@ itext_BZ_number1
Definition: menu.cpp:137
initialize.hpp
itext_sectionz
@ itext_sectionz
Definition: menu.cpp:111
MyFrame::radio_mouse
void radio_mouse(wxCommandEvent &event)
Change the function associated to the mouse movement(::lmouse)
Definition: menu.cpp:701
lbatch
int lbatch
Definition: fermisurfer.cpp:233
MyFrame::splitterV
wxSplitterWindow * splitterV
Definition: menu.hpp:52
ibutton_compute
@ ibutton_compute
Definition: menu.cpp:97
free_patch
void free_patch()
Free variables for patch before new patch is computed.
Definition: free_patch.cpp:54
MyFrame::textctrl_Band
void textctrl_Band(wxCommandEvent &event)
Change band color (::blackback)
Definition: menu.cpp:396
rgb_band
GLfloat ** rgb_band
Switch for drawn bands [nb].
Definition: fermisurfer.cpp:138
lequator
int lequator
Switch for equator.
Definition: fermisurfer.cpp:122
icheck_colorbar
@ icheck_colorbar
Definition: menu.cpp:113
fermi_patch
void fermi_patch()
itext_equatory
@ itext_equatory
Definition: menu.cpp:116
icheck_nodeline
@ icheck_nodeline
Definition: menu.cpp:112
init_corner
void init_corner()
Specify corners of tetrahedron.
Definition: initialize.cpp:43
MyFrame::textctrl_view
void textctrl_view(wxCommandEvent &event)
Setting of view.
Definition: menu.cpp:804
nbzl2d
int nbzl2d
The number of Lines of 1st Brillouin zone.
Definition: fermisurfer.cpp:167
calc_nodeline
void calc_nodeline()
Compute node-line where .
Definition: calc_nodeline.cpp:48
MyFrame::button_refresh
void button_refresh(wxCommandEvent &event)
Definition: menu.cpp:158
red
GLfloat red[4]
Red color code.
Definition: fermisurfer.cpp:205
itext_SectionG
@ itext_SectionG
Definition: menu.cpp:140
refresh_color
int refresh_color
Definition: fermisurfer.cpp:240
itet
int itet
Counter for tetrahedron.
Definition: fermisurfer.cpp:147
sphere_v
GLfloat sphere_v[190][2][3]
Vertices for wisreflame sphere.
Definition: fermisurfer.cpp:219
itext_ArrowDiff2
@ itext_ArrowDiff2
Definition: menu.cpp:150
itext_ArrowEnd0
@ itext_ArrowEnd0
Definition: menu.cpp:145
iradio_brillouinzone
@ iradio_brillouinzone
Definition: menu.cpp:99
nb
int nb
The number of Bands.
Definition: fermisurfer.cpp:99
MyFrame::textbox_ArrowDiff1
wxTextCtrl * textbox_ArrowDiff1
Definition: menu.hpp:85
MyFrame::~MyFrame
virtual ~MyFrame()
Definition: menu.cpp:1259
itext_sphereY
@ itext_sphereY
Definition: menu.cpp:152
MyFrame::textbox_ArrowDiff0
wxTextCtrl * textbox_ArrowDiff0
Definition: menu.hpp:84
eqvec
GLfloat eqvec[3]
-vector for equator
Definition: fermisurfer.cpp:173
itext_ArrowStart1
@ itext_ArrowStart1
Definition: menu.cpp:143
bzl2d_proj
GLfloat bzl2d_proj[26][3]
Lines of 1st BZ [nbzl2d (max:26)][3], projected into 2D plane.
Definition: fermisurfer.cpp:169
blue
GLfloat blue[4]
Blue color code.
Definition: fermisurfer.cpp:207
draw_band
int * draw_band
Switch for drawn bands [nb].
Definition: fermisurfer.cpp:137
MyFrame::radio_lighting
void radio_lighting(wxCommandEvent &event)
Toggle Lighting.
Definition: menu.cpp:668
itext_rotz
@ itext_rotz
Definition: menu.cpp:126
bvec
GLfloat bvec[3][3]
Reciprocal lattice vector.
Definition: fermisurfer.cpp:101
MyFrame::radio_stereo
void radio_stereo(wxCommandEvent &event)
Tern stereogram (lstereo)
Definition: menu.cpp:779
MyFrame::panel
wxScrolledWindow * panel
Definition: menu.hpp:49
MyFrame::button_compute
void button_compute(wxCommandEvent &event)
Definition: menu.cpp:164
itext_LineColorG
@ itext_LineColorG
Definition: menu.cpp:132
MyFrame::textbox_ArrowEnd0
wxTextCtrl * textbox_ArrowEnd0
Definition: menu.hpp:81
sphere_r
GLfloat sphere_r
Radius of wireflame sphere.
Definition: fermisurfer.cpp:220
cyan
GLfloat cyan[4]
Cyan color code.
Definition: fermisurfer.cpp:202
itext_BackGroundR
@ itext_BackGroundR
Definition: menu.cpp:128
itext_ArrowDiff0
@ itext_ArrowDiff0
Definition: menu.cpp:148
iradio_stereo
@ iradio_stereo
Definition: menu.cpp:102
icheck_equator
@ icheck_equator
Definition: menu.cpp:114
lmouse
int lmouse
Switch for the mouse function.
Definition: fermisurfer.cpp:120
max_and_min
void max_and_min()
Compute Max. & Min. of matrix elements. Compute color of each patch.
Definition: free_patch.cpp:132
TestGLCanvas
Definition: operation.hpp:30
itext_sectionx
@ itext_sectionx
Definition: menu.cpp:109
MyFrame::radiobox_tetra
wxRadioBox * radiobox_tetra
Definition: menu.hpp:51
equator.hpp
itext_BZ_number2
@ itext_BZ_number2
Definition: menu.cpp:138
refresh_interpol
int refresh_interpol
Definition: fermisurfer.cpp:238
BarColor
GLfloat BarColor[5][4]
Definition: fermisurfer.cpp:211
calc_2dbz
void calc_2dbz()
Compute boundary of 2D BZ.
Definition: section.cpp:181
itext_SectionB
@ itext_SectionB
Definition: menu.cpp:141
BZ_number
int BZ_number[3]
Number of BZ.
Definition: fermisurfer.cpp:123
MyFrame::checkvalue_equator
void checkvalue_equator(wxCommandEvent &event)
Modify and toggle appearance of equator (lequator)
Definition: menu.cpp:614
thetay
GLfloat thetay
Rotation angle.
Definition: fermisurfer.cpp:191
itext_colorscalemin
@ itext_colorscalemin
Definition: menu.cpp:105
rot
GLfloat rot[3][3]
Rotation matrix.
Definition: fermisurfer.cpp:187
MyFrame::textctrl_LineColor
void textctrl_LineColor(wxCommandEvent &event)
Change Line color color (::blackback)
Definition: menu.cpp:340
secscale
GLfloat secscale
0.0 (across ) or 1.0
Definition: fermisurfer.cpp:162
lcolorbar
int lcolorbar
Switch for colorbar.
Definition: fermisurfer.cpp:118
ibutton_reflesh
@ ibutton_reflesh
Definition: menu.cpp:96
MyFrame::radio_BarColor
void radio_BarColor(wxCommandEvent &event)
Change Brillouin zone (fbz)
Definition: menu.cpp:521
fermi_patch.hpp
terminal
wxTextCtrl * terminal
Definition: fermisurfer.cpp:237
MyFrame::splitterH
wxSplitterWindow * splitterH
Definition: menu.hpp:53
MyFrame::textctrl_BZ_number
void textctrl_BZ_number(wxCommandEvent &event)
Change Number of Brillouin zone.
Definition: menu.cpp:462
MyFrame::OnExit
void OnExit(wxCommandEvent &event)
Definition: menu.cpp:1265
MyFrame::MyFrame
MyFrame(wxFrame *frame, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE)
Definition: menu.cpp:879
yellow
GLfloat yellow[4]
Yellow color code.
Definition: fermisurfer.cpp:204
MyFrame::check_colorbar
void check_colorbar(wxCommandEvent &event)
Toggle Colorbar (lcolorbar)
Definition: menu.cpp:568
MyFrame::textbox_ArrowDiff2
wxTextCtrl * textbox_ArrowDiff2
Definition: menu.hpp:86
scl
GLfloat scl
Initial scale.
Definition: fermisurfer.cpp:185
refresh_patch_segment
void refresh_patch_segment()
Definition: menu.cpp:89
icheck_section
@ icheck_section
Definition: menu.cpp:107
lsection
int lsection
Switch for the 2D Fermi lines.
Definition: fermisurfer.cpp:121
itext_roty
@ itext_roty
Definition: menu.cpp:125
patch_min
GLfloat patch_min
Max value across patch.
Definition: fermisurfer.cpp:150
itext_LineColorR
@ itext_LineColorR
Definition: menu.cpp:131
paint
void paint()
Compute Max. & Min. of matrix elements. Compute color of each patch.
Definition: free_patch.cpp:288
itext_LineColorB
@ itext_LineColorB
Definition: menu.cpp:133
refresh_nodeline
int refresh_nodeline
Definition: fermisurfer.cpp:241