| 107 | } |
| 108 | |
| 109 | void vtkOpenGLActor::GetKeyMatrices(vtkMatrix4x4*& mcwc, vtkMatrix3x3*& normMat) |
| 110 | { |
| 111 | vtkMTimeType rwTime = 0; |
| 112 | if (this->CoordinateSystem != WORLD && this->CoordinateSystemRenderer) |
| 113 | { |
| 114 | rwTime = this->CoordinateSystemRenderer->GetVTKWindow()->GetMTime(); |
| 115 | } |
| 116 | |
| 117 | // has the actor changed or is in device coords? |
| 118 | if (this->GetMTime() > this->KeyMatrixTime || rwTime > this->KeyMatrixTime || |
| 119 | this->CoordinateSystem == DEVICE) |
| 120 | { |
| 121 | this->GetModelToWorldMatrix(this->MCWCMatrix); |
| 122 | |
| 123 | this->MCWCMatrix->Transpose(); |
| 124 | |
| 125 | if (this->GetIsIdentity()) |
| 126 | { |
| 127 | this->NormalMatrix->Identity(); |
| 128 | } |
| 129 | else |
| 130 | { |
| 131 | this->NormalTransform->SetMatrix(this->Matrix); |
| 132 | vtkMatrix4x4* mat4 = this->NormalTransform->GetMatrix(); |
| 133 | for (int i = 0; i < 3; ++i) |
| 134 | { |
| 135 | for (int j = 0; j < 3; ++j) |
| 136 | { |
| 137 | this->NormalMatrix->SetElement(i, j, mat4->GetElement(i, j)); |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | this->NormalMatrix->Invert(); |
| 142 | this->KeyMatrixTime.Modified(); |
| 143 | } |
| 144 | |
| 145 | mcwc = this->MCWCMatrix; |
| 146 | normMat = this->NormalMatrix; |
| 147 | } |
| 148 | VTK_ABI_NAMESPACE_END |
no test coverage detected