changeset 1411:08fd094f9582

Merge
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 04 May 2020 13:34:46 +0200
parents b2b0fc4a5596 (current diff) 07fac4fdbe07 (diff)
children 0cbc85e0c583 cde379b9d1d2 4f2e14275b09
files
diffstat 4 files changed, 3 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/Samples/Common/RtViewerApp.cpp	Mon May 04 13:34:21 2020 +0200
+++ b/Samples/Common/RtViewerApp.cpp	Mon May 04 13:34:46 2020 +0200
@@ -60,33 +60,6 @@
 
 namespace OrthancStone
 {
-  const char* RtViewerGuiToolToString(size_t i)
-  {
-    static const char* descs[] = {
-      "RtViewerGuiTool_Rotate",
-      "RtViewerGuiTool_Pan",
-      "RtViewerGuiTool_Zoom",
-      "RtViewerGuiTool_LineMeasure",
-      "RtViewerGuiTool_CircleMeasure",
-      "RtViewerGuiTool_AngleMeasure",
-      "RtViewerGuiTool_EllipseMeasure",
-      "RtViewerGuiTool_LAST"
-    };
-    if (i >= RtViewerGuiTool_LAST)
-    {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, "Wrong tool index");
-    }
-    return descs[i];
-  }
-
-  void RtViewerApp::SelectNextTool()
-  {
-    currentTool_ = static_cast<RtViewerGuiTool>(currentTool_ + 1);
-    if (currentTool_ == RtViewerGuiTool_LAST)
-      currentTool_ = static_cast<RtViewerGuiTool>(0);;
-    printf("Current tool is now: %s\n", RtViewerGuiToolToString(currentTool_));
-  }
-
   void RtViewerApp::InvalidateAllViewports()
   {
     for (size_t i = 0; i < views_.size(); ++i)
@@ -104,8 +77,7 @@
   }
 
   RtViewerApp::RtViewerApp()
-    : currentTool_(RtViewerGuiTool_Rotate)
-    , undoStack_(new UndoStack)
+    : undoStack_(new UndoStack)
   {
     // Create the volumes that will be filled later on
     ctVolume_ = boost::make_shared<DicomVolumeImage>();
--- a/Samples/Common/RtViewerApp.h	Mon May 04 13:34:21 2020 +0200
+++ b/Samples/Common/RtViewerApp.h	Mon May 04 13:34:46 2020 +0200
@@ -51,20 +51,6 @@
   class SdlOpenGLViewport;
   class RtViewerView;
    
-  enum RtViewerGuiTool
-  {
-    RtViewerGuiTool_Rotate = 0,
-    RtViewerGuiTool_Pan,
-    RtViewerGuiTool_Zoom,
-    RtViewerGuiTool_LineMeasure,
-    RtViewerGuiTool_CircleMeasure,
-    RtViewerGuiTool_AngleMeasure,
-    RtViewerGuiTool_EllipseMeasure,
-    RtViewerGuiTool_LAST
-  };
-
-  const char* MeasureToolToString(size_t i);
-
   static const unsigned int FONT_SIZE_0 = 32;
   static const unsigned int FONT_SIZE_1 = 24;
 
@@ -172,7 +158,6 @@
 
     boost::shared_ptr<IFlexiblePointerTracker> activeTracker_;
 
-    RtViewerGuiTool currentTool_;
     boost::shared_ptr<UndoStack> undoStack_;
   };
 
--- a/Samples/Sdl/RtViewer/RtViewerSdl.cpp	Mon May 04 13:34:21 2020 +0200
+++ b/Samples/Sdl/RtViewer/RtViewerSdl.cpp	Mon May 04 13:34:46 2020 +0200
@@ -375,9 +375,9 @@
             }
           }
         }
+        // Small delay to avoid using 100% of CPU
+        SDL_Delay(1);
       }
-      // Small delay to avoid using 100% of CPU
-      SDL_Delay(1);
     }
   }
 }
--- a/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp	Mon May 04 13:34:21 2020 +0200
+++ b/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp	Mon May 04 13:34:46 2020 +0200
@@ -121,11 +121,6 @@
 
         OrthancStone::DefaultViewportInteractor interactor;
 
-#if 1
-        OrthancStoneHelpers::SdlRunLoop(viewport, interactor);
-
-#else
-
         {
           int scancodeCount = 0;
           const uint8_t* keyboardState = SDL_GetKeyboardState(&scancodeCount);
@@ -227,7 +222,6 @@
             SDL_Delay(1);
           }
         }
-#endif
         context.StopOracle();
       }
     }