------------------------------------------------------------------------------ Position text with respect to a point (xTick) where the angle of the line from the point to the center of the text is given by theta. The offset is the spacing between ticks and labels.
| 1152 | // from the point to the center of the text is given by theta. The offset |
| 1153 | // is the spacing between ticks and labels. |
| 1154 | void vtkAxisActor2D::SetOffsetPosition( |
| 1155 | double xTick[3], double theta, int stringWidth, int stringHeight, int offset, vtkActor2D* actor) |
| 1156 | { |
| 1157 | double x, y, center[2]; |
| 1158 | int pos[2]; |
| 1159 | |
| 1160 | x = stringWidth / 2.0 + offset; |
| 1161 | y = stringHeight / 2.0 + offset; |
| 1162 | |
| 1163 | center[0] = xTick[0] + x * std::sin(theta); |
| 1164 | center[1] = xTick[1] - y * std::cos(theta); |
| 1165 | |
| 1166 | pos[0] = static_cast<int>(center[0] - stringWidth / 2.0); |
| 1167 | pos[1] = static_cast<int>(center[1] - stringHeight / 2.0); |
| 1168 | |
| 1169 | actor->SetPosition(pos[0], pos[1]); |
| 1170 | } |
| 1171 | |
| 1172 | //------------------------------------------------------------------------------ |
| 1173 | void vtkAxisActor2D::ShiftPosition( |
nothing calls this directly
no test coverage detected