98int Test(
int argc,
char* argv[],
const char* dfile,
const InitializationCallback& initCallback)
101 char* fname = vtkTestUtilities::ExpandDataFileName(argc, argv, dfile);
102 reader->SetFileName(fname);
105 reader->SetTimeResolution(100);
106 reader->UpdateInformation();
110 const int numTimeSteps = outInfo->
Length(SDDP::TIME_STEPS());
112 if (numTimeSteps != 100)
114 std::cerr <<
"ERROR: missing timesteps. Potential issue reading the CFG file." << std::endl;
121 renWin->AddRenderer(renderer);
124 iren->SetRenderWindow(renWin);
127 mapper->SetInputConnection(reader->GetOutputPort());
130 actor->SetMapper(mapper);
131 renderer->AddActor(actor);
133 initCallback(renWin, renderer, reader);
135 std::vector<double> ts(numTimeSteps);
136 outInfo->
Get(SDDP::TIME_STEPS(), ts.data());
140 reader->UpdateTimeStep(ts[numTimeSteps / 2]);
141 mapper->SetInputDataObject(reader->GetOutputDataObject(0));
144 const int retVal = vtkTesting::Test(argc, argv, renWin, 10);
145 if (retVal == vtkTesting::DO_INTERACTOR)
148 data.Window = renWin;
149 data.Reader = reader;
150 data.Mapper = mapper;
152 data.CurrentIndex = numTimeSteps / 2;
155 observer->SetClientData(&data);
159 std::cout <<
"Entering interactive mode......" << std::endl
160 <<
"Supported operations:" << std::endl
161 <<
" 'z' or 'Z' : go to next time step" << std::endl
162 <<
" 'x' or 'X' : go to previous time step" << std::endl
163 <<
" 'c' or 'C' : play animation from start to end" << std::endl
164 <<
" 'q' or 'Q' : quit" << std::endl;
168 else if (retVal == vtkTesting::NOT_RUN)
170 return VTK_SKIP_RETURN_CODE;
172 else if (retVal == vtkTesting::PASSED)