]> Creatis software - bbtk.git/blobdiff - packages/vtk/src/bbvtkPointsXYZtoVTKPoints.cxx
2391 BBTK Feature New Normal box castVector in std package
[bbtk.git] / packages / vtk / src / bbvtkPointsXYZtoVTKPoints.cxx
index 0a825a2ecfbb565c54b2bdb8435a57ab04744884..f2a84952f828fbed74dcb9211926abc9793604ff 100644 (file)
@@ -14,27 +14,33 @@ BBTK_BLACK_BOX_IMPLEMENTATION(PointsXYZtoVTKPoints,bbtk::AtomicBlackBox);
 void PointsXYZtoVTKPoints::Process()
 {
 
-       //std::cout << "RaC PointsXYZtoVTKPoints::Process START"<< std::endl;
+//std::cout << "RaC PointsXYZtoVTKPoints::Process START"<< std::endl;
        std::vector<int> lstPointsX = bbGetInputLstPointsX();
        std::vector<int> lstPointsY = bbGetInputLstPointsY();
        std::vector<int> lstPointsZ = bbGetInputLstPointsZ();
 
+
        if(_points==NULL)
+       {
                _points=vtkPoints::New();
-       else
+       } else {
                _points->Reset();//CLEAR
+       }
+       double point[3];
+       point[0]=0;
+       point[1]=0;
+       point[2]=0;
 
        for (int i =0; i < lstPointsX.size(); ++i)
        {
-               double point[3];
                point[0]=lstPointsX[i];
-               point[1]=lstPointsY[i];
-               point[2]=lstPointsZ[i];
+               if (lstPointsY.size()>i) { point[1]=lstPointsY[i]; }
+               if (lstPointsZ.size()>i) { point[2]=lstPointsZ[i]; }
                _points->InsertPoint(i,point);
        }
        bbSetOutputPoints(_points);
 
-       //std::cout << "RaC PointsXYZtoVTKPoints::Process END"<< std::endl;
+std::cout << "RaC PointsXYZtoVTKPoints::Process END"<< std::endl;
   
 }
 //===== 
@@ -42,9 +48,7 @@ void PointsXYZtoVTKPoints::Process()
 //===== 
 void PointsXYZtoVTKPoints::bbUserSetDefaultValues()
 {
-
-
-  
+  _points=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)