00001
00021 #include "descriptor_surface_based_trainer/Main_Dialog_Base.h"
00022
00023
00024 MainDialogBase::MainDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
00025 {
00026 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
00027
00028 wxBoxSizer* bSizer2;
00029 bSizer2 = new wxBoxSizer( wxVERTICAL );
00030
00031
00032 bSizer2->Add( 0, 10, 0, 0, 5 );
00033
00034 wxBoxSizer* bSizer10;
00035 bSizer10 = new wxBoxSizer( wxHORIZONTAL );
00036
00037
00038 bSizer10->Add( 20, 0, 0, 0, 5 );
00039
00040 label_caption = new wxStaticText( this, wxID_ANY, wxT("3D recognition parameters"), wxDefaultPosition, wxDefaultSize, 0 );
00041 label_caption->Wrap( -1 );
00042 label_caption->SetFont( wxFont( 13, 70, 90, 92, false, wxEmptyString ) );
00043
00044 bSizer10->Add( label_caption, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
00045
00046 bSizer2->Add( bSizer10, 0, wxEXPAND, 5 );
00047
00048
00049 bSizer2->Add( 0, 10, 0, 0, 5 );
00050
00051 wxBoxSizer* bSizer3;
00052 bSizer3 = new wxBoxSizer( wxHORIZONTAL );
00053
00054 label_name = new wxStaticText( this, wxID_ANY, wxT("Name"), wxDefaultPosition, wxDefaultSize, 0 );
00055 label_name->Wrap( -1 );
00056 bSizer3->Add( label_name, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
00057
00058
00059 bSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
00060
00061 edit_name = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 300,-1 ), wxTE_PROCESS_ENTER );
00062 bSizer3->Add( edit_name, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
00063
00064
00065 bSizer3->Add( 20, 0, 0, wxEXPAND, 5 );
00066
00067 bSizer2->Add( bSizer3, 0, wxEXPAND|wxLEFT, 5 );
00068
00069 wxBoxSizer* bSizer4;
00070 bSizer4 = new wxBoxSizer( wxHORIZONTAL );
00071
00072 label_object_model = new wxStaticText( this, wxID_ANY, wxT("Object-Model"), wxDefaultPosition, wxDefaultSize, 0 );
00073 label_object_model->Wrap( -1 );
00074 bSizer4->Add( label_object_model, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
00075
00076
00077 bSizer4->Add( 0, 0, 1, wxEXPAND, 5 );
00078
00079 wxArrayString choice_object_modelChoices;
00080 choice_object_model = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxSize( 300,-1 ), choice_object_modelChoices, 0 );
00081 choice_object_model->SetSelection( 0 );
00082 bSizer4->Add( choice_object_model, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
00083
00084
00085 bSizer4->Add( 20, 0, 0, wxEXPAND, 5 );
00086
00087 bSizer2->Add( bSizer4, 0, wxEXPAND|wxLEFT, 5 );
00088
00089 wxBoxSizer* bSizer41;
00090 bSizer41 = new wxBoxSizer( wxHORIZONTAL );
00091
00092 label_mesh = new wxStaticText( this, wxID_ANY, wxT("Textured object-model (Visualisation)"), wxDefaultPosition, wxDefaultSize, 0 );
00093 label_mesh->Wrap( -1 );
00094 bSizer41->Add( label_mesh, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
00095
00096
00097 bSizer41->Add( 0, 0, 1, wxEXPAND, 5 );
00098
00099 wxArrayString choice_meshChoices;
00100 choice_mesh = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxSize( 300,-1 ), choice_meshChoices, 0 );
00101 choice_mesh->SetSelection( 0 );
00102 bSizer41->Add( choice_mesh, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
00103
00104
00105 bSizer41->Add( 20, 0, 0, wxEXPAND, 5 );
00106
00107 bSizer2->Add( bSizer41, 0, wxEXPAND|wxLEFT, 5 );
00108
00109 wxBoxSizer* bSizer411;
00110 bSizer411 = new wxBoxSizer( wxHORIZONTAL );
00111
00112 label_rotation_type = new wxStaticText( this, wxID_ANY, wxT("Rotation-Model-Type"), wxDefaultPosition, wxDefaultSize, 0 );
00113 label_rotation_type->Wrap( -1 );
00114 bSizer411->Add( label_rotation_type, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
00115
00116
00117 bSizer411->Add( 0, 0, 1, wxEXPAND, 5 );
00118
00119 wxString choice_rotation_typeChoices[] = { wxT("No Rotation"), wxT("Cylinder"), wxT("Sphere") };
00120 int choice_rotation_typeNChoices = sizeof( choice_rotation_typeChoices ) / sizeof( wxString );
00121 choice_rotation_type = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxSize( 300,-1 ), choice_rotation_typeNChoices, choice_rotation_typeChoices, 0 );
00122 choice_rotation_type->SetSelection( 0 );
00123 bSizer411->Add( choice_rotation_type, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
00124
00125
00126 bSizer411->Add( 20, 0, 0, wxEXPAND, 5 );
00127
00128 bSizer2->Add( bSizer411, 0, wxEXPAND|wxLEFT, 5 );
00129
00130 wxBoxSizer* bSizer12;
00131 bSizer12 = new wxBoxSizer( wxHORIZONTAL );
00132
00133 label_orientation = new wxStaticText( this, wxID_ANY, wxT("Model-Orientation"), wxDefaultPosition, wxDefaultSize, 0 );
00134 label_orientation->Wrap( -1 );
00135 bSizer12->Add( label_orientation, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
00136
00137
00138 bSizer12->Add( 0, 0, 1, wxEXPAND, 5 );
00139
00140 label_orientation_x = new wxStaticText( this, wxID_ANY, wxT("x:"), wxDefaultPosition, wxDefaultSize, 0 );
00141 label_orientation_x->Wrap( -1 );
00142 bSizer12->Add( label_orientation_x, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
00143
00144 edit_orientation_x = new wxTextCtrl( this, wxID_ANY, wxT("1.0"), wxDefaultPosition, wxSize( 70,-1 ), wxTE_PROCESS_ENTER );
00145 bSizer12->Add( edit_orientation_x, 0, wxALL, 5 );
00146
00147 label_orientation_y = new wxStaticText( this, wxID_ANY, wxT("y:"), wxDefaultPosition, wxDefaultSize, 0 );
00148 label_orientation_y->Wrap( -1 );
00149 bSizer12->Add( label_orientation_y, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
00150
00151 edit_orientation_y = new wxTextCtrl( this, wxID_ANY, wxT("0.0"), wxDefaultPosition, wxSize( 70,-1 ), wxTE_PROCESS_ENTER );
00152 bSizer12->Add( edit_orientation_y, 0, wxALL, 5 );
00153
00154 label_orientation_z = new wxStaticText( this, wxID_ANY, wxT("z:"), wxDefaultPosition, wxDefaultSize, 0 );
00155 label_orientation_z->Wrap( -1 );
00156 bSizer12->Add( label_orientation_z, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
00157
00158 edit_orientation_z = new wxTextCtrl( this, wxID_ANY, wxT("0.0"), wxDefaultPosition, wxSize( 70,-1 ), wxTE_PROCESS_ENTER );
00159 bSizer12->Add( edit_orientation_z, 0, wxALL, 5 );
00160
00161
00162 bSizer12->Add( 20, 0, 0, wxEXPAND, 5 );
00163
00164 bSizer2->Add( bSizer12, 0, wxEXPAND|wxLEFT, 5 );
00165
00166 wxBoxSizer* bSizer13;
00167 bSizer13 = new wxBoxSizer( wxHORIZONTAL );
00168
00169 label_diameter = new wxStaticText( this, wxID_ANY, wxT("Diameter"), wxDefaultPosition, wxDefaultSize, 0 );
00170 label_diameter->Wrap( -1 );
00171 bSizer13->Add( label_diameter, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
00172
00173
00174 bSizer13->Add( 0, 0, 1, wxEXPAND, 5 );
00175
00176 edit_diameter = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 200,-1 ), wxTE_PROCESS_ENTER );
00177 bSizer13->Add( edit_diameter, 0, wxALL|wxEXPAND, 5 );
00178
00179
00180 bSizer13->Add( 20, 0, 0, wxEXPAND, 5 );
00181
00182 bSizer2->Add( bSizer13, 0, wxEXPAND|wxLEFT, 5 );
00183
00184 wxBoxSizer* bSizer14;
00185 bSizer14 = new wxBoxSizer( wxHORIZONTAL );
00186
00187 label_score_3D = new wxStaticText( this, wxID_ANY, wxT("Score 3D"), wxDefaultPosition, wxDefaultSize, 0 );
00188 label_score_3D->Wrap( -1 );
00189 bSizer14->Add( label_score_3D, 0, wxALL|wxALIGN_BOTTOM, 5 );
00190
00191
00192 bSizer14->Add( 0, 0, 1, wxEXPAND, 5 );
00193
00194 edit_score_3D = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 200,-1 ), wxTE_PROCESS_ENTER );
00195 bSizer14->Add( edit_score_3D, 0, wxALL|wxEXPAND, 5 );
00196
00197
00198 bSizer14->Add( 20, 0, 0, wxEXPAND, 5 );
00199
00200 bSizer2->Add( bSizer14, 0, wxLEFT|wxEXPAND, 5 );
00201
00202
00203 bSizer2->Add( 0, 5, 0, 0, 5 );
00204
00205 wxBoxSizer* bSizer15;
00206 bSizer15 = new wxBoxSizer( wxHORIZONTAL );
00207
00208
00209 bSizer15->Add( 0, 0, 1, wxEXPAND, 5 );
00210
00211 button_cancel = new wxButton( this, wxID_ANY, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
00212 bSizer15->Add( button_cancel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
00213
00214 button_next = new wxButton( this, wxID_ANY, wxT("Next >"), wxDefaultPosition, wxDefaultSize, 0 );
00215 bSizer15->Add( button_next, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
00216
00217 bSizer2->Add( bSizer15, 1, wxEXPAND, 5 );
00218
00219
00220 bSizer2->Add( 0, 10, 0, 0, 5 );
00221
00222 this->SetSizer( bSizer2 );
00223 this->Layout();
00224
00225 this->Centre( wxBOTH );
00226
00227
00228 this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainDialogBase::onDialogClose ) );
00229 edit_name->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( MainDialogBase::onKillFocusName ), NULL, this );
00230 edit_name->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( MainDialogBase::onTextEnterName ), NULL, this );
00231 choice_object_model->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainDialogBase::onObjectModelSelected ), NULL, this );
00232 edit_orientation_x->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( MainDialogBase::onKillFocusOrientationX ), NULL, this );
00233 edit_orientation_x->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( MainDialogBase::onTextEnterOrientationX ), NULL, this );
00234 edit_orientation_y->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( MainDialogBase::onKillFocusOrientationY ), NULL, this );
00235 edit_orientation_y->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( MainDialogBase::onTextEnterOrientationY ), NULL, this );
00236 edit_orientation_z->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( MainDialogBase::onKillFocusOrientationZ ), NULL, this );
00237 edit_orientation_z->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( MainDialogBase::onTextEnterOrientationZ ), NULL, this );
00238 edit_diameter->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( MainDialogBase::onKillFocusDiameter ), NULL, this );
00239 edit_diameter->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( MainDialogBase::onTextEnterDiameter ), NULL, this );
00240 edit_score_3D->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( MainDialogBase::onKillFocusScore3D ), NULL, this );
00241 edit_score_3D->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( MainDialogBase::onTextEnterScore3D ), NULL, this );
00242 button_cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogBase::onCancelPressed ), NULL, this );
00243 button_next->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogBase::onNextPressed ), NULL, this );
00244 }
00245
00246 MainDialogBase::~MainDialogBase()
00247 {
00248
00249 this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainDialogBase::onDialogClose ) );
00250 edit_name->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( MainDialogBase::onKillFocusName ), NULL, this );
00251 edit_name->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( MainDialogBase::onTextEnterName ), NULL, this );
00252 choice_object_model->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainDialogBase::onObjectModelSelected ), NULL, this );
00253 edit_orientation_x->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( MainDialogBase::onKillFocusOrientationX ), NULL, this );
00254 edit_orientation_x->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( MainDialogBase::onTextEnterOrientationX ), NULL, this );
00255 edit_orientation_y->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( MainDialogBase::onKillFocusOrientationY ), NULL, this );
00256 edit_orientation_y->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( MainDialogBase::onTextEnterOrientationY ), NULL, this );
00257 edit_orientation_z->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( MainDialogBase::onKillFocusOrientationZ ), NULL, this );
00258 edit_orientation_z->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( MainDialogBase::onTextEnterOrientationZ ), NULL, this );
00259 edit_diameter->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( MainDialogBase::onKillFocusDiameter ), NULL, this );
00260 edit_diameter->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( MainDialogBase::onTextEnterDiameter ), NULL, this );
00261 edit_score_3D->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( MainDialogBase::onKillFocusScore3D ), NULL, this );
00262 edit_score_3D->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( MainDialogBase::onTextEnterScore3D ), NULL, this );
00263 button_cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogBase::onCancelPressed ), NULL, this );
00264 button_next->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogBase::onNextPressed ), NULL, this );
00265 }