]> Creatis software - bbtk.git/blobdiff - packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx
#3503 Append PolyData vector
[bbtk.git] / packages / itkvtk / src / bbitkvtkGeodesicMeshDeformation.cxx
index f99dc9cb5a26b0f35e7bdc47f3a5e1b91294e85f..a589a47453ba17e6fc4202b533ae8447acc32e59 100644 (file)
@@ -14,7 +14,7 @@ BBTK_BLACK_BOX_IMPLEMENTATION(GeodesicMeshDeformation,bbtk::AtomicBlackBox);
 //===== 
 void GeodesicMeshDeformation::Process()
 {
-//printf("PG GeodesicMeshDeformation::Process START \n");
+printf("PG GeodesicMeshDeformation::Process START \n");
 // THE MAIN PROCESSING METHOD BODY
 //   Here we simply set the input 'In' value to the output 'Out'
 //   And print out the output value
@@ -29,11 +29,13 @@ void GeodesicMeshDeformation::Process()
     std::vector<double> lstCenter = bbGetInputCenter();
     double s   = bbGetInputS();
     bool    ok  = false;
+    bool       pdChanged = false;
     using MeshType = itk::QuadEdgeMesh<double, 3>;
     
     //Set up QuadEdge and filter every time polydata changes
     if ((bbGetInputIn() != polydata) && (bbGetInputActive()==true) && (bbGetInputIn() != NULL))
     {
+       pdChanged = true;
        //Reset displacement
        if(lstCenter.size() != NULL)
        {
@@ -155,8 +157,8 @@ void GeodesicMeshDeformation::Process()
             
         } // if TypeIn 1 Center
         points->GetPoint( bbGetInputEdgeId() , pb );
-        if (EdgeIdBack!=bbGetInputEdgeId() )
-        {
+        if (EdgeIdBack!=bbGetInputEdgeId() || pdChanged)
+        {printf("PG GeodesicMeshDeformation::Process ENTERED \n");
             EdgeIdBack = bbGetInputEdgeId();
             
                        backLstCenter[0] = lstCenter[0];
@@ -218,7 +220,7 @@ void GeodesicMeshDeformation::Process()
                        }// if ffmFilter != NULL
         } // if distance_x y z  != 0
     } // In != NULL    ok    active
-//    printf("PG GeodesicMeshDeformation::Process END \n");
+    printf("PG GeodesicMeshDeformation::Process END \n");
 }
 //===== 
 // 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)