97int Test(
int argc,
char* argv[],
const char* dfile,
const InitializationCallback& initCallback)
100 char* fname = vtkTestUtilities::ExpandDataFileName(argc, argv, dfile);
101 reader->SetFileName(fname);
104 reader->SetTimeResolution(100);
105 reader->UpdateInformation();
109 const int numTimeSteps = outInfo->
Length(SDDP::TIME_STEPS());
111 if (numTimeSteps != 100)
113 cerr <<
"ERROR: missing timesteps. Potential issue reading the CFG file." << endl;
120 renWin->AddRenderer(renderer);
123 iren->SetRenderWindow(renWin);
126 mapper->SetInputConnection(reader->GetOutputPort());
129 actor->SetMapper(mapper);
130 renderer->AddActor(actor);
132 initCallback(renWin, renderer, reader);
134 std::vector<double> ts(numTimeSteps);
135 outInfo->
Get(SDDP::TIME_STEPS(), ts.data());
139 reader->UpdateTimeStep(ts[numTimeSteps / 2]);
140 mapper->SetInputDataObject(reader->GetOutputDataObject(0));
143 const int retVal = vtkTesting::Test(argc, argv, renWin, 10);
144 if (retVal == vtkTesting::DO_INTERACTOR)
147 data.Window = renWin;
148 data.Reader = reader;
149 data.Mapper = mapper;
151 data.CurrentIndex = numTimeSteps / 2;
154 observer->SetClientData(&data);
158 cout <<
"Entering interactive mode......" << endl
159 <<
"Supported operations:" << endl
160 <<
" 'z' or 'Z' : go to next time step" << endl
161 <<
" 'x' or 'X' : go to previous time step" << endl
162 <<
" 'c' or 'C' : play animation from start to end" << endl
163 <<
" 'q' or 'Q' : quit" << endl;
167 else if (retVal == vtkTesting::NOT_RUN)
169 return VTK_SKIP_RETURN_CODE;
171 else if (retVal == vtkTesting::PASSED)