comparison Framework/Deprecated/Loaders/DicomStructureSetLoader2.h @ 1225:16738485e457 broker

deprecating DicomStructureSetLoader, OrthancMultiframeVolumeLoader and OrthancSeriesVolumeProgressiveLoader
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 08 Dec 2019 11:45:09 +0100
parents Framework/Loaders/DicomStructureSetLoader2.h@29f5f2031310
children 0ca50d275b9a
comparison
equal deleted inserted replaced
1224:37bc7f115f81 1225:16738485e457
1 /**
2 * Stone of Orthanc
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
6 *
7 * This program is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU Affero General Public License
9 * as published by the Free Software Foundation, either version 3 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Affero General Public License for more details.
16 *
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **/
20
21 #pragma once
22
23 #ifdef BGO_ENABLE_DICOMSTRUCTURESETLOADER2
24
25 #include "../Toolbox/DicomStructureSet2.h"
26 #include "../Messages/IMessage.h"
27 #include "../Messages/IObserver.h"
28 #include "../Messages/IObservable.h"
29 #include "../Oracle/OrthancRestApiCommand.h"
30
31 #include <boost/noncopyable.hpp>
32
33 namespace Deprecated
34 {
35 class IOracle;
36 class IObservable;
37 class OrthancRestApiCommand;
38 class OracleCommandExceptionMessage;
39
40 class DicomStructureSetLoader2 : public IObserver, public IObservable
41 {
42 public:
43 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, StructuresReady, DicomStructureSetLoader2);
44
45 /**
46 Warning: the structureSet, oracle and oracleObservable objects must live
47 at least as long as this object (TODO: shared_ptr?)
48 */
49 DicomStructureSetLoader2(DicomStructureSet2& structureSet, IOracle& oracle, IObservable& oracleObservable);
50
51 ~DicomStructureSetLoader2();
52
53 void LoadInstance(const std::string& instanceId);
54
55 /** Internal use */
56 void LoadInstanceFromString(const std::string& body);
57
58 void SetStructuresReady();
59 bool AreStructuresReady() const;
60
61 private:
62 /**
63 Called back by the oracle when data is ready!
64 */
65 void HandleSuccessMessage(const OrthancRestApiCommand::SuccessMessage& message);
66
67 /**
68 Called back by the oracle when shit hits the fan
69 */
70 void HandleExceptionMessage(const OracleCommandExceptionMessage& message);
71
72 /**
73 The structure set that will be (cleared and) filled with data from the
74 loader
75 */
76 DicomStructureSet2& structureSet_;
77
78 IOracle& oracle_;
79 IObservable& oracleObservable_;
80 bool structuresReady_;
81 };
82 }
83
84 #endif
85 // BGO_ENABLE_DICOMSTRUCTURESETLOADER2
86
87