<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>De: <b class="gmail_sendername" dir="auto">Paulo Carvalho</b> <span dir="auto"><<a href="mailto:paulo.r.m.carvalho@gmail.com">paulo.r.m.carvalho@gmail.com</a>></span><br>Date: dom, 7 de jul de 2019 às 10:06<br>Subject: Re: [vtkusers] apply filter multiple times<br>To: Martin Genet <<a href="mailto:martin.genet@polytechnique.edu">martin.genet@polytechnique.edu</a>><br></div><br><br><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div>Hi, Martin!<br><br></div>       If I understood right, you want to create a vtkUnstructuredGridAlgorithm specialization so you can plug it in to a VTK pipeline.  That would be "easy" if it were in C++, but it seems you want to do it in pure Python.  Thus, your problem is two-fold:<br><br></div>   1) You need to learn know how to extend C++ classes in Python and make your Python class usable in a C++ framework: <a href="https://stackoverflow.com/questions/2200912/inheritance-in-python-c-extension" target="_blank">https://stackoverflow.com/questions/2200912/inheritance-in-python-c-extension</a>.<br><br></div><div>   2) You need to implement a custom sub-class of vtkUnstructuredGridAlgorithm in Python to be able to plug it in to some VTK pipeline.<br><br></div><div>     I've never tried it myself, but be ready for some real headaches as I recall the pain that was to write CORBA wrappers for Java-C++ interoperabilty.<br><br></div><div>     I think you'd be better off if you write your custom vtkUnstructuredGridAlgorithm subclass in C++ and use it in Python like other VTK classes.  Overriding vtkUnstructuredGridAlgorithm alone will be enough trouble.<br><br></div><div>all the best,<br><br></div><div>Paulo<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em sáb, 6 de jul de 2019 às 17:31, Martin Genet <<a href="mailto:martin.genet@polytechnique.edu" target="_blank">martin.genet@polytechnique.edu</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear all:<br>
<br>
I am having some issue setting up a rather complex pipeline involving, <br>
but not exclusively, vtk objects and filters. I think basically the <br>
issue boils down to this: I create an unstructured grid with some vector <br>
field, warp it, modify the vector field (outside vtk), warp it again, <br>
etc. Pretty basic, right? Of course I do not want to reallocate an <br>
unstructured grid for the warped mesh each time I run the warp filter, <br>
but rather modify the one that is allocated the first time I run the <br>
warp filter. Makes sense? I have done this many times, for pipelines <br>
that only involve vtk stuff. However, I am not sure how to do this for <br>
pipelines involving non-vtk operations. Attached is a minimal example: I <br>
create a sphere, warp it along the normals, scale the normals, warp it <br>
again using the already existing warp filter (here the scaling is not <br>
taken into account for some reason), and warp it using a new warp filter <br>
(here it is, but I guess it creates a new object instead of modifying <br>
the existing one, right?). This seem like a trivial issue, but I cannot <br>
seem to figure it out. Can someone help me? Thank you so much.<br>
<br>
Martin<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://vtk.org/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div>
</div></div>