X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FThresholdImageView%2FColorLayerImageViewPanel.cxx;h=b7495217b91066e559d7bcac9c55366a34e42091;hb=e2f602be451f1017507d34aa338632800590f10a;hp=ff0f0531493e72e61115a0f300fa40ccce1cb7d0;hpb=cef231b63d21ad7ac9914306a0a012666c24f00a;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx index ff0f053..b749521 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx @@ -122,7 +122,7 @@ printf("EED wxDlgTransformByDimensionBySpacingByPixel::GetTransformType BBB %d\n /** ** Begin of the threshold panel **/ -ColorLayerImageViewPanel::ColorLayerImageViewPanel(wxWindow* parent, int min, int max, int type) +ColorLayerImageViewPanel::ColorLayerImageViewPanel(wxWindow* parent, int min, int max,int opacity, int type) //: wxPanel(parent, -1, wxDefaultPosition, wxSize(600,100), wxBORDER_SUNKEN) : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL) @@ -163,7 +163,7 @@ ColorLayerImageViewPanel::ColorLayerImageViewPanel(wxWindow* parent, int min, in _sl_SliceImageZ->Enable(false); _interpolationCheckBox = new wxCheckBox(this, -1, _T("Interpole") ); _interpolationCheckBox->SetValue(true); - _opacity = new wxSlider(this, wxID_ANY, 1, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator); + _opacity = new wxSlider(this, wxID_ANY, opacity, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator); // _histogram = new Histogram( this , -1, wxPoint(0,0), wxSize(400,400), /*wxNO_BORDER*/ wxBORDER_DEFAULT ); // _histogramMinMaxLevel = new HistogramMinMaxLevel( (HistogramBase*)_histogram ); @@ -218,7 +218,7 @@ ColorLayerImageViewPanel::ColorLayerImageViewPanel(wxWindow* parent, int min, in sizer = new wxFlexGridSizer(2); _interpolationCheckBox = new wxCheckBox(this, -1, _T("Interpolate") ); _interpolationCheckBox->SetValue(true); - _opacity = new wxSlider(this, wxID_ANY, 1, 0, 100, wxDefaultPosition, wxSize(2,40), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator); + _opacity = new wxSlider(this, wxID_ANY, opacity, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator); Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &ColorLayerImageViewPanel::onThresholdInterpolation ); Connect( _opacity->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &ColorLayerImageViewPanel::onChangeOpacity ); @@ -462,13 +462,22 @@ void ColorLayerImageViewPanel::onSliceImage(wxScrollEvent& event) } //---------------------------------------------------------------------------- -void ColorLayerImageViewPanel::onChangeOpacity(wxScrollEvent& event) +void ColorLayerImageViewPanel::ChangeOpacity() { int opacity = _opacity->GetValue(); _colorLayerImageViewManager->onThresholdChangeOpacity(opacity); RefreshView(); } +//---------------------------------------------------------------------------- +void ColorLayerImageViewPanel::onChangeOpacity(wxScrollEvent& event) +{ + ChangeOpacity(); +// int opacity = _opacity->GetValue(); +// _colorLayerImageViewManager->onThresholdChangeOpacity(opacity); +// RefreshView(); +} + //---------------------------------------------------------------------------- bool ColorLayerImageViewPanel::IsVisible()