From ac1d8305b8e48f18d939c5abb7e282fd24fc9c6a Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Mon, 8 Jul 2019 09:49:41 +0200 Subject: [PATCH] #3252 creaMaracasVisu Bug New Normal - manual paint filter fill bug setimages --- .../bbcreaMaracasVisuManualPaint_Model.cxx | 35 ++++--------------- .../widgets/manualPaint/FillFilter.cpp | 17 ++++----- .../widgets/manualPaint/ManualPaintModel.cpp | 3 +- .../wxWindows/widgets/wxVtkMPR3DView.cxx | 13 ++++--- 4 files changed, 24 insertions(+), 44 deletions(-) diff --git a/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx index e97b390..856a509 100644 --- a/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx +++ b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx @@ -34,10 +34,8 @@ void ManualPaint_Model::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " <SetActive( bbGetInputActive() ); manualpaintmodel->SetTool( bbGetInputTool() ); manualpaintmodel->Set2D3D( bbGetInput2D3D() ); @@ -50,14 +48,10 @@ void ManualPaint_Model::Process() manualpaintmodel->SetDistanceFill( bbGetInputDistanceFill() ); manualpaintmodel->SetRangeMin( bbGetInputRange()[0] ); manualpaintmodel->SetRangeMax( bbGetInputRange()[1] ); - if (bbGetInputPoint().size()==3) { manualpaintmodel->PaintImage( bbGetInputPoint()[0] , bbGetInputPoint()[1] , bbGetInputPoint()[2] ); } // if Points - - - if ( bbGetInputByLstPointsX().size()!=0 ) { int i,size = bbGetInputByLstPointsX().size(); @@ -66,8 +60,7 @@ void ManualPaint_Model::Process() manualpaintmodel->PaintImage( bbGetInputByLstPointsX()[i] , bbGetInputByLstPointsY()[i] , bbGetInputByLstPointsZ()[i] ); } // for }// if ByLstPointsX - - if (bbGetInputByImagePoints()!=NULL) + if ((bbGetInputByImagePoints()!=NULL) && (bbGetInputImage2()!=NULL) ) { // int ia,ja,ka; // int ii,jj,kk; @@ -78,16 +71,12 @@ void ManualPaint_Model::Process() #else bbGetInputByImagePoints()->GetExtent(ext); #endif - int dimX=ext[1]-ext[0]+1; int dimY=ext[3]-ext[2]+1; int dimZ=ext[5]-ext[4]+1; - DEF_POINTER_IMAGE_VTK_CREA(vBIP,sSBIP,pBIP,sTBIP,bbGetInputByImagePoints()); DEF_POINTER_IMAGE_VTK_CREA(vI2,sSI2,pI2,sTI2,bbGetInputImage2()); - //#pragma omp parallel for - int i,j,k; for (k=0;k point; point.push_back(0); point.push_back(0); point.push_back(0); bbSetInputPoint(point); - std::vector range; range.push_back(0); range.push_back(200); bbSetInputRange(range); - bbSetInputByImagePoints(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) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp index 1e2c470..fa5510b 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp @@ -48,11 +48,8 @@ FillFilter::~FillFilter() //--------------------------------------------------------------------------- void FillFilter::SetImages(vtkImageData *image,vtkImageData *image2) // virtual -{ - - - baseFilterManualPaint::SetImages(image,image2); - +{ + baseFilterManualPaint::SetImages(image,image2); if ((_maxX!=_maxXback) || (_maxY!=_maxYback) || (_maxZ!=_maxZback)) { if (_auxImageFill != NULL) @@ -99,20 +96,20 @@ void FillFilter::Run() // virtual ivi = _px + _py*(_maxX+1) + _pz*(_maxX+1)*(_maxY+1); // index vector image - DEF_POINTER_IMAGE_VTK_CREA_set(v_image,ss_image,p_image,st_image,_image) -DEF_POINTER_IMAGE_VTK_CREA_set(v_image2,ss_image2,p_image2,st_image2,_image2) - - +if (_image2!=NULL) +{ + DEF_POINTER_IMAGE_VTK_CREA_set(v_image2,ss_image2,p_image2,st_image2,_image2) +} //EED01 // FillToolRecursive(_px, _py, _pz); FillToolRecursive(_px, _py, _pz, ivi); - unsigned char *pImage; pImage = (unsigned char *) _auxImageFill->GetScalarPointer(); int ii, jj, kk; ivi = 0; + while (_countRecursiveFillProblem != 0) { _countRecursiveFillProblem = 0; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp index fd71dd6..feae5d5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp @@ -25,7 +25,8 @@ #include "ManualPaintModel.h" -ManualPaintModel::ManualPaintModel() { +ManualPaintModel::ManualPaintModel() +{ _active = true; _tool = 0; // 0 pencil , 1 fill _brushfilter = new BrushFilter(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx index 3703011..2377256 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx @@ -142,14 +142,17 @@ wxVtkMPR3DView::wxVtkMPR3DView( wxVtk3DBaseView *wxvtk3Dbaseview ) wxVtkMPR3DView::~wxVtkMPR3DView() { VisiblePointWidget( false ); - VisiblePlaneWidget( false ); - if(_pointWidget!=NULL){ +// VisiblePlaneWidget( false ); + if(_pointWidget!=NULL) + { _pointWidget->Delete(); } - if(_planeWidget!=NULL){ + if(_planeWidget!=NULL) + { _planeWidget->Delete(); } - if(_vtkplane!=NULL){ + if(_vtkplane!=NULL) + { _vtkplane->Delete(); _probe->Delete(); _contourMapper->Delete(); @@ -458,7 +461,7 @@ void wxVtkMPR3DView::FreePlaneInteraction(bool ok) _planeWidgetY->InteractionOff(); _planeWidgetZ->InteractionOff(); } - } // if _planeWidgetX + } // if _planeWidgetXVisiblePointWidget } -- 2.47.1