[vtkusers] Inherit from vtkPolyDataAlgorithm within python only?

Andrew E. Slaughter andrew.slaughter at inl.gov
Mon Aug 20 10:25:26 EDT 2018


This might help, if you haven't found it already: https://blog.kitware.com/vtkpythonalgorithm-is-great/

________________________________________
From: vtkusers <vtkusers-bounces at public.kitware.com> on behalf of normanius <juch at zhaw.ch>
Sent: Monday, August 20, 2018 8:22:55 AM
To: vtkusers at vtk.org
Subject: [vtkusers] Inherit from vtkPolyDataAlgorithm within python only?

Dear all Is it possible to somehow inherit vtkPolyDataAlgorithm from within the python wrapper only? Or in other words: is it possible to mimic a vtkPolyDataAlgorithm entirely within python? I have something like the following in mind:


from my_algo import MyAlgoObj
algo = MyAlgoObj()
algo.SetInputConnection(input.GetOutputPort())
algo.Update()
algo.GetOutput()
...



# my_algo.py:
import vtk

class MyAlgoObj(vtk.vtkPolyDataAlgorithm):
    def __init__(self):
        # ...
    def RequestData(...):
        # ...


This is certainly against vtk's design objectives. But for my project, it would be the easiest if I can create an algorithm within my python module, without the need to re-build vtk and to re-distribute a forked version of vtk. Best Norman
________________________________
Sent from the VTK - Users mailing list archive<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Candrew.slaughter%40inl.gov%7C26ab0ebc0b4d440f539b08d606a877a4%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703717970985631&sdata=nx3n1CYh84zrGmXgSVKWQarvCZocZDx%2FaPvIEybVdR4%3D&reserved=0> at Nabble.com.


More information about the vtkusers mailing list