Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tvtk/vtk_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,10 @@ def _find_get_set_methods(self, klass, methods):
# These hang on Windows (and maybe Fedora 34)
elif (klass_name in ('vtkDataEncoder', 'vtkWebApplication')):
continue
# we can actually process it
# On VTK 9.5.2 we get
# Cannot set the undefined 'copy_global_ids' attribute of a 'PointData' object
elif (klass_name == "vtkDataSetAttributes" and method[3:] in ("CopyGlobalIds", "CopyNormals", "CopyPedigreeIds", "CopyScalars", "CopyTCoords", "CopyTensors", "CopyVectors")):
continue
elif ('Get' + method[3:]) in methods:
key = method[3:]
meths.remove('Set' + key)
Expand Down
19 changes: 15 additions & 4 deletions tvtk/wrapper_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,27 @@ def patch_default(vtk_get_meth, vtk_set_meth, default):

# Collect the signatures of the get method
# We only use the arguments
all_sigs = vtk_parser.VTKMethodParser.get_method_signature(vtk_get_meth)
# TODO: Unclear why this would be used... but for example if the Get method
# takes a string as an argument, we don't want that to be what we expect the
# *output* to be (which can be for example vtkDataArray*). But presumably
# this was here for a reason so let's just add exceptions for things that are
# known to be problematic on VTK 9.5.2...
all_sigs = []
#if vtk_get_meth.__name__ not in ("GetGlobalIds", "GetHigherOrderDegrees", "GetNormals", "GetPedigreeIds", "GetProcessIds", "GetRationalWeights", "GetScalars", "GetTCoords", "GetTensors", "GetVectors", "GetTangents"):
# all_sigs.extend(
# vtk_parser.VTKMethodParser.get_method_signature(vtk_get_meth)
# )

# Collect the signatures of the set method
all_sigs.extend(
vtk_parser.VTKMethodParser.get_method_signature(vtk_set_meth))
vtk_parser.VTKMethodParser.get_method_signature(vtk_set_meth)
)

for sig in all_sigs:
if sig[1] is None:
continue

if len(sig[1]) == 1:
if len(sig[1]) == 1 and not isinstance(sig[1][0], str):
# This unpacks tuple of something e.g. (('int', 'int', 'int'))
arg_formats.append(tuple(chain.from_iterable(sig[1])))

Expand All @@ -168,9 +178,10 @@ def patch_default(vtk_get_meth, vtk_set_meth, default):
default_mappings = {
'int' : 0,
'float': 0.0,
'string': ''
'string': '',
}

# vtkDataArray shows up but isn't used... causes problems
for arg_format in arg_formats:
try:
all_same_type = len(set(arg_format)) == 1
Expand Down
Loading