X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk_creaVtk_PKG%2Fsrc%2FbbcreaVtkPlaneSource.cxx;h=91f5a49d2d890a7937fac69906accbf316c72f21;hb=2cdbf3aedf0078cd0111e6ed5c64d89ffef7c0cd;hp=14fbab9bfda5af9bd247658e82eeb9713deebc54;hpb=0669db4305686c580a5af90759aac12c2ed2f4d9;p=creaVtk.git diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx index 14fbab9..91f5a49 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx @@ -29,11 +29,14 @@ void PlaneSource::Process() p0[1] = 0; p0[2] = 0; + + bool byNormal=true; double size=350; // xy if ((bbGetInputNormal()[0]==0) && (bbGetInputNormal()[1]==0) && (bbGetInputNormal()[2]==1) ) { + byNormal= false; p1[0] = size; p1[1] = 0; p1[2] = 0; @@ -45,6 +48,7 @@ void PlaneSource::Process() // xz if ((bbGetInputNormal()[0]==0) && (bbGetInputNormal()[1]==1) && (bbGetInputNormal()[2]==0) ) { + byNormal= false; p1[0] = size; p1[1] = 0; p1[2] = 0; @@ -56,6 +60,7 @@ void PlaneSource::Process() // yz if ((bbGetInputNormal()[0]==1) && (bbGetInputNormal()[1]==0) && (bbGetInputNormal()[2]==0) ) { + byNormal= false; p1[0] = 0; p1[1] = size; p1[2] = 0; @@ -64,24 +69,18 @@ void PlaneSource::Process() p2[2] = size; } - - -/* - p1[0] = 100; - p1[1] = 0; - p1[2] = 0; - p2[0] = 0; - p2[1] = 100; - p2[2] = 0; -*/ plane->SetResolution( bbGetInputXResolution(), bbGetInputYResolution() ); - plane->SetOrigin( p0 ); - plane->SetPoint1( p1 ); - plane->SetPoint2( p2 ); -// plane->Update( ); - plane->SetNormal( bbGetInputNormal()[0], bbGetInputNormal()[1], bbGetInputNormal()[2] ); -// plane->Update( ); - plane->SetCenter( c ); + if (byNormal==false) + { + plane->SetOrigin( p0 ); + plane->SetPoint1( p1 ); + plane->SetPoint2( p2 ); + } else { + 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->Update( ); bbSetOutputPlane( (vtkDataSet*)plane ); bbSetOutputPolyData( plane->GetOutput() );