diff --git a/tvtk/common.py b/tvtk/common.py
index 77a141d..f6f704a 100644
a
|
b
|
|
11 | 11 | import vtk |
12 | 12 | |
13 | 13 | vtk_major_version = vtk.vtkVersion.GetVTKMajorVersion() |
| 14 | vtk_minor_version = vtk.vtkVersion.GetVTKMinorVersion() |
14 | 15 | |
15 | 16 | ###################################################################### |
16 | 17 | # Utility functions. |
… |
… |
def get_tvtk_name(vtk_name): |
46 | 47 | def is_old_pipeline(): |
47 | 48 | return vtk_major_version < 6 |
48 | 49 | |
| 50 | def is_version_62(): |
| 51 | return vtk_major_version == 6 and vtk_minor_version == 2 |
| 52 | |
49 | 53 | def configure_connection(obj, inp): |
50 | 54 | """ Configure topology for vtk pipeline obj.""" |
51 | 55 | if hasattr(inp, 'output_port'): |
diff --git a/tvtk/tests/test_vtk_parser.py b/tvtk/tests/test_vtk_parser.py
index 8a4f31e..28a8c4d 100644
a
|
b
|
def test_parse(self): |
136 | 136 | |
137 | 137 | res = ['BackfaceRender', 'DeepCopy', 'Render'] |
138 | 138 | if hasattr(obj, 'GetTexture'): |
139 | | if vtk_major_version == 6 and vtk_minor_version >= 1: |
| 139 | if vtk_major_version == 6: |
140 | 140 | res = ['AddShaderVariable', 'BackfaceRender', 'DeepCopy', |
141 | | 'ReleaseGraphicsResources', 'RemoveAllTextures', 'RemoveTexture', |
142 | | 'Render'] |
| 141 | 'ReleaseGraphicsResources', 'RemoveAllTextures', |
| 142 | 'RemoveTexture', 'Render'] |
| 143 | if vtk_minor_version == 2: |
| 144 | res.append('VTKTextureUnit') |
143 | 145 | else: |
144 | 146 | res = ['AddShaderVariable', 'BackfaceRender', 'DeepCopy', |
145 | 147 | 'LoadMaterial', 'LoadMaterialFromString', |
diff --git a/tvtk/vtk_parser.py b/tvtk/vtk_parser.py
index c5407bc..0ffec78 100644
a
|
b
|
|
7 | 7 | # License: BSD Style. |
8 | 8 | |
9 | 9 | import re |
| 10 | import types |
10 | 11 | |
11 | 12 | # Local imports (these are relative imports for a good reason). |
12 | 13 | import class_tree |
13 | 14 | import vtk_module as vtk |
14 | | |
| 15 | from common import is_version_62 |
15 | 16 | |
16 | 17 | class VTKMethodParser: |
17 | 18 | """This class provides useful methods for parsing methods of a VTK |
… |
… |
def get_method_signature(self, method): |
299 | 300 | A VTK method object. |
300 | 301 | |
301 | 302 | """ |
| 303 | # VTK 6.2 false built in funcs/methods are ignored |
| 304 | if is_version_62(): |
| 305 | built_in_func = isinstance(method, types.BuiltinFunctionType) |
| 306 | built_in_meth = isinstance(method, types.BuiltinMethodType) |
| 307 | if not (built_in_func or built_in_meth): |
| 308 | return None |
302 | 309 | # Remove all the C++ function signatures. |
303 | 310 | doc = method.__doc__ |
304 | 311 | doc = doc[:doc.find('\n\n')] |
diff --git a/tvtk/wrapper_gen.py b/tvtk/wrapper_gen.py
index ed4b4d2..7936a87 100644
a
|
b
|
|
16 | 16 | |
17 | 17 | # Local imports (these are relative imports because the package is not |
18 | 18 | # installed when these modules are imported). |
19 | | from common import get_tvtk_name, camel2enthought |
| 19 | from common import get_tvtk_name, camel2enthought, is_version_62 |
20 | 20 | import vtk_parser |
21 | 21 | import indenter |
22 | 22 | import special_gen |
… |
… |
def _gen_other_methods(self, klass, out): |
744 | 744 | vtk_meth = getattr(klass, m) |
745 | 745 | self._write_tvtk_method(out, vtk_meth) |
746 | 746 | |
| 747 | |
747 | 748 | ################################################################# |
748 | 749 | # Private utility methods. |
749 | 750 | ################################################################# |
… |
… |
def _write_tvtk_method(self, out, vtk_meth, sig=None): |
1042 | 1043 | If None, this is computed. If not, the passed signature |
1043 | 1044 | information is used. |
1044 | 1045 | """ |
1045 | | if not sig: |
| 1046 | if sig is None: |
1046 | 1047 | sig = self.parser.get_method_signature(vtk_meth) |
| 1048 | |
| 1049 | # VTK 6.2: There exists no method signature for false built in |
| 1050 | # functions/methods |
| 1051 | if sig is None: |
| 1052 | return |
1047 | 1053 | |
1048 | 1054 | # Figure out if we really need to wrap the return and deref |
1049 | 1055 | # the args. |