Mercurial > hg > orthanc-stone
annotate Framework/Layers/ILayerSource.h @ 96:f8bce1bebe01 wasm
removal of the NotifyLayerError callback
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 30 May 2017 10:30:57 +0200 |
parents | 64e60018943f |
children | d18dcc963930 |
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 "ILayerRenderer.h" |
77 | 25 #include "../Toolbox/Slice.h" |
65
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 namespace OrthancStone |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 { |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 class ILayerSource : public boost::noncopyable |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 { |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 public: |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 class IObserver : public boost::noncopyable |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 { |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 public: |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 virtual ~IObserver() |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 { |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 } |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 |
90
64e60018943f
fix and observer refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
39 // Triggered as soon as the source has enough information to |
64e60018943f
fix and observer refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
40 // answer to "GetExtent()" |
64e60018943f
fix and observer refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
41 virtual void NotifyGeometryReady(const ILayerSource& source) = 0; |
64e60018943f
fix and observer refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
42 |
64e60018943f
fix and observer refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
43 virtual void NotifyGeometryError(const ILayerSource& source) = 0; |
64e60018943f
fix and observer refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
44 |
89
f244018a4e4b
BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
45 // Triggered if the content of several slices in the source |
f244018a4e4b
BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
46 // volume has changed |
87
4a541cd4fa83
OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
86
diff
changeset
|
47 virtual void NotifyContentChange(const ILayerSource& source) = 0; |
65
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 |
89
f244018a4e4b
BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
49 // Triggered if the content of some individual slice in the |
f244018a4e4b
BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
50 // source volume has changed |
87
4a541cd4fa83
OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
86
diff
changeset
|
51 virtual void NotifySliceChange(const ILayerSource& source, |
77 | 52 const Slice& slice) = 0; |
89
f244018a4e4b
BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
53 |
96
f8bce1bebe01
removal of the NotifyLayerError callback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
90
diff
changeset
|
54 // The layer must be deleted by the observer that releases the |
f8bce1bebe01
removal of the NotifyLayerError callback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
90
diff
changeset
|
55 // std::auto_ptr |
90
64e60018943f
fix and observer refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
56 virtual void NotifyLayerReady(std::auto_ptr<ILayerRenderer>& layer, |
87
4a541cd4fa83
OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
86
diff
changeset
|
57 const ILayerSource& source, |
96
f8bce1bebe01
removal of the NotifyLayerError callback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
90
diff
changeset
|
58 const Slice& slice, |
f8bce1bebe01
removal of the NotifyLayerError callback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
90
diff
changeset
|
59 bool isError) = 0; |
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 virtual ~ILayerSource() |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 { |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 } |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 |
90
64e60018943f
fix and observer refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
66 virtual void Register(IObserver& observer) = 0; |
65
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 virtual bool GetExtent(double& x1, |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 double& y1, |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 double& x2, |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 double& y2, |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 const SliceGeometry& viewportSlice) = 0; |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 virtual void ScheduleLayerCreation(const SliceGeometry& viewportSlice) = 0; |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 }; |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 } |