From 3a564a367ee792837759fea699ea0a85f14ff9aa Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Wed, 27 Oct 2021 17:01:56 +0200 Subject: [PATCH] #3469 vtk8itk4wx3 macos --- .../src/bbcreaVtkApplyTransformToPoint3D.cxx | 58 ++++++++++--------- 1 file changed, 32 insertions(+), 26 deletions(-) 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 } //===== -- 2.45.1