Mercurial > hg > orthanc-stone
annotate Framework/Layers/ILayerSource.h @ 148:c6a464c266dd wasm
accessors
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 24 Jan 2018 15:30:51 +0100 |
parents | e2fe9352f240 |
children | 3d523c9a8f0d 192e6e349e69 |
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 |
135
e2fe9352f240
upgrade to year 2018
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
121
diff
changeset
|
5 * Copyright (C) 2017-2018 Osimis S.A., Belgium |
65
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, |
121
e66b2c757790
displaying rt-struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
112
diff
changeset
|
58 const CoordinateSystem3D& slice, |
112
948f86e61e83
start of SliceLocationSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
59 bool isError) = 0; // TODO Shouldn't this be separate as NotifyLayerError? |
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 |
97
d18dcc963930
separation of the renderers vs. viewport slice
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
96
diff
changeset
|
68 virtual bool GetExtent(std::vector<Vector>& points, |
110
53025eecbc95
renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
97
diff
changeset
|
69 const CoordinateSystem3D& viewportSlice) = 0; |
65
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 |
110
53025eecbc95
renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
97
diff
changeset
|
71 virtual void ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice) = 0; |
65
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 }; |
885932a893de
OrthancFrameLayerSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 } |