[vtk-developers] vtkArray and Python

Timothy Shead tshead at sandia.gov
Mon Apr 18 17:17:51 EDT 2011


Gang:

If I wanted to create a sparse array of doubles in Python, it would look 
like the following:

   array = vtkArray.CreateArray(vtkArray.SPARSE, 11)

where "11" is the value for VTK_DOUBLE, which I knew to look-up in 
vtkType.h.  I'm wondering whether there's an enumeration of VTK types 
anywhere that's Python-accessible.  Otherwise, I'd be inclined to put 
such an enumeration in vtkArray, so I could write

   array = vtkArray.CreateArray(vtkArray.SPARSE, vtkArray.DOUBLE)

... any thoughts?  Objections?  It would be duplicating the enumeration 
in vtkType.h, but it seems to be justifiable for purposes of 
discoverability ...

Cheers,
Tim

-- 
Timothy M. Shead
Sandia National Laboratories
1461, Scalable Analysis and Visualization




More information about the vtk-developers mailing list