[vtkusers] how to map UnstructuredGrid?
nikhil butala
nvbutala at yahoo.com
Tue Jun 8 02:51:35 EDT 2004
VTKUsers,
I am new to vtk and have a very simple question. I am trying to visualize an UnstructuredGrid using VTK file format. I get the following error:
Error E2034 C:\groupsinC.cxx 40: Cannot convert 'vtkUnstructuredGrid *' to 'vtkDataSet *' in function main()
Error E2342 C:\groupsinC.cxx 40: Type mismatch in parameter 'input' (wanted 'vtkDataSet *',got 'vtkUnstructuredGrid *') in function main()
*** 2 errors in Compile ***
Relevant part of my code is as follows:
vtkDataSetReader *reader1 = vtkDataSetReader::New();
reader1->SetFileName ("C:/hola.vtk");
reader1->SetScalarsName("groups");
reader1->SetVectorsName("velocity");
vtkThreshold *thresh = vtkThreshold::New();
thresh->SetAttributeModeToUseCellData();
thresh->ThresholdByUpper(1);
thresh-> AllScalarsOff();
thresh-> SetInput(reader1->GetOutput());
vtkDataSetMapper *mapper = vtkDataSetMapper::New();
mapper->SetInput(thresh->GetOutput() );
vtkActor *actor = vtkActor::New();
actor->SetMapper(mapper);
actor->GetProperty()->SetColor(.2, .2, .2);
actor->GetProperty()->SetRepresentationToWireframe();
So I don't know what mapper to use to map Unstructured grid. Can someone help me out?
Thanking you,
Yours Sincerely,
Nikhil Butala
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040607/4e81c83f/attachment.htm>
More information about the vtkusers
mailing list