annotate Framework/Layers/SliceOutlineRenderer.h @ 418:c23df8b3433b

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 15 Nov 2018 18:32:48 +0100
parents e2fe9352f240
children b70e9be013e4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
88
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
90bf4116a23c ISlicedVolume
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: 119
diff changeset
5 * Copyright (C) 2017-2018 Osimis S.A., Belgium
88
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "ILayerRenderer.h"
99
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
25 #include "../Toolbox/Slice.h"
88
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 namespace OrthancStone
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 {
99
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
29 class SliceOutlineRenderer : public ILayerRenderer
88
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 {
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 private:
119
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
32 CoordinateSystem3D geometry_;
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
33 double pixelSpacingX_;
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
34 double pixelSpacingY_;
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
35 unsigned int width_;
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
36 unsigned int height_;
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
37 RenderStyle style_;
88
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 public:
119
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
40 SliceOutlineRenderer(const Slice& slice) :
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
41 geometry_(slice.GetGeometry()),
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
42 pixelSpacingX_(slice.GetPixelSpacingX()),
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
43 pixelSpacingY_(slice.GetPixelSpacingY()),
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
44 width_(slice.GetWidth()),
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
45 height_(slice.GetHeight())
88
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 {
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 }
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 virtual bool RenderLayer(CairoContext& context,
99
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
50 const ViewportGeometry& view);
88
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 virtual void SetLayerStyle(const RenderStyle& style)
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 {
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 style_ = style;
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 }
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
110
53025eecbc95 renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 99
diff changeset
57 virtual const CoordinateSystem3D& GetLayerSlice()
99
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
58 {
119
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
59 return geometry_;
99
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
60 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 88
diff changeset
61
88
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 virtual bool IsFullQuality()
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 {
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 return true;
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 }
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 };
90bf4116a23c ISlicedVolume
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 }