diff Framework/Radiography/RadiographyMaskLayer.h @ 488:aede9b042cb7 am-touch-events

now using ImageProcessing::FillPolygon
author am@osimis.io
date Tue, 19 Feb 2019 11:40:14 +0100
parents 159a465e27bd
children 77e0eb83ff63
line wrap: on
line diff
--- a/Framework/Radiography/RadiographyMaskLayer.h	Fri Feb 15 18:43:41 2019 +0100
+++ b/Framework/Radiography/RadiographyMaskLayer.h	Tue Feb 19 11:40:14 2019 +0100
@@ -23,27 +23,17 @@
 
 #include "RadiographyLayer.h"
 #include "Core/Images/Image.h"
+#include "Core/Images/ImageProcessing.h"
 
 namespace OrthancStone
 {
   class RadiographyScene;
   class RadiographyDicomLayer;
 
-  struct MaskPoint
-  {
-    unsigned int x;
-    unsigned int y;
-
-    MaskPoint(unsigned int x, unsigned int y)
-      : x(x),
-        y(y)
-    {}
-  };
-
   class RadiographyMaskLayer : public RadiographyLayer
   {
   private:
-    std::vector<MaskPoint>            corners_;
+    std::vector<Orthanc::ImageProcessing::ImagePoint>            corners_;
     const RadiographyDicomLayer&      dicomLayer_;
     mutable bool                      invalidated_;
     float                             foreground_;
@@ -59,10 +49,10 @@
     {
     }
 
-    void SetCorners(const std::vector<MaskPoint>& corners);
-    void SetCorner(const MaskPoint& corner, size_t index);
+    void SetCorners(const std::vector<Orthanc::ImageProcessing::ImagePoint>& corners);
+    void SetCorner(const Orthanc::ImageProcessing::ImagePoint& corner, size_t index);
 
-    const std::vector<MaskPoint>& GetCorners() const
+    const std::vector<Orthanc::ImageProcessing::ImagePoint>& GetCorners() const
     {
       return corners_;
     }
@@ -86,7 +76,7 @@
     virtual void GetControlPoint(ControlPoint& cpScene,
                                          size_t index) const
     {
-      ControlPoint cp(corners_[index].x, corners_[index].y, index);
+      ControlPoint cp(corners_[index].GetX(), corners_[index].GetY(), index);
 
       // transforms image coordinates into scene coordinates
       GetTransform().Apply(cp.x, cp.y);