------------------------------------------------------------------------------
| 713 | |
| 714 | //------------------------------------------------------------------------------ |
| 715 | void vtkPolarAxesActor::BuildAxes(vtkViewport* viewport) |
| 716 | { |
| 717 | if (!this->Camera) |
| 718 | { |
| 719 | vtkWarningMacro("vtkPolarAxesActor requires a Camera to be built."); |
| 720 | return; |
| 721 | } |
| 722 | |
| 723 | if (this->GetMTime() < this->BuildTime.GetMTime()) |
| 724 | { |
| 725 | this->AutoScale(viewport); |
| 726 | return; |
| 727 | } |
| 728 | |
| 729 | // ---------- Angles check ----------- |
| 730 | // set angle range [0.0; 360.0] |
| 731 | this->MaximumAngle = std::fmod(this->MaximumAngle, 360); |
| 732 | this->MinimumAngle = std::fmod(this->MinimumAngle, 360); |
| 733 | |
| 734 | if (this->MaximumAngle < 0.0) |
| 735 | { |
| 736 | this->MaximumAngle += 360.0; |
| 737 | } |
| 738 | |
| 739 | // set angle range [0.0; 360.0] |
| 740 | if (this->MinimumAngle < 0.0) |
| 741 | { |
| 742 | this->MinimumAngle += 360.0; |
| 743 | } |
| 744 | |
| 745 | // this->MaximumAngle < this->MinimumAngle is possible, no swap |
| 746 | |
| 747 | if (!this->CheckMembersConsistency()) |
| 748 | { |
| 749 | return; |
| 750 | } |
| 751 | |
| 752 | // Determine the bounds |
| 753 | this->CalculateBounds(); |
| 754 | |
| 755 | // Set polar axis endpoints |
| 756 | vtkAxisActor* axis = this->PolarAxis; |
| 757 | |
| 758 | // compute ellipse angle |
| 759 | double miniAngleEllipse = vtkPolarAxesActor::ComputeEllipseAngle(this->MinimumAngle, this->Ratio); |
| 760 | |
| 761 | // Set the start point and end point (world coord system) of the Polar Axis. |
| 762 | double startPt[3], endPt[3]; |
| 763 | startPt[0] = this->Pole[0] + this->MinimumRadius * cos(miniAngleEllipse); |
| 764 | startPt[1] = this->Pole[1] + this->MinimumRadius * this->Ratio * sin(miniAngleEllipse); |
| 765 | startPt[2] = this->Pole[2]; |
| 766 | |
| 767 | endPt[0] = this->Pole[0] + this->MaximumRadius * cos(miniAngleEllipse); |
| 768 | endPt[1] = this->Pole[1] + this->MaximumRadius * this->Ratio * sin(miniAngleEllipse); |
| 769 | endPt[2] = this->Pole[2]; |
| 770 | |
| 771 | axis->GetPoint1Coordinate()->SetValue(startPt); |
| 772 | axis->GetPoint2Coordinate()->SetValue(endPt); |
no test coverage detected