[vtkusers] vtkFieldDataToAttributeDataFilter with vcpp/ tcl

j.mccoy at gmx.de j.mccoy at gmx.de
Wed Jul 16 11:45:47 EDT 2003


hi,

is it possible that the vtkFieldDataToAttributeDataFilter only works fine 
with tcl? i tried to use it for merging various fielddata files with one 
geometryfile (in cooperation with vtkMergeDataObjectFilter) in vcpp6, but 
nothing seems to work. i always get the error : 'Can't find array/component 
requested'. i tried the same combination of geometry-and fielddata file 
with a test script in tcl and it works fine.

here an example of the vcpp code i tried:
	ugReader = vtkUnstructuredGridReader::New();
	ugReader->SetFileName("geo.vtk");

	doReader = vtkDataObjectReader::New();
	doReader->SetFileName("attrib.vtk");
	doReader->SetFieldDataName("ScalarData");

	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);

the attributefiles are formated like:
	# vtk DataFile Version 2.0 	Scalardata 	ASCII 	FIELD ScalarData 1
	scalar0 1 3470 float
	6.300000E+02
	6.300000E+02
	...

has anybody an idea of where i'm wrong in vcpp? or, has anybody an idea of 
another way, how to merge a geometryfile with various attribute-files?

thank you very much so far
Joseph


 



More information about the vtkusers mailing list