[vtkusers] can you create a vtkPoints(VTK_DOUBLE)

Will Schroeder will.schroeder at kitware.com
Fri Jan 26 08:36:35 EST 2001


Hi Matthias -

The data can be  stored in native format, i.e., double (there's a 
vtkDoubleArray under the hood) if you create the points:

vtkPoints *pts = vtkPoints::New();
pts->SetDataTypeToDouble();

The generic API to points uses floats or doubles (i.e., there is a 
SetPoint(float) and SetPoint(double)) Also, you can reach under the hood, 
get the data array, and grab a pointer to doubles. So you can work 
generically, using the float/double API, or if you need to, you can work 
with a pointer to native type. (If you look at the imaging pipeline you can 
see that there is a lot of switching going on based on data type...this 
functionality is slowly creeping into the "graphics" pipeline.)

You may be working why templates weren't used: the reason for this is 
partially historical: templates didn't work well in 1993 when vtk began.

Will



At 06:40 PM 1/25/2001 +0100, Matthias Kronenberger wrote:
>Or, are the Points stored as a float anyway?
>Why is bounds a float?
>Why can't you get a double* via GetPoint?
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20010126/c6fa9221/attachment.htm>


More information about the vtkusers mailing list