Hello,<br><br>The ID for a cell is defined by the application when it creates a vtkIdType array and stores an ID for each cell into it.<br><br>So, the ID for a cell is retrieved by something like this:<br><br>vtkIdType cellID =pvtkPolydata->GetCellData()->GetArray("My_IDs")->GetValue(index);
<br><br>In the latest VTK library, one can use the GLOBALIDS attribute in vtkDataSetAttributes to designate a particular array as the IDS. It works like the SCALAR or VECTOR attribute. If tha application has done that them the ID for a cell can be retrieved like this:
<br><br>vtkIdType cellID = pvtkPolydata->GetCellData()->GetGlobalIDs()->GetValue(index)<br><br>If the application has not made an ID array, then the ID is just the offset into the array, which is "index" in your code snippet.
<br><br>cheers<br>Dave DeMarle<br><br><br><br><div><span class="gmail_quote">On 5/15/07, <b class="gmail_sendername">Lim, Theodore</b> <<a href="mailto:T.Lim@hw.ac.uk">T.Lim@hw.ac.uk</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;">
<div>
<div dir="ltr">
<div dir="ltr"><font color="#000000" face="Arial" size="2"></font>Hi Everybody,</div>
<div dir="ltr"> </div>
<div dir="ltr">How can a vtkCell ID be reterived?</div>
<div dir="ltr"> </div>
<div dir="ltr">It would be great if vtkCell had a function say GetID() but there
isn't one.</div>
<div dir="ltr"> </div>
<div dir="ltr">I can parse through the polydata to get cells:</div>
<div dir="ltr"> </div>
<div dir="ltr">for (int index = 0; index < pvtkPolydata->GetNumberOfCells();
index++)</div>
<div dir="ltr">{</div>
<div dir="ltr"> vtkCell *C =
pvtkPolydata->GetCell(index);</div>
<div dir="ltr"> vtkIdType cellID = C->GetID() // how?
would like but function not available... help!</div>
<div dir="ltr">}</div>
<div dir="ltr"> </div>
<div dir="ltr">Please point me in the right direction.</div>
<div dir="ltr"> </div>
<div dir="ltr">Many thanks, Theo.</div></div></div><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></blockquote></div><br>