Mercurial > hg > orthanc-stone
diff Framework/Toolbox/DicomStructureSet.h @ 1178:3c7cdbf32e2a broker
DicomStructureSet::ProjectOntoLayer()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 20 Nov 2019 14:12:11 +0100 |
parents | 1644de437a7b |
children | 9c8f557ea799 |
line wrap: on
line diff
--- a/Framework/Toolbox/DicomStructureSet.h Wed Nov 20 13:37:50 2019 +0100 +++ b/Framework/Toolbox/DicomStructureSet.h Wed Nov 20 14:12:11 2019 +0100 @@ -25,6 +25,7 @@ #include "CoordinateSystem3D.h" #include "Extent2D.h" #include "../Scene2D/Color.h" +#include "../Scene2D/PolylineSceneLayer.h" //#define USE_BOOST_UNION_FOR_POLYGONS 1 @@ -141,15 +142,15 @@ Structure& GetStructure(size_t index); -#ifdef USE_BOOST_UNION_FOR_POLYGONS - bool ProjectStructure(std::vector< std::vector<Point2D> >& polygons, - const Structure& structure, - const CoordinateSystem3D& slice) const; + bool ProjectStructure( +#if USE_BOOST_UNION_FOR_POLYGONS == 1 + std::vector< std::vector<Point2D> >& polygons, #else - bool ProjectStructure(std::vector< std::pair<Point2D, Point2D> >& segments, + std::vector< std::pair<Point2D, Point2D> >& segments, +#endif const Structure& structure, const CoordinateSystem3D& slice) const; -#endif + public: DicomStructureSet(const OrthancPlugins::FullOrthancDataset& instance); @@ -185,7 +186,7 @@ Vector GetNormal() const; -#ifdef USE_BOOST_UNION_FOR_POLYGONS +#if USE_BOOST_UNION_FOR_POLYGONS == 1 bool ProjectStructure(std::vector< std::vector<Point2D> >& polygons, size_t index, const CoordinateSystem3D& slice) const @@ -194,11 +195,23 @@ } #else bool ProjectStructure(std::vector< std::pair<Point2D, Point2D> >& segments, - size_t index, - const CoordinateSystem3D& slice) const + size_t index, + const CoordinateSystem3D& slice) const { return ProjectStructure(segments, GetStructure(index), slice); } #endif + + void ProjectOntoLayer(PolylineSceneLayer& layer, + const CoordinateSystem3D& plane, + size_t structureIndex, + const Color& color) const; + + void ProjectOntoLayer(PolylineSceneLayer& layer, + const CoordinateSystem3D& plane, + size_t structureIndex) const + { + ProjectOntoLayer(layer, plane, structureIndex, GetStructureColor(structureIndex)); + } }; }