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

Method BuildAxes

Rendering/Annotation/vtkCubeAxesActor.cxx:1105–1366  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1103
1104//------------------------------------------------------------------------------
1105void vtkCubeAxesActor::BuildAxes(vtkViewport* viewport)
1106{
1107 if ((this->GetMTime() < this->BuildTime.GetMTime()) && !this->StickyAxes)
1108 {
1109 this->AutoScale(viewport);
1110 return;
1111 }
1112
1113 this->SetNonDependentAttributes();
1114
1115 // Reset range in case of bounds type changed
1116 if (this->LastUseOrientedBounds != this->UseOrientedBounds)
1117 {
1118 this->XAxisRange[0] = this->XAxisRange[1] = VTK_DOUBLE_MAX;
1119 this->YAxisRange[0] = this->YAxisRange[1] = VTK_DOUBLE_MAX;
1120 this->ZAxisRange[0] = this->ZAxisRange[1] = VTK_DOUBLE_MAX;
1121 this->LastUseOrientedBounds = this->UseOrientedBounds;
1122 }
1123
1124 // determine the bounds to use (input, prop, or user-defined)
1125 double bounds[6];
1126 if (this->UseOrientedBounds != 0)
1127 {
1128 this->GetOrientedBounds(bounds);
1129 }
1130 else
1131 {
1132 if (this->StickyAxes)
1133 {
1134 this->GetViewportLimitedBounds(viewport, bounds);
1135 }
1136 else
1137 {
1138 this->GetBounds(bounds);
1139 }
1140 }
1141
1142 // Setup the axes for plotting
1143 double xCoords[NUMBER_OF_ALIGNED_AXIS][6];
1144 double yCoords[NUMBER_OF_ALIGNED_AXIS][6];
1145 double zCoords[NUMBER_OF_ALIGNED_AXIS][6];
1146
1147 // these arrays are accessed by 'location': mm, mX, XX, or Xm.
1148 int mm1[4] = { 0, 0, 1, 1 };
1149 int mm2[4] = { 0, 1, 1, 0 };
1150
1151 // Compute axes end-points
1152 int i;
1153 for (i = 0; i < NUMBER_OF_ALIGNED_AXIS; i++)
1154 {
1155 if (this->UseAxisOrigin == 0)
1156 {
1157 xCoords[i][0] = bounds[0] * this->AxisBaseForX[0] +
1158 bounds[2 + mm1[i]] * this->AxisBaseForY[0] + bounds[4 + mm2[i]] * this->AxisBaseForZ[0];
1159 xCoords[i][1] = bounds[0] * this->AxisBaseForX[1] +
1160 bounds[2 + mm1[i]] * this->AxisBaseForY[1] + bounds[4 + mm2[i]] * this->AxisBaseForZ[1];
1161 xCoords[i][2] = bounds[0] * this->AxisBaseForX[2] +
1162 bounds[2 + mm1[i]] * this->AxisBaseForY[2] + bounds[4 + mm2[i]] * this->AxisBaseForZ[2];

Callers 1

RenderGeometryMethod · 0.95

Calls 15

AutoScaleMethod · 0.95
AdjustAxesMethod · 0.95
AdjustValuesMethod · 0.95
AdjustRangeMethod · 0.95
ComputeTickSizeMethod · 0.95
BuildLabelsMethod · 0.95
UpdateLabelsMethod · 0.95
MaxOfMethod · 0.95
ComputeMaxLabelLengthMethod · 0.80
ComputeTitleLengthMethod · 0.80

Tested by

no test coverage detected