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

Louis le Grange louis at softflo.com
Thu Jul 25 08:46:51 EDT 2002


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




More information about the vtkusers mailing list