changeset 1162:709aa65aca17 broker

recovery of USE_BOOST_UNION_FOR_POLYGONS
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 19 Nov 2019 19:04:15 +0100
parents 19b1c8caade4
children ba9db2ad317c
files Framework/Toolbox/DicomStructureSet.cpp Framework/Toolbox/DicomStructureSet.h
diffstat 2 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Toolbox/DicomStructureSet.cpp	Tue Nov 19 17:30:05 2019 +0100
+++ b/Framework/Toolbox/DicomStructureSet.cpp	Tue Nov 19 19:04:15 2019 +0100
@@ -884,13 +884,24 @@
 
 #ifdef USE_BOOST_UNION_FOR_POLYGONS 
       std::vector<BoostPolygon> projected;
+
+      for (Polygons::const_iterator polygon = structure.polygons_.begin();
+           polygon != structure.polygons_.end(); ++polygon)
+      {
+        double x1, y1, x2, y2;
+
+        if (polygon->Project(x1, y1, x2, y2, slice))
+        {
+          projected.push_back(CreateRectangle(x1, y1, x2, y2));
+        }
+      }
 #else
       // this will contain the intersection of the polygon slab with
       // the cutting plane, projected on the cutting plane coord system 
       // (that yields a rectangle) + the Z coordinate of the polygon 
       // (this is required to group polygons with the same Z later)
       std::vector<std::pair<RtStructRectangleInSlab, double> > projected;
-#endif
+
       for (Polygons::const_iterator polygon = structure.polygons_.begin();
            polygon != structure.polygons_.end(); ++polygon)
       {
@@ -909,6 +920,8 @@
             static_cast<float>(y2)),curZ));
         }
       }
+#endif
+
 #ifndef USE_BOOST_UNION_FOR_POLYGONS
       // projected contains a set of rectangles specified by two opposite
       // corners (x1,y1,x2,y2)
--- a/Framework/Toolbox/DicomStructureSet.h	Tue Nov 19 17:30:05 2019 +0100
+++ b/Framework/Toolbox/DicomStructureSet.h	Tue Nov 19 19:04:15 2019 +0100
@@ -26,7 +26,7 @@
 #include "Extent2D.h"
 #include "../Scene2D/Color.h"
 
-//#define USE_BOOST_UNION_FOR_POLYGONS 1
+#define USE_BOOST_UNION_FOR_POLYGONS 1
 
 #include <Plugins/Samples/Common/FullOrthancDataset.h>