| 831 | } |
| 832 | |
| 833 | void vtkParallelCoordinatesView::Zoom(unsigned long eventId) |
| 834 | { |
| 835 | vtkParallelCoordinatesInteractorStyle* style = |
| 836 | vtkParallelCoordinatesInteractorStyle::SafeDownCast(this->GetInteractorStyle()); |
| 837 | vtkParallelCoordinatesRepresentation* rep = |
| 838 | vtkParallelCoordinatesRepresentation::SafeDownCast(this->GetRepresentation()); |
| 839 | |
| 840 | double p1[2], size[2], p2[2]; |
| 841 | rep->GetPositionAndSize(p1, size); |
| 842 | p2[0] = p1[0] + size[0]; |
| 843 | p2[1] = p1[1] + size[1]; |
| 844 | |
| 845 | double cursorPosition[2], cursorLastPosition[2], cursorStartPosition[2]; |
| 846 | style->GetCursorCurrentPosition(this->GetRenderer(), cursorPosition); |
| 847 | style->GetCursorLastPosition(this->GetRenderer(), cursorLastPosition); |
| 848 | style->GetCursorStartPosition(this->GetRenderer(), cursorStartPosition); |
| 849 | |
| 850 | double v1[2] = { cursorStartPosition[0] - p1[0], cursorStartPosition[1] - p1[1] }; |
| 851 | double v2[2] = { cursorStartPosition[0] - p2[0], cursorStartPosition[1] - p2[1] }; |
| 852 | |
| 853 | double dy = -(cursorPosition[1] - cursorLastPosition[1]); |
| 854 | |
| 855 | if (eventId == vtkCommand::StartInteractionEvent) |
| 856 | { |
| 857 | } |
| 858 | else if (eventId == vtkCommand::InteractionEvent) |
| 859 | { |
| 860 | double p1new[2] = { p1[0] + dy * v1[0], p1[1] + dy * v1[1] }; |
| 861 | double p2new[2] = { p2[0] + dy * v2[0], // - p1new[0], |
| 862 | p2[1] + dy * v2[1] }; // - p1new[1]}; |
| 863 | |
| 864 | double sizenew[] = { p2new[0] - p1new[0], p2new[1] - p1new[1] }; |
| 865 | |
| 866 | rep->SetPositionAndSize(p1new, sizenew); |
| 867 | this->SetAxisHighlightPosition(rep, this->SelectedAxisPosition); |
| 868 | } |
| 869 | else if (eventId == vtkCommand::EndInteractionEvent) |
| 870 | { |
| 871 | } |
| 872 | } |
| 873 | |
| 874 | void vtkParallelCoordinatesView::Pan(unsigned long eventId) |
| 875 | { |
no test coverage detected