Hello Kevin,<br><br>Thanks a lot for the help. I have one more question. <br><br>If I have a point coordinate is it possible to find its pointid and cell id of the cell in which the point lies? If yes then how?<br><br>Amitesh
<br><br><div><span class="gmail_quote">On 8/18/06, <b class="gmail_sendername">Kevin H. Hobbs</b> <<a href="mailto:hobbsk@ohiou.edu">hobbsk@ohiou.edu</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;">
On Fri, 2006-08-18 at 00:42 -0500, Amitesh Agarwal wrote:<br>> Hi all,<br>><br>> I have read an unstructured grid and have converted the grid in<br>> polydata. I have been trying to access individual cell information and
<br>> point information serially in the polydata but to no avail. The<br>> problem is that all of these have some kind of vtkid assigned to each<br>> of the cell and point. I have grown immensly frustrated trying to find
<br>> a way to access a list of those vtkids so that I could be able to use<br>> them to access the individual cells and points. Any ideas how to do<br>> it? Any help will be greatly appreciated.<br>><br>> Thanks
<br>><br>> Amitesh<br><br><br><br><br>// Make a reader.<br>vtkXMLPolyDataReader * reader = vtkXMLPolyDataReader::New();<br>reader->SetFileName( in_poly_file_name );<br>reader->Update();<br><br>in_poly = reader->GetOutput();
<br>in_poly->BuildLinks();<br><br>// Get the cells and points.<br>vtkCellArray * in_lines = in_poly->GetLines();<br>vtkPoints * in_points = in_poly->GetPoints();<br><br>// How many are there?<br>vtkIdType num_cells = in_lines->GetNumberOfCells();
<br>vtkIdType num_points = in_points->GetNumberOfPoints();<br><br>// Visit the points.<br>vtkIdType point;<br>for (point = 0; point < num_points; ++point )<br>{<br> // What is the point's location?<br> double * pcoord;
<br> pcoord = in_poly->GetPoint( point );<br><br> std::cout << pcord[0] << " "<br> << pcord[1] << " "<br> << pcord[2] << std::endl;<br>
}<br><br><br></blockquote></div><br>