ThresholdImageViewPanel Class Reference

#include <ThresholdImageViewPanel.h>

Collaboration diagram for ThresholdImageViewPanel:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ThresholdImageViewPanel (wxWindow *parent, int min, int max, int type)
 ~ThresholdImageViewPanel ()
void onThresholdStop ()
void SetThresholdImageView (ThresholdImageView *thresholdImageView)
bool IsVisible ()

Private Member Functions

void onThresholdChange (wxCommandEvent &event)
void onThresholdShow (wxCommandEvent &event)
void onThresholdInterpolation (wxCommandEvent &event)
void onChangeOpacity (wxScrollEvent &event)

Private Attributes

bool _thresholdGo
ThresholdImageView_thresholdImageView
mBarRange_mBarThreshold
wxSlider * _opacity
wxCheckBox * _interpolationCheckBox
wxCheckBox * _cb_ShowHide

Detailed Description

Definition at line 22 of file ThresholdImageViewPanel.h.


Constructor & Destructor Documentation

ThresholdImageViewPanel::ThresholdImageViewPanel ( wxWindow *  parent,
int  min,
int  max,
int  type 
)

Begin of the threshold panel

Definition at line 16 of file ThresholdImageViewPanel.cxx.

References _cb_ShowHide, _interpolationCheckBox, _mBarThreshold, _opacity, _thresholdGo, _thresholdImageView, onThresholdInterpolation(), onThresholdShow(), mBarRange::SetMin(), and mBarRange::SetStart().

00017 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
00018 {
00019         _thresholdImageView = new ThresholdImageView();
00020 
00021 //      wxButton *thresholdGoBtn = new wxButton(this,wxID_ANY,_T("Show/Hide Color"), wxDefaultPosition, wxSize(200,30) );
00022         
00023         _thresholdGo = true;
00024         _cb_ShowHide = new wxCheckBox(this, wxID_ANY, _T("Show/Hide layer") );
00025         _cb_ShowHide->SetValue(_thresholdGo);
00026         
00027         _interpolationCheckBox = new wxCheckBox(this, -1, _T("Image interpolation") );
00028         _interpolationCheckBox->SetValue(true); 
00029         _opacity = new wxSlider(this, wxID_ANY, 6, 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
00030         
00031 //      double range[2];
00032 //      interfMainPanel::getInstance()->getImageRange(range);
00033         
00034 //      int min = (int)floor (range[0]);
00035 //      int max = (int)ceil (range[1]);
00036 
00037         if (type==0)
00038         {
00039         }
00040         
00041         if (type==1)
00042         {
00043                 _mBarThreshold  =  new mBarRange(this,70,65);
00044                 _mBarThreshold->SetMin(0);
00045                 _mBarThreshold->SetStart(0);
00046                 _mBarThreshold-> SetOrientation( true );
00047                 _mBarThreshold-> setActiveStateTo(true);
00048                 _mBarThreshold-> setVisibleLabels( true );
00049                 _mBarThreshold-> setDeviceEndMargin(10);
00050                 _mBarThreshold-> setRepresentedValues( min , max );
00051                 _mBarThreshold-> setDeviceBlitStart(10,10); 
00052                 _mBarThreshold-> setIfWithActualDrawed( false );
00053                 _mBarThreshold-> SetStart( min );
00054                 _mBarThreshold-> SetEnd( max );  
00055         }
00056         
00057         
00058         Connect( _cb_ShowHide->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &ThresholdImageViewPanel::onThresholdShow ); 
00059         Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &ThresholdImageViewPanel::onThresholdInterpolation );
00060         
00061         wxFlexGridSizer * sizer         = new wxFlexGridSizer(1);
00062         if (type==1)
00063         {
00064                 sizer -> Add( new wxStaticText(this,-1,_T("Image Threshold"))  , 1, wxGROW );
00065                 sizer -> Add( _mBarThreshold, 1, wxGROW );
00066                 sizer -> Add( new wxStaticText(this,-1,_T(" "))  , 1, wxGROW );
00067         }
00068         sizer -> Add( new wxStaticText(this,-1,_T("Opacity Level"))  , 1, wxGROW );
00069         sizer -> Add( _opacity, 1, wxGROW );
00070         sizer -> Add( new wxStaticText(this,-1,_T(" "))  , 1, wxGROW );
00071         sizer -> Add( _cb_ShowHide, 1, wxGROW );
00072         sizer -> Add( new wxStaticText(this,-1,_T(" "))  , 1, wxGROW );
00073         sizer -> Add( _interpolationCheckBox, 1, wxGROW );
00074         
00075         this->SetSizer( sizer );
00076         this->SetAutoLayout( true );
00077         this->Layout();
00078 }

Here is the call graph for this function:

ThresholdImageViewPanel::~ThresholdImageViewPanel (  ) 

Definition at line 81 of file ThresholdImageViewPanel.cxx.

00082 {
00083 }


Member Function Documentation

bool ThresholdImageViewPanel::IsVisible (  ) 

Definition at line 148 of file ThresholdImageViewPanel.cxx.

References _thresholdGo.

00149 {
00150         return _thresholdGo;
00151 }

void ThresholdImageViewPanel::onChangeOpacity ( wxScrollEvent &  event  )  [private]

Definition at line 139 of file ThresholdImageViewPanel.cxx.

References _opacity, _thresholdImageView, ThresholdImageView::GetwxVtkBaseView(), ThresholdImageView::onThresholdChangeOpacity(), and wxVtkBaseView::Refresh().

00140 {
00141         int opacity = _opacity->GetValue();
00142         _thresholdImageView->onThresholdChangeOpacity(opacity);
00143         _thresholdImageView->GetwxVtkBaseView()->Refresh();
00144 }

Here is the call graph for this function:

void ThresholdImageViewPanel::onThresholdChange ( wxCommandEvent &  event  )  [private]

Definition at line 94 of file ThresholdImageViewPanel.cxx.

References _mBarThreshold, _thresholdGo, _thresholdImageView, mBarRange::GetEnd(), mBarRange::GetStart(), ThresholdImageView::GetwxVtkBaseView(), ThresholdImageView::onThresholdChange(), wxVtkBaseView::Refresh(), and ThresholdImageView::SetminMaxValue().

00095 {
00096         if (_thresholdGo)
00097         {
00098                 _thresholdImageView->SetminMaxValue( _mBarThreshold->GetStart(), _mBarThreshold->GetEnd() );
00099                 _thresholdImageView->onThresholdChange();
00100                 _thresholdImageView->GetwxVtkBaseView()->Refresh();
00101                 //std::cout<< "Valor Min: " << minVal << " & Valor Max: " << maxVal  << std::endl;
00102         }
00103 }

Here is the call graph for this function:

void ThresholdImageViewPanel::onThresholdInterpolation ( wxCommandEvent &  event  )  [private]

Definition at line 131 of file ThresholdImageViewPanel.cxx.

References _interpolationCheckBox, _thresholdImageView, ThresholdImageView::GetwxVtkBaseView(), ThresholdImageView::onThresholdInterpolation(), and wxVtkBaseView::Refresh().

Referenced by ThresholdImageViewPanel().

Here is the call graph for this function:

Here is the caller graph for this function:

void ThresholdImageViewPanel::onThresholdShow ( wxCommandEvent &  event  )  [private]

Definition at line 106 of file ThresholdImageViewPanel.cxx.

References _cb_ShowHide, _thresholdGo, _thresholdImageView, ThresholdImageView::GetwxVtkBaseView(), ThresholdImageView::onThreshold(), ThresholdImageView::onThresholdRemove(), and wxVtkBaseView::Refresh().

Referenced by ThresholdImageViewPanel().

00107 {
00108         _thresholdGo = _cb_ShowHide->GetValue();
00109         if (_thresholdGo)
00110         {
00111                 _thresholdImageView->onThreshold();
00112         }
00113         else
00114         {       
00115                 _thresholdImageView->onThresholdRemove( );
00116         }
00117         _thresholdImageView->GetwxVtkBaseView()->Refresh();
00118 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ThresholdImageViewPanel::onThresholdStop (  ) 

Definition at line 121 of file ThresholdImageViewPanel.cxx.

References _thresholdGo, _thresholdImageView, and ThresholdImageView::onThresholdRemove().

00122 {
00123         if (_thresholdGo)
00124         {       
00125                 _thresholdImageView->onThresholdRemove( );
00126                 _thresholdGo=false;             
00127         }
00128 }

Here is the call graph for this function:

void ThresholdImageViewPanel::SetThresholdImageView ( ThresholdImageView thresholdImageView  ) 

Definition at line 87 of file ThresholdImageViewPanel.cxx.

References _thresholdImageView.

00088 {
00089         _thresholdImageView = thresholdImageView;
00090 }


Member Data Documentation

Definition at line 39 of file ThresholdImageViewPanel.h.

Referenced by onThresholdShow(), and ThresholdImageViewPanel().

Definition at line 38 of file ThresholdImageViewPanel.h.

Referenced by onThresholdInterpolation(), and ThresholdImageViewPanel().

Definition at line 36 of file ThresholdImageViewPanel.h.

Referenced by onThresholdChange(), and ThresholdImageViewPanel().

wxSlider* ThresholdImageViewPanel::_opacity [private]

Definition at line 37 of file ThresholdImageViewPanel.h.

Referenced by onChangeOpacity(), and ThresholdImageViewPanel().


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

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1