Commit 0b1ca3a0 authored by Ben Boeckel's avatar Ben Boeckel Committed by Berk Geveci

pythonalg: use keyword arguments rather than members

Change-Id: Ib3bdb7fcadb08907b0243da45e78d2e983437fdc
parent 4787c7a4
......@@ -6,9 +6,7 @@ class TestPythonAlgorithm(Testing.vtkTest):
def testSource(self):
class MyAlgorithm(vta.VTKAlgorithm):
def __init__(self):
vta.VTKAlgorithm.__init__(self)
self.NumberOfInputPorts = 0
self.OutputType = 'vtkImageData'
vta.VTKAlgorithm.__init__(self, nInputPorts=0, outputType='vtkImageData')
self.Wavelet = vtk.vtkRTAnalyticSource()
def RequestInformation(self, vtkself, request, inInfo, outInfo):
......
......@@ -16,15 +16,16 @@ class VTKAlgorithm(object):
the input and output types based on data members.
"""
def __init__(self):
def __init__(self, nInputPorts=1, inputType='vtkDataSet',
nOutputPorts=1, outputType='vtkPolyData'):
"""Sets up default NumberOfInputPorts, NumberOfOutputPorts,
InputType and OutputType that are used by various initialization
methods."""
self.NumberOfInputPorts = 1
self.NumberOfOutputPorts = 1
self.InputType = 'vtkDataSet'
self.OutputType = 'vtkPolyData'
self.NumberOfInputPorts = nInputPorts
self.NumberOfOutputPorts = nOutputPorts
self.InputType = inputType
self.OutputType = outputType
def Initialize(self, vtkself):
"""Sets up number of input and output ports based on
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment