[vtkusers] SWIG + 64bits + VTK

Gheorghe Postelnicu gheorghe.postelnicu at gmail.com
Mon Aug 21 16:06:06 EDT 2006


Hi,

I am writing a simple module in Cpp that will process some data from a
vtk/python/tk GUI.

I try to use SWIG to wrap my module, so my code ended up being something like

cpp - void do_it(void* voidPolyData)
{ vtkPolyData* data = reinterpret_cast<vtkPolyData*>(voidPolyData); .... }

print "pointer = ", data.__this__
py - ModuleName.do_it(data.__this__)
where data is obviously some polyData object created in Python.

Unfortunately, my module crashes - see the trace below - notice how
the pointer address is different in Python and C++ - why?

Thanks (PS: I am a Python newbie and this is all exciting, but maybe
I'm missing something)

pointer =  _0000000000b4feb0_p_vtkPolyData
number of points in the polyData =

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 182894168448 (LWP 16677)]
0x0000002a9ed22b4d in do_it (vdata=0xb0feb40000000000)
   at /autofs/homes/011/postelni/symAsterix/code/mriScout/python/laplace.cpp:14
14        pdata->PrintSelf(std::cout,'\t');
Current language:  auto; currently c++
(gdb) print vdata
$1 = (void *) 0xb0feb40000000000

-- 
Gheorghe Postelnicu, PhD
MGH, Harvard Medical School



More information about the vtkusers mailing list