]> Creatis software - creaMaracasVisu.git/commitdiff
Clean Code
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Sun, 13 Feb 2022 15:46:21 +0000 (12:46 -0300)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Sun, 13 Feb 2022 15:46:21 +0000 (12:46 -0300)
bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx
bbtk/src/bbcreaMaracasVisuManualPaint_Model_paint.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/image3DDequeUR.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageModificationManager.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageUndoRedo.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp

index 2939ed3a35b93dc5af37585bc516759bc6e56a3c..5e63f5aa6349dab5115d76d46ccef315c8466ca6 100644 (file)
@@ -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<int> lstX;
 std::vector<int> lstY;
 std::vector<int> lstZ;
@@ -256,7 +254,6 @@ std::vector<int> 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)
index 690e03ed16864c07bcd09c68b86af43466b0d8ac..c817980fee531f29171926972a45795020f8db07 100644 (file)
@@ -28,7 +28,6 @@ void ManualPaint_Model_paint::Process()
 //    bbSetOutputOut( bbGetInputIn() );
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
   
-    printf("EED ManualPaint_Model_paint::Process Start \n");
     if (bbGetInputActive()==true)
     {
         ManualPaintModel *manualpaintmodel=bbGetInputManualPaintModel();
@@ -39,8 +38,6 @@ void ManualPaint_Model_paint::Process()
             manualpaintmodel->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)
index ab00161f83ef3fb59d4ac2fda4e883e5fffd0cf6..478e8c37e634aa4c3e99b9c7ae53fd99ced17e92 100755 (executable)
@@ -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 );
index 97b76eab0427e33df4b2042611758f8d0523831d..6bbc73fa60aff2e8690b5787f4b6adf5cdf2ad85 100644 (file)
@@ -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");
 }
 
 // ----------------------------------------------------------------------------------
index 0d650a7df91ac84f465cedb3c855ef2d8182f0e2..0752a76db3367ceb0e3a406b20f893ac415ff1ac 100755 (executable)
@@ -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 );
index 700613f061f4723d6305835ecd1ec796fdc21925..62a8cef07812e0c65f0e3614c4609b15f4698cdc 100644 (file)
@@ -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<int> lstX;
        std::vector<int> lstY;