[vtkusers] Error in vtkStructuredGridReader
Thomas Obenaus
thomaso at eas.iis.fraunhofer.de
Tue Aug 5 06:14:20 EDT 2008
Hello,
i have a problem. I don't know if it's my fault or if the
vtkStructuredGridReader has a bug. I'm using VTK
via the offered Java-Wrapper.
All I want to do is to load a vtk-file with the vtkStructuredGridReader.
This data is special because there are defined two
dataset attributes of the same type (VECTORS). Per specification the
definition of more than one dataset attribute of the same type in one
file is allowed.
the problem is that I can't access the two vectorfields. Using the
function getVectors("name") should do that for me. But I can only get
the first vectorfield.
If I want to access the second one the function returns null.
Here is an example of the file I want to read:
# vtk DataFile Version 1.0
vtk output
ASCII
DATASET STRUCTURED_GRID
DIMENSIONS 5 2 1
POINTS 10 float
-3.00E+00 -3.00E+00 -3.00E+00
-3.00E+00 -3.00E+00 -5.00E-01
-3.00E+00 -3.00E+00 2.00E+00
-3.00E+00 -3.00E+00 4.50E+00
-3.00E+00 -3.00E+00 7.00E+00
-3.00E+00 3.00E+00 -3.00E+00
-3.00E+00 3.00E+00 -5.00E-01
-3.00E+00 3.00E+00 2.00E+00
-3.00E+00 3.00E+00 4.50E+00
-3.00E+00 3.00E+00 7.00E+00
POINT_DATA 10
VECTORS field1 float
-1.790149E-4 3.204499E-4 5.385784E-4
-1.790149E-4 3.204499E-4 -5.385784E-4
-2.197622E-4 2.168404E-19 8.989287E-4
-2.197622E-4 5.421011E-20 -8.989287E-4
-1.790149E-4 -3.204499E-4 5.385784E-4
-1.790149E-4 -3.204499E-4 -5.385784E-4
-1.790149E-4 -3.204499E-4 -5.385784E-4
-1.790149E-4 -3.204499E-4 5.385784E-4
-2.197622E-4 2.439455E-19 -8.989287E-4
-2.197622E-4 5.421011E-20 8.989287E-4
VECTORS field2 float
-1.790149E-4 3.204499E-4 5.385784E-4
-1.790149E-4 3.204499E-4 -5.385784E-4
-2.197622E-4 2.168404E-19 8.989287E-4
-2.197622E-4 5.421011E-20 -8.989287E-4
-1.790149E-4 -3.204499E-4 5.385784E-4
-1.790149E-4 -3.204499E-4 -5.385784E-4
-1.790149E-4 -3.204499E-4 -5.385784E-4
-1.790149E-4 -3.204499E-4 5.385784E-4
-2.197622E-4 2.439455E-19 -8.989287E-4
-2.197622E-4 5.421011E-20 8.989287E-4
For the functioncall vtkDataSet v1 =
reader.GetOutPut().GetPointData().GetVectors( "field1" ) I get the first
vectorfield (CORRECT).
But for the functioncall vtkDataSet v2 =
reader.GetOutPut().GetPointData().GetVectors( "field2" ) v2 is null
(FAILURE).
Thanks,
Thomas Obenaus.
More information about the vtkusers
mailing list