------------------------------------------------------------------------------ Utility for adjusting the window range to a new one. Usually the previous range was ([-1,+1],[-1,+1]) as per Ortho and Frustum, and you are mapping to the display coordinate range ([0,width-1],[0,height-1]).
| 213 | // previous range was ([-1,+1],[-1,+1]) as per Ortho and Frustum, and you |
| 214 | // are mapping to the display coordinate range ([0,width-1],[0,height-1]). |
| 215 | void vtkPerspectiveTransform::AdjustViewport(double oldXMin, double oldXMax, double oldYMin, |
| 216 | double oldYMax, double newXMin, double newXMax, double newYMin, double newYMax) |
| 217 | { |
| 218 | double matrix[4][4]; |
| 219 | vtkMatrix4x4::Identity(*matrix); |
| 220 | |
| 221 | matrix[0][0] = (newXMax - newXMin) / (oldXMax - oldXMin); |
| 222 | matrix[1][1] = (newYMax - newYMin) / (oldYMax - oldYMin); |
| 223 | |
| 224 | matrix[0][3] = (newXMin * oldXMax - newXMax * oldXMin) / (oldXMax - oldXMin); |
| 225 | matrix[1][3] = (newYMin * oldYMax - newYMax * oldYMin) / (oldYMax - oldYMin); |
| 226 | |
| 227 | this->Concatenate(*matrix); |
| 228 | } |
| 229 | |
| 230 | //------------------------------------------------------------------------------ |
| 231 | // Utility for adjusting the min/max range of the Z buffer. Usually |
no test coverage detected