VTKFIG  0.20.20181114
Easy VTK based in situ visualization
void vtkfig::Figure::RTProcessKey ( const std::string  key)
protectedvirtual

Process keyboard and mouse move events.

Reimplemented in vtkfig::GridView.

Definition at line 383 of file vtkfigFigure.cxx.

384  {
385 
386  if (key=="I" && state.spacedim==3)
387  {
388 // state.show_isolines=!state.show_isolines;
389  state.show_isosurfaces=!state.show_isosurfaces;
390  // isoline_plot->SetVisibility(state.show_isolines);
391  isosurface_plot->SetVisibility(state.show_isosurfaces);
393  isosurface_plot->Modified();
394  return;
395  }
396 
397  if (key=="S" && state.spacedim==2)
398  {
399  state.show_surface=!state.show_surface;
400  state.show_isolines=!state.show_isolines;
401  isoline_plot->SetVisibility(state.show_isolines);
402  surface_plot->SetVisibility(state.show_surface);
403  isoline_plot->Modified();
404  surface_plot->Modified();
405  return;
406  }
407 
408  if (key=="E" && state.spacedim==2)
409  {
410  state.show_elevation=!state.show_elevation;
411  elevation_plot->SetVisibility(state.show_elevation);
412  elevation_plot->Modified();
413  return;
414  }
415 
416  if (key=="A")
417  {
418  if (axes)
419  {
420  int vis=axes->GetVisibility();
421  vis=!vis;
422  axes->SetVisibility(vis);
423  if (outline)
424  outline->SetVisibility(vis);
425  }
426  return;
427  }
428 
429  if (key=="O")
430  {
431  if (splot)
432  {
433  int vis=splot->GetVisibility();
434  vis=!vis;
435  splot->SetVisibility(vis);
436  }
437  return;
438  }
439 
440 
441 
442 
443  if (key=="L")
444  {
445  isoline_filter->SetNumberOfContours(11);
446  state.isolevels_locked=false;
447  GenIsolevels();
448  if (edit.l_iso)
449  {
450  state.isolevels_locked=true;
451  RTShowIsolevel();
452  }
453  return;
454  }
455 
456  if (
457  (edit.x_plane||edit.y_plane|| edit.z_plane|| edit.l_iso || edit.a_scale)
458  &&(key=="x"|| key=="y"|| key=="z"|| key=="l" || key=="a")
459  )
460  {
461  edit.x_plane=false;
462  edit.y_plane=false;
463  edit.z_plane=false;
464  edit.l_iso=false;
465  edit.a_scale=false;
466  }
467 
468  if (RTProcessArrowKey(key,edit.a_scale)) return;
469  if (RTProcessIsoKey(key,edit.l_iso)) return;
470  if (RTProcessPlaneKey("x",0,key,edit.x_plane, planecutX)) return;
471  if (RTProcessPlaneKey("y",1,key,edit.y_plane, planecutY)) return;
472  if (RTProcessPlaneKey("z",2,key,edit.z_plane, planecutZ)) return;
473  }
vtkSmartPointer< vtkActor > outline
Definition: vtkfigFigure.h:237
vtkSmartPointer< vtkCutter > planecutY
Definition: vtkfigFigure.h:204
vtkSmartPointer< vtkCutter > planecutX
Cutters for plane sections.
Definition: vtkfigFigure.h:203
int RTProcessArrowKey(const std::string key, bool &edit)
Process keyboard events for quiver arrow editing etc.
vtkSmartPointer< vtkActor > splot
Definition: vtkfigFigure.h:238
vtkSmartPointer< vtkCubeAxesActor2D > axes
Definition: vtkfigFigure.h:236
vtkSmartPointer< vtkContourFilter > isoline_filter
Definition: vtkfigFigure.h:224
vtkSmartPointer< vtkActor > surface_plot
Items for surface plot.
Definition: vtkfigFigure.h:230
struct vtkfig::Figure::@1 edit
edit state
vtkSmartPointer< vtkActor > isoline_plot
Items for isoline plot.
Definition: vtkfigFigure.h:223
void GenIsolevels()
Generate isolevels after minmax data known.
struct vtkfig::Figure::@0 state
figure state
vtkSmartPointer< vtkActor > isosurface_plot
Items for isosurface plot.
Definition: vtkfigFigure.h:219
int RTProcessPlaneKey(const std::string plane, int idim, const std::string key, bool &edit, vtkSmartPointer< vtkCutter > planecut)
Process keyboard and mouse move events for plane section editing.
void RTUpdateIsoSurfaceFilter()
vtkSmartPointer< vtkCutter > planecutZ
Definition: vtkfigFigure.h:205
int RTProcessIsoKey(const std::string key, bool &edit)
Process keyboard and mouse move events for isolevel editing.
vtkSmartPointer< vtkActor > elevation_plot
Items for elevation plot.
Definition: vtkfigFigure.h:227

+ Here is the call graph for this function: