[vtkusers] Specifying FieldData Array names in VC++

mccoy j.mccoy at gmx.de
Tue Jul 22 05:14:17 EDT 2003


Hi all,

does anybody know if there is a special way to adress an FieldDataArray by Name in VC++ ? Somehow i allways get the error: 'Can't find array/component requested'. I tried the same code in tcl and it works fine. 

here the code i used:

tcl:

vtkDataSetReader readGeom
    readGeom SetFileName "E:/3p.vtk"

vtkDataObjectReader readAttr
    readAttr SetFileName "E:/0scalar.vtk"

vtkMergeDataObjectFilter merge
    merge SetInput [readGeom GetOutput]
    merge SetDataObject [readAttr GetOutput]

vtkFieldDataToAttributeDataFilter fd2ad
    fd2ad SetInput [merge GetOutput]
    fd2ad SetOutputAttributeDataToPointData
    fd2ad SetScalarComponent 0 SCALAR_0 0     # <---------

VC++:

dsReader = vtkDataSetReader::New();
dsReader->SetFileName("E:\\3p.vtk");
 
doReader = vtkDataObjectReader::New();
doReader->SetFileName("E:\\0scalar.vtk");

mdof = vtkMergeDataObjectFilter::New();
mdof->SetInput(dsReader->GetOutput() );
mdof->SetDataObject(doReader->GetOutput(0) );

fd2ad = vtkFieldDataToAttributeDataFilter::New();
fd2ad->SetInput(mdof->GetOutput() );
fd2ad->SetOutputAttributeDataToPointData();
fd2ad->SetScalarComponent(0, "SCALAR_0", 0);    // <---------------

the Data File containing the FieldData :

# vtk DataFile Version 2.0 
Scalardata 
ASCII 
FIELD scalarData 1
SCALAR_0 1 3470 float
 6.300000E+02
 6.300000E+02
 6.300000E+02
 6.300000E+02
    ...

has anybody an idea, why the VC++ code doesn't work? Many thanks in advanced

Joseph





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030722/f1aa28c4/attachment.htm>


More information about the vtkusers mailing list