changeset 386:e33659decec5

renamed UpdateContent() as DoAnimation()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 09 Nov 2018 17:06:28 +0100
parents 6cc3ce74dc05
children a8b5cf760473
files Applications/Generic/NativeStoneApplicationContext.cpp Framework/Viewport/IViewport.h Framework/Viewport/WidgetViewport.cpp Framework/Viewport/WidgetViewport.h Framework/Widgets/EmptyWidget.cpp Framework/Widgets/EmptyWidget.h Framework/Widgets/IWidget.h Framework/Widgets/LayerWidget.cpp Framework/Widgets/LayerWidget.h Framework/Widgets/LayoutWidget.cpp Framework/Widgets/LayoutWidget.h Framework/Widgets/TestCairoWidget.cpp Framework/Widgets/TestCairoWidget.h Framework/Widgets/TestWorldSceneWidget.cpp Framework/Widgets/TestWorldSceneWidget.h Framework/Widgets/WidgetBase.cpp Framework/Widgets/WidgetBase.h Platforms/Wasm/Defaults.cpp Platforms/Wasm/wasm-application-runner.ts
diffstat 19 files changed, 50 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Generic/NativeStoneApplicationContext.cpp	Wed Nov 07 20:49:41 2018 +0100
+++ b/Applications/Generic/NativeStoneApplicationContext.cpp	Fri Nov 09 17:06:28 2018 +0100
@@ -37,7 +37,7 @@
     {
       {
         GlobalMutexLocker locker(*that);
-        locker.GetCentralViewport().UpdateContent();
+        locker.GetCentralViewport().DoAnimation();
       }
       
       boost::this_thread::sleep(boost::posix_time::milliseconds(that->updateDelayInMs_));
@@ -60,7 +60,7 @@
     boost::mutex::scoped_lock lock(globalMutex_);
     
     if (stopped_ &&
-        centralViewport_.HasUpdateContent())
+        centralViewport_.HasAnimation())
     {
       stopped_ = false;
       updateThread_ = boost::thread(UpdateThread, this);
--- a/Framework/Viewport/IViewport.h	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Viewport/IViewport.h	Fri Nov 09 17:06:28 2018 +0100
@@ -78,9 +78,9 @@
                             char keyChar,
                             KeyboardModifiers modifiers) = 0;
 
-    virtual bool HasUpdateContent() = 0;
+    virtual bool HasAnimation() = 0;
 
-    virtual void UpdateContent() = 0;
+    virtual void DoAnimation() = 0;
 
     // Should only be called from IWidget
     virtual void NotifyContentChanged()
--- a/Framework/Viewport/WidgetViewport.cpp	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Viewport/WidgetViewport.cpp	Fri Nov 09 17:06:28 2018 +0100
@@ -247,11 +247,11 @@
   }
 
 
-  bool WidgetViewport::HasUpdateContent()
+  bool WidgetViewport::HasAnimation()
   {
     if (centralWidget_.get() != NULL)
     {
-      return centralWidget_->HasUpdateContent();
+      return centralWidget_->HasAnimation();
     }
     else
     {
@@ -260,11 +260,11 @@
   }
    
 
-  void WidgetViewport::UpdateContent()
+  void WidgetViewport::DoAnimation()
   {
     if (centralWidget_.get() != NULL)
     {
-      centralWidget_->UpdateContent();
+      centralWidget_->DoAnimation();
     }
   }
 }
--- a/Framework/Viewport/WidgetViewport.h	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Viewport/WidgetViewport.h	Fri Nov 09 17:06:28 2018 +0100
@@ -79,8 +79,8 @@
                             char keyChar,
                             KeyboardModifiers modifiers);
 
-    virtual bool HasUpdateContent();
+    virtual bool HasAnimation();
 
-    virtual void UpdateContent();
+    virtual void DoAnimation();
   };
 }
--- a/Framework/Widgets/EmptyWidget.cpp	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Widgets/EmptyWidget.cpp	Fri Nov 09 17:06:28 2018 +0100
@@ -34,7 +34,7 @@
   }
 
 
-  void EmptyWidget::UpdateContent()
+  void EmptyWidget::DoAnimation()
   {
     throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
   }
--- a/Framework/Widgets/EmptyWidget.h	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Widgets/EmptyWidget.h	Fri Nov 09 17:06:28 2018 +0100
@@ -100,12 +100,12 @@
     {
     }
 
-    virtual bool HasUpdateContent() const
+    virtual bool HasAnimation() const
     {
       return false;
     }
 
-    virtual void UpdateContent();
+    virtual void DoAnimation();
 
     virtual bool HasRenderMouseOver()
     {
--- a/Framework/Widgets/IWidget.h	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Widgets/IWidget.h	Fri Nov 09 17:06:28 2018 +0100
@@ -69,9 +69,9 @@
                             char keyChar,
                             KeyboardModifiers modifiers) = 0;
 
-    virtual bool HasUpdateContent() const = 0;
+    virtual bool HasAnimation() const = 0;
 
-    virtual void UpdateContent() = 0;
+    virtual void DoAnimation() = 0;
 
     // Subclasses can call this method to signal the display of the
     // widget must be refreshed
--- a/Framework/Widgets/LayerWidget.cpp	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Widgets/LayerWidget.cpp	Fri Nov 09 17:06:28 2018 +0100
@@ -622,7 +622,7 @@
   }
 
 
-  void LayerWidget::UpdateContent()
+  void LayerWidget::DoAnimation()
   {
     assert(changedLayers_.size() <= layers_.size());
     
--- a/Framework/Widgets/LayerWidget.h	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Widgets/LayerWidget.h	Fri Nov 09 17:06:28 2018 +0100
@@ -118,11 +118,11 @@
       return slice_;
     }
 
-    virtual bool HasUpdateContent() const
+    virtual bool HasAnimation() const
     {
       return true;
     }
 
-    virtual void UpdateContent();
+    virtual void DoAnimation();
   };
 }
--- a/Framework/Widgets/LayoutWidget.cpp	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Widgets/LayoutWidget.cpp	Fri Nov 09 17:06:28 2018 +0100
@@ -92,11 +92,11 @@
       SetEmpty();
     }
 
-    void UpdateContent()
+    void DoAnimation()
     {
-      if (widget_->HasUpdateContent())
+      if (widget_->HasAnimation())
       {
-        widget_->UpdateContent();
+        widget_->DoAnimation();
       }
     }
 
@@ -362,9 +362,9 @@
 
     ComputeChildrenExtents();
 
-    if (widget->HasUpdateContent())
+    if (widget->HasAnimation())
     {
-      hasUpdateContent_ = true;
+      hasAnimation_ = true;
     }
 
     return *widget;
@@ -462,13 +462,13 @@
   }
 
   
-  void LayoutWidget::UpdateContent()
+  void LayoutWidget::DoAnimation()
   {
-    if (hasUpdateContent_)
+    if (hasAnimation_)
     {
       for (size_t i = 0; i < children_.size(); i++)
       {
-        children_[i]->UpdateContent();
+        children_[i]->DoAnimation();
       }
     }
     else
--- a/Framework/Widgets/LayoutWidget.h	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Widgets/LayoutWidget.h	Fri Nov 09 17:06:28 2018 +0100
@@ -44,7 +44,7 @@
     unsigned int                  paddingRight_;
     unsigned int                  paddingBottom_;
     unsigned int                  paddingInternal_;
-    bool                          hasUpdateContent_;
+    bool                          hasAnimation_;
 
     void ComputeChildrenExtents();
 
@@ -121,12 +121,12 @@
                             char keyChar,
                             KeyboardModifiers modifiers);
 
-    virtual bool HasUpdateContent() const
+    virtual bool HasAnimation() const
     {
-      return hasUpdateContent_;
+      return hasAnimation_;
     }
 
-    virtual void UpdateContent();
+    virtual void DoAnimation();
 
     virtual bool HasRenderMouseOver();
   };
--- a/Framework/Widgets/TestCairoWidget.cpp	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Widgets/TestCairoWidget.cpp	Fri Nov 09 17:06:28 2018 +0100
@@ -28,7 +28,7 @@
 {
   namespace Samples
   {
-    void TestCairoWidget::UpdateContent() 
+    void TestCairoWidget::DoAnimation() 
     {
       value_ -= 0.01f;
       if (value_ < 0)
--- a/Framework/Widgets/TestCairoWidget.h	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Widgets/TestCairoWidget.h	Fri Nov 09 17:06:28 2018 +0100
@@ -62,12 +62,12 @@
                               char keyChar,
                               KeyboardModifiers modifiers);
 
-      virtual bool HasUpdateContent() const
+      virtual bool HasAnimation() const
       {
         return animate_;
       }
       
-      virtual void UpdateContent();
+      virtual void DoAnimation();
 
       virtual bool HasRenderMouseOver()
       {
--- a/Framework/Widgets/TestWorldSceneWidget.cpp	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Widgets/TestWorldSceneWidget.cpp	Fri Nov 09 17:06:28 2018 +0100
@@ -130,7 +130,7 @@
     }
 
 
-    void TestWorldSceneWidget::UpdateContent()
+    void TestWorldSceneWidget::DoAnimation()
     {
       if (animate_)
       {
--- a/Framework/Widgets/TestWorldSceneWidget.h	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Widgets/TestWorldSceneWidget.h	Fri Nov 09 17:06:28 2018 +0100
@@ -47,12 +47,12 @@
 
       virtual Extent2D GetSceneExtent();
 
-      virtual bool HasUpdateContent() const
+      virtual bool HasAnimation() const
       {
         return animate_;
       }
 
-      virtual void UpdateContent();
+      virtual void DoAnimation();
 
       virtual bool HasRenderMouseOver()
       {
--- a/Framework/Widgets/WidgetBase.cpp	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Widgets/WidgetBase.cpp	Fri Nov 09 17:06:28 2018 +0100
@@ -159,7 +159,7 @@
   }
 
   
-  void WidgetBase::UpdateContent()
+  void WidgetBase::DoAnimation()
   {
     throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
   }
--- a/Framework/Widgets/WidgetBase.h	Wed Nov 07 20:49:41 2018 +0100
+++ b/Framework/Widgets/WidgetBase.h	Fri Nov 09 17:06:28 2018 +0100
@@ -94,12 +94,12 @@
 
     virtual bool Render(Orthanc::ImageAccessor& surface);
 
-    virtual bool HasUpdateContent() const
+    virtual bool HasAnimation() const
     {
       return false;
     }
 
-    virtual void UpdateContent();
+    virtual void DoAnimation();
 
     virtual bool HasRenderMouseOver()
     {
--- a/Platforms/Wasm/Defaults.cpp	Wed Nov 07 20:49:41 2018 +0100
+++ b/Platforms/Wasm/Defaults.cpp	Fri Nov 09 17:06:28 2018 +0100
@@ -102,13 +102,13 @@
     printf("StartWasmApplication - completed\n");
   }
   
-  void EMSCRIPTEN_KEEPALIVE NotifyUpdateContent()
+  void EMSCRIPTEN_KEEPALIVE WasmDoAnimation()
   {
     for (auto viewport : viewports_) {
-      // TODO Only launch the JavaScript timer if "HasUpdateContent()"
-      if (viewport->HasUpdateContent())
+      // TODO Only launch the JavaScript timer if "HasAnimation()"
+      if (viewport->HasAnimation())
       {
-        viewport->UpdateContent();
+        viewport->DoAnimation();
       }
 
     }
--- a/Platforms/Wasm/wasm-application-runner.ts	Wed Nov 07 20:49:41 2018 +0100
+++ b/Platforms/Wasm/wasm-application-runner.ts	Fri Nov 09 17:06:28 2018 +0100
@@ -11,7 +11,7 @@
 var WasmWebService_NotifyError: Function = null;
 var WasmWebService_NotifySuccess: Function = null;
 var WasmWebService_SetBaseUri: Function = null;
-var NotifyUpdateContent: Function = null;
+var WasmDoAnimation: Function = null;
 var SetStartupParameter: Function = null;
 var CreateWasmApplication: Function = null;
 var CreateCppViewport: Function = null;
@@ -20,12 +20,12 @@
 var SendMessageToStoneApplication: Function = null;
 
 
-function UpdateContentThread() {
-  if (NotifyUpdateContent != null) {
-    NotifyUpdateContent();
+function DoAnimationThread() {
+  if (WasmDoAnimation != null) {
+    WasmDoAnimation();
   }
 
-  setTimeout(UpdateContentThread, 100);  // Update the viewport content every 100ms if need be
+  setTimeout(DoAnimationThread, 100);  // Update the viewport content every 100ms if need be
 }
 
 
@@ -75,7 +75,7 @@
   // trigger a first resize of the canvas that have just been initialized
   Stone.WasmViewport.ResizeAll();
 
-  UpdateContentThread();
+  DoAnimationThread();
 }
 
 function InitializeWasmApplication(wasmModuleName: string, orthancBaseUrl: string) {
@@ -97,7 +97,7 @@
     WasmWebService_NotifySuccess = StoneFrameworkModule.cwrap('WasmWebService_NotifySuccess', null, ['number', 'string', 'array', 'number', 'number']);
     WasmWebService_NotifyError = StoneFrameworkModule.cwrap('WasmWebService_NotifyError', null, ['number', 'string', 'number']);
     WasmWebService_SetBaseUri = StoneFrameworkModule.cwrap('WasmWebService_SetBaseUri', null, ['string']);
-    NotifyUpdateContent = StoneFrameworkModule.cwrap('NotifyUpdateContent', null, []);
+    WasmDoAnimation = StoneFrameworkModule.cwrap('WasmDoAnimation', null, []);
 
     SendMessageToStoneApplication = StoneFrameworkModule.cwrap('SendMessageToStoneApplication', 'string', ['string']);