# HG changeset patch # User am@osimis.io # Date 1529497626 -7200 # Node ID 50fb32abf85ebde059e1e21f9803851f6be2a795 # Parent 092db46c6291a5c43ce94efb801421dc8e704721 cleanup diff -r 092db46c6291 -r 50fb32abf85e Applications/Samples/SampleApplicationContext.cpp --- a/Applications/Samples/SampleApplicationContext.cpp Wed Jun 20 14:20:55 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/** - * Stone of Orthanc - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2018 Osimis S.A., Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - **/ - - -#include "SampleApplicationContext.h" - -namespace OrthancStone -{ - SampleApplicationContext::~SampleApplicationContext() - { - for (Interactors::iterator it = interactors_.begin(); it != interactors_.end(); ++it) - { - assert(*it != NULL); - delete *it; - } - - for (SlicedVolumes::iterator it = slicedVolumes_.begin(); it != slicedVolumes_.end(); ++it) - { - assert(*it != NULL); - delete *it; - } - - for (VolumeLoaders::iterator it = volumeLoaders_.begin(); it != volumeLoaders_.end(); ++it) - { - assert(*it != NULL); - delete *it; - } - } - - - ISlicedVolume& SampleApplicationContext::AddSlicedVolume(ISlicedVolume* volume) - { - if (volume == NULL) - { - throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); - } - else - { - slicedVolumes_.push_back(volume); - return *volume; - } - } - - - IVolumeLoader& SampleApplicationContext::AddVolumeLoader(IVolumeLoader* loader) - { - if (loader == NULL) - { - throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); - } - else - { - volumeLoaders_.push_back(loader); - return *loader; - } - } - - - IWorldSceneInteractor& SampleApplicationContext::AddInteractor(IWorldSceneInteractor* interactor) - { - if (interactor == NULL) - { - throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); - } - - interactors_.push_back(interactor); - - return *interactor; - } -} - diff -r 092db46c6291 -r 50fb32abf85e Applications/Samples/SampleApplicationContext.h --- a/Applications/Samples/SampleApplicationContext.h Wed Jun 20 14:20:55 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/** - * Stone of Orthanc - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2018 Osimis S.A., Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - **/ - - -#pragma once - -#include "../../Framework/Viewport/WidgetViewport.h" -#include "../../Framework/Volumes/ISlicedVolume.h" -#include "../../Framework/Volumes/IVolumeLoader.h" -#include "../../Framework/Widgets/IWorldSceneInteractor.h" -#include "../../Platforms/Generic/OracleWebService.h" -#include "../BasicApplicationContext.h" - -#include -#include - - -#if ORTHANC_ENABLE_SDL==1 -#include "../Sdl/BasicSdlApplicationContext.h" -#else -#include "../Wasm/BasicWasmApplicationContext.h" -#endif - -namespace OrthancStone -{ - -//#if ORTHANC_ENABLE_SDL==1 -// class SampleApplicationContext : public BasicSdlApplicationContext -//#else -// class SampleApplicationContext : public BasicWasmApplicationContext -//#endif - class SampleApplicationContext : public BasicWasmApplicationContext - { - private: - typedef std::list SlicedVolumes; // this is actually used by the samples and shall be moved to a SampleApplicationContext - typedef std::list VolumeLoaders; - typedef std::list Interactors; - - SlicedVolumes slicedVolumes_; - VolumeLoaders volumeLoaders_; - Interactors interactors_; - - public: - -#if ORTHANC_ENABLE_SDL==1 - SampleApplicationContext(Orthanc::WebServiceParameters& orthanc, WidgetViewport* centralViewport) - : BasicSdlApplicationContext(orthanc, centralViewport) { - } -#else - SampleApplicationContext(IWebService& webService) - : BasicWasmApplicationContext(webService) { - } -#endif - - virtual ~SampleApplicationContext(); - - ISlicedVolume& AddSlicedVolume(ISlicedVolume* volume); - - IVolumeLoader& AddVolumeLoader(IVolumeLoader* loader); - - IWorldSceneInteractor& AddInteractor(IWorldSceneInteractor* interactor); - }; -} diff -r 092db46c6291 -r 50fb32abf85e Applications/Sdl/BasicSdlApplication.cpp --- a/Applications/Sdl/BasicSdlApplication.cpp Wed Jun 20 14:20:55 2018 +0200 +++ b/Applications/Sdl/BasicSdlApplication.cpp Wed Jun 20 14:27:06 2018 +0200 @@ -24,6 +24,7 @@ #endif #include "BasicSdlApplication.h" +#include #include "../../Framework/Toolbox/MessagingToolbox.h" #include "SdlEngine.h" diff -r 092db46c6291 -r 50fb32abf85e Applications/Sdl/BasicSdlApplication.h --- a/Applications/Sdl/BasicSdlApplication.h Wed Jun 20 14:20:55 2018 +0200 +++ b/Applications/Sdl/BasicSdlApplication.h Wed Jun 20 14:27:06 2018 +0200 @@ -21,11 +21,8 @@ #pragma once -#include "../BasicApplicationContext.h" #include "../IBasicApplication.h" -#include - #if ORTHANC_ENABLE_SDL != 1 #error this file shall be included only with the ORTHANC_ENABLE_SDL set to 1 #endif @@ -34,18 +31,13 @@ namespace OrthancStone { - class BasicSdlApplication : public IBasicApplication + class BasicSdlApplication { public: - virtual ~BasicSdlApplication() - { - } static int ExecuteWithSdl(IBasicApplication& application, int argc, char* argv[]); - - virtual void Finalize() {} }; } diff -r 092db46c6291 -r 50fb32abf85e Applications/Wasm/BasicWasmApplicationContext.cpp --- a/Applications/Wasm/BasicWasmApplicationContext.cpp Wed Jun 20 14:20:55 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -#include "BasicWasmApplicationContext.h" - -namespace OrthancStone -{ - -} \ No newline at end of file diff -r 092db46c6291 -r 50fb32abf85e Applications/Wasm/BasicWasmApplicationContext.h --- a/Applications/Wasm/BasicWasmApplicationContext.h Wed Jun 20 14:20:55 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/** - * Stone of Orthanc - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2018 Osimis S.A., Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - **/ - - -#pragma once - -#include "../BasicApplicationContext.h" - -#include - -namespace OrthancStone -{ - class BasicWasmApplicationContext : public BasicApplicationContext - { - private: - IWebService& webService_; - public: - BasicWasmApplicationContext(IWebService& webService) - : webService_(webService) - { - - } - - IWebService& GetWebService() - { - return webService_; - } - - virtual ~BasicWasmApplicationContext() {} - }; -} diff -r 092db46c6291 -r 50fb32abf85e Resources/CMake/OrthancStoneConfiguration.cmake --- a/Resources/CMake/OrthancStoneConfiguration.cmake Wed Jun 20 14:20:55 2018 +0200 +++ b/Resources/CMake/OrthancStoneConfiguration.cmake Wed Jun 20 14:27:06 2018 +0200 @@ -158,7 +158,6 @@ else() list(APPEND APPLICATIONS_SOURCES ${ORTHANC_STONE_ROOT}/Applications/Wasm/StartupParametersBuilder.cpp - # ${ORTHANC_STONE_ROOT}/Applications/Wasm/BasicWasmApplicationContext.cpp ) endif()