| 1082 | } |
| 1083 | |
| 1084 | bool 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 | |
| 1113 | mitk::DoseImageVtkMapper2D::LocalStorage::~LocalStorage() |
| 1114 | { |
nothing calls this directly
no test coverage detected