Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/DicomStructureSet.cpp @ 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 | 53cc787bd7bc |
children | 1644de437a7b |
comparison
equal
deleted
inserted
replaced
1161:19b1c8caade4 | 1162:709aa65aca17 |
---|---|
882 #if 1 | 882 #if 1 |
883 // Sagittal or coronal projection | 883 // Sagittal or coronal projection |
884 | 884 |
885 #ifdef USE_BOOST_UNION_FOR_POLYGONS | 885 #ifdef USE_BOOST_UNION_FOR_POLYGONS |
886 std::vector<BoostPolygon> projected; | 886 std::vector<BoostPolygon> projected; |
887 | |
888 for (Polygons::const_iterator polygon = structure.polygons_.begin(); | |
889 polygon != structure.polygons_.end(); ++polygon) | |
890 { | |
891 double x1, y1, x2, y2; | |
892 | |
893 if (polygon->Project(x1, y1, x2, y2, slice)) | |
894 { | |
895 projected.push_back(CreateRectangle(x1, y1, x2, y2)); | |
896 } | |
897 } | |
887 #else | 898 #else |
888 // this will contain the intersection of the polygon slab with | 899 // this will contain the intersection of the polygon slab with |
889 // the cutting plane, projected on the cutting plane coord system | 900 // the cutting plane, projected on the cutting plane coord system |
890 // (that yields a rectangle) + the Z coordinate of the polygon | 901 // (that yields a rectangle) + the Z coordinate of the polygon |
891 // (this is required to group polygons with the same Z later) | 902 // (this is required to group polygons with the same Z later) |
892 std::vector<std::pair<RtStructRectangleInSlab, double> > projected; | 903 std::vector<std::pair<RtStructRectangleInSlab, double> > projected; |
893 #endif | 904 |
894 for (Polygons::const_iterator polygon = structure.polygons_.begin(); | 905 for (Polygons::const_iterator polygon = structure.polygons_.begin(); |
895 polygon != structure.polygons_.end(); ++polygon) | 906 polygon != structure.polygons_.end(); ++polygon) |
896 { | 907 { |
897 double x1, y1, x2, y2; | 908 double x1, y1, x2, y2; |
898 | 909 |
907 static_cast<float>(y1), | 918 static_cast<float>(y1), |
908 static_cast<float>(x2), | 919 static_cast<float>(x2), |
909 static_cast<float>(y2)),curZ)); | 920 static_cast<float>(y2)),curZ)); |
910 } | 921 } |
911 } | 922 } |
923 #endif | |
924 | |
912 #ifndef USE_BOOST_UNION_FOR_POLYGONS | 925 #ifndef USE_BOOST_UNION_FOR_POLYGONS |
913 // projected contains a set of rectangles specified by two opposite | 926 // projected contains a set of rectangles specified by two opposite |
914 // corners (x1,y1,x2,y2) | 927 // corners (x1,y1,x2,y2) |
915 // we need to merge them | 928 // we need to merge them |
916 // each slab yields ONE polygon! | 929 // each slab yields ONE polygon! |