[vtkusers] vtkMergeDataObjectFilter
mccoy
j.mccoy at gmx.de
Tue Jul 15 09:18:31 EDT 2003
thank you for answering so fast :-)
nope, in fact, i didn't. i just 'retyped' the tcl- example in cpp. meanwhile
i've discovered that the same code in tcl works... but still i need it in
vcpp.
can you tell me, where i have to assign the array-name? in the
DataObjectReader? or must i first create an array and read the scalar file
into it? till now, the name "scalar0" appears only in the vtk scalar-file
header.
----- Original Message -----
From: <dsjen at cs.unc.edu>
To: "mccoy" <j.mccoy at gmx.de>
Cc: <vtkusers at vtk.org>
Sent: Tuesday, July 15, 2003 3:05 PM
Subject: Re: [vtkusers] vtkMergeDataObjectFilter
> It might be that you're not setting the name properly. Did you use
> something like:
>
> array->SetName("scalar0");
>
> by using some sort of vtkArray?
>
> - Dennis
>
> ----- Original Message -----
> From: "mccoy" <j.mccoy at gmx.de>
> Date: Tuesday, July 15, 2003 7:49 am
> Subject: [vtkusers] vtkMergeDataObjectFilter
>
> > 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.
> >
> >
> >
>
More information about the vtkusers
mailing list