[vtk-developers] Ongoing changes to AttributeData etc

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Tue Sep 18 05:54:49 EDT 2001


I notice that Berk has just checked in some tweaks to DataArrays with 
regard to names and thought I'd rattle off a quick post...

Last week I had a number of interrelated problems with regard to DataArray 
names and Types. It seems that the changeover to the new way of working is 
on the whole a success but a few niggles creep in. (I like it a lot by the 
way - ridding us of separate scalars and whatnot is definitely a good 
thing, lots of field arrays is much better)

I was taking the output of IdFilter and Glyph3D (with PointID's turned on) 
and Appendpolydata failed to work as vtkIdTypeArray was not being appended. 
A few fixes solved the problem, there was another error that I think was my 
fault (I now know why).
A series of PolyData objects being appended with scalars set was generating 
an output with the scalars set to "array_123456" instead of the name passed 
in "FieldStrengthdBuv/m". I added a
scalars->SetName(in_scalars->GetName()) line but forgot to mention it in 
CVS checkin.

The reason behind this was because I was doing this...
MyFilter::Execute(...)
   FloatArray *f = floatarray::New()....
   ...
   output->GetPointData()->AddArray(f);
   output->GetPointData()->SetScalars(f);

This appears to be wrong and I'm now doing
   output->GetPointData()->AddArray(f);
   output->GetPointData()->SetActiveScalars("FieldStrengthdBuv/m");
though it'd be much tidier to say this, (shall I add it?)
   output->GetPointData()->SetActiveScalars(f);

Now I'm wondering, if I fix all my code to use the above instead of the 
SetScalars(f) (which appears to be the wrong thing to do, [but I didn't 
know because nobody told us about the SetActiveScalars function!] - is the 
fix in Appendpolydata to copy the array names still required. I have a 
sneaking suspicion that I put in a fix that was only needed to solve a 
problem that occurred when you set the scalars to one of the field arrays, 
but did it wrong.

I'm not sure if this all makes sense, but I feel I ought to mention it in case
a) I've missed some fundamental point in the way the arrays operate - is 
SetActiveScalars the correct way to flag my array?
b) I've broken anything

ttfn

JB






More information about the vtk-developers mailing list