How to get a pointer on Numeric.array

Marcus Stojek stojek at part-gmbh.de
Thu Nov 28 12:57:53 EST 2002


Hi,
I am using vtk (a C graphic library) 
together with wxPython and Python 2.2
A certain function of vtk expects two arguments,
a pointer on an array of int and a special vtkarraytype.
My problem is the first argument. 
I am using Numeric.array to get a C-like representation
of my lists. But in my example ctarray does not seem to 
be a pointer on this list but something else.

Can anybody help?
Tanks,
marcus


#----snip --------------------
from vtk import *
import Numeric

    list1=[3,2,3,4,3,5,2,8,3,9,1,5]
    enumber=3
    earray=Numeric.array(list1)
    list2=[5,5,5]
    ctarray=Numeric.array(list2,'int')

    grid=vtkUnstructuredGrid()
    IdTArray=vtkIdTypeArray()
    IdTArray.SetVoidArray(earray,enumber,1)
    vtkCArray=vtkCellArray()
    vtkCArray.SetCells(enumber,IdTArray)
    grid.SetCells(ctarray,vtkCArray)
#----snip --------------------



More information about the Python-list mailing list