Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Scene2D/Internals/OpenGLArrowRenderer.h @ 1615:f5d4bd7b5593
new class: OsiriXLayerFactory
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 30 Oct 2020 17:26:44 +0100 |
parents | ad9b425f27ae |
children | 9ac2a65d4172 |
rev | line source |
---|---|
1614
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Stone of Orthanc |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public License |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * the License, or (at your option) any later version. |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, but |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * Lesser General Public License for more details. |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * License along with this program. If not, see |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * <http://www.gnu.org/licenses/>. |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 **/ |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 #pragma once |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 #include "../ArrowSceneLayer.h" |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 #include "CompositorHelper.h" |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 #include "OpenGLLinesProgram.h" |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 namespace OrthancStone |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 { |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 namespace Internals |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 { |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 class OpenGLArrowRenderer : public CompositorHelper::ILayerRenderer |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 { |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 private: |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 OpenGL::IOpenGLContext& context_; |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 OpenGLLinesProgram& program_; |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 std::unique_ptr<OpenGLLinesProgram::Data> dataBody_; |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 std::unique_ptr<OpenGLLinesProgram::Data> dataHead_; |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 AffineTransform2D transformHead_; |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 void LoadLayer(const ArrowSceneLayer& layer); |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 public: |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 OpenGLArrowRenderer(OpenGL::IOpenGLContext& context, |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 OpenGLLinesProgram& program, |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 const ArrowSceneLayer& layer); |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 virtual void Render(const AffineTransform2D& transform, |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 unsigned int canvasWidth, |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 unsigned int canvasHeight) ORTHANC_OVERRIDE; |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 virtual void Update(const ISceneLayer& layer) ORTHANC_OVERRIDE; |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 }; |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 } |
ad9b425f27ae
new class: ArrowSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 } |