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

Method UpdateKeyMatrices

Rendering/WebGPU/vtkWebGPUActor.cxx:237–275  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

235
236//------------------------------------------------------------------------------
237bool vtkWebGPUActor::UpdateKeyMatrices()
238{
239 auto& internals = (*this->Internals);
240 vtkMTimeType rwTime = 0;
241 if (this->CoordinateSystem != WORLD && this->CoordinateSystemRenderer)
242 {
243 rwTime = this->CoordinateSystemRenderer->GetVTKWindow()->GetMTime();
244 }
245
246 // has the actor changed or is in device coords?
247 if (this->GetMTime() > internals.ModelTransformsLastUpdated ||
248 rwTime > internals.ModelTransformsLastUpdated || this->CoordinateSystem == DEVICE)
249 {
250 this->GetModelToWorldMatrix(internals.MCWCMatrix);
251
252 internals.MCWCMatrix->Transpose();
253
254 if (this->GetIsIdentity())
255 {
256 internals.NormalMatrix->Identity();
257 }
258 else
259 {
260 internals.NormalTransform->SetMatrix(this->Matrix);
261 vtkMatrix4x4* mat4 = internals.NormalTransform->GetMatrix();
262 for (int i = 0; i < 3; ++i)
263 {
264 for (int j = 0; j < 3; ++j)
265 {
266 internals.NormalMatrix->SetElement(i, j, mat4->GetElement(i, j));
267 }
268 }
269 }
270 internals.NormalMatrix->Invert();
271 internals.ModelTransformsLastUpdated.Modified();
272 return true;
273 }
274 return false;
275}
276
277//------------------------------------------------------------------------------
278const void* vtkWebGPUActor::GetCachedActorInformation()

Callers 1

CacheActorTransformsMethod · 0.95

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