[vtk-developers] Recent changes
Berk Geveci
berk.geveci at kitware.com
Tue Feb 13 16:52:32 EST 2001
My mistake. Instead of
|> 2) The field data methods for adding/setting arrays
|> will change.
|> It will not be possible to do
|>
|> fd->SetField(i, array);
|> fd->SetFieldName(i, name);
|>
|> This will be replaced by:
|> array->SetName(name);
|> fd->AddArray(name);
I meant to say:
It will not be possible to do
fd->SetArray(i, array);
fd->SetArrayName(i, name);
This will be replaced by:
array->SetName(name);
fd->AddArray(array);
Note that vtkDataArray will have a Name ivar.
As for the number of arrays, I did exactly what you recommended:
SetNumberOfArrays() is now an empty function (for backwards
compatibility). There is a SetMaximumNumberOfArrays().
GetNumberOfArrays() returns the number of "used" arrays (all of
them non-null, it is not possible to add a null array). There
is a RemoveArray(name) method, which will remove an array and
shift the ones with larger indices left.
What I am trying to remove is code relying on the index of the
arrays. It is ok to iterate over all the arrays with
for(int i=0; i<fd->GetNumberOfArrays(); i++)
{
do something to fd->GetArray(i);
}
but the user shouldn't assume that array 2 is what it used to be
when they first set it. I am also trying to make the interface
as simple as possible. Right now, you can add an array with
AddArray(), AddReplaceArray(), AddNoReplaceArray(), SetArray()...
By the way, you can keep doing fd->AddArray() as many time as you
want because field will expand itself (of course this is not
efficient). This functionality was there. I didn't change it.
Please keep commenting. I want to add all the required functionality
before I check in the change.
Berk
More information about the vtk-developers
mailing list