Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Scene2D/Internals/OpenGLLinesProgram.h @ 1675:6fa05252b085
don't load low-quality image if the parsed dicom file is cached by the oracle
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 23 Nov 2020 18:09:14 +0100 |
parents | 8563ea5d8ae4 |
children | 9ac2a65d4172 |
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 | |
1270
2d8ab34c8c91
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
804
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
592 | 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 |
592 | 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:
1576
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/>. |
592 | 20 **/ |
21 | |
22 | |
23 #pragma once | |
24 | |
25 #include "../../OpenGL/IOpenGLContext.h" | |
26 #include "../../OpenGL/OpenGLProgram.h" | |
27 #include "../../Toolbox/AffineTransform2D.h" | |
28 #include "../PolylineSceneLayer.h" | |
29 | |
1455
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1301
diff
changeset
|
30 #include <Compatibility.h> |
1301 | 31 |
592 | 32 namespace OrthancStone |
33 { | |
34 namespace Internals | |
35 { | |
36 class OpenGLLinesProgram : public boost::noncopyable | |
37 { | |
38 public: | |
39 class Data : public boost::noncopyable | |
40 { | |
41 private: | |
42 class Segment; | |
43 | |
44 OpenGL::IOpenGLContext& context_; | |
804
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
592
diff
changeset
|
45 GLuint buffers_[3]; |
592 | 46 size_t verticesCount_; |
47 float thickness_; | |
48 | |
49 public: | |
50 Data(OpenGL::IOpenGLContext& context, | |
51 const PolylineSceneLayer& layer); | |
52 | |
53 ~Data(); | |
54 | |
55 bool IsEmpty() const | |
56 { | |
57 return verticesCount_ == 0; | |
58 } | |
59 | |
60 const size_t GetVerticesCount() const | |
61 { | |
62 return verticesCount_; | |
63 } | |
64 | |
65 GLuint GetVerticesBuffer() const; | |
66 | |
67 GLuint GetMiterDirectionsBuffer() const; | |
68 | |
804
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
592
diff
changeset
|
69 GLuint GetColorsBuffer() const; |
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
592
diff
changeset
|
70 |
592 | 71 float GetThickness() const |
72 { | |
73 return thickness_; | |
74 } | |
75 }; | |
76 | |
77 private: | |
78 OpenGL::IOpenGLContext& context_; | |
1298
8a0a62189f46
replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
79 std::unique_ptr<OpenGL::OpenGLProgram> program_; |
592 | 80 |
81 public: | |
1571 | 82 explicit OpenGLLinesProgram(OpenGL::IOpenGLContext& context); |
592 | 83 |
84 void Apply(const Data& data, | |
85 const AffineTransform2D& transform, | |
1576
92fca2b3ba3d
sanitizing the handling of canvas size
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
86 unsigned int canvasWidth, |
92fca2b3ba3d
sanitizing the handling of canvas size
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
87 unsigned int canvasHeight, |
592 | 88 bool antialiasing, |
89 bool scaleIndependantThickness); | |
90 }; | |
91 } | |
92 } |