File: classQCPPaintBufferGlFbo.html

package info (click to toggle)
qcustomplot 2.0.1%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,376 kB
  • sloc: cpp: 21,746; sh: 180; makefile: 2
file content (285 lines) | stat: -rw-r--r-- 19,015 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="author" content="Emanuel Eichhammer" />
<meta name="copyright" content="(C) 2011-2016 Emanuel Eichhammer" />
<title>QCPPaintBufferGlFbo Class Reference</title>
<link href="qcp.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top">
<a class="headerLink"  href="index.html">Main Page</a> &middot;
<a class="headerLink"  href="classoverview.html">Class Overview</a> &middot;
<a class="headerLink"  href="hierarchy.html">Hierarchy</a> &middot;
<a class="headerLink"  href="annotated.html">All Classes</a> &middot;
<a class="headerLink"  href="pages.html">Special Pages</a>
<!-- Generated by Doxygen 1.8.12 -->
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Functions</a> &#124;
<a href="#pro-methods">Protected Functions</a>  </div>
  <div class="headertitle">
<div class="title">QCPPaintBufferGlFbo Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A paint buffer based on OpenGL frame buffers objects, using hardware accelerated rendering.  
 <a href="classQCPPaintBufferGlFbo.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for QCPPaintBufferGlFbo:</div>
<div class="dyncontent">
<div class="center"><img src="classQCPPaintBufferGlFbo__inherit__graph.png" border="0" usemap="#QCPPaintBufferGlFbo_inherit__map" alt="Inheritance graph"/></div>
<map name="QCPPaintBufferGlFbo_inherit__map" id="QCPPaintBufferGlFbo_inherit__map">
<area shape="rect" id="node2" href="classQCPAbstractPaintBuffer.html" title="The abstract base class for paint buffers, which define the rendering backend. " alt="" coords="4,5,157,29"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Functions</h2></td></tr>
<tr class="memitem:af38531a341082feeeb22ed86922601cb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPPaintBufferGlFbo.html#af38531a341082feeeb22ed86922601cb">QCPPaintBufferGlFbo</a> (const QSize &amp;size, double devicePixelRatio, QWeakPointer&lt; QOpenGLContext &gt; glContext, QWeakPointer&lt; QOpenGLPaintDevice &gt; glPaintDevice)</td></tr>
<tr class="separator:af38531a341082feeeb22ed86922601cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26a67e7d30770513626e1fa56ce7e92a"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classQCPPainter.html">QCPPainter</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPPaintBufferGlFbo.html#a26a67e7d30770513626e1fa56ce7e92a">startPainting</a> ()</td></tr>
<tr class="separator:a26a67e7d30770513626e1fa56ce7e92a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7f157a529e63e375be2c32950ad5a9c"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPPaintBufferGlFbo.html#ae7f157a529e63e375be2c32950ad5a9c">donePainting</a> ()</td></tr>
<tr class="separator:ae7f157a529e63e375be2c32950ad5a9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abea347b90aa4ccaa8e754f7ea5446779"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPPaintBufferGlFbo.html#abea347b90aa4ccaa8e754f7ea5446779">draw</a> (<a class="el" href="classQCPPainter.html">QCPPainter</a> *painter) const</td></tr>
<tr class="separator:abea347b90aa4ccaa8e754f7ea5446779"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a15399ce6ffd20d9d01e2f09b7c232143"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPPaintBufferGlFbo.html#a15399ce6ffd20d9d01e2f09b7c232143">clear</a> (const QColor &amp;color)</td></tr>
<tr class="separator:a15399ce6ffd20d9d01e2f09b7c232143"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classQCPAbstractPaintBuffer"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classQCPAbstractPaintBuffer')"><img src="closed.png" alt="-"/>&#160;Public Functions inherited from <a class="el" href="classQCPAbstractPaintBuffer.html">QCPAbstractPaintBuffer</a></td></tr>
<tr class="memitem:a3ce532c12f10b81697108835755641e2 inherit pub_methods_classQCPAbstractPaintBuffer"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPAbstractPaintBuffer.html#a3ce532c12f10b81697108835755641e2">QCPAbstractPaintBuffer</a> (const QSize &amp;size, double devicePixelRatio)</td></tr>
<tr class="separator:a3ce532c12f10b81697108835755641e2 inherit pub_methods_classQCPAbstractPaintBuffer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ea8284e547985c5d263f26a6adfa11f inherit pub_methods_classQCPAbstractPaintBuffer"><td class="memItemLeft" align="right" valign="top"><a id="a3ea8284e547985c5d263f26a6adfa11f"></a>
QSize&#160;</td><td class="memItemRight" valign="bottom"><b>size</b> () const</td></tr>
<tr class="separator:a3ea8284e547985c5d263f26a6adfa11f inherit pub_methods_classQCPAbstractPaintBuffer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76bf771cda945a6c602cf9b7d365d92b inherit pub_methods_classQCPAbstractPaintBuffer"><td class="memItemLeft" align="right" valign="top"><a id="a76bf771cda945a6c602cf9b7d365d92b"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>invalidated</b> () const</td></tr>
<tr class="separator:a76bf771cda945a6c602cf9b7d365d92b inherit pub_methods_classQCPAbstractPaintBuffer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac1b981f8c1744036610ff1a6b9461f9 inherit pub_methods_classQCPAbstractPaintBuffer"><td class="memItemLeft" align="right" valign="top"><a id="aac1b981f8c1744036610ff1a6b9461f9"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><b>devicePixelRatio</b> () const</td></tr>
<tr class="separator:aac1b981f8c1744036610ff1a6b9461f9 inherit pub_methods_classQCPAbstractPaintBuffer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b68c3cd36533f1a4a23b5ce8cd66f01 inherit pub_methods_classQCPAbstractPaintBuffer"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPAbstractPaintBuffer.html#a8b68c3cd36533f1a4a23b5ce8cd66f01">setSize</a> (const QSize &amp;size)</td></tr>
<tr class="separator:a8b68c3cd36533f1a4a23b5ce8cd66f01 inherit pub_methods_classQCPAbstractPaintBuffer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4c7dc70dfc66be2879ce297b2b3d67f inherit pub_methods_classQCPAbstractPaintBuffer"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPAbstractPaintBuffer.html#ae4c7dc70dfc66be2879ce297b2b3d67f">setInvalidated</a> (bool invalidated=true)</td></tr>
<tr class="separator:ae4c7dc70dfc66be2879ce297b2b3d67f inherit pub_methods_classQCPAbstractPaintBuffer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a555eaad5d5c806420ff35602a1bb68fa inherit pub_methods_classQCPAbstractPaintBuffer"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPAbstractPaintBuffer.html#a555eaad5d5c806420ff35602a1bb68fa">setDevicePixelRatio</a> (double ratio)</td></tr>
<tr class="separator:a555eaad5d5c806420ff35602a1bb68fa inherit pub_methods_classQCPAbstractPaintBuffer"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Functions</h2></td></tr>
<tr class="memitem:a116e73dfc70ff70f8d196ecdb5256ce5"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPPaintBufferGlFbo.html#a116e73dfc70ff70f8d196ecdb5256ce5">reallocateBuffer</a> ()</td></tr>
<tr class="separator:a116e73dfc70ff70f8d196ecdb5256ce5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A paint buffer based on OpenGL frame buffers objects, using hardware accelerated rendering. </p>
<p>This paint buffer is one of the OpenGL paint buffers which facilitate hardware accelerated plot rendering. It is based on OpenGL frame buffer objects (fbo) and is used in Qt versions 5.0 and higher. (See <a class="el" href="classQCPPaintBufferGlPbuffer.html">QCPPaintBufferGlPbuffer</a> used in older Qt versions.)</p>
<p>The OpenGL paint buffers are used if <a class="el" href="classQCustomPlot.html#a7db1adc09016329f3aef7c60da935789">QCustomPlot::setOpenGl</a> is set to true, and if they are supported by the system. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="af38531a341082feeeb22ed86922601cb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af38531a341082feeeb22ed86922601cb">&sect;&nbsp;</a></span>QCPPaintBufferGlFbo()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">QCPPaintBufferGlFbo::QCPPaintBufferGlFbo </td>
          <td>(</td>
          <td class="paramtype">const QSize &amp;&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>devicePixelRatio</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QWeakPointer&lt; QOpenGLContext &gt;&#160;</td>
          <td class="paramname"><em>glContext</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QWeakPointer&lt; QOpenGLPaintDevice &gt;&#160;</td>
          <td class="paramname"><em>glPaintDevice</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Creates a <a class="el" href="classQCPPaintBufferGlFbo.html">QCPPaintBufferGlFbo</a> instance with the specified <em>size</em> and <em>devicePixelRatio</em>, if applicable.</p>
<p>All frame buffer objects shall share one OpenGL context and paint device, which need to be set up externally and passed via <em>glContext</em> and <em>glPaintDevice</em>. The set-up is done in <a class="el" href="classQCustomPlot.html#a8954c4667c51070ff4e9b02d858fd190">QCustomPlot::setupOpenGl</a> and the context and paint device are managed by the parent <a class="el" href="classQCustomPlot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a> instance. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a26a67e7d30770513626e1fa56ce7e92a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a26a67e7d30770513626e1fa56ce7e92a">&sect;&nbsp;</a></span>startPainting()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classQCPPainter.html">QCPPainter</a> * QCPPaintBufferGlFbo::startPainting </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns a <a class="el" href="classQCPPainter.html">QCPPainter</a> which is ready to draw to this buffer. The ownership and thus the responsibility to delete the painter after the painting operations are complete is given to the caller of this method.</p>
<p>Once you are done using the painter, delete the painter and call <a class="el" href="classQCPPaintBufferGlFbo.html#ae7f157a529e63e375be2c32950ad5a9c">donePainting</a>.</p>
<p>While a painter generated with this method is active, you must not call <a class="el" href="classQCPAbstractPaintBuffer.html#a8b68c3cd36533f1a4a23b5ce8cd66f01">setSize</a>, <a class="el" href="classQCPAbstractPaintBuffer.html#a555eaad5d5c806420ff35602a1bb68fa">setDevicePixelRatio</a> or <a class="el" href="classQCPPaintBufferGlFbo.html#a15399ce6ffd20d9d01e2f09b7c232143">clear</a>.</p>
<p>This method may return 0, if a painter couldn't be activated on the buffer. This usually indicates a problem with the respective painting backend. </p>

<p>Implements <a class="el" href="classQCPAbstractPaintBuffer.html#a9e9f29b19c033cf02fb96f1a148463f3">QCPAbstractPaintBuffer</a>.</p>

</div>
</div>
<a id="ae7f157a529e63e375be2c32950ad5a9c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae7f157a529e63e375be2c32950ad5a9c">&sect;&nbsp;</a></span>donePainting()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void QCPPaintBufferGlFbo::donePainting </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>If you have acquired a <a class="el" href="classQCPPainter.html">QCPPainter</a> to paint onto this paint buffer via <a class="el" href="classQCPPaintBufferGlFbo.html#a26a67e7d30770513626e1fa56ce7e92a">startPainting</a>, call this method as soon as you are done with the painting operations and have deleted the painter.</p>
<p>paint buffer subclasses may use this method to perform any type of cleanup that is necessary. The default implementation does nothing. </p>

<p>Reimplemented from <a class="el" href="classQCPAbstractPaintBuffer.html#a41b0dc6e7744f19fae09f8532c207dc1">QCPAbstractPaintBuffer</a>.</p>

</div>
</div>
<a id="abea347b90aa4ccaa8e754f7ea5446779"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abea347b90aa4ccaa8e754f7ea5446779">&sect;&nbsp;</a></span>draw()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void QCPPaintBufferGlFbo::draw </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classQCPPainter.html">QCPPainter</a> *&#160;</td>
          <td class="paramname"><em>painter</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Draws the contents of this buffer with the provided <em>painter</em>. This is the method that is used to finally join all paint buffers and draw them onto the screen. </p>

<p>Implements <a class="el" href="classQCPAbstractPaintBuffer.html#afb998c7525e3ae37d9d2d46c7aaf461a">QCPAbstractPaintBuffer</a>.</p>

</div>
</div>
<a id="a15399ce6ffd20d9d01e2f09b7c232143"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a15399ce6ffd20d9d01e2f09b7c232143">&sect;&nbsp;</a></span>clear()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void QCPPaintBufferGlFbo::clear </td>
          <td>(</td>
          <td class="paramtype">const QColor &amp;&#160;</td>
          <td class="paramname"><em>color</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Fills the entire buffer with the provided <em>color</em>. To have an empty transparent buffer, use the named color <code>Qt::transparent</code>.</p>
<p>This method must not be called if there is currently a painter (acquired with <a class="el" href="classQCPPaintBufferGlFbo.html#a26a67e7d30770513626e1fa56ce7e92a">startPainting</a>) active. </p>

<p>Implements <a class="el" href="classQCPAbstractPaintBuffer.html#a9e253f4541dfc01992b77e8830bd7722">QCPAbstractPaintBuffer</a>.</p>

</div>
</div>
<a id="a116e73dfc70ff70f8d196ecdb5256ce5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a116e73dfc70ff70f8d196ecdb5256ce5">&sect;&nbsp;</a></span>reallocateBuffer()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void QCPPaintBufferGlFbo::reallocateBuffer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Reallocates the internal buffer with the currently configured size (<a class="el" href="classQCPAbstractPaintBuffer.html#a8b68c3cd36533f1a4a23b5ce8cd66f01">setSize</a>) and device pixel ratio, if applicable (<a class="el" href="classQCPAbstractPaintBuffer.html#a555eaad5d5c806420ff35602a1bb68fa">setDevicePixelRatio</a>). It is called as soon as any of those properties are changed on this paint buffer.</p>
<dl class="section note"><dt>Note</dt><dd>Subclasses of <a class="el" href="classQCPAbstractPaintBuffer.html">QCPAbstractPaintBuffer</a> must call their reimplementation of this method in their constructor, to perform the first allocation (this can not be done by the base class because calling pure virtual methods in base class constructors is not possible). </dd></dl>

<p>Implements <a class="el" href="classQCPAbstractPaintBuffer.html#aee7506a52bd7e5a07c2af27935eb13e7">QCPAbstractPaintBuffer</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/paintbuffer.h</li>
<li>src/paintbuffer.cpp</li>
</ul>
</div><!-- contents -->
</body>
</html>