comparison OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp @ 1571:85e117739eca

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Sep 2020 17:46:39 +0200
parents 244ad1e4e76a
children 4fb8fdf03314
comparison
equal deleted inserted replaced
1570:9a04f42098a3 1571:85e117739eca
60 obj->LoaderStateMachine::PostConstructor(); 60 obj->LoaderStateMachine::PostConstructor();
61 return obj; 61 return obj;
62 } 62 }
63 63
64 protected: 64 protected:
65 RestInstanceLookupHandler(DicomStructureSetLoader& loader) 65 explicit RestInstanceLookupHandler(DicomStructureSetLoader& loader) :
66 : LoaderStateMachine(loader.loadersContext_) 66 LoaderStateMachine(loader.loadersContext_),
67 , loader_(loader) 67 loader_(loader)
68 { 68 {
69 } 69 }
70 70
71 virtual void RetrieveReferencedSlices(const std::set<std::string>& nonEmptyInstances) ORTHANC_OVERRIDE; 71 virtual void RetrieveReferencedSlices(const std::set<std::string>& nonEmptyInstances) ORTHANC_OVERRIDE;
72 72
89 State(that), 89 State(that),
90 instanceId_(instanceId) 90 instanceId_(instanceId)
91 { 91 {
92 } 92 }
93 93
94 virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) 94 virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE
95 { 95 {
96 Json::Value tags; 96 Json::Value tags;
97 message.ParseJsonBody(tags); 97 message.ParseJsonBody(tags);
98 98
99 Orthanc::DicomMap dicom; 99 Orthanc::DicomMap dicom;
118 State(that), 118 State(that),
119 sopInstanceUid_(sopInstanceUid) 119 sopInstanceUid_(sopInstanceUid)
120 { 120 {
121 } 121 }
122 122
123 virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) 123 virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE
124 { 124 {
125 DicomStructureSetLoader& loader = GetLoader<DicomStructureSetLoader>(); 125 DicomStructureSetLoader& loader = GetLoader<DicomStructureSetLoader>();
126 126
127 Json::Value lookup; 127 Json::Value lookup;
128 message.ParseJsonBody(lookup); 128 message.ParseJsonBody(lookup);
177 } 177 }
178 178
179 class DicomStructureSetLoader::LoadStructure : public LoaderStateMachine::State 179 class DicomStructureSetLoader::LoadStructure : public LoaderStateMachine::State
180 { 180 {
181 public: 181 public:
182 LoadStructure(DicomStructureSetLoader& that) : 182 explicit LoadStructure(DicomStructureSetLoader& that) :
183 State(that) 183 State(that)
184 { 184 {
185 } 185 }
186 186
187 virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) 187 virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE
188 { 188 {
189 DicomStructureSetLoader& loader = GetLoader<DicomStructureSetLoader>(); 189 DicomStructureSetLoader& loader = GetLoader<DicomStructureSetLoader>();
190 190
191 // Set the actual structure set content 191 // Set the actual structure set content
192 { 192 {
289 content of the vector at the corresponding index. 289 content of the vector at the corresponding index.
290 */ 290 */
291 Slice(const OrthancStone::DicomStructureSet& content, 291 Slice(const OrthancStone::DicomStructureSet& content,
292 uint64_t revision, 292 uint64_t revision,
293 const OrthancStone::CoordinateSystem3D& cuttingPlane, 293 const OrthancStone::CoordinateSystem3D& cuttingPlane,
294 std::vector<bool> visibility = std::vector<bool>()) 294 const std::vector<bool>& visibility) :
295 : content_(content) 295 content_(content),
296 , revision_(revision) 296 revision_(revision),
297 , visibility_(visibility) 297 visibility_(visibility)
298 { 298 {
299 ORTHANC_ASSERT((visibility_.size() == content_.GetStructuresCount()) 299 ORTHANC_ASSERT((visibility_.size() == content_.GetStructuresCount())
300 || (visibility_.size() == 0u)); 300 || (visibility_.size() == 0u));
301 301
302 bool opposite; 302 bool opposite;
306 OrthancStone::GeometryToolbox::IsParallelOrOpposite(opposite, normal, cuttingPlane.GetNormal()) || 306 OrthancStone::GeometryToolbox::IsParallelOrOpposite(opposite, normal, cuttingPlane.GetNormal()) ||
307 OrthancStone::GeometryToolbox::IsParallelOrOpposite(opposite, normal, cuttingPlane.GetAxisX()) || 307 OrthancStone::GeometryToolbox::IsParallelOrOpposite(opposite, normal, cuttingPlane.GetAxisX()) ||
308 OrthancStone::GeometryToolbox::IsParallelOrOpposite(opposite, normal, cuttingPlane.GetAxisY())); 308 OrthancStone::GeometryToolbox::IsParallelOrOpposite(opposite, normal, cuttingPlane.GetAxisY()));
309 } 309 }
310 310
311 virtual bool IsValid() 311 virtual bool IsValid() ORTHANC_OVERRIDE
312 { 312 {
313 return isValid_; 313 return isValid_;
314 } 314 }
315 315
316 virtual uint64_t GetRevision() 316 virtual uint64_t GetRevision() ORTHANC_OVERRIDE
317 { 317 {
318 return revision_; 318 return revision_;
319 } 319 }
320 320
321 virtual OrthancStone::ISceneLayer* CreateSceneLayer( 321 virtual OrthancStone::ISceneLayer* CreateSceneLayer(
322 const OrthancStone::ILayerStyleConfigurator* configurator, 322 const OrthancStone::ILayerStyleConfigurator* configurator,
323 const OrthancStone::CoordinateSystem3D& cuttingPlane) 323 const OrthancStone::CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE
324 { 324 {
325 assert(isValid_); 325 assert(isValid_);
326 326
327 std::unique_ptr<OrthancStone::PolylineSceneLayer> layer(new OrthancStone::PolylineSceneLayer); 327 std::unique_ptr<OrthancStone::PolylineSceneLayer> layer(new OrthancStone::PolylineSceneLayer);
328 layer->SetThickness(2); 328 layer->SetThickness(2);