diff Framework/Layers/LayerSourceBase.cpp @ 86:02c3a7a4938f wasm

removing of the Start() mechanism
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 26 May 2017 13:42:50 +0200
parents f5f54ed8d307
children 4a541cd4fa83
line wrap: on
line diff
--- a/Framework/Layers/LayerSourceBase.cpp	Fri May 26 12:20:26 2017 +0200
+++ b/Framework/Layers/LayerSourceBase.cpp	Fri May 26 13:42:50 2017 +0200
@@ -27,11 +27,6 @@
 {
   void LayerSourceBase::NotifyGeometryReady()
   {
-    if (!started_)
-    {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
-    }
-
     if (observer_ != NULL)
     {
       observer_->NotifyGeometryReady(*this);
@@ -40,11 +35,6 @@
     
   void LayerSourceBase::NotifyGeometryError()
   {
-    if (!started_)
-    {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
-    }
-
     if (observer_ != NULL)
     {
       observer_->NotifyGeometryError(*this);
@@ -53,11 +43,6 @@
     
   void LayerSourceBase::NotifySourceChange()
   {
-    if (!started_)
-    {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
-    }
-
     if (observer_ != NULL)
     {
       observer_->NotifySourceChange(*this);
@@ -66,11 +51,6 @@
 
   void LayerSourceBase::NotifySliceChange(const Slice& slice)
   {
-    if (!started_)
-    {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
-    }
-
     if (observer_ != NULL)
     {
       observer_->NotifySliceChange(*this, slice);
@@ -82,11 +62,6 @@
   {
     std::auto_ptr<ILayerRenderer> tmp(layer);
     
-    if (!started_)
-    {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
-    }
-
     if (layer == NULL)
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
@@ -100,11 +75,6 @@
 
   void LayerSourceBase::NotifyLayerError(const SliceGeometry& slice)
   {
-    if (!started_)
-    {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
-    }
-
     if (observer_ != NULL)
     {
       observer_->NotifyLayerError(*this, slice);
@@ -113,11 +83,6 @@
 
   void LayerSourceBase::SetObserver(IObserver& observer)
   {
-    if (started_)
-    {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
-    }
-
     if (observer_ == NULL)
     {
       observer_ = &observer;
@@ -128,17 +93,4 @@
       throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
     }
   }
-
-  void LayerSourceBase::Start()
-  {
-    if (started_)
-    {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
-    }
-    else
-    {
-      started_ = true;
-      StartInternal();
-    }
-  }
 }