You will need SetArray method from the concrete implementation of
vtkDataArray. I could not quickly find in the source code any hints
about the underlying storage ordering, but it is trivial to find out
experimentally. Just post the results please. If it is the same as yours
no copying is needed.
Dominik
John R. Cary wrote:
Thanks for your response. A few more questions.
Dominik Szczerba wrote:
Depends what format you are talking about. Converting to legacy VTK,
yes, this is inefficient in every regard.
Apologies for not knowing about legacy VTK. Does this imply that the
newer VTK uses C ordering by default? If so, in what version did it
change?
Thanks again.....John Cary
If you are knowledgable to program in hdf5 you may consider writing a
plugin that will import your data without file conversions. However,
you will probably have to convert rank-2 arrays anyway:
// FIXME can it be done smarter
for(int j=0; j<array->GetNumberOfTuples(); j++)
{
for(int i=0; i<array->GetNumberOfComponents(); i++)
{
array->SetComponent(j,i,data(j+1,i+1));
}
}
where data is a fortran style array. I wonder too if SetData would
work here.
-- Dominik
John R. Cary wrote:
I have arrays written out from C into HDF5 using the HDF5 C
API, and so in the file the arrays are in C ordering. I now
need to read them into VTK. AFAICT, VTK is Fortran ordering,
even though it is written in C++. So that means I need to
reverse the ordering. Of course, I can write a loop to do
this, but is there some standard way that VTK folks do this?
I don't want to reinvent the wheel.
Sorry for what is likely an elementary question, but I could
not find it on the FAQ or after googling quite a bit.
Thanks so much......John Cary
--
Dominik Szczerba, Ph.D.
Foundation for Research
on Information Technologies in Society
http://www.itis.ethz.ch
_______________________________________________
ParaView mailing list
[email protected]
http://www.paraview.org/mailman/listinfo/paraview