Mercurial > hg > orthanc-stone
comparison Framework/Radiography/RadiographyWidget.cpp @ 492:64d90190a08c am-touch-events
template GetLayer
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Wed, 20 Feb 2019 20:57:43 +0100 |
parents | a750f11892ec |
children | 11fa6f00e33c |
comparison
equal
deleted
inserted
replaced
488:aede9b042cb7 | 492:64d90190a08c |
---|---|
23 | 23 |
24 #include <Core/OrthancException.h> | 24 #include <Core/OrthancException.h> |
25 #include <Core/Images/Image.h> | 25 #include <Core/Images/Image.h> |
26 #include <Core/Images/ImageProcessing.h> | 26 #include <Core/Images/ImageProcessing.h> |
27 | 27 |
28 #include "RadiographyMaskLayer.h" | |
28 | 29 |
29 namespace OrthancStone | 30 namespace OrthancStone |
30 { | 31 { |
31 | 32 |
32 bool RadiographyWidget::IsInvertedInternal() const | 33 bool RadiographyWidget::IsInvertedInternal() const |
192 { | 193 { |
193 hasSelection_ = true; | 194 hasSelection_ = true; |
194 selectedLayer_ = layer; | 195 selectedLayer_ = layer; |
195 } | 196 } |
196 | 197 |
198 bool RadiographyWidget::SelectMaskLayer(size_t index) | |
199 { | |
200 std::vector<size_t> layerIndexes; | |
201 size_t count = 0; | |
202 scene_->GetLayersIndexes(layerIndexes); | |
203 | |
204 for (size_t i = 0; i < layerIndexes.size(); ++i) | |
205 { | |
206 const RadiographyMaskLayer* maskLayer = dynamic_cast<const RadiographyMaskLayer*>(&(scene_->GetLayer(layerIndexes[i]))); | |
207 if (maskLayer != NULL) | |
208 { | |
209 if (count == index) | |
210 { | |
211 Select(layerIndexes[i]); | |
212 return true; | |
213 } | |
214 count++; | |
215 } | |
216 } | |
217 | |
218 return false; | |
219 } | |
197 | 220 |
198 bool RadiographyWidget::LookupSelectedLayer(size_t& layer) | 221 bool RadiographyWidget::LookupSelectedLayer(size_t& layer) |
199 { | 222 { |
200 if (hasSelection_) | 223 if (hasSelection_) |
201 { | 224 { |