annotate OrthancStone/Sources/Scene2D/Internals/CompositorHelper.h @ 1640:52b8b96cb55f

cleaning namespaces
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 10 Nov 2020 16:55:22 +0100
parents 8563ea5d8ae4
children 9ac2a65d4172
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
b9ce24c606ae TextSceneLayer
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: 912
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
8 * modify it under the terms of the GNU Lesser General Public License
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
15 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
16 *
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
18 * License along with this program. If not, see
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
19 * <http://www.gnu.org/licenses/>.
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #pragma once
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
593
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
25 #include "../Scene2D.h"
848
80829436ce0c starting to re-implement radiography editor with latest framework
Alain Mazy <alain@mazy.be>
parents: 841
diff changeset
26 #include "../ScenePoint2D.h"
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
27
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
28 #include <Compatibility.h> // For ORTHANC_OVERRIDE
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
29
841
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents: 602
diff changeset
30 #include <boost/noncopyable.hpp>
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents: 602
diff changeset
31 #include <map>
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents: 602
diff changeset
32
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 namespace OrthancStone
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
593
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
35 namespace Internals
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 {
593
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
37 class CompositorHelper : protected Scene2D::IVisitor
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 {
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 public:
593
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
40 class ILayerRenderer : public boost::noncopyable
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 {
593
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
42 public:
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
43 virtual ~ILayerRenderer()
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
44 {
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
45 }
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
46
888
6e888cf6a48b renderers now have access to canvas width/height
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 841
diff changeset
47 virtual void Render(const AffineTransform2D& transform,
6e888cf6a48b renderers now have access to canvas width/height
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 841
diff changeset
48 unsigned int canvasWidth,
6e888cf6a48b renderers now have access to canvas width/height
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 841
diff changeset
49 unsigned int canvasHeight) = 0;
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50
593
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
51 // "Update()" is only called if the type of the layer has not changed
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
52 virtual void Update(const ISceneLayer& layer) = 0;
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
53 };
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
54
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
55 class IRendererFactory : public boost::noncopyable
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
56 {
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
57 public:
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
58 virtual ~IRendererFactory()
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
59 {
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
60 }
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
593
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
62 virtual ILayerRenderer* Create(const ISceneLayer& layer) = 0;
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
63 };
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
64
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
65 private:
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
66 class Item;
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
67
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
68 typedef std::map<int, Item*> Content;
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69
593
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
70 IRendererFactory& factory_;
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
71 Content content_;
1211
d10d2acb8a02 compositors do not keep a reference to the scene anymore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
72 const Scene2D* lastScene_; // This is only a safeguard, don't use it!
888
6e888cf6a48b renderers now have access to canvas width/height
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 841
diff changeset
73
6e888cf6a48b renderers now have access to canvas width/height
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 841
diff changeset
74 // Only valid during a call to Refresh()
593
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
75 AffineTransform2D sceneTransform_;
888
6e888cf6a48b renderers now have access to canvas width/height
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 841
diff changeset
76 unsigned int canvasWidth_;
6e888cf6a48b renderers now have access to canvas width/height
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 841
diff changeset
77 unsigned int canvasHeight_;
6e888cf6a48b renderers now have access to canvas width/height
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 841
diff changeset
78
593
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
79 protected:
1211
d10d2acb8a02 compositors do not keep a reference to the scene anymore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
80 virtual void Visit(const Scene2D& scene,
d10d2acb8a02 compositors do not keep a reference to the scene anymore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
81 const ISceneLayer& layer,
602
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 600
diff changeset
82 uint64_t layerIdentifier,
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
83 int depth) ORTHANC_OVERRIDE;
593
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
84
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 public:
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
86 explicit CompositorHelper(IRendererFactory& factory) :
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
87 factory_(factory),
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
88 lastScene_(NULL),
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
89 canvasWidth_(0),
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
90 canvasHeight_(0)
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 {
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 }
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
593
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
94 ~CompositorHelper();
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
1211
d10d2acb8a02 compositors do not keep a reference to the scene anymore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
96 void Refresh(const Scene2D& scene,
d10d2acb8a02 compositors do not keep a reference to the scene anymore
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
97 unsigned int canvasWidth,
593
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
98 unsigned int canvasHeight);
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
99 };
6bf8f881fcb5 OpenGLBasicPolylineRenderer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
100 }
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 }