<DIV>Hello,</DIV>
<DIV>if you simply want to convert VTK objects instances drom C++&nbsp;to Python or from Python to C++, have a look at these functions defined in vtkPythonUtil.h :</DIV>
<DIV><SPAN class=function><SPAN class=function>vtkPythonGetObjectFromPointer </SPAN></SPAN><SPAN class=function>// C++ -&gt; Python</SPAN></DIV>
<DIV><SPAN class=function><SPAN class=function>vtkPythonGetPointerFromObject // Python -&gt; C++</SPAN></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV>I have written a small example here :</DIV>
<DIV><A href="http://coding.bug.free.fr/lib/vtk/vtkpythoncpp.htm">http://coding.bug.free.fr/lib/vtk/vtkpythoncpp.htm</A></DIV>
<DIV>It is in french but you should understand.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Creating a VTK object and filling it from C++ is much faster that creating it from Python and filling it from python with values returned by C++ since you will do a lots of InsertNextValue from Python and it is very slow due to wrapping. Thats the reason why I had to deal with <SPAN class=function><SPAN class=function>vtkPythonGetObjectFromPointer .</SPAN></SPAN></DIV>
<DIV><SPAN class=function><SPAN class=function>Good luck.</SPAN></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV>Aurélien</DIV>
<DIV><BR><B><I>rharder@uiuc.edu</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Hi,<BR>I have a problem. It's probably easy, but the available<BR>documentation is not making it obvious.<BR><BR>I have a set of C codes that manipulate a data structure, one<BR>component of which is an array of doubles. I've managed to<BR>wrap the C codes with SWIG so I have access to the structure<BR>with the typical SWIG accessor functions, i.e. Sp4Array_data_get()<BR>What do I have to do to get this data array into vtk?<BR>data is declared within the structure as double* data.<BR><BR>I would like to avoid using Numarray or Numeric, I think I <BR>should write a short C++ function to move the data to a<BR>vtk datatype and the pass it back to python to impliment the<BR>visualization. How do I do that, assuming that is what's needed?<BR>I don't get how my C++ instantiation of a vtk datatype is <BR>passed back to a python instantiation of the same type.<BR><BR>I may not be able to see
 the forest for the trees, this is my<BR>first forray into python and vtk. Thanks in advance for any<BR>help you can offer.<BR><BR>Ross<BR><BR>_______________________________________________<BR>This is the private VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at: <HTTP: vtkfaq cgi-bin public.kitware.com><BR>Follow this link to subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers</BLOCKQUOTE><p><br><hr size=1><font face=arial size=-1>Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !<br>
<a href=http://fr.mail.yahoo.com>Testez le nouveau Yahoo! Mail</a></font>