From 15cfc05c4956ebc0c07dff9d0e5cb34c21432b00 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Thu, 10 Jun 2021 09:31:27 +0200 Subject: [PATCH] #3465 SetwxVtkBaseViewSetOpacityAxis box --- ...acasVisuSetwxVtkBaseViewSetOpacityAxis.cxx | 87 +++++++++++++++++++ ...aracasVisuSetwxVtkBaseViewSetOpacityAxis.h | 49 +++++++++++ .../ColorLayerImageView.cxx | 6 ++ .../wxWindows/widgets/wxVtkMPR2DView.cxx | 32 +++---- 4 files changed, 159 insertions(+), 15 deletions(-) create mode 100644 bbtk/src/bbcreaMaracasVisuSetwxVtkBaseViewSetOpacityAxis.cxx create mode 100644 bbtk/src/bbcreaMaracasVisuSetwxVtkBaseViewSetOpacityAxis.h diff --git a/bbtk/src/bbcreaMaracasVisuSetwxVtkBaseViewSetOpacityAxis.cxx b/bbtk/src/bbcreaMaracasVisuSetwxVtkBaseViewSetOpacityAxis.cxx new file mode 100644 index 0000000..cae0c2f --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuSetwxVtkBaseViewSetOpacityAxis.cxx @@ -0,0 +1,87 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaMaracasVisuSetwxVtkBaseViewSetOpacityAxis.h" +#include "bbcreaMaracasVisuPackage.h" + +#include + +namespace bbcreaMaracasVisu +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,SetwxVtkBaseViewSetOpacityAxis) +BBTK_BLACK_BOX_IMPLEMENTATION(SetwxVtkBaseViewSetOpacityAxis,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void SetwxVtkBaseViewSetOpacityAxis::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <GetVtkBaseData()); + vtkmprbasedata->SetOpacityAxis( bbGetInputOpacity() ); + wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + bbGetInputwxVtkBaseView()->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessEvent( newevent ); +#else + bbGetInputwxVtkBaseView()->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessWindowEvent( newevent ); +#endif + } // bbGetInputwxVtkBaseView +} + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void SetwxVtkBaseViewSetOpacityAxis::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputOpacity( 1 ) ; + bbSetInputwxVtkBaseView( NULL ) ; +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void SetwxVtkBaseViewSetOpacityAxis::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void SetwxVtkBaseViewSetOpacityAxis::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaMaracasVisu + + diff --git a/bbtk/src/bbcreaMaracasVisuSetwxVtkBaseViewSetOpacityAxis.h b/bbtk/src/bbcreaMaracasVisuSetwxVtkBaseViewSetOpacityAxis.h new file mode 100644 index 0000000..57257ca --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuSetwxVtkBaseViewSetOpacityAxis.h @@ -0,0 +1,49 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaMaracasVisuSetwxVtkBaseViewSetOpacityAxis_h_INCLUDED__ +#define __bbcreaMaracasVisuSetwxVtkBaseViewSetOpacityAxis_h_INCLUDED__ + +#include "bbcreaMaracasVisu_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "wxVtkBaseView.h" + +namespace bbcreaMaracasVisu +{ + +class bbcreaMaracasVisu_EXPORT SetwxVtkBaseViewSetOpacityAxis + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(SetwxVtkBaseViewSetOpacityAxis,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(Opacity,double); + BBTK_DECLARE_INPUT(wxVtkBaseView,wxVtkBaseView*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(SetwxVtkBaseViewSetOpacityAxis,bbtk::AtomicBlackBox); + BBTK_NAME("SetwxVtkBaseViewSetOpacityAxis"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(SetwxVtkBaseViewSetOpacityAxis,Opacity,"Axis opacity",double,""); + BBTK_INPUT(SetwxVtkBaseViewSetOpacityAxis,wxVtkBaseView,"wxVtkBaseView",wxVtkBaseView*,""); +// BBTK_OUTPUT(SetPosition,Out,"First output",double,""); +BBTK_END_DESCRIBE_BLACK_BOX(SetwxVtkBaseViewSetOpacityAxis); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaMaracasVisu + +#endif // __bbcreaMaracasVisuSetwxVtkBaseViewSetOpacityAxis_h_INCLUDED__ + diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageView.cxx index 3d848ab..0ac45b6 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageView.cxx @@ -371,6 +371,12 @@ void ColorLayerImageView::ConfigLookupTable() // virtual thresholdTable_range[0]= GetGreyLevelBoundaries(0); thresholdTable->SetTableRange(thresholdTable_range); + + thresholdTable->SetBelowRangeColor(1,1,1,0); // White transparent + thresholdTable->SetAboveRangeColor(1,1,1,0); // White transparent + thresholdTable->UseBelowRangeColorOn(); + thresholdTable->UseAboveRangeColorOn(); + thresholdTable->SetAlphaRange( 0,1 ); thresholdTable->SetValueRange( 0,1 ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx index f253333..bbb02ec 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx @@ -252,9 +252,9 @@ void wxVtkMPR2DView::SetVisibleAxis(bool ok) //------------------------------------------------------------------- void wxVtkMPR2DView::ResetBackXYZ() { - _backX=-9999; - _backY=-9999; - _backZ=-9999; + _backX = -9999; + _backY = -9999; + _backZ = -9999; } @@ -320,10 +320,10 @@ void wxVtkMPR2DView::Refresh() //_ptsA->SetPoint(1, x2, y2 , z ); //_ptsB->SetPoint(0, x2, y , z1); //_ptsB->SetPoint(1, x2, y , z2); - _ptsA->SetPoint(0, xx2, yy1 , z ); - _ptsA->SetPoint(1, xx2, yy2 , z ); - _ptsB->SetPoint(0, xx2, y , zz1); - _ptsB->SetPoint(1, xx2, y , zz2); + _ptsA->SetPoint(0, xx2+1, yy1 , z ); + _ptsA->SetPoint(1, xx2+1, yy2 , z ); + _ptsB->SetPoint(0, xx2+1, y , zz1); + _ptsB->SetPoint(1, xx2+1, y , zz2); position[1] = y; position[2] = z; focalpoint[1] = y; @@ -339,10 +339,10 @@ void wxVtkMPR2DView::Refresh() //_ptsA->SetPoint(1, x2 , y2 , z ); //_ptsB->SetPoint(0, x , y2 , z1); //_ptsB->SetPoint(1, x , y2 , z2); - _ptsA->SetPoint(0, xx1 , y1 , z ); - _ptsA->SetPoint(1, xx2 , y1 , z ); - _ptsB->SetPoint(0, x , y1 , zz1); - _ptsB->SetPoint(1, x , y1 , zz2); + _ptsA->SetPoint(0, xx1 , y1-1 , z ); + _ptsA->SetPoint(1, xx2 , y1-1 , z ); + _ptsB->SetPoint(0, x , y1-1 , zz1); + _ptsB->SetPoint(1, x , y1-1 , zz2); position[0] = x; position[2] = z; focalpoint[0] = x; @@ -364,10 +364,12 @@ void wxVtkMPR2DView::Refresh() //_ptsA->SetPoint(1, x2 , y , z2 ); //_ptsB->SetPoint(0, x , y1, z2 ); //_ptsB->SetPoint(1, x , y2, z2 ); - _ptsA->SetPoint(0, xx1 , y , z1 ); - _ptsA->SetPoint(1, xx2 , y , z1 ); - _ptsB->SetPoint(0, x , yy1, z1 ); - _ptsB->SetPoint(1, x , yy2, z1 ); + + _ptsA->SetPoint(0, xx1 , y , z1-1 ); + _ptsA->SetPoint(1, xx2 , y , z1-1 ); + _ptsB->SetPoint(0, x , yy1, z1-1 ); + _ptsB->SetPoint(1, x , yy2, z1-1 ); + position[0] = x; position[1] = y; focalpoint[0] = x; -- 2.47.1