changeset 886:5cfb479fdbde am-dev

fix BasicScene WASM sample
author Alain Mazy <alain@mazy.be>
date Tue, 09 Jul 2019 17:36:47 +0200
parents 56e4e9281076
children 6176917ef890 6073c980323a
files Samples/WebAssembly/NOTES.txt Samples/WebAssembly/dev.h
diffstat 2 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Samples/WebAssembly/NOTES.txt	Tue Jul 09 16:44:25 2019 +0200
+++ b/Samples/WebAssembly/NOTES.txt	Tue Jul 09 17:36:47 2019 +0200
@@ -63,3 +63,15 @@
 $ make -C ~/Subversion/orthanc-webviewer/r -j4
 $ ~/Subversion/orthanc/r/Orthanc ../ConfigurationLocalSJO.json
 
+
+Local AM
+========
+
+. ~/apps/emsdk/emsdk_env.sh
+cd /mnt/c/o/
+mkdir -p build_stone_newsamples_wasm_wsl
+mkdir -p build_install_stone_newsamples_wasm_wsl
+cd build_stone_newsamples_wasm_wsl
+cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=${EMSCRIPTEN}/cmake/Modules/Platform/Emscripten.cmake -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT=/mnt/c/o/orthanc/ -DCMAKE_BUILD_TYPE=Release -DALLOW_DOWNLOADS=ON /mnt/c/o/orthanc-stone/Samples/WebAssembly -DCMAKE_INSTALL_PREFIX=/mnt/c/o/build_install_stone_newsamples_wasm_wsl
+ninja
+
--- a/Samples/WebAssembly/dev.h	Tue Jul 09 16:44:25 2019 +0200
+++ b/Samples/WebAssembly/dev.h	Tue Jul 09 17:36:47 2019 +0200
@@ -27,8 +27,10 @@
 #include "../../Framework/Scene2D/RotateSceneTracker.h"
 #include "../../Framework/Scene2D/ZoomSceneTracker.h"
 #include "../../Framework/Scene2DViewport/ViewportController.h"
+#include "../../Framework/Scene2DViewport/UndoStack.h"
 
 #include <Core/OrthancException.h>
+#include <boost/make_shared.hpp>
 
 #include <emscripten/html5.h>
 
@@ -52,7 +54,7 @@
     WebAssemblyViewport(MessageBroker& broker,
                         const std::string& canvas) :
       context_(canvas),
-      controller_(new ViewportController(broker)),
+      controller_(new ViewportController(boost::make_shared<UndoStack>(), broker)),
       compositor_(context_, *controller_->GetScene())
     {
       compositor_.SetFont(0, Orthanc::EmbeddedResources::UBUNTU_FONT,