Mercurial > hg > orthanc-stone
annotate Framework/Layers/LayerSourceBase.h @ 79:4e21f6b3aa0d wasm
cleaning up
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 24 May 2017 21:23:29 +0200 |
parents | f5f54ed8d307 |
children | 02c3a7a4938f |
rev | line source |
---|---|
65
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Stone of Orthanc |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * Copyright (C) 2017 Osimis, Belgium |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Affero General Public License |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * the License, or (at your option) any later version. |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, but |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * Affero General Public License for more details. |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Affero General Public License |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 **/ |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 #pragma once |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 #include "ILayerSource.h" |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 namespace OrthancStone |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 { |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 class LayerSourceBase : public ILayerSource |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 { |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 private: |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 IObserver* observer_; |
66 | 32 bool started_; |
65
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 protected: |
66 | 35 bool IsStarted() |
36 { | |
37 return started_; | |
38 } | |
39 | |
40 void NotifyGeometryReady(); | |
41 | |
77 | 42 void NotifyGeometryError(); |
43 | |
65
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 void NotifySourceChange(); |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 |
77 | 46 void NotifySliceChange(const Slice& slice); |
65
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 // Takes ownership of "layer" (that cannot be "NULL") |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 void NotifyLayerReady(ILayerRenderer* layer, |
77 | 50 const Slice& slice); |
65
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 |
77 | 52 void NotifyLayerError(const SliceGeometry& slice); |
66 | 53 |
54 virtual void StartInternal() = 0; | |
65
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 public: |
66 | 57 LayerSourceBase() : |
58 observer_(NULL), | |
59 started_(false) | |
65
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 { |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 } |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 virtual void SetObserver(IObserver& observer); |
66 | 64 |
65 virtual void Start(); | |
65
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 }; |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 } |