[vtkusers] vtkPoints

David Thompson dcthomp at sandia.gov
Mon Nov 18 19:51:57 EST 2002


Hi,
	When I call vtkPoints::SetDataTypeToDouble(), it
appears to be changing the NumberOfComponents of the underlying
DataArray to 1 (from 3). Is this intentional? It seems kind of
counterintuitive. Here's an example using vtkpython (same problem
in C++, too):

from vtk.required import *
pt = vtkPoints()
pt.SetDataTypeToDouble()
pt.InsertNextPoint( 1., 0.3, 0. )
pt.InsertNextPoint( .2, 0.3, 0. )
pt.GetPoint(0)
# You should get garbage for the y & z coordinates here

print "Coords are %d-D" % pt.GetData().GetNumberOfComponents()
# Prints "Coords are 1-D"

Everything works as expected without the call to SetDataTypeToDouble.
It seems to me that vtkPoints::SetDataType() should call
	this->Data->SetNumberOfComponents(3);
and perhaps reset the bounds at some, err, point...

		David





More information about the vtkusers mailing list