comparison Framework/Layers/OrthancFrameLayerSource.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 bd48431ac285
children f244018a4e4b
comparison
equal deleted inserted replaced
85:bd48431ac285 86:02c3a7a4938f
89 instanceId_(instanceId), 89 instanceId_(instanceId),
90 frame_(frame), 90 frame_(frame),
91 loader_(*this, orthanc), 91 loader_(*this, orthanc),
92 observer2_(NULL) 92 observer2_(NULL)
93 { 93 {
94 loader_.ScheduleLoadInstance(instanceId_, frame_);
94 } 95 }
95 96
96 97
97 void OrthancFrameLayerSource::StartInternal()
98 {
99 loader_.ScheduleLoadInstance(instanceId_, frame_);
100 }
101
102
103 void OrthancFrameLayerSource::SetObserver(IVolumeSlicesObserver& observer) 98 void OrthancFrameLayerSource::SetObserver(IVolumeSlicesObserver& observer)
104 { 99 {
105 if (IsStarted())
106 {
107 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
108 }
109
110 if (observer2_ == NULL) 100 if (observer2_ == NULL)
111 { 101 {
112 observer2_ = &observer; 102 observer2_ = &observer;
113 } 103 }
114 else 104 else
161 151
162 void OrthancFrameLayerSource::ScheduleLayerCreation(const SliceGeometry& viewportSlice) 152 void OrthancFrameLayerSource::ScheduleLayerCreation(const SliceGeometry& viewportSlice)
163 { 153 {
164 size_t index; 154 size_t index;
165 155
166 if (loader_.IsGeometryReady() && 156 if (loader_.IsGeometryReady())
167 loader_.LookupSlice(index, viewportSlice))
168 { 157 {
169 loader_.ScheduleLoadSliceImage(index); 158 if (loader_.LookupSlice(index, viewportSlice))
170 } 159 {
171 else 160 loader_.ScheduleLoadSliceImage(index);
172 { 161 }
173 LayerSourceBase::NotifyLayerError(viewportSlice); 162 else
163 {
164 LayerSourceBase::NotifyLayerError(viewportSlice);
165 }
174 } 166 }
175 } 167 }
176 } 168 }