diff Framework/Toolbox/DicomStructureSet.cpp @ 988:4c9b4c4de814 toa2019090901

Fixed bug in DicomStructureSet that prevented points from being added to polygons
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 09 Sep 2019 16:15:28 +0200
parents c20dbaab360c
children 1f74bc3459ba
line wrap: on
line diff
--- a/Framework/Toolbox/DicomStructureSet.cpp	Mon Sep 09 15:18:24 2019 +0200
+++ b/Framework/Toolbox/DicomStructureSet.cpp	Mon Sep 09 16:15:28 2019 +0200
@@ -149,7 +149,7 @@
     }
   }
 
-  bool DicomStructureSet::Polygon::IsPointOnSlice(const Vector& v) const
+  bool DicomStructureSet::Polygon::IsPointOnSliceIfAny(const Vector& v) const
   {
     if (hasSlice_)
     {
@@ -171,7 +171,7 @@
     }
     else
     {
-      return false;
+      return true;
     }
   }
 
@@ -179,7 +179,7 @@
   {
 #if 1
     // BGO 2019-09-03
-    if (IsPointOnSlice(v))
+    if (IsPointOnSliceIfAny(v))
     {
       points_.push_back(v);
     }
@@ -217,7 +217,7 @@
         
         for (Points::const_iterator it = points_.begin(); it != points_.end(); ++it)
         {
-          if (IsPointOnSlice(*it))
+          if (IsPointOnSliceIfAny(*it))
           {
             double x, y;
             geometry.ProjectPoint(x, y, *it);