Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Scene2D/Internals/OpenGLLinesProgram.h @ 2008:37d6805b80ee deep-learning
integration mainline->deep-learning
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 18 Nov 2022 00:37:00 +0100 |
parents | 7053b8a0aaec |
children | 07964689cb0b |
rev | line source |
---|---|
592 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
1871
7053b8a0aaec
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1870
diff
changeset
|
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium |
7053b8a0aaec
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1870
diff
changeset
|
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
592 | 7 * |
8 * 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
|
9 * modify it under the terms of the GNU Lesser General Public License |
592 | 10 * as published by the Free Software Foundation, either version 3 of |
11 * the License, or (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, but | |
14 * 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
|
15 * 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
|
16 * Lesser General Public License for more details. |
1596
4fb8fdf03314
removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
17 * |
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
|
18 * 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
|
19 * 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
|
20 * <http://www.gnu.org/licenses/>. |
592 | 21 **/ |
22 | |
23 | |
24 #pragma once | |
25 | |
26 #include "../../OpenGL/IOpenGLContext.h" | |
27 #include "../../OpenGL/OpenGLProgram.h" | |
28 #include "../../Toolbox/AffineTransform2D.h" | |
29 #include "../PolylineSceneLayer.h" | |
30 | |
1455
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1301
diff
changeset
|
31 #include <Compatibility.h> |
1301 | 32 |
592 | 33 namespace OrthancStone |
34 { | |
35 namespace Internals | |
36 { | |
37 class OpenGLLinesProgram : public boost::noncopyable | |
38 { | |
39 public: | |
40 class Data : public boost::noncopyable | |
41 { | |
42 private: | |
43 class Segment; | |
44 | |
45 OpenGL::IOpenGLContext& context_; | |
804
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
592
diff
changeset
|
46 GLuint buffers_[3]; |
592 | 47 size_t verticesCount_; |
48 float thickness_; | |
49 | |
50 public: | |
51 Data(OpenGL::IOpenGLContext& context, | |
52 const PolylineSceneLayer& layer); | |
53 | |
54 ~Data(); | |
55 | |
56 bool IsEmpty() const | |
57 { | |
58 return verticesCount_ == 0; | |
59 } | |
60 | |
61 const size_t GetVerticesCount() const | |
62 { | |
63 return verticesCount_; | |
64 } | |
65 | |
66 GLuint GetVerticesBuffer() const; | |
67 | |
68 GLuint GetMiterDirectionsBuffer() const; | |
69 | |
804
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
592
diff
changeset
|
70 GLuint GetColorsBuffer() const; |
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
592
diff
changeset
|
71 |
592 | 72 float GetThickness() const |
73 { | |
74 return thickness_; | |
75 } | |
76 }; | |
77 | |
78 private: | |
79 OpenGL::IOpenGLContext& context_; | |
1298
8a0a62189f46
replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
80 std::unique_ptr<OpenGL::OpenGLProgram> program_; |
592 | 81 |
82 public: | |
1571 | 83 explicit OpenGLLinesProgram(OpenGL::IOpenGLContext& context); |
592 | 84 |
85 void Apply(const Data& data, | |
86 const AffineTransform2D& transform, | |
1576
92fca2b3ba3d
sanitizing the handling of canvas size
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
87 unsigned int canvasWidth, |
92fca2b3ba3d
sanitizing the handling of canvas size
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
88 unsigned int canvasHeight, |
592 | 89 bool antialiasing, |
90 bool scaleIndependantThickness); | |
91 }; | |
92 } | |
93 } |