From: Pablo Garzon Date: Fri, 2 Jun 2023 12:38:43 +0000 (+0200) Subject: #3503 Append PolyData vector X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=377c6e2f638055c2c03f544c986204d3736b0f27;p=bbtk.git #3503 Append PolyData vector --- diff --git a/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx b/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx index f99dc9c..a589a47 100644 --- a/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx +++ b/packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.cxx @@ -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 lstCenter = bbGetInputCenter(); double s = bbGetInputS(); bool ok = false; + bool pdChanged = false; using MeshType = itk::QuadEdgeMesh; //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) diff --git a/packages/vtk/src/bbvtkAppendPolyData.xml b/packages/vtk/src/bbvtkAppendPolyData.xml index 9dde44c..f415a88 100644 --- a/packages/vtk/src/bbvtkAppendPolyData.xml +++ b/packages/vtk/src/bbvtkAppendPolyData.xml @@ -16,6 +16,8 @@ +
typedef std::vector InputVector;
+
@@ -28,12 +30,22 @@
   bbGetVtkObject()->SetInput(bbGetInputIn3());
   bbGetVtkObject()->SetInput(bbGetInputIn4());
   bbGetVtkObject()->SetInput(bbGetInputIn5());
+  if(!bbGetInputInVector().empty()){
+	for(int i = 0; i < (int) bbGetInputInVector().size(); i++){
+		bbGetVtkObject()->SetInput(bbGetInputInVector()[i]);
+	}
+  }
 #else
   bbGetVtkObject()->AddInputData(bbGetInputIn1());
   bbGetVtkObject()->AddInputData(bbGetInputIn2());
   bbGetVtkObject()->AddInputData(bbGetInputIn3());
   bbGetVtkObject()->AddInputData(bbGetInputIn4());
   bbGetVtkObject()->AddInputData(bbGetInputIn5());
+  if(!bbGetInputInVector().empty()){
+	for(int i = 0; i < (int) bbGetInputInVector().size(); i++){
+		bbGetVtkObject()->AddInputData(bbGetInputInVector()[i]);
+	}
+  }
 #endif