** Begin of information panel
**/
interfInformationPanel::interfInformationPanel(wxWindow * parent)
-: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN){
-
+: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
+{
//wxPanel *panel = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxTAB_TRAVERSAL);
wxString lstOptions[4];
lstOptions[0]=_T("Current Slice");
lstOptContOperation[3]=_T("ALL");
_radiolstboxContourGroup = new wxRadioBox(this, -1, _T("Contour group"), wxDefaultPosition, wxSize(270,45), 4 , lstOptContOperation, 4, wxRA_SPECIFY_COLS);
+ _XYZValues = new wxCheckBox(this, -1, _T("Save Contour Values") );
+ _XYZValues->SetValue(true);
+
+ _contourImage = new wxCheckBox(this, -1, _T("Extract Contours as Images") );
+ _contourImage->SetValue(true);
+
+ _statistics = new wxCheckBox(this, -1, _T("Save Statistics") );
+ _statistics->SetValue(true);
+
wxButton *informationContourLabelsBtn = new wxButton(this,-1,_T("Contour labels"),wxDefaultPosition, wxSize(140,35) );
informationContourLabelsBtn->SetEventHandler( this );
Connect( informationContourLabelsBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onInformationContourLabels );
statisticsContourBtn->SetEventHandler( this );
Connect( statisticsContourBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onExtractInformation );
- wxButton *saveResultsBtn = new wxButton(this,-1,_T("Save statistics results"),wxDefaultPosition, wxSize(140,35) );
+ wxButton *saveResultsBtn = new wxButton(this,-1,_T("Save Results"),wxDefaultPosition, wxSize(140,35) );
saveResultsBtn->SetEventHandler( this );
Connect( saveResultsBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onSaveResults );
_mbarrangeRangeInformation-> SetStart( (int)range[0] );
_mbarrangeRangeInformation-> SetEnd( (int)range[1] );
-
- _staticTextInformation = new wxStaticText(this,-1,_T(" "));
-
-
-// wxButton *XXXXXXXBtn = new wxButton(this,-1,_T("Statistics"),wxDefaultPosition, wxSize(180,35) );
-// XXXXXXXBtn->SetEventHandler( this );
-// Connect( XXXXXXXBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContourEventHandler::onXXXXX );
-
+ _staticTextInformation = new wxStaticText(this,-1,_T(" "));
_grid = new wxGrid( this,
wxID_ANY,
wxPoint( 0, 0 ),
- wxSize( 100, 100 ) );
+ wxSize( 200, 500 ) );
int i,gridCol=10,gridRow=sizeZ;
_grid->CreateGrid( 0, 0 );
FillGridWithContoursInformation();
+ wxFlexGridSizer * sizerSave = new wxFlexGridSizer(2,2);
+ sizerSave -> Add( new wxStaticText(this,-1,_T("Save Options: ")) , 1, wxGROW );
+ sizerSave->Add( _XYZValues, 1, wxALL ,2 );
+ sizerSave->Add( _statistics, 1, wxALL ,2 );
+ sizerSave->Add( _contourImage, 1, wxALL ,2 );
+
wxFlexGridSizer * sizerA = new wxFlexGridSizer(10);
sizerA->Add( _informationRadiobox , 1, wxALL ,2 );
sizerA->Add( _radiolstboxContourGroup , 1, wxALL ,2 );
+ sizerA->Add( sizerSave , 1, wxALL ,2 );
+
wxFlexGridSizer * sizerB = new wxFlexGridSizer(10);
- sizerB->Add( informationContourLabelsBtn , 1, wxALL ,2 );
- sizerB->Add( statisticsContourBtn , 1, wxALL ,2 );
- sizerB->Add( saveResultsBtn , 1, wxALL ,2 );
+ sizerB->Add( informationContourLabelsBtn, 1, wxALL ,2 );
+ sizerB->Add( statisticsContourBtn, 1, wxALL ,2 );
+ sizerB->Add( saveResultsBtn, 1, wxALL ,2 );
- wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
- sizer->AddGrowableCol(0);
- sizer->AddGrowableRow(7);
+ wxFlexGridSizer * sizer = new wxFlexGridSizer(1,8);
sizer->Add( sizerA , 1, wxALL , 0 );
sizer->Add( new wxStaticText(this ,-1,_T("Slice Range")) , 1, wxALL , 0 );
sizer->Add( _mbarrangeSliceInformation , 1, wxALL|wxGROW , 2 );
sizer->Add( new wxStaticText(this ,-1,_T("Gray Range")) , 1, wxALL , 0 );
sizer->Add( _mbarrangeRangeInformation , 1, wxALL|wxGROW , 2 );
- sizer->Add( sizerB , 1, wxALL , 0 );
- sizer->Add( _staticTextInformation , 1, wxALL , 0 );
+ sizer->Add( sizerB , 1, wxEXPAND , 0 );
+ sizer->Add( _staticTextInformation , 1, wxEXPAND , 0 );
sizer->Add( _grid , 1, wxEXPAND , 0 );
-
-
this->SetSizer( sizer );
this->SetSize( wxSize(1500,1500) );
//this->SetBackgroundColour( wxColour(100,100,100) );
}
-void interfInformationPanel::onSaveResults(wxCommandEvent& event){
+void interfInformationPanel::onSaveResults(wxCommandEvent& event)
+{
wxFileDialog dialog(this, _T("Choose a file"), _T(""), _T(""), _T("*.txt"), wxSAVE );
if (dialog.ShowModal() == wxID_OK)
{
std::string namefile=(const char *)(dialog.GetFilename().mb_str());
std::string filename = (const char *)(dialog.GetPath().mb_str() );
int typeContourGroup = _radiolstboxContourGroup->GetSelection();
- interfMainPanel::getInstance()->onSaveResults(directory, namefile, filename, typeContourGroup);
+ interfMainPanel::getInstance()->onSaveResults(directory, namefile, filename,
+ typeContourGroup, _XYZValues->GetValue(), _contourImage->GetValue(), _statistics->GetValue());
}
}