comparison Applications/Samples/SingleFrameApplication.h @ 647:6af3099ed8da

uncoupling OrthancStone::SlicesSorter from OrthancStone::Slice
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 13 May 2019 17:03:46 +0200
parents 45f4953f4162
children 4f2416d519b4
comparison
equal deleted inserted replaced
646:b4fe9642e83b 647:6af3099ed8da
134 if (slice < 0) 134 if (slice < 0)
135 { 135 {
136 slice = 0; 136 slice = 0;
137 } 137 }
138 138
139 if (slice >= static_cast<int>(source_->GetSliceCount())) 139 if (slice >= static_cast<int>(source_->GetSlicesCount()))
140 { 140 {
141 slice = static_cast<int>(source_->GetSliceCount()) - 1; 141 slice = static_cast<int>(source_->GetSlicesCount()) - 1;
142 } 142 }
143 143
144 if (slice != static_cast<int>(slice_)) 144 if (slice != static_cast<int>(slice_))
145 { 145 {
146 SetSlice(slice); 146 SetSlice(slice);
156 156
157 157
158 void SetSlice(size_t index) 158 void SetSlice(size_t index)
159 { 159 {
160 if (source_ != NULL && 160 if (source_ != NULL &&
161 index < source_->GetSliceCount()) 161 index < source_->GetSlicesCount())
162 { 162 {
163 slice_ = static_cast<unsigned int>(index); 163 slice_ = static_cast<unsigned int>(index);
164 164
165 #if 1 165 #if 1
166 GetMainWidget().SetSlice(source_->GetSlice(slice_).GetGeometry()); 166 GetMainWidget().SetSlice(source_->GetSlice(slice_).GetGeometry());
189 // Once the geometry of the series is downloaded from Orthanc, 189 // Once the geometry of the series is downloaded from Orthanc,
190 // display its middle slice, and adapt the viewport to fit this 190 // display its middle slice, and adapt the viewport to fit this
191 // slice 191 // slice
192 if (source_ == &message.GetOrigin()) 192 if (source_ == &message.GetOrigin())
193 { 193 {
194 SetSlice(source_->GetSliceCount() / 2); 194 SetSlice(source_->GetSlicesCount() / 2);
195 } 195 }
196 196
197 GetMainWidget().FitContent(); 197 GetMainWidget().FitContent();
198 } 198 }
199 199