[vtkusers] Can I use double precision with VTK? (vtkPoints,SetDataTypeToDouble,GetPoint)

Malcolm Drummond malcolm at geovision.co.za
Thu Jul 25 09:51:56 EDT 2002


Hi Louis

I think you'll have to set the number of components to 3 after resetting
data-type.

vtkPoints sets the number of components on creation, but that array has been
deleted and replaced with a new one of type double - this will have the
default number of components ie. 1.

Hope this helps

Malcolm

----- Original Message -----
From: Louis le Grange <louis at softflo.com>
To: Vtkusers <vtkusers at public.kitware.com>
Sent: Thursday, July 25, 2002 2:46 PM
Subject: [vtkusers] Can I use double precision with VTK?
(vtkPoints,SetDataTypeToDouble,GetPoint)


> Hi,
>
> Is one suppose to be able to extract vertex data in double precision using
> (vtkPoints*)GetPoint?
>
> I am using SetDataTypeToDouble to force VTK 3.1 into working in double
> precision. I get junk when I look at the output.
>
> Perhaps my method of forcing VTK 3.1 to use double precision is faulty but
> here is my effort:
>
> vtkPoints* ptVertices = vtkPoints::New();
>
> // Insert dummy vertices at location zero
> double x[3];
> x[0] = 0.01;
> x[1] = 0.02;
> x[2] = 0.03;
> ptVertices->SetDataTypeToDouble();
> ptVertices->InsertPoint(0,x);
>
> // Extract points
>     double y[3];
> ptVertices->GetPoint(0,y);
>
> When NOT USING ptVertices->SetDataTypeToDouble() I get
>
> y[0] = 0.009999999776482
> y[1] = 0.019999999552965
> y[2] = 0.029999999329448
>
> When USING ptVertices->SetDataTypeToDouble() I get
>
> y[0] = 0.010000000000000
> y[1] = -9.2559631349318e+061
> y[2] = -9.2559631349318e+061
>
> Thanks,
> Louis
>
>
>
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.370 / Virus Database: 205 - Release Date: 2002/06/05
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>




More information about the vtkusers mailing list