Thank you very much, yes I made a mistake on the argument type. The problem has been solved now :)<br><br>The code looks like the following<br><br> num = model.GetNumberOfPoints()<br> ids = vtk.vtkIdList()<br> ids.SetNumberOfIds(num);<br>
model.Allocate(1,1)<br><br> for i in range(0, num):<br> ids.SetId(i, i)<br> model.InsertNextCell(vtk.VTK_VERTEX, ids)<br><br><div class="gmail_quote">On Mon, Jan 11, 2010 at 3:13 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Youbing,<br>
<br>
For the second parameter for InsertNextCell() use a vtkIdList, not a<br>
vtkIdType. But as for for vtkIdType, it's just a typedef as Jerome<br>
says. In Python, you can use a python "int" or "long" for vtkIdType.<br>
<font color="#888888"><br>
David<br>
</font><div><div></div><div class="h5"><br>
On Mon, Jan 11, 2010 at 7:10 AM, Jérôme <<a href="mailto:jerome.velut@gmail.com">jerome.velut@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> In python, as far as I remember, the type of the data is given by the first<br>
> affectation. And in vtkType.h,<br>
> vtkIdType is a simple c++ define of int (basically speaking. It seems to<br>
> handle 64/32 integer cases.).<br>
> I think you should not have to give such a type to your "id"...<br>
><br>
> Can you be more precise about your problem? eg giving code, error messages,<br>
> etc. ?<br>
><br>
> Jerome<br>
><br>
> 2010/1/11 Youbing Zhao <<a href="mailto:zhaoyoubing@gmail.com">zhaoyoubing@gmail.com</a>><br>
>><br>
>> Dear Guys,<br>
>><br>
>> I'm try to call vtkPolyData.InsertNextCell(1, id) in Python which requires<br>
>> a vtkIdType variable as the second input.<br>
>><br>
>> But I have no idea of setup a vtkIdType variable. I tried vtk.vtkIdType,<br>
>> but it's not in the module.<br>
>><br>
>> Does anybody has the experience?<br>
>><br>
>> Thank you very much<br>
>><br>
>> Youbing<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<br>
>> <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:<br>
>> <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>
><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<br>
> <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:<br>
> <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>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Youbing Zhao(趙友兵)<br>Phone: (+44) 75 0202 1598 (UK)<br> (+86) 135 8571 8767 (中國)<br>Email : <a href="mailto:zhaoyoubing@gmail.com">zhaoyoubing@gmail.com</a><br>
MSN : <a href="mailto:zhaoyoubing@hotmail.com">zhaoyoubing@hotmail.com</a><br>