No Description

class_q_c_p_layer.tex 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. \hypertarget{class_q_c_p_layer}{}\section{Q\+C\+P\+Layer Class Reference}
  2. \label{class_q_c_p_layer}\index{Q\+C\+P\+Layer@{Q\+C\+P\+Layer}}
  3. A layer that may contain objects, to control the rendering order.
  4. Inheritance diagram for Q\+C\+P\+Layer\+:\begin{figure}[H]
  5. \begin{center}
  6. \leavevmode
  7. \includegraphics[height=2.000000cm]{class_q_c_p_layer}
  8. \end{center}
  9. \end{figure}
  10. \subsection*{Public Member Functions}
  11. \begin{DoxyCompactItemize}
  12. \item
  13. \hyperlink{class_q_c_p_layer_a5d0657fc86d624e5efbe930ef21af718}{Q\+C\+P\+Layer} (\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} $\ast$parent\+Plot, const Q\+String \&layer\+Name)
  14. \item
  15. \hypertarget{class_q_c_p_layer_a3958c9a938c2d05a7378c41484acee08}{}\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} $\ast$ {\bfseries parent\+Plot} () const \label{class_q_c_p_layer_a3958c9a938c2d05a7378c41484acee08}
  16. \item
  17. \hypertarget{class_q_c_p_layer_a96ebd1e436f3813938cb9cd4a59a60be}{}Q\+String {\bfseries name} () const \label{class_q_c_p_layer_a96ebd1e436f3813938cb9cd4a59a60be}
  18. \item
  19. int \hyperlink{class_q_c_p_layer_ad5d7010829a6b99f326b07d7e37c8c99}{index} () const
  20. \item
  21. Q\+List$<$ \hyperlink{class_q_c_p_layerable}{Q\+C\+P\+Layerable} $\ast$ $>$ \hyperlink{class_q_c_p_layer_a94c2f0100e48cefad2de8fe0fbb03c27}{children} () const
  22. \end{DoxyCompactItemize}
  23. \subsection*{Protected Member Functions}
  24. \begin{DoxyCompactItemize}
  25. \item
  26. \hypertarget{class_q_c_p_layer_a57ce5e49364aa9122276d5df3b4a0ddc}{}void {\bfseries add\+Child} (\hyperlink{class_q_c_p_layerable}{Q\+C\+P\+Layerable} $\ast$layerable, bool prepend)\label{class_q_c_p_layer_a57ce5e49364aa9122276d5df3b4a0ddc}
  27. \item
  28. \hypertarget{class_q_c_p_layer_ac2f64ac7761650582d968d86670ef362}{}void {\bfseries remove\+Child} (\hyperlink{class_q_c_p_layerable}{Q\+C\+P\+Layerable} $\ast$layerable)\label{class_q_c_p_layer_ac2f64ac7761650582d968d86670ef362}
  29. \end{DoxyCompactItemize}
  30. \subsection*{Protected Attributes}
  31. \begin{DoxyCompactItemize}
  32. \item
  33. \hypertarget{class_q_c_p_layer_a2f3374a7884bf403720cd1cf6f7ad1bb}{}\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} $\ast$ {\bfseries m\+Parent\+Plot}\label{class_q_c_p_layer_a2f3374a7884bf403720cd1cf6f7ad1bb}
  34. \item
  35. \hypertarget{class_q_c_p_layer_a91e6298183cb4b9dfd4efdfaf1ecc220}{}Q\+String {\bfseries m\+Name}\label{class_q_c_p_layer_a91e6298183cb4b9dfd4efdfaf1ecc220}
  36. \item
  37. \hypertarget{class_q_c_p_layer_a122088bcab6cec76a52b75ce8606605b}{}int {\bfseries m\+Index}\label{class_q_c_p_layer_a122088bcab6cec76a52b75ce8606605b}
  38. \item
  39. \hypertarget{class_q_c_p_layer_a704aa71bba469383c3a3c598c1ec0d28}{}Q\+List$<$ \hyperlink{class_q_c_p_layerable}{Q\+C\+P\+Layerable} $\ast$ $>$ {\bfseries m\+Children}\label{class_q_c_p_layer_a704aa71bba469383c3a3c598c1ec0d28}
  40. \end{DoxyCompactItemize}
  41. \subsection*{Friends}
  42. \begin{DoxyCompactItemize}
  43. \item
  44. \hypertarget{class_q_c_p_layer_a1cdf9df76adcfae45261690aa0ca2198}{}class {\bfseries Q\+Custom\+Plot}\label{class_q_c_p_layer_a1cdf9df76adcfae45261690aa0ca2198}
  45. \item
  46. \hypertarget{class_q_c_p_layer_ad655f55cccf49ba14d5172ec517e07ae}{}class {\bfseries Q\+C\+P\+Layerable}\label{class_q_c_p_layer_ad655f55cccf49ba14d5172ec517e07ae}
  47. \end{DoxyCompactItemize}
  48. \subsection{Detailed Description}
  49. A layer that may contain objects, to control the rendering order.
  50. The Layering system of \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} is the mechanism to control the rendering order of the elements inside the plot.
  51. It is based on the two classes \hyperlink{class_q_c_p_layer}{Q\+C\+P\+Layer} and \hyperlink{class_q_c_p_layerable}{Q\+C\+P\+Layerable}. \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} holds an ordered list of one or more instances of \hyperlink{class_q_c_p_layer}{Q\+C\+P\+Layer} (see \hyperlink{class_q_custom_plot_ad5255393df078448bb6ac83fa5db5f52}{Q\+Custom\+Plot\+::add\+Layer}, \hyperlink{class_q_custom_plot_aac492da01782820454e9136a8db28182}{Q\+Custom\+Plot\+::layer}, \hyperlink{class_q_custom_plot_ae896140beff19424e9e9e02d6e331104}{Q\+Custom\+Plot\+::move\+Layer}, etc.). When replotting, \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} goes through the list of layers bottom to top and successively draws the layerables of the layers.
  52. A \hyperlink{class_q_c_p_layer}{Q\+C\+P\+Layer} contains an ordered list of \hyperlink{class_q_c_p_layerable}{Q\+C\+P\+Layerable} instances. \hyperlink{class_q_c_p_layerable}{Q\+C\+P\+Layerable} is an abstract base class from which almost all visible objects derive, like axes, grids, graphs, items, etc.
  53. Initially, \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} has five layers\+: \char`\"{}background\char`\"{}, \char`\"{}grid\char`\"{}, \char`\"{}main\char`\"{}, \char`\"{}axes\char`\"{} and \char`\"{}legend\char`\"{} (in that order). The top two layers \char`\"{}axes\char`\"{} and \char`\"{}legend\char`\"{} contain the default axes and legend, so they will be drawn on top. In the middle, there is the \char`\"{}main\char`\"{} layer. It is initially empty and set as the current layer (see \hyperlink{class_q_custom_plot_a73a6dc47c653bb6f8f030abca5a11852}{Q\+Custom\+Plot\+::set\+Current\+Layer}). This means, all new plottables, items etc. are created on this layer by default. Then comes the \char`\"{}grid\char`\"{} layer which contains the \hyperlink{class_q_c_p_grid}{Q\+C\+P\+Grid} instances (which belong tightly to \hyperlink{class_q_c_p_axis}{Q\+C\+P\+Axis}, see \hyperlink{class_q_c_p_axis_ac4fb913cce3072b5e75a4635e0f6cd04}{Q\+C\+P\+Axis\+::grid}). The Axis rect background shall be drawn behind everything else, thus the default \hyperlink{class_q_c_p_axis_rect}{Q\+C\+P\+Axis\+Rect} instance is placed on the \char`\"{}background\char`\"{} layer. Of course, the layer affiliation of the individual objects can be changed as required (\hyperlink{class_q_c_p_layerable_ab0d0da6d2de45a118886d2c8e16d5a54}{Q\+C\+P\+Layerable\+::set\+Layer}).
  54. Controlling the ordering of objects is easy\+: Create a new layer in the position you want it to be, e.\+g. above \char`\"{}main\char`\"{}, with \hyperlink{class_q_custom_plot_ad5255393df078448bb6ac83fa5db5f52}{Q\+Custom\+Plot\+::add\+Layer}. Then set the current layer with \hyperlink{class_q_custom_plot_a73a6dc47c653bb6f8f030abca5a11852}{Q\+Custom\+Plot\+::set\+Current\+Layer} 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 \hyperlink{class_q_c_p_layerable_ab0d0da6d2de45a118886d2c8e16d5a54}{Q\+C\+P\+Layerable\+::set\+Layer} to the desired layer after creating them.
  55. 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 \char`\"{}main\char`\"{} layer, just move it above \char`\"{}main\char`\"{} with \hyperlink{class_q_custom_plot_ae896140beff19424e9e9e02d6e331104}{Q\+Custom\+Plot\+::move\+Layer}.
  56. 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.
  57. When a layer is deleted, the objects on it are not deleted with it, but fall on the layer below the deleted layer, see \hyperlink{class_q_custom_plot_a40f75e342c5eaab6a86066a42a0e2a94}{Q\+Custom\+Plot\+::remove\+Layer}.
  58. \subsection{Constructor \& Destructor Documentation}
  59. \hypertarget{class_q_c_p_layer_a5d0657fc86d624e5efbe930ef21af718}{}\index{Q\+C\+P\+Layer@{Q\+C\+P\+Layer}!Q\+C\+P\+Layer@{Q\+C\+P\+Layer}}
  60. \index{Q\+C\+P\+Layer@{Q\+C\+P\+Layer}!Q\+C\+P\+Layer@{Q\+C\+P\+Layer}}
  61. \subsubsection[{Q\+C\+P\+Layer}]{\setlength{\rightskip}{0pt plus 5cm}Q\+C\+P\+Layer\+::\+Q\+C\+P\+Layer (
  62. \begin{DoxyParamCaption}
  63. \item[{{\bf Q\+Custom\+Plot} $\ast$}]{parent\+Plot, }
  64. \item[{const Q\+String \&}]{layer\+Name}
  65. \end{DoxyParamCaption}
  66. )}\label{class_q_c_p_layer_a5d0657fc86d624e5efbe930ef21af718}
  67. Creates a new \hyperlink{class_q_c_p_layer}{Q\+C\+P\+Layer} instance.
  68. Normally you shouldn\textquotesingle{}t directly instantiate layers, use \hyperlink{class_q_custom_plot_ad5255393df078448bb6ac83fa5db5f52}{Q\+Custom\+Plot\+::add\+Layer} instead.
  69. \begin{DoxyWarning}{Warning}
  70. It is not checked that {\itshape layer\+Name} is actually a unique layer name in {\itshape parent\+Plot}. This check is only performed by \hyperlink{class_q_custom_plot_ad5255393df078448bb6ac83fa5db5f52}{Q\+Custom\+Plot\+::add\+Layer}.
  71. \end{DoxyWarning}
  72. \subsection{Member Function Documentation}
  73. \hypertarget{class_q_c_p_layer_a94c2f0100e48cefad2de8fe0fbb03c27}{}\index{Q\+C\+P\+Layer@{Q\+C\+P\+Layer}!children@{children}}
  74. \index{children@{children}!Q\+C\+P\+Layer@{Q\+C\+P\+Layer}}
  75. \subsubsection[{children}]{\setlength{\rightskip}{0pt plus 5cm}Q\+List$<$ {\bf Q\+C\+P\+Layerable} $\ast$ $>$ Q\+C\+P\+Layer\+::children (
  76. \begin{DoxyParamCaption}
  77. {}
  78. \end{DoxyParamCaption}
  79. ) const\hspace{0.3cm}{\ttfamily [inline]}}\label{class_q_c_p_layer_a94c2f0100e48cefad2de8fe0fbb03c27}
  80. 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. \hypertarget{class_q_c_p_layer_ad5d7010829a6b99f326b07d7e37c8c99}{}\index{Q\+C\+P\+Layer@{Q\+C\+P\+Layer}!index@{index}}
  81. \index{index@{index}!Q\+C\+P\+Layer@{Q\+C\+P\+Layer}}
  82. \subsubsection[{index}]{\setlength{\rightskip}{0pt plus 5cm}int Q\+C\+P\+Layer\+::index (
  83. \begin{DoxyParamCaption}
  84. {}
  85. \end{DoxyParamCaption}
  86. ) const\hspace{0.3cm}{\ttfamily [inline]}}\label{class_q_c_p_layer_ad5d7010829a6b99f326b07d7e37c8c99}
  87. Returns the index this layer has in the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}. The index is the integer number by which this layer can be accessed via \hyperlink{class_q_custom_plot_aac492da01782820454e9136a8db28182}{Q\+Custom\+Plot\+::layer}.
  88. Layers with higher indices will be drawn above layers with lower indices.
  89. The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
  90. \item
  91. \hyperlink{qcustomplot_8h}{qcustomplot.\+h}\item
  92. \hyperlink{qcustomplot_8cpp}{qcustomplot.\+cpp}\end{DoxyCompactItemize}