changeset 243:50fb32abf85e am

cleanup
author am@osimis.io
date Wed, 20 Jun 2018 14:27:06 +0200
parents 092db46c6291
children 313903066093
files Applications/Samples/SampleApplicationContext.cpp Applications/Samples/SampleApplicationContext.h Applications/Sdl/BasicSdlApplication.cpp Applications/Sdl/BasicSdlApplication.h Applications/Wasm/BasicWasmApplicationContext.cpp Applications/Wasm/BasicWasmApplicationContext.h Resources/CMake/OrthancStoneConfiguration.cmake
diffstat 7 files changed, 2 insertions(+), 232 deletions(-) [+]
line wrap: on
line diff
--- 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 <http://www.gnu.org/licenses/>.
- **/
-
-
-#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;
-  }
-}
-
--- 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 <http://www.gnu.org/licenses/>.
- **/
-
-
-#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 <list>
-#include <boost/thread.hpp>
-
-
-#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<ISlicedVolume*>          SlicedVolumes;  // this is actually used by the samples and shall be moved to a SampleApplicationContext
-    typedef std::list<IVolumeLoader*>          VolumeLoaders;
-    typedef std::list<IWorldSceneInteractor*>  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);
-  };
-}
--- 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 <boost/program_options.hpp>
 
 #include "../../Framework/Toolbox/MessagingToolbox.h"
 #include "SdlEngine.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 <boost/program_options.hpp>
-
 #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() {}
   };
 
 }
--- 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
--- 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 <http://www.gnu.org/licenses/>.
- **/
-
-
-#pragma once
-
-#include "../BasicApplicationContext.h"
-
-#include <list>
-
-namespace OrthancStone
-{
-  class BasicWasmApplicationContext : public BasicApplicationContext
-  {
-  private:
-    IWebService& webService_;
-  public:
-    BasicWasmApplicationContext(IWebService& webService)
-    : webService_(webService)
-    {
-        
-    }
-
-    IWebService& GetWebService()
-    {
-      return webService_;
-    }
-
-    virtual ~BasicWasmApplicationContext() {}
-  };
-}
--- 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()