[vtkusers] contour plot from tecplot files
Ahmad
falahatpisheh at gmail.com
Sat Feb 18 03:28:32 EST 2012
Hi All,
I have a problem in getting a correct contour plot from reading tecplot
files. I did the following but I get a contour which is completely white.
The Tecplot file has X, Y, U, V, MAG, FLAG variables. Could someone help me
with this?
vtkCompositeDataPipeline* exec = vtkCompositeDataPipeline::New();
vtkSmartPointer<vtkTecplotReader> reader =
vtkSmartPointer<vtkTecplotReader>::New();
reader->SetFileName("myfile.dat");
reader->Update();
vtkSmartPointer<vtkCompositeDataGeometryFilter> geom =
vtkSmartPointer<vtkCompositeDataGeometryFilter>::New();
geom->SetExecutive(exec);
geom->SetInputConnection(0,reader->GetOutputPort(0));
geom->Update();
vtkSmartPointer<vtkPolyData> data = geom->GetOutput();
data->GetPointData()->SetScalars( data->GetPointData()->GetArray("V") );
vtkSmartPointer<vtkPolyDataMapper> mapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInput(data);
vtkSmartPointer<vtkActor> Actor = vtkSmartPointer<vtkActor>::New();
Actor->SetMapper(mapper);
vtkSmartPointer<vtkRenderer> Renderer = vtkSmartPointer<vtkRenderer>::New();
Renderer->AddActor(Actor);
Thanks,
Ahmad
--
View this message in context: http://vtk.1045678.n5.nabble.com/contour-plot-from-tecplot-files-tp5494923p5494923.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list