------------------------------------------------------------------------------
| 125 | |
| 126 | //------------------------------------------------------------------------------ |
| 127 | void vtkTextActor::GetBoundingBox(vtkViewport* vport, double bbox[4]) |
| 128 | { |
| 129 | if (this->UpdateRectangle(vport) && this->RectanglePoints && |
| 130 | this->RectanglePoints->GetNumberOfPoints() >= 4) |
| 131 | { |
| 132 | double x[3]; |
| 133 | this->RectanglePoints->GetPoint(0, x); |
| 134 | bbox[0] = bbox[1] = x[0]; |
| 135 | bbox[2] = bbox[3] = x[1]; |
| 136 | for (int i = 1; i < this->RectanglePoints->GetNumberOfPoints(); ++i) |
| 137 | { |
| 138 | this->RectanglePoints->GetPoint(i, x); |
| 139 | |
| 140 | if (bbox[0] > x[0]) |
| 141 | bbox[0] = x[0]; |
| 142 | else if (bbox[1] < x[0]) |
| 143 | bbox[1] = x[0]; |
| 144 | |
| 145 | if (bbox[2] > x[1]) |
| 146 | bbox[2] = x[1]; |
| 147 | else if (bbox[3] < x[1]) |
| 148 | bbox[3] = x[1]; |
| 149 | } |
| 150 | // Use pixel centers rather than pixel corners for the coordinates. |
| 151 | --bbox[1]; |
| 152 | --bbox[3]; |
| 153 | } |
| 154 | else |
| 155 | { |
| 156 | vtkErrorMacro("UpdateRectangle failed to do so"); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | //------------------------------------------------------------------------------ |
| 161 | void vtkTextActor::GetSize(vtkViewport* vport, double size[2]) |
no test coverage detected