[vtkusers] vtkMergeDataObjectFilter
mccoy
j.mccoy at gmx.de
Tue Jul 15 07:49:28 EDT 2003
hi there,
i have problem that has allready been dealt with some time before in this archive, but nevertheless my code won't work. maybe someone can tell me what i'm doing wrong.
all right, here is my problem: i have a geometry (unstructured grid) and a lot of time steps of scalar data. now i want to read the geometry once and then merge it with some attribute-data of a special timestep.
following the answers in the archives i created one unstructured grid *.vtk file and a lot of fielddata- files containing the scalar- values of each timestep. now i wanted to mergethe geometry and a scalarfile with 'vtkMergeDataObjectFilter'. i did so using:
// m_reader: DataSetReader
// doReader: DataObjectReader
vtkMergeDataObjectFilter *mdof;
vtkFieldDataToAttributeDataFilter *fd2ad;
vtkDataSetMapper *dMapper;
...
mdof = vtkMergeDataObjectFilter::New();
mdof->SetInput(m_reader->GetOutput() );
mdof->SetDataObject(doReader->GetOutput() );
fd2ad = vtkFieldDataToAttributeDataFilter::New();
fd2ad->SetInput(mdof->GetOutput() );
fd2ad->SetOutputAttributeDataToPointData();
fd2ad->SetScalarComponent(0, "scalar0", 0);
dMapper = vtkDataSetMapper::New();
dMapper->SetInput(fd2ad->GetOutput() );
the scalar- files are formated like:
# vtk DataFile Version 2.0
Scalardata
ASCII
FIELD time0 1
scalar0 1 3470 float
6.300000E+02
6.300000E+02
6.300000E+02
...
now there is no compiler error (vcpp6.0), and the program runs. but it only shows the geometry, no scalar information. and i get the error:
error: vtkFieldDataToAttributeDataFilter (0x09D1B940): Can't find array/component requested
does anybody now where i'm wrong? How else should i run SetScalarComponent, or is there something complete different to use?
thank u all.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030715/0d4a3c48/attachment.htm>
More information about the vtkusers
mailing list