interfInformationPanel Class Reference

#include <interfToolsPanels.h>

List of all members.

Public Member Functions

 interfInformationPanel (wxWindow *parent)
 ~interfInformationPanel ()
void setStringInfoPanel (wxString tmpString)
void setRowLabelInfoPanel (int z, wxString tempString)
void appendCols (int numcols)
int getNumberCols ()
void setCellValue (int z, int tmpIntA, wxString tempString)
void setColLabel (int tmpIntB, wxString tmpTitleString)
wxString getCellValue (int j, int i)

Private Member Functions

void onInformationContourLabels (wxCommandEvent &event)
void onExtractInformation (wxCommandEvent &event)
void onShowResultImages (wxCommandEvent &event)
void onSaveResults (wxCommandEvent &event)
void onContourGroup (wxCommandEvent &event)
void FillGridWithContoursInformation ()
void onRangeSliceInformation (wxCommandEvent &event)

Private Attributes

mBarRange * _mbarrangeRangeInformation
mBarRange * _mbarrangeSliceInformation
wxGrid * _grid
wxRadioBox * _informationRadiobox
wxRadioBox * _radiolstboxContourGroup
wxStaticText * _staticTextInformation
wxCheckBox * _XYZValues
wxCheckBox * _contourImage
wxCheckBox * _statistics


Detailed Description

Definition at line 58 of file interfToolsPanels.h.


Constructor & Destructor Documentation

interfInformationPanel::interfInformationPanel ( wxWindow *  parent  ) 

Begin of information panel

Definition at line 190 of file interfToolsPanels.cxx.

References _contourImage, _grid, _informationRadiobox, _mbarrangeRangeInformation, _mbarrangeSliceInformation, _radiolstboxContourGroup, _staticTextInformation, _statistics, _XYZValues, FillGridWithContoursInformation(), interfMainPanel::GetImageDataSizeZ(), interfMainPanel::getImageRange(), interfMainPanel::getInstance(), onContourGroup(), onExtractInformation(), onInformationContourLabels(), onRangeSliceInformation(), onSaveResults(), and onShowResultImages().

00191 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
00192 {
00193         //wxPanel *panel                                                                        = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxTAB_TRAVERSAL);
00194         wxString lstOptions[4];
00195         lstOptions[0]=_T("Current Slice");
00196         lstOptions[1]=_T("Range Slices");
00197 //      lstOptions[2]=_T("All Slices");
00198         _informationRadiobox     = new wxRadioBox(this, -1, _T("Slice analysis"), wxDefaultPosition, wxSize(270,45), 2 , lstOptions,  2, wxRA_SPECIFY_COLS);
00199 
00200 
00201         wxString lstOptContOperation[5];
00202         lstOptContOperation[0]=_T("AND");
00203         lstOptContOperation[1]=_T("OR");
00204         lstOptContOperation[2]=_T("XOR");
00205         lstOptContOperation[3]=_T("ALL");
00206         _radiolstboxContourGroup = new wxRadioBox(this, -1, _T("Contour group"), wxDefaultPosition, wxSize(270,45), 4 , lstOptContOperation,  4, wxRA_SPECIFY_COLS);
00207         _radiolstboxContourGroup->SetSelection(1);
00208         Connect( _radiolstboxContourGroup->GetId(), wxEVT_COMMAND_RADIOBOX_SELECTED , (wxObjectEventFunction) &interfInformationPanel::onContourGroup );
00209 
00210 
00211         _XYZValues = new wxCheckBox(this, -1, _T("Save Contour Values") );
00212         _XYZValues->SetValue(true);
00213 
00214         _contourImage = new wxCheckBox(this, -1, _T("Extract Contours as Images") );
00215         _contourImage->SetValue(true);
00216 
00217         _statistics = new wxCheckBox(this, -1, _T("Save Statistics") );
00218         _statistics->SetValue(true);
00219 
00220         wxButton *informationContourLabelsBtn           = new wxButton(this,-1,_T("Contour labels"),wxDefaultPosition, wxSize(140,35) );
00221         informationContourLabelsBtn->SetEventHandler( this );
00222         Connect( informationContourLabelsBtn->GetId(),          wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onInformationContourLabels );
00223 
00224         wxButton *statisticsContourBtn                  = new wxButton(this,-1,_T("Contour statistics"),wxDefaultPosition, wxSize(140,35) );
00225         statisticsContourBtn->SetEventHandler( this );
00226         Connect( statisticsContourBtn->GetId(),         wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onExtractInformation );
00227 
00228         wxButton *showResultImagesBtn                   = new wxButton(this,-1,_T("Show result images"),wxDefaultPosition, wxSize(140,35) );
00229         showResultImagesBtn->SetEventHandler( this );
00230         Connect( showResultImagesBtn->GetId(),          wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onShowResultImages );
00231 
00232 
00233         wxButton *saveResultsBtn                        = new wxButton(this,-1,_T("Save Results"),wxDefaultPosition, wxSize(140,35) );
00234         saveResultsBtn->SetEventHandler( this );
00235         Connect( saveResultsBtn->GetId(),               wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onSaveResults );
00236 
00237 
00238         int sizeZ = interfMainPanel::getInstance()->GetImageDataSizeZ();
00239         //_theViewPanel->getSceneManager()->GetImageDataSizeZ();
00240         _mbarrangeSliceInformation                      =  new mBarRange(this,65,65);
00241         _mbarrangeSliceInformation->SetMin(0);
00242         _mbarrangeSliceInformation->SetStart(0);
00243         _mbarrangeSliceInformation-> SetOrientation( true );
00244         _mbarrangeSliceInformation-> setActiveStateTo(true);
00245         _mbarrangeSliceInformation-> setVisibleLabels( true );
00246         _mbarrangeSliceInformation-> setDeviceEndMargin(10);
00247         _mbarrangeSliceInformation-> setRepresentedValues( 0 , sizeZ-1 );
00248         _mbarrangeSliceInformation-> setDeviceBlitStart(10,10);
00249         _mbarrangeSliceInformation-> setIfWithActualDrawed( false );
00250         _mbarrangeSliceInformation-> SetStart( 0 );
00251         _mbarrangeSliceInformation-> SetEnd( sizeZ-1 );
00252 
00253 
00254 
00255         double range[2];
00256         interfMainPanel::getInstance()->getImageRange(range);
00257 
00258         int min = (int)floor (range[0]);
00259         int max = (int)ceil (range[1]);
00260 
00261         _mbarrangeRangeInformation      =  new mBarRange(this,65,65);
00262         _mbarrangeRangeInformation->SetMin(0);
00263         _mbarrangeRangeInformation->SetStart(0);
00264         _mbarrangeRangeInformation->SetOrientation( true );
00265         _mbarrangeRangeInformation->setActiveStateTo(true);
00266         _mbarrangeRangeInformation->setVisibleLabels( true );
00267         _mbarrangeRangeInformation->setDeviceEndMargin(10);
00268         _mbarrangeRangeInformation->setRepresentedValues( min , max );
00269         _mbarrangeRangeInformation->setDeviceBlitStart(10,10);
00270         _mbarrangeRangeInformation->setIfWithActualDrawed( false );
00271         _mbarrangeRangeInformation->SetStart( min );
00272         _mbarrangeRangeInformation->SetEnd( max );
00273 
00274 //      _mbarrangeSliceInformation->PushEventHandler(this);
00275 //      Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
00276 //      Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction)  &interfInformationPanel::onRangeSliceInformation );
00277         Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_START,(wxObjectEventFunction) (wxCommandEventFunction)  &interfInformationPanel::onRangeSliceInformation );
00278         Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction)  &interfInformationPanel::onRangeSliceInformation );
00279 //      Connect(_mbarrangeRangeInformation->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction)  &interfInformationPanel::onRangeSliceInformation );
00280         Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction)  &interfInformationPanel::onRangeSliceInformation );
00281 
00282 
00283         _staticTextInformation  = new wxStaticText(this,-1,_T("    "));
00284 
00285         _grid = new wxGrid( this,
00286                 wxID_ANY,
00287                 wxPoint( 0, 0 ),
00288                 wxSize( 200, 500 ) );
00289 
00290         int i,gridCol=10,gridRow=sizeZ+2;
00291         _grid->CreateGrid( 0, 0 );
00292         _grid->AppendRows(gridRow);
00293         _grid->AppendCols(gridCol);
00294 
00295         for (i=0;i<gridRow;i++)
00296         {
00297                 _grid->SetRowLabelValue(i, _T(" ") );
00298         }
00299 //                      _grid->SetColLabelSize(0);
00300 
00301 
00302         FillGridWithContoursInformation();
00303 
00304         wxFlexGridSizer * sizerSave             = new wxFlexGridSizer(2,2);
00305         sizerSave -> Add( new wxStaticText(this,-1,_T("Save Options: "))  , 1, wxGROW );
00306         sizerSave->Add( _XYZValues,    1, wxALL, 2 );
00307         sizerSave->Add( _statistics,   1, wxALL, 2 );
00308         sizerSave->Add( _contourImage, 1, wxALL, 2 );
00309 
00310         wxFlexGridSizer * sizerA                = new wxFlexGridSizer(10);
00311         sizerA->Add( _informationRadiobox,     1, wxALL, 2 );
00312         sizerA->Add( _radiolstboxContourGroup, 1, wxALL, 2 );
00313         sizerA->Add( sizerSave,                1, wxALL, 2 );
00314 
00315 
00316         wxFlexGridSizer * sizerB                = new wxFlexGridSizer(10);
00317         sizerB->Add( informationContourLabelsBtn, 1, wxALL, 2 );
00318         sizerB->Add( statisticsContourBtn,        1, wxALL, 2 );
00319         sizerB->Add( showResultImagesBtn,         1, wxALL, 2 );
00320         sizerB->Add( saveResultsBtn,              1, wxALL, 2 );
00321 
00322         wxFlexGridSizer * sizer         = new wxFlexGridSizer(1,8);
00323         sizer->Add( sizerA                     , 1, wxALL               , 0 );
00324         sizer->Add( new wxStaticText(this      ,-1,_T("Slice Range"))   , 1, wxALL , 0 );
00325         sizer->Add( _mbarrangeSliceInformation , 1, wxALL|wxGROW        , 2 );
00326         sizer->Add( new wxStaticText(this      ,-1,_T("Gray Range"))    , 1, wxALL , 0 );
00327         sizer->Add( _mbarrangeRangeInformation , 1, wxALL|wxGROW        , 2 );
00328         sizer->Add( sizerB                     , 1, wxEXPAND            , 0 );
00329         sizer->Add( _staticTextInformation     , 1, wxEXPAND            , 0 );
00330         sizer->Add( _grid                      , 1, wxEXPAND            , 0 );
00331 
00332         this->SetSizer( sizer );
00333         this->SetSize( wxSize(1500,1500) );
00334         //this->SetBackgroundColour( wxColour(100,100,100) );
00335         this->SetAutoLayout( true );
00336         this->Layout();
00337         //return panel;
00338 }

Here is the call graph for this function:

interfInformationPanel::~interfInformationPanel (  ) 

Definition at line 340 of file interfToolsPanels.cxx.

00341 {
00342 }


Member Function Documentation

void interfInformationPanel::appendCols ( int  numcols  ) 

Definition at line 460 of file interfToolsPanels.cxx.

References _grid.

00460                                                   {
00461     _grid->AppendCols(numcols);
00462 }

void interfInformationPanel::FillGridWithContoursInformation (  )  [private]

Definition at line 405 of file interfToolsPanels.cxx.

References _grid, interfMainPanel::GetImageDataSizeZ(), interfMainPanel::getInstance(), and interfMainPanel::getOutlinesName().

Referenced by interfInformationPanel(), and onInformationContourLabels().

00405                                                             {
00406 
00407         wxString tempString;
00408         _grid->ClearGrid();
00409         _grid->SetColLabelValue(0, _T("A") );
00410         _grid->SetColLabelValue(1, _T("B") );
00411         _grid->SetColLabelValue(2, _T("C") );
00412         _grid->SetColLabelValue(3, _T("D") );
00413         _grid->SetColLabelValue(4, _T("E") );
00414         _grid->SetColLabelValue(5, _T("F") );
00415         //_instantPanel->getInstant( tempVector );
00416 
00417         int z,sizeZ = interfMainPanel::getInstance()->GetImageDataSizeZ();//->getSceneManager()->GetImageDataSizeZ();
00418         int ii,sizeLstContourThings;
00419         for ( z=0 ; z<sizeZ ; z++)
00420         {
00421 
00422                 std::vector<std::string> lstContourThings = interfMainPanel::getInstance()->getOutlinesName(z);
00423 
00424                         //this->_modelManager->getOutlinesAtInstant( &instant );
00425 
00426                 sizeLstContourThings = lstContourThings.size();
00427                 tempString.Printf(_T("%d - %d"),z, sizeLstContourThings);
00428                 _grid->SetRowLabelValue(z, tempString );
00429 
00430                 for (ii=0 ; ii<sizeLstContourThings ; ii++)
00431                 {
00432                         //ContourThing **contourthing = lstContourThings[ii];
00433                         //tempString = wxString((*contourthing)->getName().c_str(),wxConvUTF8) ;
00434                         tempString = wxString(lstContourThings[ii].c_str(),wxConvUTF8) ;
00435                         _grid->SetCellValue( z, ii, tempString );
00436                 } // for ii
00437         }// for z
00438 
00439         // Last line
00440         _grid->SetRowLabelValue(sizeZ, _T(" ") );
00441         for (ii=0 ; ii<sizeLstContourThings ; ii++)
00442         {
00443                 _grid->SetCellValue( sizeZ, ii, _T(" ") );
00444         } // for ii
00445 
00446 }

Here is the call graph for this function:

Here is the caller graph for this function:

wxString interfInformationPanel::getCellValue ( int  j,
int  i 
)

Definition at line 472 of file interfToolsPanels.cxx.

References _grid.

00472                                                         {
00473         return _grid->GetCellValue( j , i );
00474 }

int interfInformationPanel::getNumberCols (  ) 

Definition at line 456 of file interfToolsPanels.cxx.

References _grid.

00456                                          {
00457         return _grid->GetNumberCols();
00458 }

void interfInformationPanel::onContourGroup ( wxCommandEvent &  event  )  [private]

Definition at line 476 of file interfToolsPanels.cxx.

References _radiolstboxContourGroup, interfMainPanel::getInstance(), and interfMainPanel::SetContourGroup().

Referenced by interfInformationPanel().

00477 {
00478         printf("EED interfInformationPanel::onContourGroup \n");
00479         int contourGroup=_radiolstboxContourGroup->GetSelection();
00480         if (contourGroup==3)
00481         {
00482                 contourGroup=0;
00483         }
00484         interfMainPanel::getInstance()->SetContourGroup( _radiolstboxContourGroup->GetSelection() );
00485 }

Here is the call graph for this function:

Here is the caller graph for this function:

void interfInformationPanel::onExtractInformation ( wxCommandEvent &  event  )  [private]

Definition at line 371 of file interfToolsPanels.cxx.

References _grid, _informationRadiobox, _mbarrangeRangeInformation, _mbarrangeSliceInformation, _radiolstboxContourGroup, interfMainPanel::getInstance(), and interfMainPanel::onInformationContourLabels().

Referenced by interfInformationPanel(), and onSaveResults().

00371                                                                       {
00372         wxBusyCursor wait;
00373         _grid->ClearGrid();
00374 
00375         int typeContourGroup = this->_radiolstboxContourGroup->GetSelection();
00376         int selection        = _informationRadiobox->GetSelection();
00377         int minZ             = _mbarrangeSliceInformation->GetStart();
00378         int maxZ             = _mbarrangeSliceInformation->GetEnd();
00379         int grayRangeMin     = _mbarrangeRangeInformation->GetStart();
00380         int grayRangeMax     = _mbarrangeRangeInformation->GetEnd();
00381 
00382         interfMainPanel::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ, grayRangeMin, grayRangeMax);
00383 }

Here is the call graph for this function:

Here is the caller graph for this function:

void interfInformationPanel::onInformationContourLabels ( wxCommandEvent &  event  )  [private]

Definition at line 354 of file interfToolsPanels.cxx.

References FillGridWithContoursInformation().

Referenced by interfInformationPanel().

00354                                                                             {
00355         wxBusyCursor wait;
00356         FillGridWithContoursInformation();
00357 }

Here is the call graph for this function:

Here is the caller graph for this function:

void interfInformationPanel::onRangeSliceInformation ( wxCommandEvent &  event  )  [private]

Definition at line 345 of file interfToolsPanels.cxx.

References _mbarrangeRangeInformation, interfMainPanel::getInstance(), interfMainPanel::RefreshInterface(), and interfMainPanel::SetScalarRange().

Referenced by interfInformationPanel().

00346 {
00347         int     grayRangeMin    = _mbarrangeRangeInformation->GetStart();
00348         int     grayRangeMax    = _mbarrangeRangeInformation->GetEnd();
00349         interfMainPanel::getInstance()->SetScalarRange(grayRangeMin,grayRangeMax);
00350         interfMainPanel::getInstance()->RefreshInterface();
00351 }

Here is the call graph for this function:

Here is the caller graph for this function:

void interfInformationPanel::onSaveResults ( wxCommandEvent &  event  )  [private]

Definition at line 385 of file interfToolsPanels.cxx.

References _contourImage, _informationRadiobox, _mbarrangeSliceInformation, _radiolstboxContourGroup, _statistics, _XYZValues, interfMainPanel::getInstance(), onExtractInformation(), and interfMainPanel::onSaveResults().

Referenced by interfInformationPanel().

00386 {
00387         wxFileDialog dialog(this, _T("Choose a filename"), _T(""), _T(""), wxFileSelectorDefaultWildcardStr, wxSAVE );
00388         if (dialog.ShowModal() == wxID_OK)
00389         {
00390                 onExtractInformation( event );
00391                 int selection         = _informationRadiobox->GetSelection();
00392                 int minZ              = _mbarrangeSliceInformation->GetStart();
00393                 int maxZ              = _mbarrangeSliceInformation->GetEnd();
00394                 std::string directory = (const char *)(dialog.GetDirectory().mb_str());
00395                 std::string namefile  = (const char *)(dialog.GetFilename().mb_str());
00396                 std::string filename  = (const char *)(dialog.GetPath().mb_str() );
00397                 int typeContourGroup  = _radiolstboxContourGroup->GetSelection();
00398                 interfMainPanel::getInstance()->onSaveResults(directory, namefile, filename,
00399                         typeContourGroup,
00400                         selection,minZ,maxZ,
00401                         _XYZValues->GetValue(), _contourImage->GetValue(), _statistics->GetValue());
00402         }
00403 }

Here is the call graph for this function:

Here is the caller graph for this function:

void interfInformationPanel::onShowResultImages ( wxCommandEvent &  event  )  [private]

Definition at line 360 of file interfToolsPanels.cxx.

References _informationRadiobox, _mbarrangeSliceInformation, _radiolstboxContourGroup, interfMainPanel::getInstance(), and interfMainPanel::ShowResultImages().

Referenced by interfInformationPanel().

00361 {
00362 //      onExtractInformation( event );
00363         int selection        = _informationRadiobox->GetSelection();
00364         int minZ             = _mbarrangeSliceInformation->GetStart();
00365         int maxZ             = _mbarrangeSliceInformation->GetEnd();
00366         int typeContourGroup = _radiolstboxContourGroup->GetSelection();
00367         interfMainPanel::getInstance()->ShowResultImages(typeContourGroup, selection, minZ, maxZ);
00368 }

Here is the call graph for this function:

Here is the caller graph for this function:

void interfInformationPanel::setCellValue ( int  z,
int  tmpIntA,
wxString  tempString 
)

Definition at line 464 of file interfToolsPanels.cxx.

References _grid.

00464                                                                               {
00465         _grid->SetCellValue( z, tmpIntA , tempString );
00466 }

void interfInformationPanel::setColLabel ( int  tmpIntB,
wxString  tmpTitleString 
)

Definition at line 468 of file interfToolsPanels.cxx.

References _grid.

00468                                                                            {
00469         _grid->SetColLabelValue(tmpIntB, tmpTitleString);
00470 }

void interfInformationPanel::setRowLabelInfoPanel ( int  z,
wxString  tempString 
)

Definition at line 452 of file interfToolsPanels.cxx.

References _grid.

00452                                                                           {
00453         _grid->SetRowLabelValue(z, tempString );
00454 }

void interfInformationPanel::setStringInfoPanel ( wxString  tmpString  ) 

Definition at line 448 of file interfToolsPanels.cxx.

References _staticTextInformation.

00448                                                                  {
00449         _staticTextInformation->SetLabel(tmpString);
00450 }


Member Data Documentation

Definition at line 81 of file interfToolsPanels.h.

Referenced by interfInformationPanel(), and onSaveResults().

wxGrid* interfInformationPanel::_grid [private]

Definition at line 79 of file interfToolsPanels.h.

Referenced by interfInformationPanel(), and setStringInfoPanel().

wxCheckBox* interfInformationPanel::_statistics [private]

Definition at line 82 of file interfToolsPanels.h.

Referenced by interfInformationPanel(), and onSaveResults().

wxCheckBox* interfInformationPanel::_XYZValues [private]

Definition at line 80 of file interfToolsPanels.h.

Referenced by interfInformationPanel(), and onSaveResults().


The documentation for this class was generated from the following files:

Generated on Wed Jun 27 23:28:33 2012 for creaContours_lib by  doxygen 1.5.7.1