<div dir="ltr">Hi Evgeniya,<div><br></div><div>Try renaming your class to vtkMyClass to see if that works.</div><div><br></div><div> - David<br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 5, 2017 at 10:02 AM, Евгения Маликова via vtkusers <span dir="ltr"><<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><pre style="white-space:pre-wrap"><em> Hi,
</em><em>I am trying to wrap a custom class derived from vtkImplicitFunction in python. Wrapping was done with a similar to <a href="http://public.kitware.com/pipermail/vtkusers/2016-August/096019.html" target="_blank">http://public.kitware.com/<wbr>pipermail/vtkusers/2016-<wbr>August/096019.html</a> CMakeLists.txt .All methods are accessed and work fine within python. But when I try to pass this class variable to vtkSampleFunction as ImplicitFunction, I receive an error:<br><br>>m=myClassPython.myClass()<br>>s=vtk.vtkSampleFunction()<br>>s.SetImplicitFunction(m)</em></pre>TypeError:SetImplicitFunction argument 1: methond requires a VTK Object.<br><br>I'm launching this code with vtkpython.exe.<br><br>.h file of wrapped class looks like:<br><br><p>class myClass : public vtkImplicitFunction {<br>public:<br>static myClass *New();<br>vtkTypeMacro(myClass, vtkImplicitFunction);<br>void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;<br>vtkMTimeType GetMTime() VTK_OVERRIDE;</p><p>// Description<br>// Evaluate function<br>double EvaluateFunction(double x[3]) VTK_OVERRIDE;<br>double EvaluateFunction(double x, double y, double z) {<br>return this->vtkImplicitFunction::<wbr>EvaluateFunction(x, y, z);<br>}<br>.....<br>myClass();<br>~myClass() VTK_OVERRIDE;</p><p>private:<br>myClass(const myClass&) VTK_DELETE_FUNCTION;<br>void operator=(const myClass&)VTK_DELETE_FUNCTION;<br>};</p><pre style="white-space:pre-wrap"><em>I don't have much experience in vtk to python wrapping and I guess there is something very simple, but I don't have any idea what it can be. Any help would be appreciated.
</em>Thank you in advance,<br>Best regards,<br>Evgeniya</pre></div>
</blockquote></div><br></div></div></div>