vtkAttribute : If it looks like a bug...

John Biddiscombe j.biddiscombe at rl.ac.uk
Sun Mar 19 08:51:44 EST 2000


If it looks like a bug, smells like a bug, seems like a bug, but doesn't
actually do anything, then is it a bug?

consider

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

in vtkAttribute data SetDataTypeToDouble() deletes that data object and then
creates a new one. However, performing the above two lines causes the
vtkPoints object to have its number of components reset from 3 (x,y,z) to
just one. Oh dear.

Problem is, that although in my code this regularly hoses everything up and
I have to

vtkPoints *newpoints = vtkPoints::New();
newpoints->SetDataTypeToDouble();
newpoints->GetData()->SetNumberOfComponents(3);

to make it work. But in vtkDelaunay2D it doesn't do this and everything
works fine.

I smell a bug - but is it? (what have I missed).

I feel that vtkAttributeData should reset the numberof Components.

Whilst I'm at it. Any objection to adding
static vtkPoints::SetDefaultDataType(...)
to allow
vtkPoints::SetDefaultDataType(VTK_DOUBLE);

and have the constructor use this from then on?

John B


--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list