comparison Framework/Layers/OrthancFrameLayerSource.cpp @ 85:bd48431ac285 wasm

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 26 May 2017 12:20:26 +0200
parents f5f54ed8d307
children 02c3a7a4938f
comparison
equal deleted inserted replaced
83:c75377306598 85:bd48431ac285
46 return; 46 return;
47 } 47 }
48 } 48 }
49 } 49 }
50 50
51 LayerSourceBase::NotifyGeometryReady();
52
51 if (observer2_ != NULL) 53 if (observer2_ != NULL)
52 { 54 {
53 ParallelSlices slices; 55 ParallelSlices slices;
54 56
55 for (size_t i = 0; i < loader.GetSliceCount(); i++) 57 for (size_t i = 0; i < loader.GetSliceCount(); i++)
57 slices.AddSlice(loader.GetSlice(i).GetGeometry()); 59 slices.AddSlice(loader.GetSlice(i).GetGeometry());
58 } 60 }
59 61
60 observer2_->NotifySlicesAvailable(slices); 62 observer2_->NotifySlicesAvailable(slices);
61 } 63 }
62
63 LayerSourceBase::NotifyGeometryReady();
64 } 64 }
65 65
66 void OrthancFrameLayerSource::NotifyGeometryError(const OrthancSlicesLoader& loader) 66 void OrthancFrameLayerSource::NotifyGeometryError(const OrthancSlicesLoader& loader)
67 { 67 {
68 LayerSourceBase::NotifyGeometryError(); 68 LayerSourceBase::NotifyGeometryError();
121 121
122 bool OrthancFrameLayerSource::GetExtent(double& x1, 122 bool OrthancFrameLayerSource::GetExtent(double& x1,
123 double& y1, 123 double& y1,
124 double& x2, 124 double& x2,
125 double& y2, 125 double& y2,
126 const SliceGeometry& viewportSlice /* ignored */) 126 const SliceGeometry& viewportSlice)
127 { 127 {
128 bool ok = false; 128 bool ok = false;
129 129
130 if (IsStarted() && 130 if (loader_.IsGeometryReady())
131 loader_.IsGeometryReady())
132 { 131 {
133 double tx1, ty1, tx2, ty2; 132 double tx1, ty1, tx2, ty2;
134 133
135 for (size_t i = 0; i < loader_.GetSliceCount(); i++) 134 for (size_t i = 0; i < loader_.GetSliceCount(); i++)
136 { 135 {
162 161
163 void OrthancFrameLayerSource::ScheduleLayerCreation(const SliceGeometry& viewportSlice) 162 void OrthancFrameLayerSource::ScheduleLayerCreation(const SliceGeometry& viewportSlice)
164 { 163 {
165 size_t index; 164 size_t index;
166 165
167 if (!IsStarted() || 166 if (loader_.IsGeometryReady() &&
168 !loader_.IsGeometryReady()) 167 loader_.LookupSlice(index, viewportSlice))
169 {
170 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
171 }
172 else if (loader_.LookupSlice(index, viewportSlice))
173 { 168 {
174 loader_.ScheduleLoadSliceImage(index); 169 loader_.ScheduleLoadSliceImage(index);
175 } 170 }
176 else 171 else
177 { 172 {