38 #include "fermisurfer.xpm"
39 #include <wx/splitter.h>
40 #include <wx/gbsizer.h>
41 #if defined(HAVE_CONFIG_H)
44 #if defined(HAVE_GL_GL_H)
46 #elif defined(HAVE_OPENGL_GL_H)
47 #include <OpenGL/gl.h>
159 wxCommandEvent& event
165 wxCommandEvent& event
172 wxCommandEvent& event
176 fp = fopen(
"fermi_line.dat",
"w");
177 for (ib = 0; ib <
nb; ib++) {
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]);
190 *
terminal << wxT(
" fermi_line.dat was written.\n");
192 fp = fopen(
"bz_line.dat",
"w");
193 for (i2d = 0; i2d <
nbzl2d; i2d++) {
194 fprintf(fp,
"%15.5e %15.5e\n",
197 fprintf(fp,
"%15.5e %15.5e\n",
200 *
terminal << wxT(
" bz_line.dat was written.\n");
206 wxCommandEvent& event
213 if (event.GetString().ToDouble(&dvalue)) {
215 arrow[0][0] = (GLfloat)dvalue;
220 if (event.GetString().ToDouble(&dvalue)) {
222 arrow[0][1] = (GLfloat)dvalue;
227 if (event.GetString().ToDouble(&dvalue)) {
229 arrow[0][2] = (GLfloat)dvalue;
234 if (event.GetString().ToDouble(&dvalue)) {
235 arrow[1][0] = (GLfloat)dvalue;
240 if (event.GetString().ToDouble(&dvalue)) {
241 arrow[1][1] = (GLfloat)dvalue;
246 if (event.GetString().ToDouble(&dvalue)) {
247 arrow[1][2] = (GLfloat)dvalue;
252 if (event.GetString().ToDouble(&dvalue)) {
258 if (event.GetString().ToDouble(&dvalue)) {
264 if (event.GetString().ToDouble(&dvalue)) {
276 wxCommandEvent& event
280 double dvalue, diff, theta1, theta2, phi1, phi2;
283 if (event.GetString().ToDouble(&dvalue)) {
288 if (event.GetString().ToDouble(&dvalue)) {
293 if (event.GetString().ToDouble(&dvalue)) {
298 if (event.GetString().ToDouble(&dvalue)) {
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;
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;
341 wxCommandEvent& event
347 if (event.GetString().ToDouble(&dvalue)) {
353 if (event.GetString().ToDouble(&dvalue)) {
359 if (event.GetString().ToDouble(&dvalue)) {
369 wxCommandEvent& event
375 if (event.GetString().ToDouble(&dvalue)) {
381 if (event.GetString().ToDouble(&dvalue)) {
387 if (event.GetString().ToDouble(&dvalue)) {
397 wxCommandEvent& event
404 if (event.GetString().ToDouble(&dvalue)) {
410 else if (event.GetId() ==
icheck_band + 4 * ib + 2) {
411 if (event.GetString().ToDouble(&dvalue)) {
417 else if (event.GetId() ==
icheck_band + 4 * ib + 3) {
418 if (event.GetString().ToDouble(&dvalue)) {
429 wxCommandEvent& event
435 if (event.GetString().ToDouble(&dvalue)) {
443 if (event.GetString().ToDouble(&dvalue)) {
451 if (event.GetString().ToDouble(&dvalue)) {
463 wxCommandEvent& event
469 if (event.GetString().ToDouble(&dvalue)) {
475 if (event.GetString().ToDouble(&dvalue)) {
481 if (event.GetString().ToDouble(&dvalue)) {
491 wxCommandEvent& event
507 wxCommandEvent& event
510 if (event.GetString().Cmp(wxT(
"First Brillouin zone")) == 0) {
513 else if (event.GetString().Cmp(wxT(
"Primitive Brillouin zone")) == 0) {
522 wxCommandEvent& event
526 if (event.GetString().Cmp(wxT(
"BGR")) == 0) {
527 for (ii = 0; ii < 4; ii++) {
535 else if (event.GetString().Cmp(wxT(
"CMY")) == 0) {
536 for (ii = 0; ii < 4; ii++) {
544 else if (event.GetString().Cmp(wxT(
"MCY")) == 0) {
545 for (ii = 0; ii < 4; ii++) {
553 else if (event.GetString().Cmp(wxT(
"BWR")) == 0) {
554 for (ii = 0; ii < 4; ii++) {
569 wxCommandEvent& event
580 wxCommandEvent& event
586 if (event.GetString().ToDouble(&dminmax))
591 if (event.GetString().ToDouble(&dminmax))
595 else if (event.GetString().Cmp(wxT(
"Input (1D)")) == 0)
597 else if (event.GetString().Cmp(wxT(
"Input (2D)")) == 0)
599 else if (event.GetString().Cmp(wxT(
"Input (3D)")) == 0)
601 else if (event.GetString().Cmp(wxT(
"Fermi Velocity")) == 0)
603 else if (event.GetString().Cmp(wxT(
"Band Index")) == 0)
605 else if (event.GetString().Cmp(wxT(
"Input (1D, Gray Scale)")) == 0)
607 else if (event.GetString().Cmp(wxT(
"Fermi Velocity (Gray Scale)")) == 0)
615 wxCommandEvent& event
628 if (event.GetString().ToDouble(&deqvec))
eqvec_fr[0] = (GLfloat)deqvec;
631 if (event.GetString().ToDouble(&deqvec))
eqvec_fr[1] = (GLfloat)deqvec;
634 if (event.GetString().ToDouble(&deqvec))
eqvec_fr[2] = (GLfloat)deqvec;
639 for (ii = 0; ii < 3; ii++) {
641 for (jj = 0; jj < 3; jj++) {
655 wxCommandEvent& event
658 long int long_interpol;
660 if (event.GetString().ToLong(&long_interpol)) {
669 wxCommandEvent& event
672 if (event.GetString().Cmp(wxT(
"Both")) == 0) {
674 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
676 if (event.GetString().Cmp(wxT(
"Unoccupy")) == 0) {
678 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
680 if (event.GetString().Cmp(wxT(
"Occupy")) == 0) {
682 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
690 wxCommandEvent& event
695 if (event.GetString().ToDouble(&dlinewidth))
linewidth = (GLfloat)dlinewidth;
702 wxCommandEvent& event
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;
714 wxCommandEvent& event
725 wxCommandEvent& event
743 if (event.GetString().ToDouble(&dsecvec))
secvec_fr[0] = (GLfloat)dsecvec;
746 if (event.GetString().ToDouble(&dsecvec))
secvec_fr[1] = (GLfloat)dsecvec;
749 if (event.GetString().ToDouble(&dsecvec))
secvec_fr[2] = (GLfloat)dsecvec;
754 for (ii = 0; ii < 3; ii++) {
756 for (jj = 0; jj < 3; jj++) {
767 wxCommandEvent& event
771 if (event.GetString().ToDouble(&dEF)) {
780 wxCommandEvent& event
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;
791 wxCommandEvent& event
794 itet = wxAtoi(event.GetString()) - 1;
805 wxCommandEvent& event
811 if (event.GetString().ToDouble(&dvalue)) {
813 scl = (GLfloat)dvalue;
819 if (event.GetString().ToDouble(&dvalue)) {
820 trans[0] = (GLfloat)dvalue;
825 if (event.GetString().ToDouble(&dvalue)) {
826 trans[1] = (GLfloat)dvalue;
853 if (event.GetString().ToDouble(&dvalue))
854 thetax = (GLfloat)(dvalue) / 180.0f * 3.14159265f;
857 if (event.GetString().ToDouble(&dvalue))
858 thetay = (GLfloat)(dvalue) / 180.0f * 3.14159265f;
861 if (event.GetString().ToDouble(&dvalue))
862 thetaz = (GLfloat)(dvalue) / 180.0f * 3.14159265f;
880 const wxSize& size,
long style)
881 : wxFrame(frame, wxID_ANY, title, pos, size, style),
884 SetIcon(wxICON(fermisurfer));
893 int* gl_attrib = NULL;
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,
899 # if defined(__WXMAC__) || defined(__WXCOCOA__)
907 wxBoxSizer* sizermain =
new wxBoxSizer(wxVERTICAL);
909 splitterV =
new wxSplitterWindow(
this, wxID_ANY);
910 splitterV->SetSashGravity(1.0);
911 splitterV->SetMinimumPaneSize(0);
912 sizermain->Add(splitterV, 1, wxEXPAND, 0);
914 panel =
new wxScrolledWindow(splitterV);
916 gbsizer =
new wxGridBagSizer();
918 splitterH =
new wxSplitterWindow(splitterV, wxID_ANY);
919 splitterH->SetSashGravity(1.0);
920 splitterH->SetMinimumPaneSize(0);
922 m_canvas =
new TestGLCanvas(splitterH, wxID_ANY, gl_attrib);
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);
931 if (
lbatch == 1)splitterV->SplitVertically(splitterH, panel, -1);
932 else splitterV->SplitVertically(splitterH, panel, 0);
935 gbsizer->Add(
new wxButton(panel,
ibutton_compute, wxT(
"Update")), wxGBPosition(0,0), wxGBSpan(1,1));
937 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Line width : ")),
938 wxGBPosition(0, 1), wxGBSpan(1, 1), wxALIGN_RIGHT);
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));
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);
949 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Section-v : ")),
950 wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
952 wxTextCtrl* textbox_sectionx =
new wxTextCtrl(panel,
itext_sectionx, wxT(
""));
953 gbsizer->Add(textbox_sectionx, wxGBPosition(1, 1), wxGBSpan(1, 1));
955 wxTextCtrl* textbox_sectiony =
new wxTextCtrl(panel,
itext_sectiony, wxT(
""));
956 gbsizer->Add(textbox_sectiony, wxGBPosition(1, 2), wxGBSpan(1, 1));
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"));
964 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Equator-v : ")),
965 wxGBPosition(2, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
967 wxTextCtrl* textbox_equatorx =
new wxTextCtrl(panel,
itext_equatorx, wxT(
""));
968 gbsizer->Add(textbox_equatorx, wxGBPosition(2, 1), wxGBSpan(1, 1));
970 wxTextCtrl* textbox_equatory =
new wxTextCtrl(panel,
itext_equatory, wxT(
""));
971 gbsizer->Add(textbox_equatory, wxGBPosition(2, 2), wxGBSpan(1, 1));
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"));
979 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Interpol ratio : ")),
980 wxGBPosition(3, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
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"));
986 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Fermi energy : ")),
987 wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
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"));
993 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Min of Scale : ")),
994 wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
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);
1002 gbsizer->Add(textbox_max, wxGBPosition(6, 1), wxGBSpan(1, 1));
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);
1012 gbsizer->Add(radiobox_tetra, wxGBPosition(3,2), wxGBSpan(5, 2));
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)") };
1018 wxT(
"Color scale mode"),
1019 wxDefaultPosition, wxDefaultSize,
1020 WXSIZEOF(choices_colorscale), choices_colorscale,
1021 1, wxRA_SPECIFY_COLS);
1023 gbsizer->Add(radiobox_color, wxGBPosition(7, 0), wxGBSpan(3, 2));
1025 wxString choices_bz[] = { wxT(
"First Brillouin zone"), wxT(
"Primitive Brillouin zone") };
1028 wxDefaultPosition, wxDefaultSize,
1029 WXSIZEOF(choices_bz), choices_bz,
1030 1, wxRA_SPECIFY_COLS), wxGBPosition(8, 2), wxGBSpan(1, 2));
1032 wxString choices_stereo[] = { wxT(
"None"), wxT(
"Parallel"), wxT(
"Cross") };
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));
1039 wxString choices_mouse[] = { wxT(
"Rotate"), wxT(
"Scale"), wxT(
"Translate") };
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));
1046 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"BZ number : ")),
1047 wxGBPosition(10, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1050 gbsizer->Add(textbox_BZ_number0, wxGBPosition(10, 1), wxGBSpan(1, 1));
1053 gbsizer->Add(textbox_BZ_number1, wxGBPosition(10, 2), wxGBSpan(1, 1));
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"));
1061 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Background (RGB) : ")),
1062 wxGBPosition(11, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1065 gbsizer->Add(textbox_BackGroundR, wxGBPosition(11, 1), wxGBSpan(1, 1));
1068 gbsizer->Add(textbox_BackGroundG, wxGBPosition(11, 2), wxGBSpan(1, 1));
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"));
1076 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Line color (RGB) : ")),
1077 wxGBPosition(12, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1080 gbsizer->Add(textbox_LineColorR, wxGBPosition(12, 1), wxGBSpan(1, 1));
1083 gbsizer->Add(textbox_LineColorG, wxGBPosition(12, 2), wxGBSpan(1, 1));
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"));
1093 wxGBPosition(13, 0), wxGBSpan(1, 1));
1095 textbox_rotatex =
new wxTextCtrl(panel,
itext_rotx, wxT(
""));
1096 gbsizer->Add(textbox_rotatex, wxGBPosition(13, 1), wxGBSpan(1, 1));
1098 textbox_rotatey =
new wxTextCtrl(panel,
itext_roty, wxT(
""));
1099 gbsizer->Add(textbox_rotatey, wxGBPosition(13, 2), wxGBSpan(1, 1));
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"));
1107 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Position : ")),
1108 wxGBPosition(14, 1), wxGBSpan(1, 1), wxALIGN_RIGHT);
1111 gbsizer->Add(textbox_positionx, wxGBPosition(14, 2), wxGBSpan(1, 1));
1114 gbsizer->Add(textbox_positiony, wxGBPosition(14, 3), wxGBSpan(1, 1));
1115 textbox_positionx->ChangeValue(wxT(
"0"));
1116 textbox_positiony->ChangeValue(wxT(
"0"));
1118 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Scale : ")),
1119 wxGBPosition(15, 2), wxGBSpan(1, 1), wxALIGN_RIGHT);
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));
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);
1132 gbsizer->Add(
new wxCheckBox(panel,
icheck_equator, wxT(
"Equator")), wxGBPosition(17, 2), wxGBSpan(1, 1));
1135 gbsizer->Add(
new wxCheckBox(panel,
icheck_nodeline, wxT(
"Nodal line")), wxGBPosition(18, 2), wxGBSpan(1, 1));
1138 gbsizer->Add(
new wxCheckBox(panel,
icheck_section, wxT(
"Section")), wxGBPosition(16, 3), wxGBSpan(1, 1));
1141 gbsizer->Add(
new wxButton(panel,
ibutton_section, wxT(
"Section file")),
1142 wxGBPosition(17, 3), wxGBSpan(1, 1));
1144 wxString choices_light[] = { wxT(
"Both"), wxT(
"Unoccupy"), wxT(
"Occupy") };
1147 wxDefaultPosition, wxDefaultSize,
1148 WXSIZEOF(choices_light), choices_light,
1149 1, wxRA_SPECIFY_COLS), wxGBPosition(15, 1), wxGBSpan(4, 1));
1151 wxString choices_BarColor[] = { wxT(
"BGR"), wxT(
"CMY"), wxT(
"MCY"), wxT(
"BWR") };
1154 wxDefaultPosition, wxDefaultSize,
1155 WXSIZEOF(choices_BarColor), choices_BarColor,
1156 1, wxRA_SPECIFY_COLS), wxGBPosition(14, 0), wxGBSpan(5, 1));
1160 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Section (RGB) : ")),
1161 wxGBPosition(19, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1163 textbox_SectionR =
new wxTextCtrl(panel,
itext_SectionR, wxT(
""));
1164 gbsizer->Add(textbox_SectionR, wxGBPosition(19, 1), wxGBSpan(1, 1));
1166 textbox_SectionG =
new wxTextCtrl(panel,
itext_SectionG, wxT(
""));
1167 gbsizer->Add(textbox_SectionG, wxGBPosition(19, 2), wxGBSpan(1, 1));
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"));
1177 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Arrow (Start) : ")),
1178 wxGBPosition(20, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1181 gbsizer->Add(textbox_ArrowStart0, wxGBPosition(20, 1), wxGBSpan(1, 1));
1184 gbsizer->Add(textbox_ArrowStart1, wxGBPosition(20, 2), wxGBSpan(1, 1));
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"));
1194 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Arrow (End) : ")),
1195 wxGBPosition(21, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1198 gbsizer->Add(textbox_ArrowEnd0, wxGBPosition(21, 1), wxGBSpan(1, 1));
1201 gbsizer->Add(textbox_ArrowEnd1, wxGBPosition(21, 2), wxGBSpan(1, 1));
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"));
1211 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Arrow (Diff) : ")),
1212 wxGBPosition(22, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1215 gbsizer->Add(textbox_ArrowDiff0, wxGBPosition(22, 1), wxGBSpan(1, 1));
1218 gbsizer->Add(textbox_ArrowDiff1, wxGBPosition(22, 2), wxGBSpan(1, 1));
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"));
1228 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Sphere center : ")),
1229 wxGBPosition(23, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
1231 textbox_sphereX =
new wxTextCtrl(panel,
itext_sphereX, wxT(
""));
1232 gbsizer->Add(textbox_sphereX, wxGBPosition(23, 1), wxGBSpan(1, 1));
1234 textbox_sphereY =
new wxTextCtrl(panel,
itext_sphereY, wxT(
""));
1235 gbsizer->Add(textbox_sphereY, wxGBPosition(23, 2), wxGBSpan(1, 1));
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"));
1243 gbsizer->Add(
new wxStaticText(panel, wxID_ANY, wxT(
"Sphere radius : ")),
1244 wxGBPosition(24, 0), wxGBSpan(1, 1), wxALIGN_RIGHT);
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);
1274 wxTextCtrl** textbox_BandR, ** textbox_BandG, ** textbox_BandB;
1280 check =
new wxCheckBox * [
nb];
1281 textbox_BandR =
new wxTextCtrl * [
nb];
1282 textbox_BandG =
new wxTextCtrl * [
nb];
1283 textbox_BandB =
new wxTextCtrl * [
nb];
1285 for (ib = 0; ib <
nb; 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);
1292 if (
nb == 1) mat2 = 0.5f;
1293 else mat2 = 1.0f / (GLfloat)(
nb - 1) * (GLfloat)ib;
1296 for (j = 0; j < 4; ++j)
rgb_band[ib][j] =
cyan[j] * mat2 +
blue[j] * (1.0f - mat2);
1298 else if (mat2 <= 2.0) {
1300 for (j = 0; j < 4; ++j)
rgb_band[ib][j] =
green[j] * mat2 +
cyan[j] * (1.0f - mat2);
1302 else if (mat2 <= 3.0) {
1308 for (j = 0; j < 4; ++j)
rgb_band[ib][j] =
red[j] * mat2 +
yellow[j] * (1.0f - mat2);
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));
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));
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]));