VTKFIG  0.20.20181114
Easy VTK based in situ visualization
int vtkfig::Figure::RTProcessPlaneKey ( const std::string  plane,
int  idim,
const std::string  key,
bool &  edit,
vtkSmartPointer< vtkCutter >  planecut 
)
protected

Process keyboard and mouse move events for plane section editing.

Definition at line 272 of file vtkfigFigure.cxx.

278  {
279 
280  if (!edit && key==plane)
281  {
282  edit=true;
283  RTShowPlanePos(planecut,plane,idim);
284  return 1;
285  }
286 
287  if (edit && key=="Return")
288  {
289  double planepos;
290  int i=planecut->GetNumberOfContours();
291  if (i>0)
292  planepos=planecut->GetValue(i-1);
293  else
294  planepos=0.0;
295  planecut->SetValue(i,planepos);
296  RTShowPlanePos(planecut,plane,idim);
297  return 1;
298  }
299 
300  if (edit&& key=="Delete")
301  {
302  int i=planecut->GetNumberOfContours();
303  if (i>0)
304  planecut->SetNumberOfContours(i-1);
305 
306  RTShowPlanePos(planecut,plane,idim);
307  return 1;
308  }
309 
310  if (edit&& key=="Escape")
311  {
312  edit=false;
313  return 1;
314  }
315 
316  return 0;
317  }
struct vtkfig::Figure::@1 edit
edit state
void RTShowPlanePos(vtkSmartPointer< vtkCutter > planecut, const std::string plane, int idim)

+ Here is the call graph for this function: