<div class="gmail_quote">2010/2/2 Sylvain Jaume <span dir="ltr"><<a href="mailto:sylvain@csail.mit.edu">sylvain@csail.mit.edu</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><font style="color:rgb(0, 0, 0)" size="2"><span>ÄãºÃ</span>°¢¶ûÈü˹</font>,<br><br>(Next time you may have more luck sending your VTK questions to <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>>.)<br>
<br></div>To retrieve the geometry and topology information from a vtkPolyData you can do something like this:<div class="im"><br>
<br>double pt[3];<br>vtkIdType npts, *pts;<br><br>int numPts = myPolyData->GetNumberOfPoints();<br><div><br>for (int i=0; i < numPts; i++)<br>{<br> myPolyData->GetPoint(m,pt);<br>
std::cout << "point with index " << i << ": ("
<< pt[0] << " " << pt[1] << " " << pt[2]
<< ")" << std::endl;<br>
}<br><br>myPolyData->GetCells()->InitTraversal();<br><br>while (myPolyData->GetCells()->GetNextCell(npts,pts))<br>{<br> std::cout << "cell has " << npts << " points with indices:";<br>
<br> for (int i=0; i < npts; i++)<br> {<br> std::cout << " " << pts[i];<br> }<br><br> std::cout << std::endl;<br>}<br><br>You might need to try and compile this code as I have just typed it into GMail without compiling.<br>
<br>Regards,<br>Sylvain</div><div><br></div></div></blockquote><div><br></div><div>Folks,</div><div><br></div><div>There are many examples of this type of thing here:</div><a href="http://www.vtk.org/Wiki/VTK/Examples">http://www.vtk.org/Wiki/VTK/Examples</a></div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Namely:</div><div class="gmail_quote"><a href="http://www.vtk.org/Wiki/VTK/Examples/IO/ReadPolyData">http://www.vtk.org/Wiki/VTK/Examples/IO/ReadPolyData</a></div>
<div class="gmail_quote"><br clear="all">Good luck!<br><br><div>David </div></div>