[vtkusers] vtkParametricFunction sub-classes in Python

Jack Zentner jack.zentner at gmail.com
Mon Aug 29 10:03:07 EDT 2016


All,

I've been playing around with some parametric geometry in Python and I
wanted to use VTK to visualize the surfaces that I'm creating.  It seems
that extending the vtkParametricFunction class and using it with the
vtkParametricFunctionSource should work great.  However I can't seem to get
this to work from Python. 

Per Andrew Maclean's instructions in the "Parametric Equations for Surfaces"
pdf, I've created my geometry class by inheriting from vtkParametricFunction
and implemented the Evaluate, EvaluateScalar and GetDimension methods.  The
problem comes when I try to instantiate my new vtkParametricFunction object,
I get the following error:

    TypeError: this is an abstract class and cannot be instantiated.

I though maybe it was because I had not explicitly implemented the other
virtual methods in the vtkParametricFunction interface. So I implemented all
of those as well and I still get the same error. Then I tried to inherit
from one of the C++ sub-classes of vtkParametricFunction and simply override
the Evaluate, EvaluateSCalar and GetDimension methods.  This works from an
instantiation stand point but my overrides of Evaluate and the like are not
being recognized.

Am I missing something?  Is it not possible to define vtkParametricFunction
sub-classes in Python for use with a vtkParametricFunctionSource object?  

FYI, I'm using Python3.5 and the VTK 7.0 package from conda-forge.


Thank you in advance,

jack



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkParametricFunction-sub-classes-in-Python-tp5740029.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list