Skip to content

Commit

Permalink
FIX: vtkCylinderSource().GetLatLongTessellation() broken
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Feb 21, 2024
1 parent 1eb7c4e commit 92b973c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tvtk/wrapper_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,11 @@ def _write_trait_with_range(self, klass, out, vtk_attr_name):
'vtkLineIntegralConvolution2D.MaxNoiseValue$': (
True, True, '_write_line_integral_conv_2d_max_noise_value'
),
# In VTK 9.3, vtkCylinderSource's GetLatLongTesselation gives random values
# https://gitlab.kitware.com/vtk/vtk/-/issues/19252
'vtkCylinderSource.LatLongTessellation$': (
True, True, '_write_cylinder_source_lat_long_tessellation'
),
}

@classmethod
Expand Down Expand Up @@ -1917,3 +1922,18 @@ def _write_line_integral_conv_2d_max_noise_value(
name = self._reform_name(vtk_attr_name)
vtk_set_meth = getattr(klass, 'Set' + vtk_attr_name)
self._write_trait(out, name, t_def, vtk_set_meth, mapped=False)

def _write_cylinder_source_lat_long_tessellation(
self, klass, out, vtk_attr_name
):
if vtk_attr_name != 'LatLongTessellation':
raise RuntimeError(f"Wrong attribute name: {vtk_attr_name}")
if vtk_major_version >= 9:
message = ("vtkCylinderSource: "
"LatLongTesselation not updatable "
"(VTK 9.3 bug - value not properly initialized)")
print(message)
t_def = 'tvtk_base.false_bool_trait'
name = self._reform_name(vtk_attr_name)
vtk_set_meth = getattr(klass, 'Set' + vtk_attr_name)
self._write_trait(out, name, t_def, vtk_set_meth, mapped=True)

0 comments on commit 92b973c

Please sign in to comment.