From: eduardo.davila@creatis.insa-lyon.fr Date: Fri, 6 Dec 2024 10:30:04 +0000 (+0100) Subject: Clean code X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=6c65d1fa924cb5c729a2c6e27fc229203b0378fb;p=creaVtk.git Clean code --- diff --git a/bbtk_creaVtk_PKG/.DS_Store b/bbtk_creaVtk_PKG/.DS_Store index 9e9655d..8fd3482 100644 Binary files a/bbtk_creaVtk_PKG/.DS_Store and b/bbtk_creaVtk_PKG/.DS_Store differ diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx index 2521476..a7ed64b 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx @@ -32,12 +32,13 @@ void PlaneSource::Process() bool byNormal = true; double size = 350; - +// bbGetInputVolumeSize ????????? + // xy if ((bbGetInputNormal()[0]==0) && (bbGetInputNormal()[1]==0) && (bbGetInputNormal()[2]==1) ) { byNormal= false; - p1[0] = size; + p1[0] = size; p1[1] = 0; p1[2] = 0; p2[0] = 0; @@ -93,8 +94,7 @@ void PlaneSource::Process() plane->SetNormal( bbGetInputNormal()[0], bbGetInputNormal()[1], bbGetInputNormal()[2] ); printf("EED PlaneSource. Missing mechanism to define the size of the plane\n"); } - plane->SetCenter( c ); - + plane->SetCenter( c ); plane->Update( ); bbSetOutputPlane( (vtkDataSet*)plane ); bbSetOutputPolyData( plane->GetOutput() ); @@ -105,36 +105,39 @@ void PlaneSource::Process() //===== void PlaneSource::bbUserSetDefaultValues() { - std::vector c; - std::vector n; + std::vector c; c.push_back(0); c.push_back(0); c.push_back(0); - n.push_back(1); - n.push_back(0); - n.push_back(0); - bbSetInputCenter(c); - bbSetInputNormal(n); - bbSetInputXResolution(100); - bbSetInputYResolution(100); + bbSetInputCenter( c ); + std::vector n; + n.push_back(1); + n.push_back(0); + n.push_back(0); + bbSetInputNormal( n ); + std::vector volSize; + volSize.push_back(350); + volSize.push_back(350); + volSize.push_back(350); + bbSetInputVolumeSize( volSize ); + bbSetInputXResolution(100); + bbSetInputYResolution(100); } -//===== + +//===== // 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 PlaneSource::bbUserInitializeProcessing() { - - } -//===== + +//===== // 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 PlaneSource::bbUserFinalizeProcessing() { - - -} } -// EO namespace bbcreaVtk + +}// EO namespace bbcreaVtk diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.h b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.h index 2646c9b..0f54e0c 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.h @@ -25,6 +25,7 @@ class bbcreaVtk_EXPORT PlaneSource BBTK_DECLARE_INPUT(Normal,std::vector); BBTK_DECLARE_INPUT(XResolution,int); BBTK_DECLARE_INPUT(YResolution,int); + BBTK_DECLARE_INPUT(VolumeSize,std::vector); BBTK_DECLARE_OUTPUT(Plane,vtkDataSet*); BBTK_DECLARE_OUTPUT(PolyData,vtkPolyData*); BBTK_PROCESS(Process); @@ -39,10 +40,11 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(PlaneSource,bbtk::AtomicBlackBox); BBTK_AUTHOR("carlos torres"); BBTK_DESCRIPTION("No Description."); BBTK_CATEGORY("empty"); - BBTK_INPUT(PlaneSource,Center,"Center (default[0,0,0]) ",std::vector,""); - BBTK_INPUT(PlaneSource,Normal,"Normal (default[1,0,0]) ",std::vector,""); - BBTK_INPUT(PlaneSource,XResolution,"XResolution (default 100)",int,""); - BBTK_INPUT(PlaneSource,YResolution,"YResolution (default 100)",int,""); + BBTK_INPUT(PlaneSource,Center,"( default [0,0,0] ) Center ",std::vector,""); + BBTK_INPUT(PlaneSource,Normal,"( default [1,0,0] ) Normal ",std::vector,""); + BBTK_INPUT(PlaneSource,XResolution,"(default 100) XResolution ",int,""); + BBTK_INPUT(PlaneSource,YResolution,"(default 100) YResolution ",int,""); + BBTK_INPUT(PlaneSource,VolumeSize,"(default [350 350 350]) VolumeSize [sizeX sizeY sizeZ] ",std::vector,""); BBTK_OUTPUT(PlaneSource,Plane,"Plane",vtkDataSet*,""); BBTK_OUTPUT(PlaneSource,PolyData,"vtkPolyData",vtkPolyData*,""); BBTK_END_DESCRIBE_BLACK_BOX(PlaneSource);