comparison Framework/Radiography/RadiographySceneReader.h @ 1279:7ec8fea061b9 broker

integration mainline->broker
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 Feb 2020 15:20:08 +0100
parents bdc6837d5917 69177b10e2b9
children 68579a31eeb4
comparison
equal deleted inserted replaced
1271:0ca50d275b9a 1279:7ec8fea061b9
31 #include <json/value.h> 31 #include <json/value.h>
32 #include <Core/Images/FontRegistry.h> 32 #include <Core/Images/FontRegistry.h>
33 33
34 namespace OrthancStone 34 namespace OrthancStone
35 { 35 {
36 // a layer containing only the geometry of a DICOM layer (bit hacky !)
37 class RadiographyPlaceholderLayer : public RadiographyDicomLayer
38 {
39 public:
40 RadiographyPlaceholderLayer(const RadiographyScene& scene) :
41 RadiographyDicomLayer(scene)
42 {
43 }
44
45 };
46
47
36 // HACK: I had to introduce this builder class in order to be able to recreate a RadiographyScene 48 // HACK: I had to introduce this builder class in order to be able to recreate a RadiographyScene
37 // from a serialized scene that is passed to web-workers. 49 // from a serialized scene that is passed to web-workers.
38 // It needs some architecturing... 50 // It needs some architecturing...
39 class RadiographySceneBuilder : public boost::noncopyable 51 class RadiographySceneBuilder : public boost::noncopyable
40 { 52 {
66 }; 78 };
67 79
68 80
69 class RadiographySceneReader : public RadiographySceneBuilder 81 class RadiographySceneReader : public RadiographySceneBuilder
70 { 82 {
71 private: 83 Deprecated::OrthancApiClient& orthancApiClient_;
72 boost::shared_ptr<Deprecated::OrthancApiClient> orthancApiClient_;
73 84
74 public: 85 public:
75 RadiographySceneReader(RadiographyScene& scene, 86 RadiographySceneReader(RadiographyScene& scene, Deprecated::OrthancApiClient& orthancApiClient) :
76 boost::shared_ptr<Deprecated::OrthancApiClient> orthancApiClient) :
77 RadiographySceneBuilder(scene), 87 RadiographySceneBuilder(scene),
78 orthancApiClient_(orthancApiClient) 88 orthancApiClient_(orthancApiClient)
79 { 89 {
80 } 90 }
81 91
82 void Read(const Json::Value& input); 92 protected:
93 virtual RadiographyDicomLayer* LoadDicom(const std::string& instanceId, unsigned int frame, RadiographyLayer::Geometry* geometry);
94 };
95
96 // reads the whole scene but the DICOM image such that we have the full geometry
97 class RadiographySceneGeometryReader : public RadiographySceneBuilder
98 {
99 unsigned int dicomImageWidth_;
100 unsigned int dicomImageHeight_;
101
102 public:
103 RadiographySceneGeometryReader(RadiographyScene& scene, unsigned int dicomImageWidth, unsigned int dicomImageHeight) :
104 RadiographySceneBuilder(scene),
105 dicomImageWidth_(dicomImageWidth),
106 dicomImageHeight_(dicomImageHeight)
107 {
108 }
83 109
84 protected: 110 protected:
85 virtual RadiographyDicomLayer* LoadDicom(const std::string& instanceId, unsigned int frame, RadiographyLayer::Geometry* geometry); 111 virtual RadiographyDicomLayer* LoadDicom(const std::string& instanceId, unsigned int frame, RadiographyLayer::Geometry* geometry);
86 }; 112 };
87 } 113 }