]> Creatis software - creaContours.git/blobdiff - lib/Interface_Icons_NDimensions/interfToolsPanels.cxx
no message
[creaContours.git] / lib / Interface_Icons_NDimensions / interfToolsPanels.cxx
index 145d5110f8dc1dfe4dd1474f41cb6870b5b300d2..5b2b1c29b241c53dceda1b6d718795c17a46899a 100644 (file)
@@ -188,8 +188,8 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        wxString lstOptions[4];
        lstOptions[0]=_T("Current Slice");
        lstOptions[1]=_T("Range Slices");
-       lstOptions[2]=_T("All Slices");
-       _informationRadiobox                                                    = new wxRadioBox(this, -1, _T("Slice analysis"), wxDefaultPosition, wxSize(270,45), 3 , lstOptions,  3, wxRA_SPECIFY_COLS);
+//     lstOptions[2]=_T("All Slices");
+       _informationRadiobox                                                    = new wxRadioBox(this, -1, _T("Slice analysis"), wxDefaultPosition, wxSize(270,45), 2 , lstOptions,  2, wxRA_SPECIFY_COLS);
 
        wxString lstOptContOperation[5];
        lstOptContOperation[0]=_T("AND");
@@ -266,7 +266,7 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
                 wxPoint( 0, 0 ),
                 wxSize( 200, 500 ) );
 
-       int i,gridCol=10,gridRow=sizeZ;
+       int i,gridCol=10,gridRow=sizeZ+2;
        _grid->CreateGrid( 0, 0 );
        _grid->AppendRows(gridRow);
        _grid->AppendCols(gridCol);
@@ -327,8 +327,11 @@ void interfInformationPanel::onInformationContourLabels(wxCommandEvent& event){
 void interfInformationPanel::onShowResultImages(wxCommandEvent& event)
 {
 //     onExtractInformation( event );
+       int selection           = _informationRadiobox->GetSelection();
+       int minZ                        = _mbarrangeSliceInformation->GetStart();
+       int maxZ                        = _mbarrangeSliceInformation->GetEnd();
        int typeContourGroup = _radiolstboxContourGroup->GetSelection();
-       interfMainPanel::getInstance()->ShowResultImages( typeContourGroup );   
+       interfMainPanel::getInstance()->ShowResultImages( typeContourGroup , selection, minZ, maxZ);    
 }
 
 
@@ -337,11 +340,13 @@ void interfInformationPanel::onExtractInformation(wxCommandEvent& event){
        _grid->ClearGrid();
 
        int typeContourGroup = this->_radiolstboxContourGroup->GetSelection();
-       int selection = _informationRadiobox->GetSelection();
-       int minZ        = _mbarrangeSliceInformation->GetStart();
-       int maxZ        = _mbarrangeSliceInformation->GetEnd();
-
-       interfMainPanel::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ);    
+       int selection           = _informationRadiobox->GetSelection();
+       int minZ                        = _mbarrangeSliceInformation->GetStart();
+       int maxZ                        = _mbarrangeSliceInformation->GetEnd();
+       int     grayRangeMin    = _mbarrangeRangeInformation->GetStart();
+       int     grayRangeMax    = _mbarrangeRangeInformation->GetEnd();
+       
+       interfMainPanel::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ,grayRangeMin,grayRangeMax);  
 }
 
 void interfInformationPanel::onSaveResults(wxCommandEvent& event)
@@ -350,12 +355,17 @@ void interfInformationPanel::onSaveResults(wxCommandEvent& event)
        if (dialog.ShowModal() == wxID_OK)
        {
                onExtractInformation( event );
+               int selection           = _informationRadiobox->GetSelection();
+               int minZ                        = _mbarrangeSliceInformation->GetStart();
+               int maxZ                        = _mbarrangeSliceInformation->GetEnd();
                std::string directory=(const char *)(dialog.GetDirectory().mb_str());
                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, _XYZValues->GetValue(), _contourImage->GetValue(), _statistics->GetValue());
+                       typeContourGroup,
+                       selection,minZ,maxZ,
+                       _XYZValues->GetValue(), _contourImage->GetValue(), _statistics->GetValue());
        }
 }
 
@@ -390,8 +400,16 @@ void interfInformationPanel::FillGridWithContoursInformation(){
                        //tempString = wxString((*contourthing)->getName().c_str(),wxConvUTF8) ;
                        tempString = wxString(lstContourThings[ii].c_str(),wxConvUTF8) ;
                        _grid->SetCellValue( z, ii, tempString );
-               }
-       }
+               } // for ii
+       }// for z
+       
+       // Last line
+       _grid->SetRowLabelValue(sizeZ, _T(" ") );
+       for (ii=0 ; ii<sizeLstContourThings ; ii++)
+       {
+               _grid->SetCellValue( sizeZ, ii, _T(" ") );
+       } // for ii
+       
 }
 
 void interfInformationPanel::setStringInfoPanel(wxString tmpString){