diff Applications/BasicApplicationContext.cpp @ 102:fcec0ab44054 wasm

display volumes
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 31 May 2017 17:01:18 +0200
parents f244018a4e4b
children 71d574a3607f
line wrap: on
line diff
--- a/Applications/BasicApplicationContext.cpp	Wed May 31 10:35:20 2017 +0200
+++ b/Applications/BasicApplicationContext.cpp	Wed May 31 17:01:18 2017 +0200
@@ -80,33 +80,17 @@
   }
 
 
-  VolumeImage& BasicApplicationContext::AddSeriesVolume(const std::string& series,
-                                                        bool isProgressiveDownload,
-                                                        size_t downloadThreadCount)
+  ISlicedVolume& BasicApplicationContext::AddVolume(ISlicedVolume* volume)
   {
-    /*std::auto_ptr<VolumeImage> volume
-      (new VolumeImage(new OrthancSeriesLoader(GetWebService().GetConnection(), series)));
-
-    if (isProgressiveDownload)
+    if (volume == NULL)
     {
-      volume->SetDownloadPolicy(new VolumeImageProgressivePolicy);
-    }
-    else
-    {
-      volume->SetDownloadPolicy(new VolumeImageSimplePolicy);
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
     }
 
-    volume->SetThreadCount(downloadThreadCount);
-
-    VolumeImage& result = *volume;
-    volumes_.push_back(volume.release());
-
-    return result;*/
-
-    throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented);
+    volumes_.push_back(volume);
+    return *volume;
   }
 
-
   DicomStructureSet& BasicApplicationContext::AddStructureSet(const std::string& instance)
   {
     /*std::auto_ptr<DicomStructureSet> structureSet
@@ -125,7 +109,7 @@
   {
     if (interactor == NULL)
     {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
     }
 
     interactors_.push_back(interactor);
@@ -138,13 +122,6 @@
   {
     oracle_.Start();
 
-    // TODO REMOVE THIS
-    for (Volumes::iterator it = volumes_.begin(); it != volumes_.end(); ++it)
-    {
-      assert(*it != NULL);
-      (*it)->Start();
-    }
-
     if (viewport_.HasUpdateContent())
     {
       stopped_ = false;
@@ -162,13 +139,6 @@
       updateThread_.join();
     }
     
-    // TODO REMOVE THIS
-    for (Volumes::iterator it = volumes_.begin(); it != volumes_.end(); ++it)
-    {
-      assert(*it != NULL);
-      (*it)->Stop();
-    }
-
     oracle_.Stop();
   }
 }