[vtkusers] Basic question, vtkStructuredPoints

REGAT-BARREL Aurélien arbvtk at yahoo.fr
Wed Feb 11 20:14:39 EST 2004


Hello,
Can you show us how is declared self.scalars ?  Keep in mind that if you win CPU time by skipping file access, you lose memory place by having your data loaded in Python. I don't really know how the wrapping layer & SetVoidArray work, but I would not be surprised to learn that the data are duplicated by VTK.
Is it so slow to load your 81x81x1 object ?
 
Aurélien REGAT-BARREL

Oeyvind Knudsen <knudsen at operamail.com> wrote:
Hi!
Thanks for the tip. Actually, I tried something similar:

spData = vtkStructuredPoints()
spData.SetDimensions(81, 81, 1)
spData.SetOrigin(0.0, 0.0, 0.0)
spData.SetSpacing(1.0, 1.0, 1.0)
pData = spData.GetPointData()
dArray = vtkDoubleArray()
dArray.SetName("double Array")
dArray.SetVoidArray("self.scalars", len(self.scalars), 1)
pData.SetScalars(dArray)

(self.scalars is the array of data given as argument)

Would this be similar to your suggestion? The problem here is that the resulting object spData, does not look like the vtkStructuredPoints object obtained from the file at all. 
In fact the object given from the file reader looks quite empty, with no point data, no array, no nothing, not even the dimensions set correctly. Despite that, the surface is rendered. 
		
---------------------------------
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040212/b6005b7d/attachment.htm>


More information about the vtkusers mailing list