diff Framework/Scene2D/InfoPanelSceneLayer.h @ 1325:be17fed8c7c5 broker

Added flag in InfoPanelSceneLayer to apply the scene rotation to the displayed image.
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 24 Mar 2020 20:34:28 +0100
parents 8a0a62189f46
children 30deba7bc8e2
line wrap: on
line diff
--- a/Framework/Scene2D/InfoPanelSceneLayer.h	Tue Mar 24 16:24:26 2020 +0100
+++ b/Framework/Scene2D/InfoPanelSceneLayer.h	Tue Mar 24 20:34:28 2020 +0100
@@ -37,15 +37,26 @@
     std::unique_ptr<Orthanc::ImageAccessor>  texture_;
     BitmapAnchor                           anchor_;
     bool                                   isLinearInterpolation_;
+    bool                                   applySceneRotation_;
 
   public:
+  /**
+   * If you supply `true` for `applySceneRotation`, then, in addition to 
+   * a translation to bring it at the desired anchoring location, the image
+   * will be rotated around its center by the same rotation as the scene
+   * transformation.
+   */
     InfoPanelSceneLayer(const Orthanc::ImageAccessor& texture,
                         BitmapAnchor anchor,
-                        bool isLinearInterpolation);
+                        bool isLinearInterpolation,
+                        bool applySceneRotation = false);
 
     virtual ISceneLayer* Clone() const
     {
-      return new InfoPanelSceneLayer(*texture_, anchor_, isLinearInterpolation_);
+      return new InfoPanelSceneLayer(*texture_, 
+                                     anchor_, 
+                                     isLinearInterpolation_, 
+                                     applySceneRotation_);
     }
 
     const Orthanc::ImageAccessor& GetTexture() const
@@ -58,6 +69,11 @@
       return anchor_;
     }
 
+    bool ShouldApplySceneRotation() const
+    {
+      return applySceneRotation_;
+    }
+
     bool IsLinearInterpolation() const
     {
       return isLinearInterpolation_;