From: Eduardo DAVILA Date: Wed, 27 Oct 2021 15:01:56 +0000 (+0200) Subject: #3469 vtk8itk4wx3 macos X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=3a564a367ee792837759fea699ea0a85f14ff9aa;p=creaVtk.git #3469 vtk8itk4wx3 macos --- diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkApplyTransformToPoint3D.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkApplyTransformToPoint3D.cxx index 6b66267..743ee1e 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkApplyTransformToPoint3D.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkApplyTransformToPoint3D.cxx @@ -31,32 +31,38 @@ void ApplyTransformToPoint3D::Process() // std::cout << "Output value = " <TransformPoint( point,newPoint ); - std::vector out; - out.push_back( newPoint[0] ); - out.push_back( newPoint[1] ); - out.push_back( newPoint[2] ); - bbSetOutputOut( out ); - - double pointDir[3] , newPointDir[3]; - pointDir[0] = bbGetInputPoint()[0]+bbGetInputDirectionInPoint()[0]; - pointDir[1] = bbGetInputPoint()[1]+bbGetInputDirectionInPoint()[1]; - pointDir[2] = bbGetInputPoint()[2]+bbGetInputDirectionInPoint()[2]; - bbGetInputTransform()->TransformPoint( pointDir,newPointDir ); - std::vector outDir; - outDir.push_back( newPointDir[0]-newPoint[0] ); - outDir.push_back( newPointDir[1]-newPoint[1] ); - outDir.push_back( newPointDir[2]-newPoint[2] ); - bbSetOutputOutDirection( outDir ); - } else { - printf("EED Warning! ApplyTransformToPoint3D::Process Incoherent sizes Point(3)=%d DirectionInPoint(3)=%d\n", bbGetInputPoint().size(),bbGetInputDirectionInPoint().size() ); - }// if Point size + if (bbGetInputTransform()!=NULL) + { + if ((bbGetInputPoint().size()==3) && (bbGetInputDirectionInPoint().size()==3) ) + { + double point[3] , newPoint[3]; + point[0] = bbGetInputPoint()[0]; + point[1] = bbGetInputPoint()[1]; + point[2] = bbGetInputPoint()[2]; + bbGetInputTransform()->TransformPoint( point,newPoint ); + std::vector out; + out.push_back( newPoint[0] ); + out.push_back( newPoint[1] ); + out.push_back( newPoint[2] ); + bbSetOutputOut( out ); + + double pointDir[3] , newPointDir[3]; + pointDir[0] = bbGetInputPoint()[0]+bbGetInputDirectionInPoint()[0]; + pointDir[1] = bbGetInputPoint()[1]+bbGetInputDirectionInPoint()[1]; + pointDir[2] = bbGetInputPoint()[2]+bbGetInputDirectionInPoint()[2]; + bbGetInputTransform()->TransformPoint( pointDir,newPointDir ); + std::vector outDir; + outDir.push_back( newPointDir[0]-newPoint[0] ); + outDir.push_back( newPointDir[1]-newPoint[1] ); + outDir.push_back( newPointDir[2]-newPoint[2] ); + bbSetOutputOutDirection( outDir ); + } else { + printf("EED Warning! ApplyTransformToPoint3D::Process Incoherent sizes Point(3)=%d DirectionInPoint(3)=%d\n", bbGetInputPoint().size(),bbGetInputDirectionInPoint().size() ); + }// if Point size + + } else { + printf("Warning! ApplyTransformToPoint3D::Process Transform not set.\n"); + }// if Transform NULL } //=====