From: Eduardo DAVILA Date: Tue, 22 Aug 2023 11:54:36 +0000 (+0200) Subject: Clean code X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=edb8e9b8948e7216e06b3ef5228b16f18417ca52;p=bbtk.git Clean code --- diff --git a/kernel/src/bbtkBlackBox.cxx b/kernel/src/bbtkBlackBox.cxx index b753c6f..3e22573 100644 --- a/kernel/src/bbtkBlackBox.cxx +++ b/kernel/src/bbtkBlackBox.cxx @@ -748,15 +748,15 @@ namespace bbtk ) { -printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() ); -auto start = std::chrono::high_resolution_clock::now(); +//printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() ); +//auto start = std::chrono::high_resolution_clock::now(); this->bbProcess(); -auto stop = std::chrono::high_resolution_clock::now(); -auto duration = duration_cast(stop - start); -printf("EED BlackBox::bbRecursiveExecute bbProcess time= %ld %s \n", duration.count() , bbGetFullName().c_str() ); -printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() ); +//auto stop = std::chrono::high_resolution_clock::now(); +//auto duration = duration_cast(stop - start); +//printf("EED BlackBox::bbRecursiveExecute bbProcess time= %ld %s \n", duration.count() , bbGetFullName().c_str() ); +//printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() ); } // Manual analysis diff --git a/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx b/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx index 9855950..c845f23 100644 --- a/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx +++ b/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx @@ -25,11 +25,12 @@ void GeodesicMeshDeformation::Process() // (the one provided in the attribute 'name' of the tag 'input') // * TYPE is the C++ type of the input/output // (the one provided in the attribute 'type' of the tag 'input') - std::vector lstCenter = bbGetInputCenter(); - double s = bbGetInputS(); - bool ok = false; - bool pdChanged = false; - using MeshType = itk::QuadEdgeMesh; + + std::vector lstCenter = bbGetInputCenter(); + double s = bbGetInputS(); + bool ok = false; + bool pdChanged = false; + using MeshType = itk::QuadEdgeMesh; std::vector deformInfo; bbSetOutputOut(deformInfo); //std::vector displacementVector; @@ -50,7 +51,7 @@ void GeodesicMeshDeformation::Process() */ using PointType = MeshType::PointType; //polydataBack - polydata = bbGetInputIn(); + polydata = bbGetInputIn(); //points = points of input polydata vtkPoints* points=bbGetInputIn()->GetPoints(); @@ -226,14 +227,14 @@ void GeodesicMeshDeformation::Process() bbGetInputIn()->Modified(); }// if ffmFilter != NULL } // if distance_x y z != 0 - } // In != NULL ok active + } // In != NULL ok active } + //===== // 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) //===== void GeodesicMeshDeformation::bbUserSetDefaultValues() { - // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 bbSetInputActive(true); @@ -253,38 +254,35 @@ void GeodesicMeshDeformation::bbUserSetDefaultValues() backLstCenter.push_back(0); backLstCenter.push_back(0); backLstCenter.push_back(0); - polydata = NULL; - quadEdgeMesh = NULL; - sCurrent = 0; - fmmFilter = NULL; - firstTime = true; + polydata = NULL; + quadEdgeMesh = NULL; + sCurrent = 0; + fmmFilter = NULL; + firstTime = true; } + //===== // 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) //===== void GeodesicMeshDeformation::bbUserInitializeProcessing() { - // THE INITIALIZATION METHOD BODY : // Here does nothing // but this is where you should allocate the internal/output pointers -// if any - - +// if any } + //===== // 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) //===== void GeodesicMeshDeformation::bbUserFinalizeProcessing() { - // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers // if any - } -} -// EO namespace bbitkvtk + +}// EO namespace bbitkvtk diff --git a/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.h b/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.h index e5a325d..b8475e9 100644 --- a/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.h +++ b/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.h @@ -55,24 +55,27 @@ class bbitkvtk_EXPORT GeodesicMeshDeformation }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(GeodesicMeshDeformation,bbtk::AtomicBlackBox); -BBTK_NAME("GeodesicMeshDeformation"); -BBTK_AUTHOR("InfoDev"); -BBTK_DESCRIPTION("No Description."); -BBTK_CATEGORY("empty"); -BBTK_INPUT(GeodesicMeshDeformation,Active,"(default true) true/false",bool,""); -BBTK_INPUT(GeodesicMeshDeformation,TypeIn,"(default 0) 0:Direction 1:Center",int,""); -BBTK_INPUT(GeodesicMeshDeformation,In,"vtk PolyData",vtkPolyData*,""); -BBTK_INPUT(GeodesicMeshDeformation,EdgeId,"Edge Id",long,""); -BBTK_INPUT(GeodesicMeshDeformation,S,"Deformation",double,""); -BBTK_INPUT(GeodesicMeshDeformation,Center,"[X,Y,Z]",std::vector,""); -BBTK_INPUT(GeodesicMeshDeformation,Direction,"(default [1,0,0]) [X,Y,Z]",std::vector,""); -BBTK_OUTPUT(GeodesicMeshDeformation,Out,"double vector output, for output information for other tools",std::vector,""); + BBTK_NAME("GeodesicMeshDeformation"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(GeodesicMeshDeformation,Active,"(default true) true/false",bool,""); + BBTK_INPUT(GeodesicMeshDeformation,TypeIn,"(default 0) 0:Direction 1:Center",int,""); + BBTK_INPUT(GeodesicMeshDeformation,In,"vtk PolyData",vtkPolyData*,""); + BBTK_INPUT(GeodesicMeshDeformation,EdgeId,"Edge Id",long,""); + BBTK_INPUT(GeodesicMeshDeformation,S,"Deformation",double,""); + BBTK_INPUT(GeodesicMeshDeformation,Center,"[X,Y,Z]",std::vector,""); + BBTK_INPUT(GeodesicMeshDeformation,Direction,"(default [1,0,0]) [X,Y,Z]",std::vector,""); + + BBTK_OUTPUT(GeodesicMeshDeformation,Out,"double vector output, for output information for other tools",std::vector,""); + BBTK_END_DESCRIBE_BLACK_BOX(GeodesicMeshDeformation); //===== // 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) -//===== -} -// EO namespace bbitkvtk +//===== + +}// EO namespace bbitkvtk #endif // __bbitkvtkGeodesicMeshDeformation_h_INCLUDED__ diff --git a/packages/vtk/src/bbvtkPolyDataToActor.cxx b/packages/vtk/src/bbvtkPolyDataToActor.cxx index 4fbdafc..da92f3b 100644 --- a/packages/vtk/src/bbvtkPolyDataToActor.cxx +++ b/packages/vtk/src/bbvtkPolyDataToActor.cxx @@ -223,26 +223,6 @@ printf("EED WARNNING! PolyDataToActor::DoProcess which is the default values o bbSetOutputOut( vtkactor ); -/* / >>>> - AAAAA - vtkArrowSource *arrow = vtkArrowSource::New(); - vtkPolyDataNormals *normals = vtkPolyDataNormals::New(); - normals->SetInputData( bbGetInputIn() ); - vtkGlyph3D *glyph = vtkGlyph3D::New(); - glyph->SetInputData(normals->GetOutput() ); - glyph->SetSourceData(arrow->GetOutput() ); - glyph->SetVectorModeToUseNormal(); - glyph->SetScaleModeToScaleByVector(); - glyph->SetScaleFactor(10); - vtkPolyDataMapper *mapper2 = vtkPolyDataMapper::New(); - mapper2->SetInputData( glyph->GetOutput() ); - vtkActor *actor2 = vtkActor::New(); - actor2->SetMapper(mapper2); - actor2->GetProperty()->SetColor(1, 0, 0); -*/ - - - // Interface Update if ((actorAdded==false) && (bbGetInputRenderer()!=NULL )) { diff --git a/packages/vtk/src/bbvtkUpdateRender.cxx b/packages/vtk/src/bbvtkUpdateRender.cxx index ad773c2..fb58558 100644 --- a/packages/vtk/src/bbvtkUpdateRender.cxx +++ b/packages/vtk/src/bbvtkUpdateRender.cxx @@ -39,12 +39,7 @@ void UpdateRender::Process() { if (bbGetInputRenderer()!=NULL) { -printf("EED UpdateRender::Process Ojo -----------\n"); bbGetInputRenderer()->GetRenderWindow()->Render(); - -//EED 4 nov 2015 Estelle -// bbGetInputRenderer()->GradientBackgroundOff(); -// bbGetInputRenderer()->SetBackground( 0 , 0 , 0 ); } // Renderer } // if Active }