Commit 8257ef39 authored by Robert Maynard's avatar Robert Maynard
Browse files

ENH: Updating the tecplot test to include gunzip files.

parent 6ab8da6c
......@@ -38,6 +38,7 @@ int TestTecplotReader( int argc, char *argv[] )
// we have to use a composite pipeline
vtkCompositeDataPipeline* exec = vtkCompositeDataPipeline::New();
vtkCompositeDataPipeline* exec2 = vtkCompositeDataPipeline::New();
vtkCompositeDataPipeline* exec3 = vtkCompositeDataPipeline::New();
// Basic visualization.
vtkRenderWindow* renWin = vtkRenderWindow::New();
......@@ -76,6 +77,7 @@ int TestTecplotReader( int argc, char *argv[] )
vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);
//create the reader for the cell centered data set.
char* fname2 = vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/cellcentered.tec");
vtkSmartPointer<vtkTecplotReader> reader2 =
vtkSmartPointer<vtkTecplotReader>::New();
......@@ -104,9 +106,40 @@ int TestTecplotReader( int argc, char *argv[] )
vtkSmartPointer<vtkActor>::New();
actor2->SetMapper(mapper2);
//create the reader for the gzipped dataset
char* fname3 = vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/flow.tec.gz");
vtkSmartPointer<vtkTecplotReader> reader3 =
vtkSmartPointer<vtkTecplotReader>::New();
reader3->SetFileName(fname3);
reader3->SetDataArrayStatus("V",1); //both files have a property named V
reader3->Update();
delete [] fname3;
vtkSmartPointer<vtkCompositeDataGeometryFilter> geom3 =
vtkSmartPointer<vtkCompositeDataGeometryFilter>::New();
geom3->SetExecutive(exec3);
geom3->SetInputConnection(0,reader3->GetOutputPort(0));
geom3->Update();
vtkPolyData *data3 = geom3->GetOutput();
data3->GetPointData()->SetScalars( data3->GetPointData()->GetArray("V") );
vtkSmartPointer<vtkPolyDataMapper> mapper3 =
vtkSmartPointer<vtkPolyDataMapper>::New();
mapper3->SetInput(data3);
mapper3->ScalarVisibilityOn();
mapper3->SetColorModeToMapScalars();
mapper3->SetScalarRange(-0.3,0.3);
vtkSmartPointer<vtkActor> actor3 =
vtkSmartPointer<vtkActor>::New();
actor3->SetMapper(mapper3);
actor3->SetPosition(1,0,0);
ren->SetBackground(0.0,0.0,0.0);
ren->AddActor(actor);
ren->AddActor(actor2);
ren->AddActor(actor3);
renWin->SetSize(300,300);
vtkCamera *cam=ren->GetActiveCamera();
ren->ResetCamera();
......@@ -127,5 +160,6 @@ int TestTecplotReader( int argc, char *argv[] )
iren->Delete();
exec->Delete();
exec2->Delete();
exec3->Delete();
return !retVal;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment