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

Method BuildAxes

Rendering/Annotation/vtkPolarAxesActor.cxx:715–879  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

713
714//------------------------------------------------------------------------------
715void 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);

Callers 1

RenderOpaqueGeometryMethod · 0.95

Calls 15

AutoScaleMethod · 0.95
CalculateBoundsMethod · 0.95
SetTitleAlignLocationMethod · 0.80
GetTitleActorMethod · 0.80
GetExponentActorMethod · 0.80
GetLabelFollowerMethod · 0.80
fmodFunction · 0.50

Tested by

no test coverage detected