annotate Framework/Deprecated/Widgets/SliceViewerWidget.h @ 1510:1005c1cbe4dd

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Jul 2020 09:45:27 +0200
parents 257f2c9a02ac
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1270
2d8ab34c8c91 upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 732
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
267
89d02de83c03 added declaretion of messages handled/emitted
am@osimis.io
parents: 266
diff changeset
16 *
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "WorldSceneWidget.h"
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 394
diff changeset
25 #include "../Layers/IVolumeSlicer.h"
732
c35e98d22764 move Deprecated classes to a separate folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 726
diff changeset
26 #include "../../Toolbox/Extent2D.h"
1066
b537002f83a9 removing broker from deprecated classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 732
diff changeset
27 #include "../../Messages/ObserverBase.h"
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #include <map>
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
31 namespace Deprecated
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
388
20f149669c1f renamed LayerWidget as SliceViewerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 386
diff changeset
33 class SliceViewerWidget :
20f149669c1f renamed LayerWidget as SliceViewerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 386
diff changeset
34 public WorldSceneWidget,
1066
b537002f83a9 removing broker from deprecated classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 732
diff changeset
35 public OrthancStone::ObserverBase<SliceViewerWidget>,
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
36 public OrthancStone::IObservable
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 {
299
3897f9f28cfa backup work in progress: updated messaging framework with ICallable
am@osimis.io
parents: 273
diff changeset
38 public:
643
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 547
diff changeset
39 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, GeometryChangedMessage, SliceViewerWidget);
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 547
diff changeset
40 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, ContentChangedMessage, SliceViewerWidget);
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 547
diff changeset
41
299
3897f9f28cfa backup work in progress: updated messaging framework with ICallable
am@osimis.io
parents: 273
diff changeset
42
400
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
43 // TODO - Use this message in ReferenceLineSource
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
44 class DisplayedSliceMessage : public OrthancStone::OriginMessage<SliceViewerWidget>
400
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
45 {
643
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 547
diff changeset
46 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 547
diff changeset
47
400
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
48 private:
714
d2c0e347ddc2 deprecating DicomFrameConverter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 643
diff changeset
49 const Deprecated::Slice& slice_;
400
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
50
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
51 public:
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
52 DisplayedSliceMessage(SliceViewerWidget& origin,
714
d2c0e347ddc2 deprecating DicomFrameConverter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 643
diff changeset
53 const Deprecated::Slice& slice) :
400
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
54 OriginMessage(origin),
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
55 slice_(slice)
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
56 {
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
57 }
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
58
714
d2c0e347ddc2 deprecating DicomFrameConverter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 643
diff changeset
59 const Deprecated::Slice& GetSlice() const
400
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
60 {
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
61 return slice_;
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
62 }
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
63 };
518f680dbf2e SliceViewerWidget::DisplayedSliceMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 399
diff changeset
64
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 private:
547
0f43e479b49c Removed old rtstruct demo (correct one on its way) + Many warning fixes (mostly 64-bit ?) + reformat + small fixes + indent (breaking long lines)
Benjamin Golinvaux <bgo@osimis.io>
parents: 439
diff changeset
66 SliceViewerWidget(const SliceViewerWidget&);
0f43e479b49c Removed old rtstruct demo (correct one on its way) + Many warning fixes (mostly 64-bit ?) + reformat + small fixes + indent (breaking long lines)
Benjamin Golinvaux <bgo@osimis.io>
parents: 439
diff changeset
67 SliceViewerWidget& operator=(const SliceViewerWidget&);
0f43e479b49c Removed old rtstruct demo (correct one on its way) + Many warning fixes (mostly 64-bit ?) + reformat + small fixes + indent (breaking long lines)
Benjamin Golinvaux <bgo@osimis.io>
parents: 439
diff changeset
68
1299
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
69 class Scene : public boost::noncopyable
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
70 {
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
71 private:
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
72 OrthancStone::CoordinateSystem3D plane_;
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
73 double thickness_;
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
74 size_t countMissing_;
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
75 std::vector<ILayerRenderer*> renderers_;
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
76
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
77 public:
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
78 void DeleteLayer(size_t index);
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
79
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
80 Scene(const OrthancStone::CoordinateSystem3D& plane,
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
81 double thickness,
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
82 size_t countLayers);
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
83
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
84 ~Scene();
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
85
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
86 void SetLayer(size_t index,
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
87 ILayerRenderer* renderer); // Takes ownership
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
88
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
89 const OrthancStone::CoordinateSystem3D& GetPlane() const
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
90 {
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
91 return plane_;
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
92 }
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
93
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
94 bool HasRenderer(size_t index)
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
95 {
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
96 return renderers_[index] != NULL;
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
97 }
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
98
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
99 bool IsComplete() const
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
100 {
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
101 return countMissing_ == 0;
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
102 }
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
103
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
104 unsigned int GetCountMissing() const
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
105 {
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
106 return static_cast<unsigned int>(countMissing_);
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
107 }
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
108
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
109 bool RenderScene(OrthancStone::CairoContext& context,
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
110 const ViewportGeometry& view,
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
111 const OrthancStone::CoordinateSystem3D& viewportPlane);
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
112
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
113 void SetLayerStyle(size_t index,
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
114 const RenderStyle& style);
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
115
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
116 bool ContainsPlane(const OrthancStone::CoordinateSystem3D& plane) const;
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
117
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
118 double GetThickness() const
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
119 {
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
120 return thickness_;
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
121 }
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
122 };
c38c89684d83 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
123
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 394
diff changeset
125 typedef std::map<const IVolumeSlicer*, size_t> LayersIndex;
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 394
diff changeset
127 bool started_;
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 394
diff changeset
128 LayersIndex layersIndex_;
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
129 std::vector<boost::shared_ptr<IVolumeSlicer> > layers_;
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 394
diff changeset
130 std::vector<RenderStyle> styles_;
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
131 OrthancStone::CoordinateSystem3D plane_;
1298
8a0a62189f46 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
132 std::unique_ptr<Scene> currentScene_;
8a0a62189f46 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
133 std::unique_ptr<Scene> pendingScene_;
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 394
diff changeset
134 std::vector<bool> changedLayers_;
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 bool LookupLayer(size_t& index /* out */,
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 394
diff changeset
137 const IVolumeSlicer& layer) const;
85
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 78
diff changeset
138
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
139 void GetLayerExtent(OrthancStone::Extent2D& extent,
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 394
diff changeset
140 IVolumeSlicer& source) const;
77
f5f54ed8d307 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 66
diff changeset
141
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 394
diff changeset
142 void OnGeometryReady(const IVolumeSlicer::GeometryReadyMessage& message);
90
64e60018943f fix and observer refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 89
diff changeset
143
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 394
diff changeset
144 virtual void OnContentChanged(const IVolumeSlicer::ContentChangedMessage& message);
77
f5f54ed8d307 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 66
diff changeset
145
399
885e1ebd315c rename SliceChange as SliceContentChange
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 396
diff changeset
146 virtual void OnSliceChanged(const IVolumeSlicer::SliceContentChangedMessage& message);
77
f5f54ed8d307 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 66
diff changeset
147
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 394
diff changeset
148 virtual void OnLayerReady(const IVolumeSlicer::LayerReadyMessage& message);
77
f5f54ed8d307 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 66
diff changeset
149
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 394
diff changeset
150 virtual void OnLayerError(const IVolumeSlicer::LayerErrorMessage& message);
380
ba5ad93f935a ILayerSource::LayerErrorMessage
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
151
396
ed7146fa2c98 rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 394
diff changeset
152 void ObserveLayer(IVolumeSlicer& source);
251
192e6e349e69 first usage of new message system (in SDL only)
am@osimis.io
parents: 219
diff changeset
153
103
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
154 void ResetChangedLayers();
112
948f86e61e83 start of SliceLocationSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 111
diff changeset
155
948f86e61e83 start of SliceLocationSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 111
diff changeset
156 public:
1066
b537002f83a9 removing broker from deprecated classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 732
diff changeset
157 SliceViewerWidget(const std::string& name);
251
192e6e349e69 first usage of new message system (in SDL only)
am@osimis.io
parents: 219
diff changeset
158
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
159 virtual OrthancStone::Extent2D GetSceneExtent();
267
89d02de83c03 added declaretion of messages handled/emitted
am@osimis.io
parents: 266
diff changeset
160
112
948f86e61e83 start of SliceLocationSource
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 111
diff changeset
161 protected:
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
162 virtual bool RenderScene(OrthancStone::CairoContext& context,
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 const ViewportGeometry& view);
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 void ResetPendingScene();
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 void UpdateLayer(size_t index,
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 ILayerRenderer* renderer,
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
169 const OrthancStone::CoordinateSystem3D& plane);
89
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
170
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
171 void InvalidateAllLayers();
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
172
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
173 void InvalidateLayer(size_t layer);
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 public:
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
176 virtual ~SliceViewerWidget()
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
177 {
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
178 }
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
180 size_t AddLayer(boost::shared_ptr<IVolumeSlicer> layer);
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181
1068
04a95ee91327 recovery of OrthancStoneSingleFrame
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
182 void ReplaceLayer(size_t layerIndex, boost::shared_ptr<IVolumeSlicer> layer); // Takes ownership
219
26e3bfe30e66 ReplaceLayer()
am@osimis.io
parents: 135
diff changeset
183
315
aad37d0b6407 Added LayerWidget::RemoveLayer + DELETE commands in WebService
am@osimis.io
parents: 300
diff changeset
184 void RemoveLayer(size_t layerIndex);
aad37d0b6407 Added LayerWidget::RemoveLayer + DELETE commands in WebService
am@osimis.io
parents: 300
diff changeset
185
89
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
186 size_t GetLayerCount() const
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
187 {
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
188 return layers_.size();
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
189 }
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
190
119
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 112
diff changeset
191 const RenderStyle& GetLayerStyle(size_t layer) const;
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 112
diff changeset
192
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 void SetLayerStyle(size_t layer,
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 const RenderStyle& style);
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
196 void SetSlice(const OrthancStone::CoordinateSystem3D& plane);
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
198 const OrthancStone::CoordinateSystem3D& GetSlice() const
85
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 78
diff changeset
199 {
394
17d54c028805 rename ILayerRenderer::GetLayerSlice() to GetLayerPlane()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 388
diff changeset
200 return plane_;
85
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 78
diff changeset
201 }
103
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
202
386
e33659decec5 renamed UpdateContent() as DoAnimation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
203 virtual bool HasAnimation() const
103
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
204 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
205 return true;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
206 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 97
diff changeset
207
386
e33659decec5 renamed UpdateContent() as DoAnimation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 380
diff changeset
208 virtual void DoAnimation();
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 };
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 }