# HG changeset patch # User Benjamin Golinvaux # Date 1588592086 -7200 # Node ID 08fd094f9582b2386839d10c3bda6f2c42e35f6e # Parent b2b0fc4a55964d5bdab0dc6805bea9dfff960ae1# Parent 07fac4fdbe0760cf9497e2921d3870c65c0ff4a9 Merge diff -r b2b0fc4a5596 -r 08fd094f9582 Samples/Common/RtViewerApp.cpp --- 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(currentTool_ + 1); - if (currentTool_ == RtViewerGuiTool_LAST) - currentTool_ = static_cast(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(); diff -r b2b0fc4a5596 -r 08fd094f9582 Samples/Common/RtViewerApp.h --- 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 activeTracker_; - RtViewerGuiTool currentTool_; boost::shared_ptr undoStack_; }; diff -r b2b0fc4a5596 -r 08fd094f9582 Samples/Sdl/RtViewer/RtViewerSdl.cpp --- 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); } } } diff -r b2b0fc4a5596 -r 08fd094f9582 Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp --- 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(); } }