No Description

class_q_c_p_layer.html 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.9.1"/>
  7. <title>My Project: QCPLayer Class Reference</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  12. <script type="text/javascript" src="search/searchdata.js"></script>
  13. <script type="text/javascript" src="search/search.js"></script>
  14. <script type="text/javascript">
  15. $(document).ready(function() { init_search(); });
  16. </script>
  17. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  18. </head>
  19. <body>
  20. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  21. <div id="titlearea">
  22. <table cellspacing="0" cellpadding="0">
  23. <tbody>
  24. <tr style="height: 56px;">
  25. <td style="padding-left: 0.5em;">
  26. <div id="projectname">My Project
  27. </div>
  28. </td>
  29. </tr>
  30. </tbody>
  31. </table>
  32. </div>
  33. <!-- end header part -->
  34. <!-- Generated by Doxygen 1.8.9.1 -->
  35. <script type="text/javascript">
  36. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  37. </script>
  38. <div id="navrow1" class="tabs">
  39. <ul class="tablist">
  40. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  41. <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
  42. <li><a href="namespaces.html"><span>Namespaces</span></a></li>
  43. <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
  44. <li><a href="files.html"><span>Files</span></a></li>
  45. <li>
  46. <div id="MSearchBox" class="MSearchBoxInactive">
  47. <span class="left">
  48. <img id="MSearchSelect" src="search/mag_sel.png"
  49. onmouseover="return searchBox.OnSearchSelectShow()"
  50. onmouseout="return searchBox.OnSearchSelectHide()"
  51. alt=""/>
  52. <input type="text" id="MSearchField" value="Search" accesskey="S"
  53. onfocus="searchBox.OnSearchFieldFocus(true)"
  54. onblur="searchBox.OnSearchFieldFocus(false)"
  55. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  56. </span><span class="right">
  57. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  58. </span>
  59. </div>
  60. </li>
  61. </ul>
  62. </div>
  63. <div id="navrow2" class="tabs2">
  64. <ul class="tablist">
  65. <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
  66. <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
  67. <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
  68. <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
  69. </ul>
  70. </div>
  71. <!-- window showing the filter options -->
  72. <div id="MSearchSelectWindow"
  73. onmouseover="return searchBox.OnSearchSelectShow()"
  74. onmouseout="return searchBox.OnSearchSelectHide()"
  75. onkeydown="return searchBox.OnSearchSelectKey(event)">
  76. </div>
  77. <!-- iframe showing the search results (closed by default) -->
  78. <div id="MSearchResultsWindow">
  79. <iframe src="javascript:void(0)" frameborder="0"
  80. name="MSearchResults" id="MSearchResults">
  81. </iframe>
  82. </div>
  83. </div><!-- top -->
  84. <div class="header">
  85. <div class="summary">
  86. <a href="#pub-methods">Public Member Functions</a> &#124;
  87. <a href="#pro-methods">Protected Member Functions</a> &#124;
  88. <a href="#pro-attribs">Protected Attributes</a> &#124;
  89. <a href="#friends">Friends</a> &#124;
  90. <a href="class_q_c_p_layer-members.html">List of all members</a> </div>
  91. <div class="headertitle">
  92. <div class="title">QCPLayer Class Reference</div> </div>
  93. </div><!--header-->
  94. <div class="contents">
  95. <p>A layer that may contain objects, to control the rendering order.
  96. <a href="class_q_c_p_layer.html#details">More...</a></p>
  97. <div class="dynheader">
  98. Inheritance diagram for QCPLayer:</div>
  99. <div class="dyncontent">
  100. <div class="center">
  101. <img src="class_q_c_p_layer.png" usemap="#QCPLayer_map" alt=""/>
  102. <map id="QCPLayer_map" name="QCPLayer_map">
  103. </map>
  104. </div></div>
  105. <table class="memberdecls">
  106. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  107. Public Member Functions</h2></td></tr>
  108. <tr class="memitem:a5d0657fc86d624e5efbe930ef21af718"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_layer.html#a5d0657fc86d624e5efbe930ef21af718">QCPLayer</a> (<a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *parentPlot, const QString &amp;layerName)</td></tr>
  109. <tr class="separator:a5d0657fc86d624e5efbe930ef21af718"><td class="memSeparator" colspan="2">&#160;</td></tr>
  110. <tr class="memitem:a3958c9a938c2d05a7378c41484acee08"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3958c9a938c2d05a7378c41484acee08"></a>
  111. <a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>parentPlot</b> () const </td></tr>
  112. <tr class="separator:a3958c9a938c2d05a7378c41484acee08"><td class="memSeparator" colspan="2">&#160;</td></tr>
  113. <tr class="memitem:a96ebd1e436f3813938cb9cd4a59a60be"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a96ebd1e436f3813938cb9cd4a59a60be"></a>
  114. QString&#160;</td><td class="memItemRight" valign="bottom"><b>name</b> () const </td></tr>
  115. <tr class="separator:a96ebd1e436f3813938cb9cd4a59a60be"><td class="memSeparator" colspan="2">&#160;</td></tr>
  116. <tr class="memitem:ad5d7010829a6b99f326b07d7e37c8c99"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_layer.html#ad5d7010829a6b99f326b07d7e37c8c99">index</a> () const </td></tr>
  117. <tr class="separator:ad5d7010829a6b99f326b07d7e37c8c99"><td class="memSeparator" colspan="2">&#160;</td></tr>
  118. <tr class="memitem:a94c2f0100e48cefad2de8fe0fbb03c27"><td class="memItemLeft" align="right" valign="top">QList&lt; <a class="el" href="class_q_c_p_layerable.html">QCPLayerable</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_layer.html#a94c2f0100e48cefad2de8fe0fbb03c27">children</a> () const </td></tr>
  119. <tr class="separator:a94c2f0100e48cefad2de8fe0fbb03c27"><td class="memSeparator" colspan="2">&#160;</td></tr>
  120. </table><table class="memberdecls">
  121. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
  122. Protected Member Functions</h2></td></tr>
  123. <tr class="memitem:a57ce5e49364aa9122276d5df3b4a0ddc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a57ce5e49364aa9122276d5df3b4a0ddc"></a>
  124. void&#160;</td><td class="memItemRight" valign="bottom"><b>addChild</b> (<a class="el" href="class_q_c_p_layerable.html">QCPLayerable</a> *layerable, bool prepend)</td></tr>
  125. <tr class="separator:a57ce5e49364aa9122276d5df3b4a0ddc"><td class="memSeparator" colspan="2">&#160;</td></tr>
  126. <tr class="memitem:ac2f64ac7761650582d968d86670ef362"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac2f64ac7761650582d968d86670ef362"></a>
  127. void&#160;</td><td class="memItemRight" valign="bottom"><b>removeChild</b> (<a class="el" href="class_q_c_p_layerable.html">QCPLayerable</a> *layerable)</td></tr>
  128. <tr class="separator:ac2f64ac7761650582d968d86670ef362"><td class="memSeparator" colspan="2">&#160;</td></tr>
  129. </table><table class="memberdecls">
  130. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
  131. Protected Attributes</h2></td></tr>
  132. <tr class="memitem:a2f3374a7884bf403720cd1cf6f7ad1bb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2f3374a7884bf403720cd1cf6f7ad1bb"></a>
  133. <a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>mParentPlot</b></td></tr>
  134. <tr class="separator:a2f3374a7884bf403720cd1cf6f7ad1bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
  135. <tr class="memitem:a91e6298183cb4b9dfd4efdfaf1ecc220"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a91e6298183cb4b9dfd4efdfaf1ecc220"></a>
  136. QString&#160;</td><td class="memItemRight" valign="bottom"><b>mName</b></td></tr>
  137. <tr class="separator:a91e6298183cb4b9dfd4efdfaf1ecc220"><td class="memSeparator" colspan="2">&#160;</td></tr>
  138. <tr class="memitem:a122088bcab6cec76a52b75ce8606605b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a122088bcab6cec76a52b75ce8606605b"></a>
  139. int&#160;</td><td class="memItemRight" valign="bottom"><b>mIndex</b></td></tr>
  140. <tr class="separator:a122088bcab6cec76a52b75ce8606605b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  141. <tr class="memitem:a704aa71bba469383c3a3c598c1ec0d28"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a704aa71bba469383c3a3c598c1ec0d28"></a>
  142. QList&lt; <a class="el" href="class_q_c_p_layerable.html">QCPLayerable</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>mChildren</b></td></tr>
  143. <tr class="separator:a704aa71bba469383c3a3c598c1ec0d28"><td class="memSeparator" colspan="2">&#160;</td></tr>
  144. </table><table class="memberdecls">
  145. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
  146. Friends</h2></td></tr>
  147. <tr class="memitem:a1cdf9df76adcfae45261690aa0ca2198"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1cdf9df76adcfae45261690aa0ca2198"></a>
  148. class&#160;</td><td class="memItemRight" valign="bottom"><b>QCustomPlot</b></td></tr>
  149. <tr class="separator:a1cdf9df76adcfae45261690aa0ca2198"><td class="memSeparator" colspan="2">&#160;</td></tr>
  150. <tr class="memitem:ad655f55cccf49ba14d5172ec517e07ae"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad655f55cccf49ba14d5172ec517e07ae"></a>
  151. class&#160;</td><td class="memItemRight" valign="bottom"><b>QCPLayerable</b></td></tr>
  152. <tr class="separator:ad655f55cccf49ba14d5172ec517e07ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
  153. </table>
  154. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  155. <div class="textblock"><p>A layer that may contain objects, to control the rendering order. </p>
  156. <p>The Layering system of <a class="el" href="class_q_custom_plot.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>
  157. <p>It is based on the two classes <a class="el" href="class_q_c_p_layer.html" title="A layer that may contain objects, to control the rendering order. ">QCPLayer</a> and <a class="el" href="class_q_c_p_layerable.html" title="Base class for all drawable objects. ">QCPLayerable</a>. <a class="el" href="class_q_custom_plot.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="class_q_c_p_layer.html" title="A layer that may contain objects, to control the rendering order. ">QCPLayer</a> (see <a class="el" href="class_q_custom_plot.html#ad5255393df078448bb6ac83fa5db5f52">QCustomPlot::addLayer</a>, <a class="el" href="class_q_custom_plot.html#aac492da01782820454e9136a8db28182">QCustomPlot::layer</a>, <a class="el" href="class_q_custom_plot.html#ae896140beff19424e9e9e02d6e331104">QCustomPlot::moveLayer</a>, etc.). When replotting, <a class="el" href="class_q_custom_plot.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.</p>
  158. <p>A <a class="el" href="class_q_c_p_layer.html" title="A layer that may contain objects, to control the rendering order. ">QCPLayer</a> contains an ordered list of <a class="el" href="class_q_c_p_layerable.html" title="Base class for all drawable objects. ">QCPLayerable</a> instances. <a class="el" href="class_q_c_p_layerable.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>
  159. <p>Initially, <a class="el" href="class_q_custom_plot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a> has five layers: "background", "grid", "main", "axes" and "legend" (in that order). The top two layers "axes" and "legend" contain the default axes and legend, so they will be drawn on top. In the middle, there is the "main" layer. It is initially empty and set as the current layer (see <a class="el" href="class_q_custom_plot.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="class_q_c_p_grid.html" title="Responsible for drawing the grid of a QCPAxis. ">QCPGrid</a> instances (which belong tightly to <a class="el" href="class_q_c_p_axis.html" title="Manages a single axis inside a QCustomPlot. ">QCPAxis</a>, see <a class="el" href="class_q_c_p_axis.html#ac4fb913cce3072b5e75a4635e0f6cd04">QCPAxis::grid</a>). The Axis rect background shall be drawn behind everything else, thus the default <a class="el" href="class_q_c_p_axis_rect.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="class_q_c_p_layerable.html#ab0d0da6d2de45a118886d2c8e16d5a54">QCPLayerable::setLayer</a>).</p>
  160. <p>Controlling the ordering of objects is easy: Create a new layer in the position you want it to be, e.g. above "main", with <a class="el" href="class_q_custom_plot.html#ad5255393df078448bb6ac83fa5db5f52">QCustomPlot::addLayer</a>. Then set the current layer with <a class="el" href="class_q_custom_plot.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="class_q_c_p_layerable.html#ab0d0da6d2de45a118886d2c8e16d5a54">QCPLayerable::setLayer</a> to the desired layer after creating them.</p>
  161. <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="class_q_custom_plot.html#ae896140beff19424e9e9e02d6e331104">QCustomPlot::moveLayer</a>.</p>
  162. <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>
  163. <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="class_q_custom_plot.html#a40f75e342c5eaab6a86066a42a0e2a94">QCustomPlot::removeLayer</a>. </p>
  164. </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
  165. <a class="anchor" id="a5d0657fc86d624e5efbe930ef21af718"></a>
  166. <div class="memitem">
  167. <div class="memproto">
  168. <table class="memname">
  169. <tr>
  170. <td class="memname">QCPLayer::QCPLayer </td>
  171. <td>(</td>
  172. <td class="paramtype"><a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *&#160;</td>
  173. <td class="paramname"><em>parentPlot</em>, </td>
  174. </tr>
  175. <tr>
  176. <td class="paramkey"></td>
  177. <td></td>
  178. <td class="paramtype">const QString &amp;&#160;</td>
  179. <td class="paramname"><em>layerName</em>&#160;</td>
  180. </tr>
  181. <tr>
  182. <td></td>
  183. <td>)</td>
  184. <td></td><td></td>
  185. </tr>
  186. </table>
  187. </div><div class="memdoc">
  188. <p>Creates a new <a class="el" href="class_q_c_p_layer.html" title="A layer that may contain objects, to control the rendering order. ">QCPLayer</a> instance.</p>
  189. <p>Normally you shouldn't directly instantiate layers, use <a class="el" href="class_q_custom_plot.html#ad5255393df078448bb6ac83fa5db5f52">QCustomPlot::addLayer</a> instead.</p>
  190. <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="class_q_custom_plot.html#ad5255393df078448bb6ac83fa5db5f52">QCustomPlot::addLayer</a>. </dd></dl>
  191. </div>
  192. </div>
  193. <h2 class="groupheader">Member Function Documentation</h2>
  194. <a class="anchor" id="a94c2f0100e48cefad2de8fe0fbb03c27"></a>
  195. <div class="memitem">
  196. <div class="memproto">
  197. <table class="mlabels">
  198. <tr>
  199. <td class="mlabels-left">
  200. <table class="memname">
  201. <tr>
  202. <td class="memname">QList&lt; <a class="el" href="class_q_c_p_layerable.html">QCPLayerable</a> * &gt; QCPLayer::children </td>
  203. <td>(</td>
  204. <td class="paramname"></td><td>)</td>
  205. <td> const</td>
  206. </tr>
  207. </table>
  208. </td>
  209. <td class="mlabels-right">
  210. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  211. </tr>
  212. </table>
  213. </div><div class="memdoc">
  214. <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>
  215. </div>
  216. </div>
  217. <a class="anchor" id="ad5d7010829a6b99f326b07d7e37c8c99"></a>
  218. <div class="memitem">
  219. <div class="memproto">
  220. <table class="mlabels">
  221. <tr>
  222. <td class="mlabels-left">
  223. <table class="memname">
  224. <tr>
  225. <td class="memname">int QCPLayer::index </td>
  226. <td>(</td>
  227. <td class="paramname"></td><td>)</td>
  228. <td> const</td>
  229. </tr>
  230. </table>
  231. </td>
  232. <td class="mlabels-right">
  233. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  234. </tr>
  235. </table>
  236. </div><div class="memdoc">
  237. <p>Returns the index this layer has in the <a class="el" href="class_q_custom_plot.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="class_q_custom_plot.html#aac492da01782820454e9136a8db28182">QCustomPlot::layer</a>.</p>
  238. <p>Layers with higher indices will be drawn above layers with lower indices. </p>
  239. </div>
  240. </div>
  241. <hr/>The documentation for this class was generated from the following files:<ul>
  242. <li><a class="el" href="qcustomplot_8h_source.html">qcustomplot.h</a></li>
  243. <li><a class="el" href="qcustomplot_8cpp.html">qcustomplot.cpp</a></li>
  244. </ul>
  245. </div><!-- contents -->
  246. <!-- start footer part -->
  247. <hr class="footer"/><address class="footer"><small>
  248. Generated on Tue Aug 11 2015 13:04:52 for My Project by &#160;<a href="http://www.doxygen.org/index.html">
  249. <img class="footer" src="doxygen.png" alt="doxygen"/>
  250. </a> 1.8.9.1
  251. </small></address>
  252. </body>
  253. </html>