Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/SlicesSorter.cpp @ 956:a7351ad54960
Made IsContextLost automatically set the flag by checking with the emscripten
WebGL wrapper + added a LOT of logging messages right before throwing
ErrorCode_BadSequenceOfCalls exceptions + increased the http request timeouts
from 60 to 600 sec (big datasets in some recent customer use cases) + added
IsContext lost through the Viewport/Context layer (to make it reachable from
external API) + the same for the underlying device context (for debug)
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 21 Aug 2019 16:16:30 +0200 |
parents | f7c236894c1a |
children | 24fecc02bfb1 |
comparison
equal
deleted
inserted
replaced
953:118fc5c85d07 | 956:a7351ad54960 |
---|---|
70 { | 70 { |
71 return *payload_; | 71 return *payload_; |
72 } | 72 } |
73 else | 73 else |
74 { | 74 { |
75 LOG(ERROR) << "SlicesSorter::SliceWithDepth::GetPayload(): (!HasPayload())"; | |
75 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); | 76 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); |
76 } | 77 } |
77 } | 78 } |
78 }; | 79 }; |
79 | 80 |
150 | 151 |
151 void SlicesSorter::SortInternal() | 152 void SlicesSorter::SortInternal() |
152 { | 153 { |
153 if (!hasNormal_) | 154 if (!hasNormal_) |
154 { | 155 { |
156 LOG(ERROR) << "SlicesSorter::SortInternal(): (!hasNormal_)"; | |
155 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); | 157 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); |
156 } | 158 } |
157 | 159 |
158 Comparator comparator; | 160 Comparator comparator; |
159 std::sort(slices_.begin(), slices_.end(), comparator); | 161 std::sort(slices_.begin(), slices_.end(), comparator); |
303 double p = reference.ProjectAlongNormal(GetSliceGeometry(1).GetOrigin()); | 305 double p = reference.ProjectAlongNormal(GetSliceGeometry(1).GetOrigin()); |
304 double spacingZ = p - referencePosition; | 306 double spacingZ = p - referencePosition; |
305 | 307 |
306 if (spacingZ <= 0) | 308 if (spacingZ <= 0) |
307 { | 309 { |
310 LOG(ERROR) << "SlicesSorter::ComputeSpacingBetweenSlices(): (spacingZ <= 0)"; | |
308 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls, | 311 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls, |
309 "Please call the Sort() method before"); | 312 "Please call the Sort() method before"); |
310 } | 313 } |
311 | 314 |
312 for (size_t i = 1; i < GetSlicesCount(); i++) | 315 for (size_t i = 1; i < GetSlicesCount(); i++) |