]> Creatis software - creaMaracasVisu.git/commitdiff
Clean code
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Fri, 20 Dec 2024 13:21:46 +0000 (14:21 +0100)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Fri, 20 Dec 2024 13:21:46 +0000 (14:21 +0100)
bbtk/src/bbcreaMaracasVisuSetPosition.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx

index 29261b6c8bd1bfa0b31639f3c25f2e09be1e1bd8..2bf174a72df2e8c5f766076a12751923782833a3 100644 (file)
@@ -38,6 +38,9 @@ auto start1 = std::chrono::high_resolution_clock::now();
                                vtkmprbasedata->SetX( bbGetInputPoint()[0] );
                                vtkmprbasedata->SetY( bbGetInputPoint()[1] );
                                vtkmprbasedata->SetZ( bbGetInputPoint()[2] );
+auto stop1       = std::chrono::high_resolution_clock::now();
+auto duration1   = std::chrono::duration_cast<std::chrono::microseconds>(stop1 - start1);
+printf("EED SetPosition::Process time= %ld  \n", duration1.count() , this->bbGetFullName().c_str() );
                 bool tmpFixAxis = vtkmprbasedata->GetFixAxis2D(  );
                                vtkmprbasedata->SetFixAxis2D( bbGetInputFixAxis2D() );
                 int codeEvent;
@@ -50,9 +53,6 @@ auto start1 = std::chrono::high_resolution_clock::now();
                     codeEvent = 22222;    // Refresh without box reactivity
                 }
                 wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,codeEvent);
-auto stop1       = std::chrono::high_resolution_clock::now();
-auto duration1   = std::chrono::duration_cast<std::chrono::microseconds>(stop1 - start1);
-printf("EED SetPosition::Process time= %ld  \n", duration1.count() , this->bbGetFullName().c_str() );
        //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
        #if wxMAJOR_VERSION <= 2
                                bbGetInputwxVtkBaseView()->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessEvent( newevent );
index b911468f6ccf4958960e15f314dc47a64741400d..7fb65bf5ffb83ee2b1139238457129905e4e8221 100644 (file)
@@ -72,7 +72,6 @@ marImageData* vtkBaseData::GetMarImageData()
 }
 
 //-------------------------------------------------------------------
-
 void vtkBaseData::Configure()  // virtual
 {
        vtkImageData* imageData = _marImageData->GetImageData();
@@ -92,7 +91,6 @@ void vtkBaseData::Configure()  // virtual
                        //_imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel( 500 );
                        SetColorWindow( 1000 );
                        SetColorLevel( 500 );
-
                } // range
        }       // img
 }
@@ -100,22 +98,16 @@ void vtkBaseData::Configure()  // virtual
 //-------------------------------------------------------------------
 void vtkBaseData::SetZ(double z)
 {
-
        //int maxZ;
-
 //     int dim[3];
 //     _marImageData->GetDimensions(dim);
 //     maxZ=dim[2];
-
        int ext[6];
        double *origin;
-       
-       
        vtkImageData* img = _marImageData->GetImageData();
        if(img!=NULL){
                /*img->GetWholeExtent(ext);
                maxZ=ext[5]-ext[4]+1;
-
                if (z>=maxZ)
                {
                        //z=maxZ-1;
@@ -124,7 +116,6 @@ void vtkBaseData::SetZ(double z)
                {
                        z=0;
                }
-
                _z=z;*/
                img->GetExtent(ext);
                origin = img->GetOrigin();
@@ -136,9 +127,8 @@ void vtkBaseData::SetZ(double z)
                {
                        z = ext[4] + origin[2];
                }
-
                _z=z;
-               _observable->InvokeEvent(3);    
+//             _observable->InvokeEvent(3);    
        }
 }
 
index baf7d816a92e73c65433d38e8737a35d1564bbdf..4ee946bde1dce2ce120c809538b83447905082a5 100644 (file)
@@ -160,12 +160,12 @@ void vtkMPRBaseData::SetX(double x)
                if (x > ext[1])
                {
                        x=ext[1] + origin[0];
-               }
-               
+               }               
                _x=x;
-               _observable->InvokeEvent(1);    
+//             _observable->InvokeEvent(1);
        }
 }
+
 //-------------------------------------------------------------------
 /**
 **     Calculates the value of the slider and the layer in the image that is spouse to show
@@ -198,9 +198,10 @@ void vtkMPRBaseData::SetY(double y)
                        y=ext[3] + origin[1];
                }
                _y=y;
-               _observable->InvokeEvent(2);    
+//             _observable->InvokeEvent(2);
        }
 }
+
 //-------------------------------------------------------------------
 vtkTransform *vtkMPRBaseData::GetTransformOrientation()
 {