MCPcopy Create free account
hub / github.com/Kitware/VTK / GetKeyMatrices

Method GetKeyMatrices

Rendering/OpenGL2/vtkOpenGLActor.cxx:109–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void 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}
148VTK_ABI_NAMESPACE_END

Callers 10

SetShaderParametersMethod · 0.45
SetShaderParametersMethod · 0.45
RenderMethod · 0.45
ApplyStencilMethod · 0.45
RenderMethod · 0.45

Calls 10

GetVTKWindowMethod · 0.80
GetModelToWorldMatrixMethod · 0.80
GetMTimeMethod · 0.45
TransposeMethod · 0.45
IdentityMethod · 0.45
SetMatrixMethod · 0.45
GetMatrixMethod · 0.45
SetElementMethod · 0.45
InvertMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected