changeset 2410:364b3b7e6fed refactoring tip

fix build of sample plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 15 Nov 2026 15:09:38 +0100
parents 50384488da51
children
files Applications/Samples/RtViewerPlugin/CMakeLists.txt Applications/Samples/RtViewerPlugin/Plugin.cpp OrthancStone/Sources/Platforms/Native/ThreadedOracle.cpp RenderingPlugin/CMakeLists.txt RenderingPlugin/Sources/Plugin.cpp
diffstat 5 files changed, 22 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Samples/RtViewerPlugin/CMakeLists.txt	Sun Nov 15 14:13:05 2026 +0100
+++ b/Applications/Samples/RtViewerPlugin/CMakeLists.txt	Sun Nov 15 15:09:38 2026 +0100
@@ -112,7 +112,7 @@
   # RtViewer individual files
   RT_VIEWER_WASM_JS      ${ORTHANC_STONE_BINARIES}/RtViewerWasm.js
   RT_VIEWER_WASM         ${ORTHANC_STONE_BINARIES}/RtViewerWasm.wasm
-  RT_VIEWER_WASM_APP_JS  ${ORTHANC_STONE_BINARIES}/RtViewerWasmApp.js
+  RT_VIEWER_APP_JS       ${ORTHANC_STONE_BINARIES}/app.js
   RT_VIEWER_INDEX_HTML   ${ORTHANC_STONE_BINARIES}/index.html
   )
 
--- a/Applications/Samples/RtViewerPlugin/Plugin.cpp	Sun Nov 15 14:13:05 2026 +0100
+++ b/Applications/Samples/RtViewerPlugin/Plugin.cpp	Sun Nov 15 15:09:38 2026 +0100
@@ -109,7 +109,11 @@
   {
     OrthancPlugins::SetGlobalContext(context);
 
-    OrthancStone::InitializeStone(context);
+#if ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 7, 2)
+    Orthanc::Logging::InitializePluginContext(context);
+#else
+    Orthanc::Logging::Initialize(context);
+#endif
 
     /* Check the version of the Orthanc core */
     if (OrthancPluginCheckVersion(context) == 0)
@@ -146,8 +150,8 @@
         ("/stone-rtviewer/RtViewerWasm.wasm", true);
 
       OrthancPlugins::RegisterRestCallback
-        <ServeEmbeddedFile<Orthanc::EmbeddedResources::RT_VIEWER_WASM_APP_JS> >
-        ("/stone-rtviewer/RtViewerWasmApp.js", true);
+        <ServeEmbeddedFile<Orthanc::EmbeddedResources::RT_VIEWER_APP_JS> >
+        ("/stone-rtviewer/app.js", true);
 
       OrthancPlugins::RegisterRestCallback
         <ServeEmbeddedFile<Orthanc::EmbeddedResources::RT_VIEWER_INDEX_HTML> >
--- a/OrthancStone/Sources/Platforms/Native/ThreadedOracle.cpp	Sun Nov 15 14:13:05 2026 +0100
+++ b/OrthancStone/Sources/Platforms/Native/ThreadedOracle.cpp	Sun Nov 15 15:09:38 2026 +0100
@@ -160,6 +160,7 @@
     threadPool_.SetThreadsCount(configuration.GetOracleThreadsCount());
     threadPool_.SetDequeueTimeout(configuration.GetWorkersTimeResolution());
 
+#if ORTHANC_ENABLE_DCMTK == 1
     if (configuration.GetDicomCacheSize() == 0)
     {
       LOG(WARNING) << "The DICOM cache is disabled";
@@ -170,6 +171,7 @@
                 << (static_cast<float>(configuration.GetDicomCacheSize()) / static_cast<float>(1024 * 1024)) << " MB";
       dicomCache_.reset(new ParsedDicomCache(configuration.GetDicomCacheSize()));
     }
+#endif
   }
 
 
--- a/RenderingPlugin/CMakeLists.txt	Sun Nov 15 14:13:05 2026 +0100
+++ b/RenderingPlugin/CMakeLists.txt	Sun Nov 15 15:09:38 2026 +0100
@@ -37,6 +37,9 @@
 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")
 
 include(${CMAKE_SOURCE_DIR}/../OrthancStone/Resources/CMake/OrthancStoneParameters.cmake)
+
+set(ENABLE_WEB_CLIENT ON)
+
 include(${CMAKE_SOURCE_DIR}/../OrthancStone/Resources/CMake/OrthancStoneConfiguration.cmake)
 
 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake)
@@ -60,8 +63,9 @@
   -DHAS_ORTHANC_EXCEPTION=1
   -DPLUGIN_VERSION="${PLUGIN_VERSION}"
   -DPLUGIN_NAME="stone-rendering"
-  -DORTHANC_ENABLE_SDL=OFF
-  -DORTHANC_ENABLE_WASM=OFF
+  -DORTHANC_ENABLE_SDL=0
+  -DORTHANC_ENABLE_WASM=0
+  -DORTHANC_STONE_TARGET_PLATFORM_NATIVE=1
   )
 
 
@@ -87,6 +91,9 @@
 add_library(StoneRendering SHARED
   Sources/OrthancPluginConnection.cpp
   Sources/Plugin.cpp
+  ../../OrthancStone/Sources/Platforms/Native/NativeEnvironment.cpp
+  ../../OrthancStone/Sources/Platforms/Native/GenericOracleRunner.cpp
+  ../../OrthancStone/Sources/Platforms/Native/ThreadedOracle.cpp
 
   ${AUTOGENERATED_SOURCES}
   ${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp
--- a/RenderingPlugin/Sources/Plugin.cpp	Sun Nov 15 14:13:05 2026 +0100
+++ b/RenderingPlugin/Sources/Plugin.cpp	Sun Nov 15 15:09:38 2026 +0100
@@ -23,6 +23,7 @@
 #include "OrthancPluginConnection.h"
 #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h"
 
+#include "../../OrthancStone/Sources/StoneInitialization.h"
 #include "../../OrthancStone/Sources/Toolbox/AffineTransform2D.h"
 #include "../../OrthancStone/Sources/Toolbox/DicomInstanceParameters.h"
 #include "../../OrthancStone/Sources/Toolbox/DicomStructureSet.h"
@@ -959,7 +960,7 @@
   {
     OrthancPlugins::SetGlobalContext(context);
 
-    OrthancStone::InitializeStone(context);
+    OrthancStone::StoneInitialize(context);
 
     /* Check the version of the Orthanc core */
     if (OrthancPluginCheckVersion(context) == 0)
@@ -996,6 +997,7 @@
 
   ORTHANC_PLUGINS_API void OrthancPluginFinalize()
   {
+    OrthancStone::StoneFinalize();
   }