MCPcopy Create free account
hub / github.com/Kitware/VTK / ProcessKeyEvents

Method ProcessKeyEvents

Interaction/Widgets/vtkCameraPathWidget.cxx:273–302  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

271
272//------------------------------------------------------------------------------
273void vtkCameraPathWidget::ProcessKeyEvents(vtkObject*, unsigned long event, void* clientdata, void*)
274{
275 vtkCameraPathWidget* self = static_cast<vtkCameraPathWidget*>(clientdata);
276 vtkCameraPathRepresentation* rep = vtkCameraPathRepresentation::SafeDownCast(self->WidgetRep);
277 char* cKeySym = self->Interactor->GetKeySym();
278 std::string keySym = cKeySym != nullptr ? cKeySym : "";
279 std::transform(keySym.begin(), keySym.end(), keySym.begin(), ::toupper);
280 if (event == vtkCommand::KeyPressEvent)
281 {
282 if (keySym == "X")
283 {
284 rep->SetXTranslationAxisOn();
285 }
286 else if (keySym == "Y")
287 {
288 rep->SetYTranslationAxisOn();
289 }
290 else if (keySym == "Z")
291 {
292 rep->SetZTranslationAxisOn();
293 }
294 }
295 else if (event == vtkCommand::KeyReleaseEvent)
296 {
297 if (keySym == "X" || keySym == "Y" || keySym == "Z")
298 {
299 rep->SetTranslationAxisOff();
300 }
301 }
302}
303
304//------------------------------------------------------------------------------
305void vtkCameraPathWidget::PrintSelf(ostream& os, vtkIndent indent)

Callers

nothing calls this directly

Calls 4

GetKeySymMethod · 0.80
transformFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected