Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Toolbox/DicomStructureSet.cpp @ 1905:e318b524ad3f
use UnionOfRectangles algorithm to render RT-STRUCT
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 31 Jan 2022 18:50:35 +0100 |
parents | 738814c24574 |
children | affde38b84de |
comparison
equal
deleted
inserted
replaced
1904:738814c24574 | 1905:e318b524ad3f |
---|---|
898 for (Polygons::const_iterator polygon = structure.polygons_.begin(); | 898 for (Polygons::const_iterator polygon = structure.polygons_.begin(); |
899 polygon != structure.polygons_.end(); ++polygon) | 899 polygon != structure.polygons_.end(); ++polygon) |
900 { | 900 { |
901 double x1, y1, x2, y2; | 901 double x1, y1, x2, y2; |
902 | 902 |
903 if (polygon->Project(x1, y1, x2, y2, slice)) | 903 if (polygon->Project(x1, y1, x2, y2, slice, GetEstimatedNormal(), GetEstimatedSliceThickness())) |
904 { | 904 { |
905 projected.push_back(CreateRectangle(x1, y1, x2, y2)); | 905 projected.push_back(CreateRectangle(x1, y1, x2, y2)); |
906 } | 906 } |
907 } | 907 } |
908 | 908 |
919 { | 919 { |
920 chains[i][j] = ScenePoint2D(outer[j].x(), outer[j].y()); | 920 chains[i][j] = ScenePoint2D(outer[j].x(), outer[j].y()); |
921 } | 921 } |
922 } | 922 } |
923 | 923 |
924 #elif 0 | 924 #elif 1 |
925 | 925 |
926 // TODO - Fix possible infinite loop in UnionOfRectangles | |
927 | |
928 std::list<Extent2D> rectangles; | 926 std::list<Extent2D> rectangles; |
929 | 927 |
930 for (Polygons::const_iterator polygon = structure.polygons_.begin(); | 928 for (Polygons::const_iterator polygon = structure.polygons_.begin(); |
931 polygon != structure.polygons_.end(); ++polygon) | 929 polygon != structure.polygons_.end(); ++polygon) |
932 { | 930 { |
933 double x1, y1, x2, y2; | 931 double x1, y1, x2, y2; |
934 | 932 |
935 if (polygon->Project(x1, y1, x2, y2, slice)) | 933 if (polygon->Project(x1, y1, x2, y2, slice, GetEstimatedNormal(), GetEstimatedSliceThickness())) |
936 { | 934 { |
937 rectangles.push_back(Extent2D(x1, y1, x2, y2)); | 935 rectangles.push_back(Extent2D(x1, y1, x2, y2)); |
938 } | 936 } |
939 } | 937 } |
940 | 938 |