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

Method Pan

Views/Infovis/vtkParallelCoordinatesView.cxx:874–910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

872}
873
874void vtkParallelCoordinatesView::Pan(unsigned long eventId)
875{
876 vtkParallelCoordinatesInteractorStyle* style =
877 vtkParallelCoordinatesInteractorStyle::SafeDownCast(this->GetInteractorStyle());
878 vtkParallelCoordinatesRepresentation* rep =
879 vtkParallelCoordinatesRepresentation::SafeDownCast(this->GetRepresentation());
880
881 double p1[2], size[2], p2[2];
882 rep->GetPositionAndSize(p1, size);
883 p2[0] = p1[0] + size[0];
884 p2[1] = p1[1] + size[1];
885
886 double cursorPosition[2], cursorLastPosition[2], cursorStartPosition[2];
887 style->GetCursorCurrentPosition(this->GetRenderer(), cursorPosition);
888 style->GetCursorLastPosition(this->GetRenderer(), cursorLastPosition);
889 style->GetCursorStartPosition(this->GetRenderer(), cursorStartPosition);
890
891 double dx = cursorPosition[0] - cursorLastPosition[0];
892 double dy = cursorPosition[1] - cursorLastPosition[1];
893
894 if (eventId == vtkCommand::StartInteractionEvent)
895 {
896 }
897 else if (eventId == vtkCommand::InteractionEvent)
898 {
899 double p1new[2] = { p1[0] + dx, p1[1] + dy };
900 double p2new[2] = { p2[0] + dx, p2[1] + dy };
901
902 double sizenew[] = { p2new[0] - p1new[0], p2new[1] - p1new[1] };
903
904 rep->SetPositionAndSize(p1new, sizenew);
905 this->SetAxisHighlightPosition(rep, this->SelectedAxisPosition);
906 }
907 else if (eventId == vtkCommand::EndInteractionEvent)
908 {
909 }
910}
911
912void vtkParallelCoordinatesView::ApplyViewTheme(vtkViewTheme* theme)
913{

Callers 1

ProcessEventsMethod · 0.95

Calls 9

GetRepresentationMethod · 0.80
GetPositionAndSizeMethod · 0.80
GetCursorLastPositionMethod · 0.80
SetPositionAndSizeMethod · 0.80
GetInteractorStyleMethod · 0.45
GetRendererMethod · 0.45

Tested by

no test coverage detected