diff OrthancStone/Sources/Scene2D/TextureBaseSceneLayer.h @ 1775:fca942f4b4a7

fix conversion from voxel centers to texture borders
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 12 May 2021 19:57:50 +0200
parents a217140dd41a
children d9c5474c5588
line wrap: on
line diff
--- a/OrthancStone/Sources/Scene2D/TextureBaseSceneLayer.h	Wed May 12 17:43:51 2021 +0200
+++ b/OrthancStone/Sources/Scene2D/TextureBaseSceneLayer.h	Wed May 12 19:57:50 2021 +0200
@@ -59,6 +59,12 @@
   public:
     TextureBaseSceneLayer();
 
+  private:
+    /**
+     * TODO - The methods below could be removed, as well as the
+     * corresponding members
+     **/
+    
     // Center of the top-left pixel
     void SetOrigin(double x,
                    double y);
@@ -69,8 +75,6 @@
     // In radians
     void SetAngle(double angle);
 
-    void SetLinearInterpolation(bool isLinearInterpolation);
-
     void SetFlipX(bool flip);
     
     void SetFlipY(bool flip);
@@ -100,16 +104,6 @@
       return angle_;
     }
 
-    bool IsLinearInterpolation() const
-    {
-      return isLinearInterpolation_;
-    }
-
-    bool HasTexture() const
-    {
-      return (texture_.get() != NULL);
-    }
-
     bool IsFlipX() const
     {
       return flipX_;
@@ -120,15 +114,32 @@
       return flipY_;
     }
 
+  public:
+    bool IsLinearInterpolation() const
+    {
+      return isLinearInterpolation_;
+    }
+
+    void SetLinearInterpolation(bool isLinearInterpolation);
+
+    bool HasTexture() const
+    {
+      return (texture_.get() != NULL);
+    }
+
     const Orthanc::ImageAccessor& GetTexture() const;
 
     void SetTransform(const AffineTransform2D& transform);
 
     void ClearTransform();
 
-    // Initialize a transform that maps a texture slice in 3D, to a
-    // cutting plane (the cutting plane should be parallel to the 3D
-    // slice). The "pixelOffsetX/Y" must take pixel spacing into account.
+    /**
+     * Initialize a transform that maps a texture slice in 3D, to a
+     * cutting plane (the cutting plane should be parallel to the 3D
+     * slice). The "pixelOffsetX/Y" must take pixel spacing into
+     * account. This method automatically converts from voxel centers
+     * (3D) to pixel corners (2D).
+     **/
     void SetCuttingPlaneTransform(const CoordinateSystem3D& cuttingPlane,
                                   const Vector& origin,        // coordinates of the center of the voxel
                                   const Vector& pixelOffsetX,  // 3D offset from (0,0) voxel to (1,0) voxel