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 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396
|
<!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>QCPLayer 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> ·
<a class="headerLink" href="classoverview.html">Class Overview</a> ·
<a class="headerLink" href="hierarchy.html">Hierarchy</a> ·
<a class="headerLink" href="annotated.html">All Classes</a> ·
<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-types">Public Types</a> |
<a href="#pub-methods">Public Functions</a> |
<a href="#pro-methods">Protected Functions</a> </div>
<div class="headertitle">
<div class="title">QCPLayer Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A layer that may contain objects, to control the rendering order.
<a href="classQCPLayer.html#details">More...</a></p>
<p>Inherits QObject.</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a67dcfc1590be2a1f2227c5a39bb59c7c"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPLayer.html#a67dcfc1590be2a1f2227c5a39bb59c7c">LayerMode</a> </td></tr>
<tr class="separator:a67dcfc1590be2a1f2227c5a39bb59c7c"><td class="memSeparator" colspan="2"> </td></tr>
</table><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:a5d0657fc86d624e5efbe930ef21af718"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPLayer.html#a5d0657fc86d624e5efbe930ef21af718">QCPLayer</a> (<a class="el" href="classQCustomPlot.html">QCustomPlot</a> *parentPlot, const QString &layerName)</td></tr>
<tr class="separator:a5d0657fc86d624e5efbe930ef21af718"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5520019787482e13857ebe631c27c3fa"><td class="memItemLeft" align="right" valign="top"><a id="a5520019787482e13857ebe631c27c3fa"></a>
<a class="el" href="classQCustomPlot.html">QCustomPlot</a> * </td><td class="memItemRight" valign="bottom"><b>parentPlot</b> () const</td></tr>
<tr class="separator:a5520019787482e13857ebe631c27c3fa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a37806f662b50b588fb1029a14fc5ef50"><td class="memItemLeft" align="right" valign="top"><a id="a37806f662b50b588fb1029a14fc5ef50"></a>
QString </td><td class="memItemRight" valign="bottom"><b>name</b> () const</td></tr>
<tr class="separator:a37806f662b50b588fb1029a14fc5ef50"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad322905c4700dcc7ceba63e011c730d2"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPLayer.html#ad322905c4700dcc7ceba63e011c730d2">index</a> () const</td></tr>
<tr class="separator:ad322905c4700dcc7ceba63e011c730d2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a183b90941fc78f0b136edd77c5fb6966"><td class="memItemLeft" align="right" valign="top">QList< <a class="el" href="classQCPLayerable.html">QCPLayerable</a> * > </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPLayer.html#a183b90941fc78f0b136edd77c5fb6966">children</a> () const</td></tr>
<tr class="separator:a183b90941fc78f0b136edd77c5fb6966"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad1cc2d6b32d2abb33c7f449b964e068c"><td class="memItemLeft" align="right" valign="top"><a id="ad1cc2d6b32d2abb33c7f449b964e068c"></a>
bool </td><td class="memItemRight" valign="bottom"><b>visible</b> () const</td></tr>
<tr class="separator:ad1cc2d6b32d2abb33c7f449b964e068c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a44ae50b011b19f3dd46a38d8e2e2c1b6"><td class="memItemLeft" align="right" valign="top"><a id="a44ae50b011b19f3dd46a38d8e2e2c1b6"></a>
<a class="el" href="classQCPLayer.html#a67dcfc1590be2a1f2227c5a39bb59c7c">LayerMode</a> </td><td class="memItemRight" valign="bottom"><b>mode</b> () const</td></tr>
<tr class="separator:a44ae50b011b19f3dd46a38d8e2e2c1b6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac07671f74edf6884b51a82afb2c19516"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPLayer.html#ac07671f74edf6884b51a82afb2c19516">setVisible</a> (bool visible)</td></tr>
<tr class="separator:ac07671f74edf6884b51a82afb2c19516"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a938d57b04f4e4c23cedf1711f983919b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPLayer.html#a938d57b04f4e4c23cedf1711f983919b">setMode</a> (<a class="el" href="classQCPLayer.html#a67dcfc1590be2a1f2227c5a39bb59c7c">LayerMode</a> mode)</td></tr>
<tr class="separator:a938d57b04f4e4c23cedf1711f983919b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adefd53b6db02f470151c416f42e37180"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPLayer.html#adefd53b6db02f470151c416f42e37180">replot</a> ()</td></tr>
<tr class="separator:adefd53b6db02f470151c416f42e37180"><td class="memSeparator" colspan="2"> </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:ab831a99c8d30b15ec4533ca341e8813b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPLayer.html#ab831a99c8d30b15ec4533ca341e8813b">draw</a> (<a class="el" href="classQCPPainter.html">QCPPainter</a> *painter)</td></tr>
<tr class="separator:ab831a99c8d30b15ec4533ca341e8813b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4a8e0a86f31462299e7fc8e8158dd2c6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPLayer.html#a4a8e0a86f31462299e7fc8e8158dd2c6">drawToPaintBuffer</a> ()</td></tr>
<tr class="separator:a4a8e0a86f31462299e7fc8e8158dd2c6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a57ce5e49364aa9122276d5df3b4a0ddc"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPLayer.html#a57ce5e49364aa9122276d5df3b4a0ddc">addChild</a> (<a class="el" href="classQCPLayerable.html">QCPLayerable</a> *layerable, bool prepend)</td></tr>
<tr class="separator:a57ce5e49364aa9122276d5df3b4a0ddc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac2f64ac7761650582d968d86670ef362"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPLayer.html#ac2f64ac7761650582d968d86670ef362">removeChild</a> (<a class="el" href="classQCPLayerable.html">QCPLayerable</a> *layerable)</td></tr>
<tr class="separator:ac2f64ac7761650582d968d86670ef362"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A layer that may contain objects, to control the rendering order. </p>
<p>The Layering system of <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> is the mechanism to control the rendering order of the elements inside the plot.</p>
<p>It is based on the two classes <a class="el" href="classQCPLayer.html" title="A layer that may contain objects, to control the rendering order. ">QCPLayer</a> and <a class="el" href="classQCPLayerable.html" title="Base class for all drawable objects. ">QCPLayerable</a>. <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> holds an ordered list of one or more instances of <a class="el" href="classQCPLayer.html" title="A layer that may contain objects, to control the rendering order. ">QCPLayer</a> (see <a class="el" href="classQCustomPlot.html#ad5255393df078448bb6ac83fa5db5f52">QCustomPlot::addLayer</a>, <a class="el" href="classQCustomPlot.html#a0a96244e7773b242ef23c32b7bdfb159">QCustomPlot::layer</a>, <a class="el" href="classQCustomPlot.html#ae896140beff19424e9e9e02d6e331104">QCustomPlot::moveLayer</a>, etc.). When replotting, <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> goes through the list of layers bottom to top and successively draws the layerables of the layers into the paint buffer(s).</p>
<p>A <a class="el" href="classQCPLayer.html" title="A layer that may contain objects, to control the rendering order. ">QCPLayer</a> contains an ordered list of <a class="el" href="classQCPLayerable.html" title="Base class for all drawable objects. ">QCPLayerable</a> instances. <a class="el" href="classQCPLayerable.html" title="Base class for all drawable objects. ">QCPLayerable</a> is an abstract base class from which almost all visible objects derive, like axes, grids, graphs, items, etc.</p>
<h1><a class="anchor" id="qcplayer-defaultlayers"></a>
Default layers</h1>
<p>Initially, <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> has six layers: "background", "grid", "main", "axes", "legend" and "overlay" (in that order). On top is the "overlay" layer, which only contains the <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>'s selection rect (<a class="el" href="classQCustomPlot.html#ad7df2bcbba307e644db383b449e31efd">QCustomPlot::selectionRect</a>). The next two layers "axes" and "legend" contain the default axes and legend, so they will be drawn above plottables. In the middle, there is the "main" layer. It is initially empty and set as the current layer (see <a class="el" href="classQCustomPlot.html#a73a6dc47c653bb6f8f030abca5a11852">QCustomPlot::setCurrentLayer</a>). This means, all new plottables, items etc. are created on this layer by default. Then comes the "grid" layer which contains the <a class="el" href="classQCPGrid.html" title="Responsible for drawing the grid of a QCPAxis. ">QCPGrid</a> instances (which belong tightly to <a class="el" href="classQCPAxis.html" title="Manages a single axis inside a QCustomPlot. ">QCPAxis</a>, see <a class="el" href="classQCPAxis.html#a63f1dd2df663680d2a8d06c19592dd63">QCPAxis::grid</a>). The Axis rect background shall be drawn behind everything else, thus the default <a class="el" href="classQCPAxisRect.html" title="Holds multiple axes and arranges them in a rectangular shape. ">QCPAxisRect</a> instance is placed on the "background" layer. Of course, the layer affiliation of the individual objects can be changed as required (<a class="el" href="classQCPLayerable.html#ab0d0da6d2de45a118886d2c8e16d5a54">QCPLayerable::setLayer</a>).</p>
<h1><a class="anchor" id="qcplayer-ordering"></a>
Controlling the rendering order via layers</h1>
<p>Controlling the ordering of layerables in the plot is easy: Create a new layer in the position you want the layerable to be in, e.g. above "main", with <a class="el" href="classQCustomPlot.html#ad5255393df078448bb6ac83fa5db5f52">QCustomPlot::addLayer</a>. Then set the current layer with <a class="el" href="classQCustomPlot.html#a73a6dc47c653bb6f8f030abca5a11852">QCustomPlot::setCurrentLayer</a> to that new layer and finally create the objects normally. They will be placed on the new layer automatically, due to the current layer setting. Alternatively you could have also ignored the current layer setting and just moved the objects with <a class="el" href="classQCPLayerable.html#ab0d0da6d2de45a118886d2c8e16d5a54">QCPLayerable::setLayer</a> to the desired layer after creating them.</p>
<p>It is also possible to move whole layers. For example, If you want the grid to be shown in front of all plottables/items on the "main" layer, just move it above "main" with <a class="el" href="classQCustomPlot.html#ae896140beff19424e9e9e02d6e331104">QCustomPlot::moveLayer</a>.</p>
<p>The rendering order within one layer is simply by order of creation or insertion. The item created last (or added last to the layer), is drawn on top of all other objects on that layer.</p>
<p>When a layer is deleted, the objects on it are not deleted with it, but fall on the layer below the deleted layer, see <a class="el" href="classQCustomPlot.html#a40f75e342c5eaab6a86066a42a0e2a94">QCustomPlot::removeLayer</a>.</p>
<h1><a class="anchor" id="qcplayer-buffering"></a>
Replotting only a specific layer</h1>
<p>If the layer mode (<a class="el" href="classQCPLayer.html#a938d57b04f4e4c23cedf1711f983919b">setMode</a>) is set to <a class="el" href="classQCPLayer.html#a67dcfc1590be2a1f2227c5a39bb59c7cab581b9fab3007c4c65f057f4185d7538">lmBuffered</a>, you can replot only this specific layer by calling <a class="el" href="classQCPLayer.html#adefd53b6db02f470151c416f42e37180">replot</a>. In certain situations this can provide better replot performance, compared with a full replot of all layers. Upon creation of a new layer, the layer mode is initialized to <a class="el" href="classQCPLayer.html#a67dcfc1590be2a1f2227c5a39bb59c7ca02eb5e9a4cb7f1baf1e2b6b99e3b87ce">lmLogical</a>. The only layer that is set to <a class="el" href="classQCPLayer.html#a67dcfc1590be2a1f2227c5a39bb59c7cab581b9fab3007c4c65f057f4185d7538">lmBuffered</a> in a new <a class="el" href="classQCustomPlot.html">QCustomPlot</a> instance is the "overlay" layer, containing the selection rect. </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="a67dcfc1590be2a1f2227c5a39bb59c7c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a67dcfc1590be2a1f2227c5a39bb59c7c">§ </a></span>LayerMode</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classQCPLayer.html#a67dcfc1590be2a1f2227c5a39bb59c7c">QCPLayer::LayerMode</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Defines the different rendering modes of a layer. Depending on the mode, certain layers can be replotted individually, without the need to replot (possibly complex) layerables on other layers.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classQCPLayer.html#a938d57b04f4e4c23cedf1711f983919b">setMode</a> </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a67dcfc1590be2a1f2227c5a39bb59c7ca02eb5e9a4cb7f1baf1e2b6b99e3b87ce"></a>lmLogical </td><td class="fielddoc"><p>Layer is used only for rendering order, and shares paint buffer with all other adjacent logical layers. </p>
</td></tr>
<tr><td class="fieldname"><a id="a67dcfc1590be2a1f2227c5a39bb59c7cab581b9fab3007c4c65f057f4185d7538"></a>lmBuffered </td><td class="fielddoc"><p>Layer has its own paint buffer and may be replotted individually (see <a class="el" href="classQCPLayer.html#adefd53b6db02f470151c416f42e37180">replot</a>). </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="a5d0657fc86d624e5efbe930ef21af718"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5d0657fc86d624e5efbe930ef21af718">§ </a></span>QCPLayer()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">QCPLayer::QCPLayer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classQCustomPlot.html">QCustomPlot</a> * </td>
<td class="paramname"><em>parentPlot</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const QString & </td>
<td class="paramname"><em>layerName</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a new <a class="el" href="classQCPLayer.html" title="A layer that may contain objects, to control the rendering order. ">QCPLayer</a> instance.</p>
<p>Normally you shouldn't directly instantiate layers, use <a class="el" href="classQCustomPlot.html#ad5255393df078448bb6ac83fa5db5f52">QCustomPlot::addLayer</a> instead.</p>
<dl class="section warning"><dt>Warning</dt><dd>It is not checked that <em>layerName</em> is actually a unique layer name in <em>parentPlot</em>. This check is only performed by <a class="el" href="classQCustomPlot.html#ad5255393df078448bb6ac83fa5db5f52">QCustomPlot::addLayer</a>. </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ad322905c4700dcc7ceba63e011c730d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad322905c4700dcc7ceba63e011c730d2">§ </a></span>index()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int QCPLayer::index </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the index this layer has in the <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>. The index is the integer number by which this layer can be accessed via <a class="el" href="classQCustomPlot.html#a0a96244e7773b242ef23c32b7bdfb159">QCustomPlot::layer</a>.</p>
<p>Layers with higher indices will be drawn above layers with lower indices. </p>
</div>
</div>
<a id="a183b90941fc78f0b136edd77c5fb6966"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a183b90941fc78f0b136edd77c5fb6966">§ </a></span>children()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">QList< <a class="el" href="classQCPLayerable.html">QCPLayerable</a> * > QCPLayer::children </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a list of all layerables on this layer. The order corresponds to the rendering order: layerables with higher indices are drawn above layerables with lower indices. </p>
</div>
</div>
<a id="ac07671f74edf6884b51a82afb2c19516"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac07671f74edf6884b51a82afb2c19516">§ </a></span>setVisible()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void QCPLayer::setVisible </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname"><em>visible</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets whether this layer is visible or not. If <em>visible</em> is set to false, all layerables on this layer will be invisible.</p>
<p>This function doesn't change the visibility property of the layerables (<a class="el" href="classQCPLayerable.html#a3bed99ddc396b48ce3ebfdc0418744f8">QCPLayerable::setVisible</a>), but the <a class="el" href="classQCPLayerable.html#ab054e88f15d485defcb95e7376f119e7">QCPLayerable::realVisibility</a> of each layerable takes the visibility of the parent layer into account. </p>
</div>
</div>
<a id="a938d57b04f4e4c23cedf1711f983919b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a938d57b04f4e4c23cedf1711f983919b">§ </a></span>setMode()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void QCPLayer::setMode </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classQCPLayer.html#a67dcfc1590be2a1f2227c5a39bb59c7c">QCPLayer::LayerMode</a> </td>
<td class="paramname"><em>mode</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the rendering mode of this layer.</p>
<p>If <em>mode</em> is set to <a class="el" href="classQCPLayer.html#a67dcfc1590be2a1f2227c5a39bb59c7cab581b9fab3007c4c65f057f4185d7538">lmBuffered</a> for a layer, it will be given a dedicated paint buffer 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. This means it may be replotted individually by calling <a class="el" href="classQCPLayer.html#adefd53b6db02f470151c416f42e37180">QCPLayer::replot</a>, without needing to replot all other layers.</p>
<p>Layers which are set to <a class="el" href="classQCPLayer.html#a67dcfc1590be2a1f2227c5a39bb59c7ca02eb5e9a4cb7f1baf1e2b6b99e3b87ce">lmLogical</a> (the default) are used only to define the rendering order and can't be replotted individually.</p>
<p>Note that each layer which is set to <a class="el" href="classQCPLayer.html#a67dcfc1590be2a1f2227c5a39bb59c7cab581b9fab3007c4c65f057f4185d7538">lmBuffered</a> requires additional paint buffers for the layers below, above and for the layer itself. This increases the memory consumption and (slightly) decreases the repainting speed because multiple paint buffers need to be joined. So you should carefully choose which layers benefit from having their own paint buffer. A typical example would be a layer which contains certain layerables (e.g. items) that need to be changed and thus replotted regularly, while all other layerables on other layers stay static. By default, only the topmost layer called "overlay" is in mode <a class="el" href="classQCPLayer.html#a67dcfc1590be2a1f2227c5a39bb59c7cab581b9fab3007c4c65f057f4185d7538">lmBuffered</a>, and contains the selection rect.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classQCPLayer.html#adefd53b6db02f470151c416f42e37180">replot</a> </dd></dl>
</div>
</div>
<a id="adefd53b6db02f470151c416f42e37180"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adefd53b6db02f470151c416f42e37180">§ </a></span>replot()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void QCPLayer::replot </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>If the layer mode (<a class="el" href="classQCPLayer.html#a938d57b04f4e4c23cedf1711f983919b">setMode</a>) is set to <a class="el" href="classQCPLayer.html#a67dcfc1590be2a1f2227c5a39bb59c7cab581b9fab3007c4c65f057f4185d7538">lmBuffered</a>, this method allows replotting only the layerables on this specific layer, without the need to replot all other layers (as a call to <a class="el" href="classQCustomPlot.html#aa4bfe7d70dbe67e81d877819b75ab9af">QCustomPlot::replot</a> would do).</p>
<p>If the layer mode is <a class="el" href="classQCPLayer.html#a67dcfc1590be2a1f2227c5a39bb59c7ca02eb5e9a4cb7f1baf1e2b6b99e3b87ce">lmLogical</a> however, this method simply calls <a class="el" href="classQCustomPlot.html#aa4bfe7d70dbe67e81d877819b75ab9af">QCustomPlot::replot</a> on 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>
<p><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> also makes sure to replot all layers instead of only this one, if the layer ordering has changed since the last full replot and the other paint buffers were thus invalidated.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classQCPLayer.html#ab831a99c8d30b15ec4533ca341e8813b">draw</a> </dd></dl>
</div>
</div>
<a id="ab831a99c8d30b15ec4533ca341e8813b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab831a99c8d30b15ec4533ca341e8813b">§ </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 QCPLayer::draw </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classQCPPainter.html">QCPPainter</a> * </td>
<td class="paramname"><em>painter</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Draws the contents of this layer with the provided <em>painter</em>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classQCPLayer.html#adefd53b6db02f470151c416f42e37180">replot</a>, <a class="el" href="classQCPLayer.html#a4a8e0a86f31462299e7fc8e8158dd2c6">drawToPaintBuffer</a> </dd></dl>
</div>
</div>
<a id="a4a8e0a86f31462299e7fc8e8158dd2c6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4a8e0a86f31462299e7fc8e8158dd2c6">§ </a></span>drawToPaintBuffer()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void QCPLayer::drawToPaintBuffer </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> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Draws the contents of this layer into the paint buffer which is associated with this layer. The association is established 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>, which manages all paint buffers (see <a class="el" href="classQCustomPlot.html#a2685341f7242c3882f4cc5e379308d71">QCustomPlot::setupPaintBuffers</a>).</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classQCPLayer.html#ab831a99c8d30b15ec4533ca341e8813b">draw</a> </dd></dl>
</div>
</div>
<a id="a57ce5e49364aa9122276d5df3b4a0ddc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a57ce5e49364aa9122276d5df3b4a0ddc">§ </a></span>addChild()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void QCPLayer::addChild </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classQCPLayerable.html">QCPLayerable</a> * </td>
<td class="paramname"><em>layerable</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>prepend</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds the <em>layerable</em> to the list of this layer. If <em>prepend</em> is set to true, the layerable will be prepended to the list, i.e. be drawn beneath the other layerables already in the list.</p>
<p>This function does not change the <em>mLayer</em> member of <em>layerable</em> to this layer. (Use <a class="el" href="classQCPLayerable.html#ab0d0da6d2de45a118886d2c8e16d5a54">QCPLayerable::setLayer</a> to change the layer of an object, not this function.)</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classQCPLayer.html#ac2f64ac7761650582d968d86670ef362">removeChild</a> </dd></dl>
</div>
</div>
<a id="ac2f64ac7761650582d968d86670ef362"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac2f64ac7761650582d968d86670ef362">§ </a></span>removeChild()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void QCPLayer::removeChild </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classQCPLayerable.html">QCPLayerable</a> * </td>
<td class="paramname"><em>layerable</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Removes the <em>layerable</em> from the list of this layer.</p>
<p>This function does not change the <em>mLayer</em> member of <em>layerable</em>. (Use <a class="el" href="classQCPLayerable.html#ab0d0da6d2de45a118886d2c8e16d5a54">QCPLayerable::setLayer</a> to change the layer of an object, not this function.)</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classQCPLayer.html#a57ce5e49364aa9122276d5df3b4a0ddc">addChild</a> </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/layer.h</li>
<li>src/layer.cpp</li>
</ul>
</div><!-- contents -->
</body>
</html>
|