X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk_creaVtk_PKG%2Fsrc%2FbbcreaVtkCreateMeshFromPoints.cxx;h=671b2645d49df41b4253a31fa6315bfd42168602;hb=4d71ce834efd16b6e7c23ee82134cb421defe8d0;hp=b141e0257287999a8a218992cb9262b1171750cc;hpb=644dfd4ee6908a0afac46f4839b518c8f972ecd6;p=creaVtk.git diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx index b141e02..671b264 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx @@ -31,6 +31,7 @@ void CreateMeshFromPoints::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " < lstX = bbGetInputLstX(); std::vector lstY = bbGetInputLstY(); std::vector lstZ = bbGetInputLstZ(); @@ -38,6 +39,7 @@ void CreateMeshFromPoints::Process() if ( (lstIndexs.size()<=1) || (lstX.size()==0) || (lstX.size()!=lstY.size()) || (lstY.size()!=lstZ.size()) ) { printf("Warnning! CreateMeshFromPoints::Process: List of points X Y Z and LstIndexes is not correct\n"); + bbSetOutputOut(NULL); } else { int ii,sizeSegment1,sizeSegment2; int endSegment; @@ -57,7 +59,7 @@ void CreateMeshFromPoints::Process() int iSeg1,iSeg2; int iGeneral = 0; int sizeLstIdexes=lstIndexs.size(); - for (i=0; iGetPointIds()->SetId(ii*2+1,iSeg2); iSeg1++; iSeg2++; - if (iSeg1>=maxSegment1) iSeg1=maxSegment1-1; - if (iSeg2>=maxSegment2) iSeg2=maxSegment2-1; + if (iSeg1>=maxSegment1) { iSeg1=maxSegment1-1; } + if (iSeg2>=maxSegment2) { iSeg2=maxSegment2-1; } } // for ii iGeneral=iGeneral+sizeSegment1; cells->InsertNextCell(triangleStrip); - } //for LstIndexs + } //for LstIndexs // vtkPolyData *polydata = vtkPolyData::New(); if (polydata!=NULL) polydata->Delete(); polydata = vtkPolyData::New(); @@ -99,6 +101,7 @@ void CreateMeshFromPoints::Process() bbSetOutputOut( clean->GetOutput() ); }// if listXYZ size } + //===== // 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) //=====