[vtk-developers] Python and mutable test failing for modular
David Gobbi
david.gobbi at gmail.com
Mon Mar 19 17:27:11 EDT 2012
Hi Marcus,
The vtk.mutable class is a special VTK/Python type, it is needed to
handle pass-by-reference (see Wrapping/Python/README_WRAP.txt for
rationale). Its header is PyVTKMutableObject.h, but this header isn't
wrapped to create a python object, this header _is_ a python object.
The python name of this custom class is simply "mutable", or
"vtk.mutable" to be more precise because it ends up in the vtk
namespace.
At the very end of vtkWrapPythonInit.c there is some code that adds it
to the vtkCommonPython module:
/* extra object for the Common module */
if (strcmp(libName, "vtkCommonPython") == 0)
{
/* the PyVTKMutableObject */
files[numFiles] = strdup("mutable");
numFiles++;
}
The code for PyVTKMutableObject.cxx is actually in vtkPythonCore, but
vtkPythonCore is not a python module (it's just a shared library) so
it was still necessary to add "mutable" to the dict of one of the
python modules. And vtkCommonPython seemed to be the most obvious
choice.
Hmm... I don't know if I did a very good job of explaining. To make a
long story short, there was special code (shown above) in
vtkWrapPythonInit.c that added "mutable" to the list of python objects
for vtkCommonPython.
- David
On Mon, Mar 19, 2012 at 3:01 PM, Marcus D. Hanwell
<marcus.hanwell at kitware.com> wrote:
> Hi,
>
> I am working my way through a few of the failing tests in VTK modular,
> and came across the vtk.mutable test. I don't see where mutable is
> defined, it is possible I missed a special header or something. In
> general, I wondered how we would like to handle these failures as we
> verify the functionality of modularized VTK. This failure says that
> vtk.mutable is not defined, and so can't be used.
>
> I am close to having the Tcl wrapping working (it is building, but no
> modules are imported yet) and may need some pointers there too if
> anyone remembers how some of those things work.
>
> Thanks,
>
> Marcus
More information about the vtk-developers
mailing list