]> Creatis software - creaVtk.git/blobdiff - bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataInfo.cxx
#3282 creaVtk Feature New Normal PolyDataInfo
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkPolyDataInfo.cxx
index 5aa1f2d7f33d3ec773a26af7e4480ad67c848c16..68c02e156ce236977da7f110bbceb0e5b437a665 100644 (file)
@@ -38,6 +38,38 @@ void PolyDataInfo::Process()
                bbSetOutputNumberOfPolys( bbGetInputIn()->GetNumberOfPolys() );
                bbSetOutputNumberOfStrips( bbGetInputIn()->GetNumberOfStrips() );
                bbSetOutputNumberOfVerts( bbGetInputIn()->GetNumberOfVerts() );
+
+               if (bbGetInputPoints()==true)
+               {
+                       std::vector<double> lstIds;
+                       std::vector<double> lstPointsX;
+                       std::vector<double> lstPointsY;
+                       std::vector<double> lstPointsZ;
+                       double p1[3];
+                       double p2[3];
+                       long int i,size= bbGetInputIn()->GetNumberOfPoints();
+                       for (i=0;i<size;i++)
+                       {
+                               if (bbGetInputIdsPoints()==true)
+                               {
+                                       lstIds.push_back(i);
+                               } // IdsPoints
+                               if (bbGetInputTransform()!=NULL)
+                               {
+                                       bbGetInputIn()->GetPoint(i,p1);
+                                       bbGetInputTransform()->TransformPoint(p1,p2);
+                               } else {
+                                       bbGetInputIn()->GetPoint(i,p2);
+                               }
+                               lstPointsX.push_back(p2[0]);
+                               lstPointsY.push_back(p2[1]);
+                               lstPointsZ.push_back(p2[2]);
+                       } // for i
+                       bbSetOutputLstIdsPoints(lstIds);
+                       bbSetOutputLstPointsX(lstPointsX);
+                       bbSetOutputLstPointsY(lstPointsY);
+                       bbSetOutputLstPointsZ(lstPointsZ);
+               } // Points
        } else {
                bbSetOutputNumberOfCells(-1);
                bbSetOutputNumberOfLines(-1);
@@ -65,6 +97,9 @@ void PolyDataInfo::bbUserSetDefaultValues()
    bbSetOutputNumberOfPolys(-9999);
    bbSetOutputNumberOfStrips(-9999);
    bbSetOutputNumberOfVerts(-9999);
+   bbSetInputIdsPoints(false);
+   bbSetInputPoints(false);
+   bbSetInputTransform(NULL);
 }
 //===== 
 // 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)