Here's something to try.. Right after you setup the vtkContourFilter (This is in C++)<br><br><span style="font-family: courier new,monospace;"></span><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">
vtkContourFilter *contour = vtkContourFilter::New();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">contour->SetInput(blah);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">... configure the contour ...</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">contour->Update();</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">for(int cid = 0; cid < contour->GetOutput()->GetNumberOfCells(); cid++) {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> vtkCell *acell = contour->GetOutput()->GetCell(cid);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> printf("Polygon %i: (%i points)\n", cid, acell->GetNumberOfPoints());
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> for(int pid=0; pid < acell->GetNumberOfPoints(); pid++) {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> double *point = contour->GetOutput()->GetPoint(aCell->GetPointId(pid));</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
printf("\tPoint %i: %lf, %lf, %lf\n", pid, point[0], point[1], point[2]);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span><br></div><br><div><span class="gmail_quote">On 1/29/06, <b class="gmail_sendername">Syed Amjad</b> <<a href="mailto:majeed.amjad@gmail.com">majeed.amjad@gmail.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi, <br>
<br>
I wanted to know how I can get cell or array information form vtk. I'm using vtkContourFilter on some data that I have read, <br>
<br>
NOW I ONLY WANT TO GET THE COORDINATES of the POLYGONS on the CONTOUR..<br>
<br>
how can I do this?? <br>
<br>
I've tried GetNextCell() but it returns zero? <br>
I've read the class referrence and tried all the funcions but for some
reason the data is read properly and rendered but when I try to extract
the PolyData, I get nothing, <br>
ie <br>
<br>
for lets say after reading the data, I try getCells() functions I get a nice round 0. <br>
<br>
I know it's reading properly because it renders fine....<br>
<br>
Q: <br>
<br>
How can I get the coordinates out of the polydata once i've applied the contourfilter??<br>
<br>
<br>
Thankyou,<br>
<br>
<br>
<br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers
</a><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>Randall Hand<br>Visualization Scientist, <br>ERDC-MSRC Vicksburg, MS<br>Homepage: <a href="http://www.yeraze.com">http://www.yeraze.com</a>