# HG changeset patch # User Benjamin Golinvaux # Date 1588057121 -7200 # Node ID 5c83be3a6be5ac3de11408b4ffb4ddcebff6e169 # Parent 240531afdd2dd36d42536124b3779e85256f8ad3 split SDL / common + RtViewer rename + html test file diff -r 240531afdd2d -r 5c83be3a6be5 Samples/Common/RtViewer.cpp --- a/Samples/Common/RtViewer.cpp Tue Apr 28 08:57:39 2020 +0200 +++ b/Samples/Common/RtViewer.cpp Tue Apr 28 08:58:41 2020 +0200 @@ -334,6 +334,7 @@ } else if (viewport_->IsRefreshEvent(event)) { + // the viewport has been invalidated and requires repaint viewport_->Paint(); } } diff -r 240531afdd2d -r 5c83be3a6be5 Samples/Sdl/RtViewer/RtViewerSdl.cpp --- a/Samples/Sdl/RtViewer/RtViewerSdl.cpp Tue Apr 28 08:57:39 2020 +0200 +++ b/Samples/Sdl/RtViewer/RtViewerSdl.cpp Tue Apr 28 08:58:41 2020 +0200 @@ -52,11 +52,6 @@ namespace po = boost::program_options; po::options_description desc("Usage:"); - //ctLoader->LoadSeries("a04ecf01-79b2fc33-58239f7e-ad9db983-28e81afa"); // CT - //doseLoader->LoadInstance("830a69ff-8e4b5ee3-b7f966c8-bccc20fb-d322dceb"); // RT-DOSE - //rtstructLoader->LoadInstance("54460695-ba3885ee-ddf61ac0-f028e31d-a6e474d9"); // RT-STRUCT - - desc.add_options() ("loglevel", po::value()->default_value("WARNING"), "You can choose WARNING, INFO or TRACE for the logging level: Errors and warnings will always be displayed. (default: WARNING)") @@ -123,8 +118,8 @@ Scene2D& scene = controller.GetScene(); ICompositor& compositor = lock->GetCompositor(); - // False means we do NOT let Windows treat this as a legacy application - // that needs to be scaled + // False means we do NOT let a hi-DPI aware desktop managedr treat this as a legacy application that requires + // scaling. controller.FitContent(compositor.GetCanvasWidth(), compositor.GetCanvasHeight()); glEnable(GL_DEBUG_OUTPUT); @@ -141,7 +136,7 @@ loadersContext_->StartOracle(); /** - It is very important that the Oracle (responsible for network I/O be started before creating and firing the + It is very important that the Oracle (responsible for network I/O) be started before creating and firing the loaders, for any command scheduled by the loader before the oracle is started will be lost. */ PrepareLoadersAndSlicers(); @@ -150,8 +145,6 @@ while (!stopApplication) { - //compositor.Refresh(scene); - SDL_Event event; while (!stopApplication && SDL_PollEvent(&event)) { @@ -163,7 +156,7 @@ else if (event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { - DisableTracker(); // was: tracker.reset(NULL); + DisableTracker(); } else if (event.type == SDL_KEYDOWN && event.key.repeat == 0 /* Ignore key bounce */) @@ -171,8 +164,8 @@ switch (event.key.keysym.sym) { case SDLK_f: - // TODO: implement GetWindow!!! - // viewport_->GetContext()->GetWindow().ToggleMaximize(); + // TODO: implement GetWindow to be able to do: + // viewport_->GetWindow().ToggleMaximize(); ORTHANC_ASSERT(false, "Please implement GetWindow()"); break; case SDLK_q: @@ -182,6 +175,8 @@ break; } } + // the code above is rather application-neutral. + // the following call handles events specific to the application HandleApplicationEvent(event); } SDL_Delay(1); diff -r 240531afdd2d -r 5c83be3a6be5 Samples/WebAssembly/RtViewer/CMakeLists.txt --- a/Samples/WebAssembly/RtViewer/CMakeLists.txt Tue Apr 28 08:57:39 2020 +0200 +++ b/Samples/WebAssembly/RtViewer/CMakeLists.txt Tue Apr 28 08:58:41 2020 +0200 @@ -59,20 +59,21 @@ # Declare installation files for the module # --------------------------------------------------------------- install( - TARGETS CtDoseStructViewerWasm + TARGETS RtViewerWasm RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} ) # Declare installation files for the companion files (web scaffolding) -# please note that ${CMAKE_CURRENT_BINARY_DIR}/SingleFrameViewerWasm.js +# please note that ${CMAKE_CURRENT_BINARY_DIR}/RtViewerWasm.js # (the generated JS loader for the WASM module) is handled by the `install1` -# section above +# section above: it is considered to be the binary output of +# the linker. # --------------------------------------------------------------- install( FILES - ${CMAKE_SOURCE_DIR}/CtDoseStructViewerApp.js + ${CMAKE_SOURCE_DIR}/RtViewerApp.js ${CMAKE_SOURCE_DIR}/index.html - ${CMAKE_CURRENT_BINARY_DIR}/CtDoseStructViewerWasm.wasm + ${CMAKE_CURRENT_BINARY_DIR}/RtViewerWasm.wasm ${CMAKE_SOURCE_DIR}/WasmWrapper.js DESTINATION ${CMAKE_INSTALL_PREFIX} ) diff -r 240531afdd2d -r 5c83be3a6be5 Samples/WebAssembly/RtViewer/RtViewerWasm.html --- a/Samples/WebAssembly/RtViewer/RtViewerWasm.html Tue Apr 28 08:57:39 2020 +0200 +++ b/Samples/WebAssembly/RtViewer/RtViewerWasm.html Tue Apr 28 08:58:41 2020 +0200 @@ -54,7 +54,6 @@ - - +