diff Framework/Toolbox/Slice.cpp @ 89:f244018a4e4b wasm

BUGGY- trying to remove IVolumeSlicesObserver
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 26 May 2017 18:27:59 +0200
parents ffa6dded91bd
children af312ce4fe59
line wrap: on
line diff
--- a/Framework/Toolbox/Slice.cpp	Fri May 26 16:11:52 2017 +0200
+++ b/Framework/Toolbox/Slice.cpp	Fri May 26 18:27:59 2017 +0200
@@ -170,4 +170,18 @@
         
     return converter_;
   }
+
+
+  bool Slice::ContainsPlane(const SliceGeometry& plane) const
+  {
+    if (type_ == Type_Invalid)
+    {
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
+    }
+        
+    return (GeometryToolbox::IsParallel(GetGeometry().GetNormal(), plane.GetNormal()) &&
+            GeometryToolbox::IsNear(GetGeometry().ProjectAlongNormal(GetGeometry().GetOrigin()),
+                                    GetGeometry().ProjectAlongNormal(plane.GetOrigin()),
+                                    thickness_ / 2.0));
+  }
 }