creaContours_lib
interfInformationPanel Class Reference

#include <interfToolsPanels.h>

Inheritance diagram for interfInformationPanel:
Collaboration diagram for interfInformationPanel:

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 83 of file interfToolsPanels.h.

Constructor & Destructor Documentation

interfInformationPanel::interfInformationPanel ( wxWindow *  parent)

Begin of information panel

Definition at line 215 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().

216 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
217 {
218  //wxPanel *panel = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxTAB_TRAVERSAL);
219  wxString lstOptions[4];
220  lstOptions[0]=_T("Current Slice");
221  lstOptions[1]=_T("Range Slices");
222 // lstOptions[2]=_T("All Slices");
223  _informationRadiobox = new wxRadioBox(this, -1, _T("Slice analysis"), wxDefaultPosition, wxSize(270,45), 2 , lstOptions, 2, wxRA_SPECIFY_COLS);
224 
225 
226  wxString lstOptContOperation[5];
227  lstOptContOperation[0]=_T("AND");
228  lstOptContOperation[1]=_T("OR");
229  lstOptContOperation[2]=_T("XOR");
230  lstOptContOperation[3]=_T("ALL");
231  _radiolstboxContourGroup = new wxRadioBox(this, -1, _T("Contour group"), wxDefaultPosition, wxSize(270,45), 4 , lstOptContOperation, 4, wxRA_SPECIFY_COLS);
232  _radiolstboxContourGroup->SetSelection(1);
233  Connect( _radiolstboxContourGroup->GetId(), wxEVT_COMMAND_RADIOBOX_SELECTED , (wxObjectEventFunction) &interfInformationPanel::onContourGroup );
234 
235 
236  _XYZValues = new wxCheckBox(this, -1, _T("Save Contour Values") );
237  _XYZValues->SetValue(true);
238 
239  _contourImage = new wxCheckBox(this, -1, _T("Extract Contours as Images") );
240  _contourImage->SetValue(true);
241 
242  _statistics = new wxCheckBox(this, -1, _T("Save Statistics") );
243  _statistics->SetValue(true);
244 
245  wxButton *informationContourLabelsBtn = new wxButton(this,-1,_T("Contour labels"),wxDefaultPosition, wxSize(140,35) );
246  informationContourLabelsBtn->SetEventHandler( this );
247  Connect( informationContourLabelsBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onInformationContourLabels );
248 
249  wxButton *statisticsContourBtn = new wxButton(this,-1,_T("Contour statistics"),wxDefaultPosition, wxSize(140,35) );
250  statisticsContourBtn->SetEventHandler( this );
251  Connect( statisticsContourBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onExtractInformation );
252 
253  wxButton *showResultImagesBtn = new wxButton(this,-1,_T("Show result images"),wxDefaultPosition, wxSize(140,35) );
254  showResultImagesBtn->SetEventHandler( this );
255  Connect( showResultImagesBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onShowResultImages );
256 
257 
258  wxButton *saveResultsBtn = new wxButton(this,-1,_T("Save Results"),wxDefaultPosition, wxSize(140,35) );
259  saveResultsBtn->SetEventHandler( this );
260  Connect( saveResultsBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onSaveResults );
261 
262 
264  //_theViewPanel->getSceneManager()->GetImageDataSizeZ();
265  _mbarrangeSliceInformation = new mBarRange(this,65,65);
266  _mbarrangeSliceInformation->SetMin(0);
267  _mbarrangeSliceInformation->SetStart(0);
268  _mbarrangeSliceInformation-> SetOrientation( true );
269  _mbarrangeSliceInformation-> setActiveStateTo(true);
270  _mbarrangeSliceInformation-> setVisibleLabels( true );
271  _mbarrangeSliceInformation-> setDeviceEndMargin(10);
272  _mbarrangeSliceInformation-> setRepresentedValues( 0 , sizeZ-1 );
273  _mbarrangeSliceInformation-> setDeviceBlitStart(10,10);
274  _mbarrangeSliceInformation-> setIfWithActualDrawed( false );
275  _mbarrangeSliceInformation-> SetStart( 0 );
276  _mbarrangeSliceInformation-> SetEnd( sizeZ-1 );
277 
278 
279 
280  double range[2];
282 
283  int min = (int)floor (range[0]);
284  int max = (int)ceil (range[1]);
285 
286  _mbarrangeRangeInformation = new mBarRange(this,65,65);
287  _mbarrangeRangeInformation->SetMin(0);
288  _mbarrangeRangeInformation->SetStart(0);
289  _mbarrangeRangeInformation->SetOrientation( true );
290  _mbarrangeRangeInformation->setActiveStateTo(true);
291  _mbarrangeRangeInformation->setVisibleLabels( true );
292  _mbarrangeRangeInformation->setDeviceEndMargin(10);
293  _mbarrangeRangeInformation->setRepresentedValues( min , max );
294  _mbarrangeRangeInformation->setDeviceBlitStart(10,10);
295  _mbarrangeRangeInformation->setIfWithActualDrawed( false );
296  _mbarrangeRangeInformation->SetStart( min );
297  _mbarrangeRangeInformation->SetEnd( max );
298 
299 // _mbarrangeSliceInformation->PushEventHandler(this);
300 // Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
301 // Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
302  Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_START,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
303  Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
304 // Connect(_mbarrangeRangeInformation->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
305  Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
306 
307 
308  _staticTextInformation = new wxStaticText(this,-1,_T(" "));
309 
310  _grid = new wxGrid( this,
311  wxID_ANY,
312  wxPoint( 0, 0 ),
313  wxSize( 200, 500 ) );
314 
315  int i,gridCol=10,gridRow=sizeZ+2;
316  _grid->CreateGrid( 0, 0 );
317  _grid->AppendRows(gridRow);
318  _grid->AppendCols(gridCol);
319 
320  for (i=0;i<gridRow;i++)
321  {
322  _grid->SetRowLabelValue(i, _T(" ") );
323  }
324 // _grid->SetColLabelSize(0);
325 
326 
328 
329  wxFlexGridSizer * sizerSave = new wxFlexGridSizer(2,2);
330  sizerSave -> Add( new wxStaticText(this,-1,_T("Save Options: ")) , 1, wxGROW );
331  sizerSave->Add( _XYZValues, 1, wxALL, 2 );
332  sizerSave->Add( _statistics, 1, wxALL, 2 );
333  sizerSave->Add( _contourImage, 1, wxALL, 2 );
334 
335  wxFlexGridSizer * sizerA = new wxFlexGridSizer(10);
336  sizerA->Add( _informationRadiobox, 1, wxALL, 2 );
337  sizerA->Add( _radiolstboxContourGroup, 1, wxALL, 2 );
338  sizerA->Add( sizerSave, 1, wxALL, 2 );
339 
340 
341  wxFlexGridSizer * sizerB = new wxFlexGridSizer(10);
342  sizerB->Add( informationContourLabelsBtn, 1, wxALL, 2 );
343  sizerB->Add( statisticsContourBtn, 1, wxALL, 2 );
344  sizerB->Add( showResultImagesBtn, 1, wxALL, 2 );
345  sizerB->Add( saveResultsBtn, 1, wxALL, 2 );
346 
347  wxFlexGridSizer * sizer = new wxFlexGridSizer(1,8);
348  sizer->Add( sizerA , 1, wxALL , 0 );
349  sizer->Add( new wxStaticText(this ,-1,_T("Slice Range")) , 1, wxALL , 0 );
350  sizer->Add( _mbarrangeSliceInformation , 1, wxALL|wxGROW , 2 );
351  sizer->Add( new wxStaticText(this ,-1,_T("Gray Range")) , 1, wxALL , 0 );
352  sizer->Add( _mbarrangeRangeInformation , 1, wxALL|wxGROW , 2 );
353  sizer->Add( sizerB , 1, wxEXPAND , 0 );
354  sizer->Add( _staticTextInformation , 1, wxEXPAND , 0 );
355  sizer->Add( _grid , 1, wxEXPAND , 0 );
356 
357  this->SetSizer( sizer );
358  this->SetSize( wxSize(1500,1500) );
359  //this->SetBackgroundColour( wxColour(100,100,100) );
360  this->SetAutoLayout( true );
361  this->Layout();
362  //return panel;
363 }

Here is the call graph for this function:

interfInformationPanel::~interfInformationPanel ( )

Definition at line 365 of file interfToolsPanels.cxx.

366 {
367 }

Member Function Documentation

void interfInformationPanel::appendCols ( int  numcols)

Definition at line 485 of file interfToolsPanels.cxx.

References _grid.

485  {
486  _grid->AppendCols(numcols);
487 }
void interfInformationPanel::FillGridWithContoursInformation ( )
private

Definition at line 430 of file interfToolsPanels.cxx.

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

Referenced by interfInformationPanel(), and onInformationContourLabels().

430  {
431 
432  wxString tempString;
433  _grid->ClearGrid();
434  _grid->SetColLabelValue(0, _T("A") );
435  _grid->SetColLabelValue(1, _T("B") );
436  _grid->SetColLabelValue(2, _T("C") );
437  _grid->SetColLabelValue(3, _T("D") );
438  _grid->SetColLabelValue(4, _T("E") );
439  _grid->SetColLabelValue(5, _T("F") );
440  //_instantPanel->getInstant( tempVector );
441 
442  int z,sizeZ = interfMainPanel::getInstance()->GetImageDataSizeZ();//->getSceneManager()->GetImageDataSizeZ();
443  int ii,sizeLstContourThings;
444  for ( z=0 ; z<sizeZ ; z++)
445  {
446 
447  std::vector<std::string> lstContourThings = interfMainPanel::getInstance()->getOutlinesName(z);
448 
449  //this->_modelManager->getOutlinesAtInstant( &instant );
450 
451  sizeLstContourThings = lstContourThings.size();
452  tempString.Printf(_T("%d - %d"),z, sizeLstContourThings);
453  _grid->SetRowLabelValue(z, tempString );
454 
455  for (ii=0 ; ii<sizeLstContourThings ; ii++)
456  {
457  //ContourThing **contourthing = lstContourThings[ii];
458  //tempString = wxString((*contourthing)->getName().c_str(),wxConvUTF8) ;
459  tempString = wxString(lstContourThings[ii].c_str(),wxConvUTF8) ;
460  _grid->SetCellValue( z, ii, tempString );
461  } // for ii
462  }// for z
463 
464  // Last line
465  _grid->SetRowLabelValue(sizeZ, _T(" ") );
466  for (ii=0 ; ii<sizeLstContourThings ; ii++)
467  {
468  _grid->SetCellValue( sizeZ, ii, _T(" ") );
469  } // for ii
470 
471 }

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 497 of file interfToolsPanels.cxx.

References _grid.

497  {
498  return _grid->GetCellValue( j , i );
499 }
int interfInformationPanel::getNumberCols ( )

Definition at line 481 of file interfToolsPanels.cxx.

References _grid.

481  {
482  return _grid->GetNumberCols();
483 }
void interfInformationPanel::onContourGroup ( wxCommandEvent &  event)
private

Definition at line 501 of file interfToolsPanels.cxx.

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

Referenced by interfInformationPanel().

502 {
503  printf("EED interfInformationPanel::onContourGroup \n");
504  int contourGroup=_radiolstboxContourGroup->GetSelection();
505  if (contourGroup==3)
506  {
507  contourGroup=0;
508  }
510 }

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 396 of file interfToolsPanels.cxx.

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

Referenced by interfInformationPanel(), and onSaveResults().

396  {
397  wxBusyCursor wait;
398  _grid->ClearGrid();
399 
400  int typeContourGroup = this->_radiolstboxContourGroup->GetSelection();
401  int selection = _informationRadiobox->GetSelection();
402  int minZ = _mbarrangeSliceInformation->GetStart();
403  int maxZ = _mbarrangeSliceInformation->GetEnd();
404  int grayRangeMin = _mbarrangeRangeInformation->GetStart();
405  int grayRangeMax = _mbarrangeRangeInformation->GetEnd();
406 
407  interfMainPanel::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ, grayRangeMin, grayRangeMax);
408 }

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 379 of file interfToolsPanels.cxx.

References FillGridWithContoursInformation().

Referenced by interfInformationPanel().

379  {
380  wxBusyCursor wait;
382 }

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 370 of file interfToolsPanels.cxx.

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

Referenced by interfInformationPanel().

371 {
372  int grayRangeMin = _mbarrangeRangeInformation->GetStart();
373  int grayRangeMax = _mbarrangeRangeInformation->GetEnd();
374  interfMainPanel::getInstance()->SetScalarRange(grayRangeMin,grayRangeMax);
376 }

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 410 of file interfToolsPanels.cxx.

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

Referenced by interfInformationPanel().

411 {
412  wxFileDialog dialog(this, _T("Choose a filename"), _T(""), _T(""), wxFileSelectorDefaultWildcardStr, wxSAVE );
413  if (dialog.ShowModal() == wxID_OK)
414  {
415  onExtractInformation( event );
416  int selection = _informationRadiobox->GetSelection();
417  int minZ = _mbarrangeSliceInformation->GetStart();
418  int maxZ = _mbarrangeSliceInformation->GetEnd();
419  std::string directory = (const char *)(dialog.GetDirectory().mb_str());
420  std::string namefile = (const char *)(dialog.GetFilename().mb_str());
421  std::string filename = (const char *)(dialog.GetPath().mb_str() );
422  int typeContourGroup = _radiolstboxContourGroup->GetSelection();
423  interfMainPanel::getInstance()->onSaveResults(directory, namefile, filename,
424  typeContourGroup,
425  selection,minZ,maxZ,
426  _XYZValues->GetValue(), _contourImage->GetValue(), _statistics->GetValue());
427  }
428 }

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 385 of file interfToolsPanels.cxx.

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

Referenced by interfInformationPanel().

386 {
387 // onExtractInformation( event );
388  int selection = _informationRadiobox->GetSelection();
389  int minZ = _mbarrangeSliceInformation->GetStart();
390  int maxZ = _mbarrangeSliceInformation->GetEnd();
391  int typeContourGroup = _radiolstboxContourGroup->GetSelection();
392  interfMainPanel::getInstance()->ShowResultImages(typeContourGroup, selection, minZ, maxZ);
393 }

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 489 of file interfToolsPanels.cxx.

References _grid.

489  {
490  _grid->SetCellValue( z, tmpIntA , tempString );
491 }
void interfInformationPanel::setColLabel ( int  tmpIntB,
wxString  tmpTitleString 
)

Definition at line 493 of file interfToolsPanels.cxx.

References _grid.

493  {
494  _grid->SetColLabelValue(tmpIntB, tmpTitleString);
495 }
void interfInformationPanel::setRowLabelInfoPanel ( int  z,
wxString  tempString 
)

Definition at line 477 of file interfToolsPanels.cxx.

References _grid.

477  {
478  _grid->SetRowLabelValue(z, tempString );
479 }
void interfInformationPanel::setStringInfoPanel ( wxString  tmpString)

Definition at line 473 of file interfToolsPanels.cxx.

References _staticTextInformation.

473  {
474  _staticTextInformation->SetLabel(tmpString);
475 }

Member Data Documentation

wxCheckBox* interfInformationPanel::_contourImage
private

Definition at line 106 of file interfToolsPanels.h.

Referenced by interfInformationPanel(), and onSaveResults().

wxRadioBox* interfInformationPanel::_informationRadiobox
private
mBarRange* interfInformationPanel::_mbarrangeRangeInformation
private
mBarRange* interfInformationPanel::_mbarrangeSliceInformation
private
wxRadioBox* interfInformationPanel::_radiolstboxContourGroup
private
wxStaticText* interfInformationPanel::_staticTextInformation
private

Definition at line 104 of file interfToolsPanels.h.

Referenced by interfInformationPanel(), and setStringInfoPanel().

wxCheckBox* interfInformationPanel::_statistics
private

Definition at line 107 of file interfToolsPanels.h.

Referenced by interfInformationPanel(), and onSaveResults().

wxCheckBox* interfInformationPanel::_XYZValues
private

Definition at line 105 of file interfToolsPanels.h.

Referenced by interfInformationPanel(), and onSaveResults().


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