VTKFIG  0.20.20181114
Easy VTK based in situ visualization
int main ( void  )
Examples:
examples/example-custom.cxx, examples/example-custom1.cxx, examples/example-multifig.cxx, examples/example-rectcontour2d.cxx, examples/example-rectcontour3d.cxx, examples/example-rectquiver2d.cxx, examples/example-simplexcontour2d.cxx, examples/example-simplexcontour3d.cxx, examples/example-simplexquiver2d.cxx, and examples/example-xyplot.cxx.

Definition at line 248 of file example-axis.cxx.

249 {
250 
251 
252  auto frame=vtkfig::Frame::New();
253  auto plot=myplot0::New();
254 
255 
256  frame->AddFigure(plot);
257  frame->Interact();
258 
259 
260 
261 #if 0
262  while (ii <nspin)
263  {
264 
265  for (int i=0; i<Nx; i++)
266  for (int j=0; j<Ny; j++)
267  z[j*Nx+i] = G(x[i],y[j],t);
268 
269  float vmax=-10000;
270  float vmin=10000;
271  for (int j = 0; j < Ny; j++)
272  {
273  for (int i = 0; i < Nx; i++)
274  {
275  int k=j*Nx+i;
276  float v=z[k];
277  vmin=std::min(v,vmin);
278  vmax=std::max(v,vmax);
279  double p[3];
280  points->GetPoint(k,p);
281  p[2]=v;
282  points->SetPoint(k,p);
283  colors->InsertComponent(k, 0,v);
284  }
285  }
286 
287  points->Modified();
288  colors->Modified();
289  gridfunc->Modified();
290 
291  lut->SetTableRange(vmin,vmax);
292  lut->Modified();
293 
294  frame->Show();
295 
296 
297  t+=dt;
298  auto t1=std::chrono::system_clock::now();
299  double dt=std::chrono::duration_cast<std::chrono::duration<double>>(t1-t0).count();
300  double i1=ii;
301  if (dt>4.0)
302  {
303  printf("Frame rate: %.2f fps\n",(double)(i1-i0)/4.0);
304  t0=std::chrono::system_clock::now();
305  i0=ii;
306  fflush(stdout);
307  }
308  ii++;
309  }
310 #endif
311 }
static std::shared_ptr< Frame > New()
Create frame with multiple subframes.
Definition: vtkfigFrame.h:54
double G(double x, double y, double t)
static std::shared_ptr< myplot0 > New()

+ Here is the call graph for this function: