MCPcopy Create free account
hub / github.com/MITK/MITK / SetCurrentWorldGeometry

Method SetCurrentWorldGeometry

Modules/Core/src/Rendering/mitkBaseRenderer.cpp:725–762  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

723}
724
725void mitk::BaseRenderer::SetCurrentWorldGeometry(const mitk::BaseGeometry* geometry)
726{
727 if (m_CurrentWorldGeometry == geometry)
728 {
729 return;
730 }
731
732 m_CurrentWorldGeometry = geometry;
733 if (geometry == nullptr)
734 {
735 m_Bounds[0] = 0;
736 m_Bounds[1] = 0;
737 m_Bounds[2] = 0;
738 m_Bounds[3] = 0;
739 m_Bounds[4] = 0;
740 m_Bounds[5] = 0;
741 m_EmptyWorldGeometry = true;
742 return;
743 }
744
745 BoundingBox::Pointer boundingBox = m_CurrentWorldGeometry->CalculateBoundingBoxRelativeToTransform(nullptr);
746 const BoundingBox::BoundsArrayType& worldBounds = boundingBox->GetBounds();
747 m_Bounds[0] = worldBounds[0];
748 m_Bounds[1] = worldBounds[1];
749 m_Bounds[2] = worldBounds[2];
750 m_Bounds[3] = worldBounds[3];
751 m_Bounds[4] = worldBounds[4];
752 m_Bounds[5] = worldBounds[5];
753
754 if (boundingBox->GetDiagonalLength2() <= mitk::eps)
755 {
756 m_EmptyWorldGeometry = true;
757 }
758 else
759 {
760 m_EmptyWorldGeometry = false;
761 }
762}
763
764void mitk::BaseRenderer::PrintSelf(std::ostream &os, itk::Indent indent) const
765{

Callers

nothing calls this directly

Calls 3

GetDiagonalLength2Method · 0.80
GetBoundsMethod · 0.45

Tested by

no test coverage detected