Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Scene2D/Internals/OpenGLInfoPanelRenderer.h @ 1842:9568082ee013
If available, use ZIP streaming from Orthanc >= 1.9.4 to create archives
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 24 Jun 2021 14:19:36 +0200 |
parents | 9ac2a65d4172 |
children | 3889ae96d2e9 |
rev | line source |
---|---|
594 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
1739
9ac2a65d4172
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
594 | 6 * |
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 |
594 | 9 * as published by the Free Software Foundation, either version 3 of |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
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/>. |
594 | 20 **/ |
21 | |
22 | |
23 #pragma once | |
24 | |
25 #include "CompositorHelper.h" | |
26 #include "OpenGLColorTextureProgram.h" | |
27 #include "../InfoPanelSceneLayer.h" | |
28 | |
29 namespace OrthancStone | |
30 { | |
31 namespace Internals | |
32 { | |
33 class OpenGLInfoPanelRenderer : public CompositorHelper::ILayerRenderer | |
34 { | |
35 private: | |
36 OpenGL::IOpenGLContext& context_; | |
37 OpenGLColorTextureProgram& program_; | |
1298
8a0a62189f46
replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
38 std::unique_ptr<OpenGL::OpenGLTexture> texture_; |
594 | 39 BitmapAnchor anchor_; |
1325
be17fed8c7c5
Added flag in InfoPanelSceneLayer to
Benjamin Golinvaux <bgo@osimis.io>
parents:
1298
diff
changeset
|
40 bool applySceneRotation_; |
594 | 41 |
42 void LoadTexture(const InfoPanelSceneLayer& layer); | |
43 | |
44 public: | |
45 OpenGLInfoPanelRenderer(OpenGL::IOpenGLContext& context, | |
46 OpenGLColorTextureProgram& program, | |
47 const InfoPanelSceneLayer& layer); | |
48 | |
888
6e888cf6a48b
renderers now have access to canvas width/height
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
594
diff
changeset
|
49 virtual void Render(const AffineTransform2D& transform, |
6e888cf6a48b
renderers now have access to canvas width/height
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
594
diff
changeset
|
50 unsigned int canvasWidth, |
1571 | 51 unsigned int canvasHeight) ORTHANC_OVERRIDE; |
594 | 52 |
1571 | 53 virtual void Update(const ISceneLayer& layer) ORTHANC_OVERRIDE |
594 | 54 { |
55 LoadTexture(dynamic_cast<const InfoPanelSceneLayer&>(layer)); | |
56 } | |
57 }; | |
58 } | |
59 } |