]> Creatis software - creaVtk.git/commitdiff
#3469 vtk8itk4wx3 macos
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 27 Oct 2021 15:01:56 +0000 (17:01 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 27 Oct 2021 15:01:56 +0000 (17:01 +0200)
bbtk_creaVtk_PKG/src/bbcreaVtkApplyTransformToPoint3D.cxx

index 6b662675b5296a36a29011b1a1a9cb81ec4627f6..743ee1ede146f88e4aefd61d9880e9df8bcf75a1 100644 (file)
@@ -31,32 +31,38 @@ void ApplyTransformToPoint3D::Process()
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
 
 
-       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<double> 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<double> 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<double> 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<double> 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
 }
 
 //=====