comparison Framework/Layers/LayerSourceBase.cpp @ 77:f5f54ed8d307 wasm

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 24 May 2017 21:13:29 +0200
parents 298f375dcb68
children 02c3a7a4938f
comparison
equal deleted inserted replaced
76:0aef120d7e1c 77:f5f54ed8d307
36 { 36 {
37 observer_->NotifyGeometryReady(*this); 37 observer_->NotifyGeometryReady(*this);
38 } 38 }
39 } 39 }
40 40
41 void LayerSourceBase::NotifyGeometryError()
42 {
43 if (!started_)
44 {
45 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
46 }
47
48 if (observer_ != NULL)
49 {
50 observer_->NotifyGeometryError(*this);
51 }
52 }
53
41 void LayerSourceBase::NotifySourceChange() 54 void LayerSourceBase::NotifySourceChange()
42 { 55 {
43 if (!started_) 56 if (!started_)
44 { 57 {
45 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 58 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
49 { 62 {
50 observer_->NotifySourceChange(*this); 63 observer_->NotifySourceChange(*this);
51 } 64 }
52 } 65 }
53 66
54 void LayerSourceBase::NotifySliceChange(const SliceGeometry& slice) 67 void LayerSourceBase::NotifySliceChange(const Slice& slice)
55 { 68 {
56 if (!started_) 69 if (!started_)
57 { 70 {
58 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 71 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
59 } 72 }
63 observer_->NotifySliceChange(*this, slice); 76 observer_->NotifySliceChange(*this, slice);
64 } 77 }
65 } 78 }
66 79
67 void LayerSourceBase::NotifyLayerReady(ILayerRenderer* layer, 80 void LayerSourceBase::NotifyLayerReady(ILayerRenderer* layer,
68 const SliceGeometry& viewportSlice) 81 const Slice& slice)
69 { 82 {
70 std::auto_ptr<ILayerRenderer> tmp(layer); 83 std::auto_ptr<ILayerRenderer> tmp(layer);
71 84
72 if (!started_) 85 if (!started_)
73 { 86 {
79 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 92 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
80 } 93 }
81 94
82 if (observer_ != NULL) 95 if (observer_ != NULL)
83 { 96 {
84 observer_->NotifyLayerReady(tmp.release(), *this, viewportSlice); 97 observer_->NotifyLayerReady(tmp.release(), *this, slice);
85 } 98 }
86 } 99 }
87 100
88 void LayerSourceBase::NotifyLayerError(const SliceGeometry& viewportSlice) 101 void LayerSourceBase::NotifyLayerError(const SliceGeometry& slice)
89 { 102 {
90 if (!started_) 103 if (!started_)
91 { 104 {
92 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 105 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
93 } 106 }
94 107
95 if (observer_ != NULL) 108 if (observer_ != NULL)
96 { 109 {
97 observer_->NotifyLayerError(*this, viewportSlice); 110 observer_->NotifyLayerError(*this, slice);
98 } 111 }
99 } 112 }
100 113
101 void LayerSourceBase::SetObserver(IObserver& observer) 114 void LayerSourceBase::SetObserver(IObserver& observer)
102 { 115 {