From d6062f597ad2d97f707de48373269b0d389f4dd9 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Sun, 13 Feb 2022 12:46:21 -0300 Subject: [PATCH] Clean Code --- bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx | 8 +------- .../src/bbcreaMaracasVisuManualPaint_Model_paint.cxx | 3 --- .../widgets/imageUndoRedo/image3DDequeUR.cxx | 7 +++---- .../imageUndoRedo/imageModificationManager.cxx | 6 ++---- .../widgets/imageUndoRedo/imageUndoRedo.cxx | 12 ++++++++---- .../wxWindows/widgets/manualPaint/FillFilter.cpp | 4 +--- 6 files changed, 15 insertions(+), 25 deletions(-) diff --git a/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx index 2939ed3..5e63f5a 100644 --- a/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx +++ b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx @@ -146,7 +146,6 @@ void ManualPaint_Model::Process() 4. Verificar el mecanismo de undo con ByImagePoints */ - printf("EED ManualPaint_Model::Process Start \n"); if (bbGetInputActive()==true) { if (bbGetInputImage()!=NULL) @@ -232,7 +231,6 @@ printf("EED ManualPaint_Model::Process list of points (with openmp) size=%d\n" long int index, size=dimX*dimY*dimZ; -printf("EED ManualPaint_Model::Process A.start\n"); std::vector lstX; std::vector lstY; std::vector lstZ; @@ -256,7 +254,6 @@ std::vector lstZ; } // if value2 } // if value1 } // for -printf("EED ManualPaint_Model::Process B.end\n"); size=lstX.size(); long int k1omp=(double)(size-1)*0.0; @@ -381,10 +378,7 @@ omp_set_num_threads( omp_get_max_threads()-1 ); } else { bbSetOutputOut( NULL ); } - bbSetOutputManualpaintmodel( manualpaintmodel ); - - printf("EED ManualPaint_Model::Process End \n"); - + bbSetOutputManualpaintmodel( manualpaintmodel ); } //===== // 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/bbtk/src/bbcreaMaracasVisuManualPaint_Model_paint.cxx b/bbtk/src/bbcreaMaracasVisuManualPaint_Model_paint.cxx index 690e03e..c817980 100644 --- a/bbtk/src/bbcreaMaracasVisuManualPaint_Model_paint.cxx +++ b/bbtk/src/bbcreaMaracasVisuManualPaint_Model_paint.cxx @@ -28,7 +28,6 @@ void ManualPaint_Model_paint::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " <Copy_GeneralAuxFill_to_Results(); } // if Points } // if Active - printf("EED ManualPaint_Model_paint::Process End\n"); - } //===== // 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/imageUndoRedo/image3DDequeUR.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/image3DDequeUR.cxx index ab00161..478e8c3 100755 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/image3DDequeUR.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/image3DDequeUR.cxx @@ -125,7 +125,6 @@ ImageInfoUR* Image3DDequeUR::Redo( ) //virtual void Image3DDequeUR::CleanURContainerFromIndex( const int& index ) { - printf("EED Image3DDequeUR::CleanURContainerFromIndex Start \n"); int count = 0; for( unsigned int i = index; i < this->m_ImgURDeque.size( ); i++ ) { @@ -137,8 +136,6 @@ void Image3DDequeUR::CleanURContainerFromIndex( const int& index ) { this->m_ImgURDeque.pop_back( ); } //rof - printf("EED Image3DDequeUR::CleanURContainerFromIndex End \n"); - } // ---------------------------------------------------------------------------------- @@ -159,7 +156,9 @@ void Image3DDequeUR::ManageMemory( ) { this->m_ImgURDeque[ this->m_CurrentURPos ]->LoadImagesToMemory( this->m_GlobalPath ); } - int currentRedoPos = this->m_CurrentURPos + 1; + + int currentRedoPos = this->m_CurrentURPos + 1; + if( ( currentRedoPos < imgURDequeSize ) && !( this->m_ImgURDeque[ currentRedoPos ]->GetStatus( ) ) ) { this->m_ImgURDeque[ currentRedoPos ]->LoadImagesToMemory( this->m_GlobalPath ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageModificationManager.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageModificationManager.cxx index 97b76ea..6bbc73f 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageModificationManager.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageModificationManager.cxx @@ -72,8 +72,6 @@ void ImageMManager::CleanModifiedRegion() // ---------------------------------------------------------------------------------- void ImageMManager::CalculateMinMaxRegion(const int& i, const int& j, const int& k) { - printf("EED ImageMManager::CalculateMinMaxRegion i j k = %d %d %d\n", i, j, k); - printf("EED ImageMManager::CalculateMinMaxRegion min = %d %d %d\n", this->m_RegionStruct.minX, this->m_RegionStruct.minY, this->m_RegionStruct.minZ); if (i >= 0 && j >= 0 && k >= 0) { if (i <= this->m_RegionStruct.minX) { this->m_RegionStruct.minX = i; } //fi @@ -87,8 +85,8 @@ void ImageMManager::CalculateMinMaxRegion(const int& i, const int& j, const int& this->m_ValidRegion = false; } // if i j k - if (m_ValidRegion ) printf("EED ImageMManager::CalculateMinMaxRegion true \n"); - if (!m_ValidRegion ) printf("EED ImageMManager::CalculateMinMaxRegion false \n"); + //if (m_ValidRegion ) printf("EED ImageMManager::CalculateMinMaxRegion true \n"); + //if (!m_ValidRegion ) printf("EED ImageMManager::CalculateMinMaxRegion false \n"); } // ---------------------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageUndoRedo.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageUndoRedo.cxx index 0d650a7..0752a76 100755 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageUndoRedo.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageUndoRedo.cxx @@ -160,16 +160,20 @@ void ImageUndoRedo::DrawUR( ImageInfoUR* imageInfo, const bool& undo ) m_RestorBaseInitialPointY = imageInfo->GetImageMManager()->GetBaseInitialPointY(); m_RestorBaseInitialPointZ = imageInfo->GetImageMManager()->GetBaseInitialPointZ(); + printf("EED ImageUndoRedo::DrawUR %d - %d %d - %d %d - %d\n", region.minX, region.maxX, region.minY, region.maxY,region.minZ,region.maxZ); + if( img != NULL) { int *dim = img->GetDimensions( ); int sizeXImageIn = dim[ 0 ]; -//EED size_t linesize = sizeXImageIn * sizeof(unsigned short); - +//EED 2022-02-11 +// size_t linesize = sizeXImageIn * sizeof(unsigned short); size_t linesize = sizeXImageIn * img->GetScalarSize(); - for( int j = region.minY, y = 0; j <= region.maxY; j++, y++ ) + int j,k; + int y,z; + for( j = region.minY, y = 0; j <= region.maxY; j++, y++ ) { - for( int k = region.minZ, z = 0; k <= region.maxZ; k++, z++ ) + for( k = region.minZ, z = 0; k <= region.maxZ; k++, z++ ) { void* ptrsrc = img->GetScalarPointer( 0, y, z ); void* ptrdest = this->m_CurrentImage->GetScalarPointer( region.minX, j, k ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp index 700613f..62a8cef 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp @@ -259,9 +259,7 @@ void FillFilter::FillToolLoop(int px, int py, int pz) double tmpiglfill2; bool auxGrayLevelValidationFill; - - - distbasefill = _distancefill * _distancefill; + distbasefill = _distancefill * _distancefill; double difX,difY,difZ,_tmpDistfill; std::vector lstX; std::vector lstY; -- 2.47.1