changeset 1694:7226b68e2742

print button
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 26 Nov 2020 13:57:15 +0100
parents eafb10992e73
children a691ab50d416
files Applications/StoneWebViewer/WebApplication/index.html Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp
diffstat 2 files changed, 36 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebApplication/index.html	Thu Nov 26 13:46:50 2020 +0100
+++ b/Applications/StoneWebViewer/WebApplication/index.html	Thu Nov 26 13:57:15 2020 +0100
@@ -471,6 +471,15 @@
               </button>
             </div>
 
+
+            <div class="ng-scope inline-object">
+              <button class="wvButton--underline text-center"
+                      data-toggle="tooltip" data-title="Print"
+                      onclick="window.print()">
+                <i class="fas fa-print"></i>
+              </button>
+            </div>
+
             <div class="ng-scope inline-object">
               <button class="wvButton--underline text-center"
                       data-toggle="tooltip" data-title="User preferences"
--- a/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp	Thu Nov 26 13:46:50 2020 +0100
+++ b/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp	Thu Nov 26 13:57:15 2020 +0100
@@ -1035,6 +1035,10 @@
 
     virtual void SignalCrosshair(const ViewerViewport& viewport,
                                  const OrthancStone::Vector& click) = 0;
+
+    virtual void SignalSynchronizedBrowsing(const ViewerViewport& viewport,
+                                            const OrthancStone::Vector& click,
+                                            const OrthancStone::Vector& normal) = 0;
   };
 
 private:
@@ -1860,7 +1864,8 @@
           that.synchronizationOffset_ += previous.GetOrigin() - current.GetOrigin();
         }
 
-        that.observer_->SignalCrosshair(that, current.GetOrigin() + that.synchronizationOffset_);
+        that.observer_->SignalSynchronizedBrowsing(
+          that, current.GetOrigin() + that.synchronizationOffset_, current.GetNormal());
       }
     }
     
@@ -2535,6 +2540,7 @@
   {
     for (Viewports::const_iterator it = allViewports_.begin(); it != allViewports_.end(); ++it)
     {
+      // TODO - One could check the "Frame Of Reference UID" here
       assert(it->second.get() != NULL);
       if (it->second.get() != &viewport)
       {
@@ -2543,6 +2549,26 @@
     }
   }
 
+  virtual void SignalSynchronizedBrowsing(const ViewerViewport& viewport,
+                                          const OrthancStone::Vector& click,
+                                          const OrthancStone::Vector& normal) ORTHANC_OVERRIDE
+  {
+    for (Viewports::const_iterator it = allViewports_.begin(); it != allViewports_.end(); ++it)
+    {
+      assert(it->second.get() != NULL);
+
+      OrthancStone::CoordinateSystem3D plane;
+      bool isOpposite;
+      
+      if (it->second.get() != &viewport &&
+          it->second->GetCurrentPlane(plane) &&
+          OrthancStone::GeometryToolbox::IsParallelOrOpposite(isOpposite, plane.GetNormal(), normal))
+      {
+        it->second->FocusOnPoint(click);
+      }
+    }
+  }
+
   virtual void SignalSeriesPdfLoaded(const std::string& studyInstanceUid,
                                      const std::string& seriesInstanceUid,
                                      const std::string& pdf) ORTHANC_OVERRIDE