From 830775f772ecae3e51e1b8d254d78312a61e9111 Mon Sep 17 00:00:00 2001 From: "eduardo.davila@creatis.insa-lyon.fr" Date: Fri, 20 Dec 2024 14:21:46 +0100 Subject: [PATCH] Clean code --- bbtk/src/bbcreaMaracasVisuSetPosition.cxx | 6 +++--- .../src/interface/wxWindows/widgets/vtkBaseData.cxx | 12 +----------- .../interface/wxWindows/widgets/wxMPRBaseData.cxx | 9 +++++---- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/bbtk/src/bbcreaMaracasVisuSetPosition.cxx b/bbtk/src/bbcreaMaracasVisuSetPosition.cxx index 29261b6..2bf174a 100644 --- a/bbtk/src/bbcreaMaracasVisuSetPosition.cxx +++ b/bbtk/src/bbcreaMaracasVisuSetPosition.cxx @@ -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(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(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 ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx index b911468..7fb65bf 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx @@ -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); } } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx index baf7d81..4ee946b 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx @@ -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() { -- 2.47.1