<div dir="ltr"><div>Hi,<br><br></div>First, you probably want to use vtkIdTypeArray to get type consistency. After that, you&#39;ll want to use SafeDowncast to convert the array returned from vtPointData to vtkIdTypeArray. Then you can use GetValue() or GetTupleValue() to avoid the type conversion.<br>
<br>Andy<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 13, 2013 at 12:50 PM, Sunrise <span dir="ltr">&lt;<a href="mailto:helios.corona@gmail.com" target="_blank">helios.corona@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,

I have two datasets, an vtkUnstructuredGrid and a vtkPolyData. The polydata is physically inside unstructured grid. For each point of polydata, I have an Id of the Cell of unstructuredgrid which that point is located inside that cell. I stored the Ids in vtkIdList.

Now, I want to attach the vtkIdList to the polydata (like vtkPolyData::GetPointData()-&gt;SetScalars(myIds)). But it seems only vtkDataArrays can be an argument (like vtkIntArray).

I could use vtkIntArray at first. The little problem with vtkIntArray is that its output is double type again (double vtkIntArray::GetTuple()), so I have to cast its output to unsigned int every time I want to get an Id. While my guess is that vtkIdList is designed for integers and does not have such problems.

Is there any way to assign vtkIdlist to vtkDataSet?

Thanks.

        
        
        
<br><hr align="left" width="300">
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/How-to-attach-vtkIdlist-to-vtkDataSet-tp5723467.html" target="_blank">How to attach vtkIdlist to vtkDataSet?</a><br>
Sent from the <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html" target="_blank">VTK - Users mailing list archive</a> at Nabble.com.<br><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>