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

Method ManipulateAxes

Views/Infovis/vtkParallelCoordinatesView.cxx:604–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

602}
603
604void 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
656void vtkParallelCoordinatesView::SelectData(unsigned long eventId)
657{

Callers 1

ProcessEventsMethod · 0.95

Calls 11

GetRepresentationMethod · 0.80
GetCursorLastPositionMethod · 0.80
GetRangeAtPositionMethod · 0.80
GetInteractorStyleMethod · 0.45
GetRendererMethod · 0.45
SetRangeAtPositionMethod · 0.45

Tested by

no test coverage detected