/*========================================================================= Program: Visualization Toolkit Module: TestAVSucdReader.cxx Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #include #include #include #include #include #include #include #include #include #include #include int TestAVSucdReader(int argc, char* argv[]) { if (argc < 2) { std::cerr << "Required parameters: " << std::endl; return EXIT_FAILURE; } std::string filename = argv[1]; vtkNew reader; reader->SetFileName(filename.c_str()); reader->Update(); reader->Print(std::cout); reader->GetOutput()->Print(std::cout); vtkUnstructuredGrid* grid = vtkUnstructuredGrid::SafeDownCast(reader->GetOutput()); grid->GetPointData()->SetActiveScalars("temperature"); vtkNew mapper; mapper->SetInputData(reader->GetOutput()); mapper->ScalarVisibilityOn(); mapper->SetScalarRange(grid->GetPointData()->GetScalars()->GetRange()); vtkNew actor; actor->SetMapper(mapper); actor->GetProperty()->EdgeVisibilityOn(); vtkNew ren; ren->AddActor(actor); ren->SetBackground(0, 0, 0); vtkNew renWin; renWin->AddRenderer(ren); renWin->SetSize(300, 300); vtkNew iren; iren->SetRenderWindow(renWin); renWin->Render(); int r = vtkRegressionTestImage(renWin); if (r == vtkRegressionTester::DO_INTERACTOR) { iren->Start(); } return !r; }