Wrap VTK properties to pythonic properties with snake_case names
Add properties for python wrappers
The properties of a VTK object can now be accessed in a pythonic style.
Example:
i = vtk.vtkImageData()
print(i.dimensions) # prints (0, 0, 0)
i.dimensions = [2, 2, 3]
print(i.dimensions) # prints (2, 2, 3)
print(i.reference_count) # prints 1
Accept keyword arguments in constructor for python wrapped VTK classes
In python, you can now initialize the properties of a wrapped VTK class through specifying keyword arguments in the constructor.
Example:
s = vtkSphereSource(center=(1, 0, 0), generate_normals=False, radius=10, theta_resolution=20)
e = vtkElevationFilter(low_point=(1, 0, -10), high_point=(1, 0, 10), input_connection=s.output_port)
e.Update()
print(e.output.point_data.scalars.range) # prints (0.0, 1.0)
Conveniently build and reuse pipelines with vtkAlgorithm and vtkDataObject
Example:
pipeline = (
vtkElevationFilter()
>> vtkShrinkFilter()
>> vtkGeometryFilter()
>> vtkPolyDataConnectivityFilter(color_regions=True, extraction_mode=VTK_EXTRACT_ALL_REGIONS)
>> vtkPolyDataNormals()
)
cone = vtkConeSource(radius=5, resolution=8, height=2).execute()
print(pipeline.execute(cone))
cylinder = vtkCylinderSource(radius=6, resolution=9, height=3).execute()
print(pipeline.execute(cylinder))
Edited by Jaswant Panchumarti (Kitware)