[vtkusers] Retrieve poligonal data after delaunay triangulation
Samuel Marcos
godofredoiii at gmail.com
Wed May 16 06:42:44 EDT 2007
Ok, I've managed it (I write down the part of code in case someone reads
this post and needs it). The weird thing is that I previously tried to write
the PolyData to a text file. If I use the vtkPolyDataWriter before
extracting the triangles, I get an empty array as if the vtkPolyDataWriter
erased the PolyData. Is that normal? I think this is a begginer question but
how do I know if a filter erases or changes the input contents? I've read
each filter makes a copy of the input so I thought the input would stay as
it is even if passed through a filter. Am I wrong? Many thanks to all your
responses, Luca, burlen and Mike (also for the code).
int j=0;
int h;
int npts=3,*pts;
vtkCellArray* oCellArr= vtkCellArray::New();
oCellArr=oPolyDataDel->GetPolys();
for(int i=0;i<oPolyDataDel->GetNumberOfPolys();i++)
{
h=oCellArr->GetNextCell(npts,pts);
if(h==0){
break;
}
if(npts==3){
vTriangulos[j]= pts[0];
vTriangulos[j+1]= pts[1];
vTriangulos[j+2]= pts[2];
j+=3;
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070516/f75d80a5/attachment.htm>
More information about the vtkusers
mailing list