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

Method RenderingGeometryIntersectsImage

Modules/RT/src/mitkDoseImageVtkMapper2D.cpp:1084–1111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1082}
1083
1084bool mitk::DoseImageVtkMapper2D::RenderingGeometryIntersectsImage(const PlaneGeometry *renderingGeometry,
1085 SlicedGeometry3D *imageGeometry)
1086{
1087 // if either one of the two geometries is nullptr we return true
1088 // for safety reasons
1089 if (renderingGeometry == nullptr || imageGeometry == nullptr)
1090 return true;
1091
1092 // get the distance for the first cornerpoint
1093 ScalarType initialDistance = renderingGeometry->SignedDistance(imageGeometry->GetCornerPoint(0));
1094 for (int i = 1; i < 8; i++)
1095 {
1096 mitk::Point3D cornerPoint = imageGeometry->GetCornerPoint(i);
1097
1098 // get the distance to the other cornerpoints
1099 ScalarType distance = renderingGeometry->SignedDistance(cornerPoint);
1100
1101 // if it has not the same signing as the distance of the first point
1102 if (initialDistance * distance < 0)
1103 {
1104 // we have an intersection and return true
1105 return true;
1106 }
1107 }
1108
1109 // all distances have the same sign, no intersection and we return false
1110 return false;
1111}
1112
1113mitk::DoseImageVtkMapper2D::LocalStorage::~LocalStorage()
1114{

Callers

nothing calls this directly

Calls 2

SignedDistanceMethod · 0.80
GetCornerPointMethod · 0.80

Tested by

no test coverage detected