Mercurial > hg > orthanc-stone
annotate Framework/Scene2D/Internals/OpenGLLinesProgram.h @ 982:3f6e5a38c88f toa2019090601
Merge
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Fri, 06 Sep 2019 09:39:18 +0200 |
parents | 61ba4b504e9a |
children | 2d8ab34c8c91 |
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 | |
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium | |
6 * | |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU Affero General Public License | |
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 | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 #include "../../OpenGL/IOpenGLContext.h" | |
25 #include "../../OpenGL/OpenGLProgram.h" | |
26 #include "../../Toolbox/AffineTransform2D.h" | |
27 #include "../PolylineSceneLayer.h" | |
28 | |
29 namespace OrthancStone | |
30 { | |
31 namespace Internals | |
32 { | |
33 class OpenGLLinesProgram : public boost::noncopyable | |
34 { | |
35 public: | |
36 class Data : public boost::noncopyable | |
37 { | |
38 private: | |
39 class Segment; | |
40 | |
41 OpenGL::IOpenGLContext& context_; | |
804
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
592
diff
changeset
|
42 GLuint buffers_[3]; |
592 | 43 size_t verticesCount_; |
44 float thickness_; | |
45 | |
46 public: | |
47 Data(OpenGL::IOpenGLContext& context, | |
48 const PolylineSceneLayer& layer); | |
49 | |
50 ~Data(); | |
51 | |
52 bool IsEmpty() const | |
53 { | |
54 return verticesCount_ == 0; | |
55 } | |
56 | |
57 const size_t GetVerticesCount() const | |
58 { | |
59 return verticesCount_; | |
60 } | |
61 | |
62 GLuint GetVerticesBuffer() const; | |
63 | |
64 GLuint GetMiterDirectionsBuffer() const; | |
65 | |
804
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
592
diff
changeset
|
66 GLuint GetColorsBuffer() const; |
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
592
diff
changeset
|
67 |
592 | 68 float GetThickness() const |
69 { | |
70 return thickness_; | |
71 } | |
72 }; | |
73 | |
74 private: | |
75 OpenGL::IOpenGLContext& context_; | |
76 std::auto_ptr<OpenGL::OpenGLProgram> program_; | |
77 | |
78 public: | |
79 OpenGLLinesProgram(OpenGL::IOpenGLContext& context); | |
80 | |
81 void Apply(const Data& data, | |
82 const AffineTransform2D& transform, | |
83 bool antialiasing, | |
84 bool scaleIndependantThickness); | |
85 }; | |
86 } | |
87 } |