------------------------------------------------------------------------------ Update the WorldToData transformation matrix, which is just the inverse of the vtkProp3D matrix.
| 473 | // Update the WorldToData transformation matrix, which is just the |
| 474 | // inverse of the vtkProp3D matrix. |
| 475 | void vtkImageResliceMapper::UpdateWorldToDataMatrix(vtkImageSlice* prop) |
| 476 | { |
| 477 | // copy the matrix, but only if it has changed (we do this to |
| 478 | // preserve the modified time of the matrix) |
| 479 | double tmpmat[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }; |
| 480 | if (!prop->GetIsIdentity()) |
| 481 | { |
| 482 | vtkMatrix4x4::Invert(*prop->GetMatrix()->Element, tmpmat); |
| 483 | } |
| 484 | double* mat = *this->WorldToDataMatrix->Element; |
| 485 | for (int i = 0; i < 16; i++) |
| 486 | { |
| 487 | if (mat[i] != tmpmat[i]) |
| 488 | { |
| 489 | this->WorldToDataMatrix->DeepCopy(tmpmat); |
| 490 | break; |
| 491 | } |
| 492 | } |
| 493 | } |
| 494 | |
| 495 | //------------------------------------------------------------------------------ |
| 496 | // Update the SliceToWorld transformation matrix |
no test coverage detected