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

Method UpdateAnimationPath

Charts/Core/vtkScatterPlotMatrix.cxx:576–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574}
575
576void vtkScatterPlotMatrix::UpdateAnimationPath(const vtkVector2i& newActivePos)
577{
578 this->Private->AnimationPath.clear();
579 if (newActivePos[0] != this->ActivePlot[0] || newActivePos[1] != this->ActivePlot[1])
580 {
581 if (newActivePos[1] >= this->ActivePlot[1])
582 {
583 // x direction first
584 if (this->ActivePlot[0] > newActivePos[0])
585 {
586 for (int r = this->ActivePlot[0] - 1; r >= newActivePos[0]; r--)
587 {
588 this->Private->AnimationPath.emplace_back(r, this->ActivePlot[1]);
589 }
590 }
591 else
592 {
593 for (int r = this->ActivePlot[0] + 1; r <= newActivePos[0]; r++)
594 {
595 this->Private->AnimationPath.emplace_back(r, this->ActivePlot[1]);
596 }
597 }
598 // then y direction
599 for (int c = this->ActivePlot[1] + 1; c <= newActivePos[1]; c++)
600 {
601 this->Private->AnimationPath.emplace_back(newActivePos[0], c);
602 }
603 }
604 else
605 {
606 // y direction first
607 for (int c = this->ActivePlot[1] - 1; c >= newActivePos[1]; c--)
608 {
609 this->Private->AnimationPath.emplace_back(this->ActivePlot[0], c);
610 }
611 // then x direction
612 if (this->ActivePlot[0] > newActivePos[0])
613 {
614 for (int r = this->ActivePlot[0] - 1; r >= newActivePos[0]; r--)
615 {
616 this->Private->AnimationPath.emplace_back(r, newActivePos[1]);
617 }
618 }
619 else
620 {
621 for (int r = this->ActivePlot[0] + 1; r <= newActivePos[0]; r++)
622 {
623 this->Private->AnimationPath.emplace_back(r, newActivePos[1]);
624 }
625 }
626 }
627 }
628}
629
630void vtkScatterPlotMatrix::StartAnimation(vtkRenderWindowInteractor* interactor)
631{

Callers 1

Calls 2

clearMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected