Mercurial > hg > orthanc-stone
comparison Framework/SmartLoader.h @ 318:3a4ca166fafa am-2
ImageAccessor refactoring + implemented Image Cache in SmartLoader
author | am@osimis.io |
---|---|
date | Mon, 08 Oct 2018 17:10:08 +0200 |
parents | b66d13708f40 |
children | a902a07769d4 |
comparison
equal
deleted
inserted
replaced
317:b66d13708f40 | 318:3a4ca166fafa |
---|---|
26 #include "Messages/IObservable.h" | 26 #include "Messages/IObservable.h" |
27 #include "Toolbox/OrthancApiClient.h" | 27 #include "Toolbox/OrthancApiClient.h" |
28 | 28 |
29 namespace OrthancStone | 29 namespace OrthancStone |
30 { | 30 { |
31 class SmartLoader : public IObservable, IObserver | 31 class LayerWidget; |
32 | |
33 class SmartLoader : public IObservable, public IObserver | |
32 { | 34 { |
35 struct CachedSlice; | |
36 | |
37 protected: | |
38 typedef std::map<std::string, boost::shared_ptr<SmartLoader::CachedSlice>> CachedSlices; | |
39 CachedSlices cachedSlices_; | |
40 | |
33 SliceImageQuality imageQuality_; | 41 SliceImageQuality imageQuality_; |
34 OrthancApiClient& orthancApiClient_; | 42 OrthancApiClient& orthancApiClient_; |
35 | 43 |
36 int studyListRequest_; | 44 int studyListRequest_; |
37 | 45 |
42 void PreloadSeries(const std::string seriesId); | 50 void PreloadSeries(const std::string seriesId); |
43 void LoadStudyList(); | 51 void LoadStudyList(); |
44 | 52 |
45 void SetImageQuality(SliceImageQuality imageQuality) { imageQuality_ = imageQuality; } | 53 void SetImageQuality(SliceImageQuality imageQuality) { imageQuality_ = imageQuality; } |
46 | 54 |
47 ILayerSource* GetFrame(const std::string& instanceId, unsigned int frame); | 55 void SetFrameInWidget(LayerWidget& layerWidget, size_t layerIndex, const std::string& instanceId, unsigned int frame); |
48 | 56 |
49 void GetFirstInstanceIdForSeries(std::string& output, const std::string& seriesId); | 57 void GetFirstInstanceIdForSeries(std::string& output, const std::string& seriesId); |
58 | |
59 private: | |
60 void OnLayerGeometryReady(const ILayerSource::GeometryReadyMessage& message); | |
61 void OnImageReady(const ILayerSource::ImageReadyMessage& message); | |
62 void OnLayerReady(const ILayerSource::LayerReadyMessage& message); | |
50 | 63 |
51 }; | 64 }; |
52 | 65 |
53 } | 66 } |