Jack Zentner
2016-08-29 14:03:07 UTC
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.
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Search the list archives at: http://markmail.org/search/?q=vtkusers
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
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.
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Search the list archives at: http://markmail.org/search/?q=vtkusers
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers