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

Method GetPhysicalToWorldMatrix

Rendering/Core/vtkRenderWindow.cxx:302–325  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

300
301//------------------------------------------------------------------------------
302void vtkRenderWindow::GetPhysicalToWorldMatrix(vtkMatrix4x4* physicalToWorldMatrix)
303{
304 if (!physicalToWorldMatrix)
305 {
306 return;
307 }
308
309 physicalToWorldMatrix->Identity();
310
311 // construct physical to non-scaled world axes (scaling is applied later)
312 double physicalZ_NonscaledWorld[3] = { -this->PhysicalViewDirection[0],
313 -this->PhysicalViewDirection[1], -this->PhysicalViewDirection[2] };
314 double* physicalY_NonscaledWorld = this->PhysicalViewUp;
315 double physicalX_NonscaledWorld[3] = { 0.0 };
316 vtkMath::Cross(physicalY_NonscaledWorld, physicalZ_NonscaledWorld, physicalX_NonscaledWorld);
317
318 for (int row = 0; row < 3; ++row)
319 {
320 physicalToWorldMatrix->SetElement(row, 0, physicalX_NonscaledWorld[row] * this->PhysicalScale);
321 physicalToWorldMatrix->SetElement(row, 1, physicalY_NonscaledWorld[row] * this->PhysicalScale);
322 physicalToWorldMatrix->SetElement(row, 2, physicalZ_NonscaledWorld[row] * this->PhysicalScale);
323 physicalToWorldMatrix->SetElement(row, 3, -this->PhysicalTranslation[row]);
324 }
325}
326
327//------------------------------------------------------------------------------
328bool vtkRenderWindow::GetDeviceToWorldMatrixForDevice(

Calls 3

CrossFunction · 0.50
IdentityMethod · 0.45
SetElementMethod · 0.45

Tested by

no test coverage detected