| 602 | } |
| 603 | |
| 604 | void vtkParallelCoordinatesView::ManipulateAxes(unsigned long eventId) |
| 605 | { |
| 606 | vtkParallelCoordinatesInteractorStyle* style = |
| 607 | vtkParallelCoordinatesInteractorStyle::SafeDownCast(this->GetInteractorStyle()); |
| 608 | vtkParallelCoordinatesRepresentation* rep = |
| 609 | vtkParallelCoordinatesRepresentation::SafeDownCast(this->GetRepresentation()); |
| 610 | |
| 611 | double cursorPosition[2], cursorLastPosition[2], cursorStartPosition[2]; |
| 612 | style->GetCursorCurrentPosition(this->GetRenderer(), cursorPosition); |
| 613 | style->GetCursorLastPosition(this->GetRenderer(), cursorLastPosition); |
| 614 | style->GetCursorStartPosition(this->GetRenderer(), cursorStartPosition); |
| 615 | |
| 616 | double dx = cursorPosition[0] - cursorLastPosition[0]; |
| 617 | double dy = cursorPosition[1] - cursorLastPosition[1]; |
| 618 | |
| 619 | if (eventId == vtkCommand::StartInteractionEvent) |
| 620 | { |
| 621 | } |
| 622 | else if (eventId == vtkCommand::InteractionEvent) |
| 623 | { |
| 624 | if (this->SelectedAxisPosition >= 0) |
| 625 | { |
| 626 | if (AxisHighlightPosition == VTK_HIGHLIGHT_CENTER) |
| 627 | { |
| 628 | double xpos = rep->GetXCoordinateOfPosition(this->SelectedAxisPosition); |
| 629 | this->SelectedAxisPosition = |
| 630 | rep->SetXCoordinateOfPosition(this->SelectedAxisPosition, xpos + dx); |
| 631 | this->SetAxisHighlightPosition(rep, this->SelectedAxisPosition); |
| 632 | } |
| 633 | else |
| 634 | { |
| 635 | double range[] = { 0.0, 0.0 }; |
| 636 | rep->GetRangeAtPosition(this->SelectedAxisPosition, range); |
| 637 | |
| 638 | if (AxisHighlightPosition == VTK_HIGHLIGHT_MAX) |
| 639 | { |
| 640 | range[1] += dy * (range[1] - range[0]); |
| 641 | } |
| 642 | else if (AxisHighlightPosition == VTK_HIGHLIGHT_MIN) |
| 643 | { |
| 644 | range[0] += dy * (range[1] - range[0]); |
| 645 | } |
| 646 | rep->SetRangeAtPosition(this->SelectedAxisPosition, range); |
| 647 | } |
| 648 | } |
| 649 | } |
| 650 | else if (eventId == vtkCommand::EndInteractionEvent) |
| 651 | { |
| 652 | this->SelectedAxisPosition = -1; |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | void vtkParallelCoordinatesView::SelectData(unsigned long eventId) |
| 657 | { |
no test coverage detected