No Description

class_q_c_p_item_line.tex 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. \hypertarget{class_q_c_p_item_line}{}\section{Q\+C\+P\+Item\+Line Class Reference}
  2. \label{class_q_c_p_item_line}\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
  3. A line from one point to another.
  4. Inheritance diagram for Q\+C\+P\+Item\+Line\+:\begin{figure}[H]
  5. \begin{center}
  6. \leavevmode
  7. \includegraphics[height=4.000000cm]{class_q_c_p_item_line}
  8. \end{center}
  9. \end{figure}
  10. \subsection*{Public Member Functions}
  11. \begin{DoxyCompactItemize}
  12. \item
  13. \hyperlink{class_q_c_p_item_line_a17804b7f64961c6accf25b61e85142e3}{Q\+C\+P\+Item\+Line} (\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} $\ast$parent\+Plot)
  14. \item
  15. \hypertarget{class_q_c_p_item_line_a235779dd079a263bedb20b3daecc40eb}{}Q\+Pen {\bfseries pen} () const \label{class_q_c_p_item_line_a235779dd079a263bedb20b3daecc40eb}
  16. \item
  17. \hypertarget{class_q_c_p_item_line_a9fde5e95a1a369008252e18f1925650c}{}Q\+Pen {\bfseries selected\+Pen} () const \label{class_q_c_p_item_line_a9fde5e95a1a369008252e18f1925650c}
  18. \item
  19. \hypertarget{class_q_c_p_item_line_a5f6cbc5c763feae9dfbce71748fc43f1}{}\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending} {\bfseries head} () const \label{class_q_c_p_item_line_a5f6cbc5c763feae9dfbce71748fc43f1}
  20. \item
  21. \hypertarget{class_q_c_p_item_line_a5d2ca0f784933e80f3e6e1d15dceebb3}{}\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending} {\bfseries tail} () const \label{class_q_c_p_item_line_a5d2ca0f784933e80f3e6e1d15dceebb3}
  22. \item
  23. void \hyperlink{class_q_c_p_item_line_a572528dab61c1abe205822fbd5db4b27}{set\+Pen} (const Q\+Pen \&pen)
  24. \item
  25. void \hyperlink{class_q_c_p_item_line_a3e2fec44503277e77717e9c24f87f1ea}{set\+Selected\+Pen} (const Q\+Pen \&pen)
  26. \item
  27. void \hyperlink{class_q_c_p_item_line_aebf3d687114d584e0459db6759e2c3c3}{set\+Head} (const \hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending} \&head)
  28. \item
  29. void \hyperlink{class_q_c_p_item_line_ac264222c3297a7efe33df9345c811a5f}{set\+Tail} (const \hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending} \&tail)
  30. \item
  31. virtual double \hyperlink{class_q_c_p_item_line_a7541e5d9378ca121d07b0df3b24f7178}{select\+Test} (const Q\+Point\+F \&pos, bool only\+Selectable, Q\+Variant $\ast$details=0) const
  32. \end{DoxyCompactItemize}
  33. \subsection*{Public Attributes}
  34. \begin{DoxyCompactItemize}
  35. \item
  36. \hypertarget{class_q_c_p_item_line_a602da607a09498b0f152ada1d6851bc5}{}\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$const {\bfseries start}\label{class_q_c_p_item_line_a602da607a09498b0f152ada1d6851bc5}
  37. \item
  38. \hypertarget{class_q_c_p_item_line_a15598864c1c22a2497a1979c4980c4e1}{}\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$const {\bfseries end}\label{class_q_c_p_item_line_a15598864c1c22a2497a1979c4980c4e1}
  39. \end{DoxyCompactItemize}
  40. \subsection*{Protected Member Functions}
  41. \begin{DoxyCompactItemize}
  42. \item
  43. \hypertarget{class_q_c_p_item_line_a1fc045dd33919f8006df0692aeb0e84a}{}virtual void {\bfseries draw} (\hyperlink{class_q_c_p_painter}{Q\+C\+P\+Painter} $\ast$painter)\label{class_q_c_p_item_line_a1fc045dd33919f8006df0692aeb0e84a}
  44. \item
  45. \hypertarget{class_q_c_p_item_line_a36e8620019a221ccea4357f0287b81c2}{}Q\+Line\+F {\bfseries get\+Rect\+Clipped\+Line} (const Q\+Vector2\+D \&start, const Q\+Vector2\+D \&end, const Q\+Rect \&rect) const \label{class_q_c_p_item_line_a36e8620019a221ccea4357f0287b81c2}
  46. \item
  47. \hypertarget{class_q_c_p_item_line_a7b5bc4ebacb55774b87c91b308ca7912}{}Q\+Pen {\bfseries main\+Pen} () const \label{class_q_c_p_item_line_a7b5bc4ebacb55774b87c91b308ca7912}
  48. \end{DoxyCompactItemize}
  49. \subsection*{Protected Attributes}
  50. \begin{DoxyCompactItemize}
  51. \item
  52. \hypertarget{class_q_c_p_item_line_abbb544d5bb927dfe4e81a7f3ca4c65ac}{}Q\+Pen {\bfseries m\+Pen}\label{class_q_c_p_item_line_abbb544d5bb927dfe4e81a7f3ca4c65ac}
  53. \item
  54. \hypertarget{class_q_c_p_item_line_aff858ad6dde3b90024814ca4b116f278}{}Q\+Pen {\bfseries m\+Selected\+Pen}\label{class_q_c_p_item_line_aff858ad6dde3b90024814ca4b116f278}
  55. \item
  56. \hypertarget{class_q_c_p_item_line_a51603f28ab7ddb1c1a95ea384791d3ed}{}\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending} {\bfseries m\+Head}\label{class_q_c_p_item_line_a51603f28ab7ddb1c1a95ea384791d3ed}
  57. \item
  58. \hypertarget{class_q_c_p_item_line_ab8ed61dfe15bbb1cbf9b95eae95e242f}{}\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending} {\bfseries m\+Tail}\label{class_q_c_p_item_line_ab8ed61dfe15bbb1cbf9b95eae95e242f}
  59. \end{DoxyCompactItemize}
  60. \subsection*{Additional Inherited Members}
  61. \subsection{Detailed Description}
  62. A line from one point to another.
  63. It has two positions, {\itshape start} and {\itshape end}, which define the end points of the line.
  64. With \hyperlink{class_q_c_p_item_line_aebf3d687114d584e0459db6759e2c3c3}{set\+Head} and \hyperlink{class_q_c_p_item_line_ac264222c3297a7efe33df9345c811a5f}{set\+Tail} you may set different line ending styles, e.\+g. to create an arrow.
  65. \subsection{Constructor \& Destructor Documentation}
  66. \hypertarget{class_q_c_p_item_line_a17804b7f64961c6accf25b61e85142e3}{}\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}!Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
  67. \index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}!Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
  68. \subsubsection[{Q\+C\+P\+Item\+Line}]{\setlength{\rightskip}{0pt plus 5cm}Q\+C\+P\+Item\+Line\+::\+Q\+C\+P\+Item\+Line (
  69. \begin{DoxyParamCaption}
  70. \item[{{\bf Q\+Custom\+Plot} $\ast$}]{parent\+Plot}
  71. \end{DoxyParamCaption}
  72. )}\label{class_q_c_p_item_line_a17804b7f64961c6accf25b61e85142e3}
  73. Creates a line item and sets default values.
  74. The constructed item can be added to the plot with \hyperlink{class_q_custom_plot_aa500620379262321685cb7a7674cbd2a}{Q\+Custom\+Plot\+::add\+Item}.
  75. \subsection{Member Function Documentation}
  76. \hypertarget{class_q_c_p_item_line_a7541e5d9378ca121d07b0df3b24f7178}{}\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}!select\+Test@{select\+Test}}
  77. \index{select\+Test@{select\+Test}!Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
  78. \subsubsection[{select\+Test}]{\setlength{\rightskip}{0pt plus 5cm}double Q\+C\+P\+Item\+Line\+::select\+Test (
  79. \begin{DoxyParamCaption}
  80. \item[{const Q\+Point\+F \&}]{pos, }
  81. \item[{bool}]{only\+Selectable, }
  82. \item[{Q\+Variant $\ast$}]{details = {\ttfamily 0}}
  83. \end{DoxyParamCaption}
  84. ) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{class_q_c_p_item_line_a7541e5d9378ca121d07b0df3b24f7178}
  85. This function is used to decide whether a click hits a layerable object or not.
  86. {\itshape pos} is a point in pixel coordinates on the \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} surface. This function returns the shortest pixel distance of this point to the object. If the object is either invisible or the distance couldn\textquotesingle{}t be determined, -\/1.\+0 is returned. Further, if {\itshape only\+Selectable} is true and the object is not selectable, -\/1.\+0 is returned, too.
  87. If the item is represented not by single lines but by an area like \hyperlink{class_q_c_p_item_rect}{Q\+C\+P\+Item\+Rect} or \hyperlink{class_q_c_p_item_text}{Q\+C\+P\+Item\+Text}, a click inside the area returns a constant value greater zero (typically the selection\+Tolerance of the parent \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} multiplied by 0.\+99). If the click lies outside the area, this function returns -\/1.\+0.
  88. Providing a constant value for area objects allows selecting line objects even when they are obscured by such area objects, by clicking close to the lines (i.\+e. closer than 0.\+99$\ast$selection\+Tolerance).
  89. The actual setting of the selection state is not done by this function. This is handled by the parent \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} when the mouse\+Release\+Event occurs, and the finally selected object is notified via the select\+Event/deselect\+Event methods.
  90. {\itshape details} is an optional output parameter. Every layerable subclass may place any information in {\itshape details}. This information will be passed to select\+Event when the parent \hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} decides on the basis of this select\+Test call, that the object was successfully selected. The subsequent call to select\+Event will carry the {\itshape details}. This is useful for multi-\/part objects (like \hyperlink{class_q_c_p_axis}{Q\+C\+P\+Axis}). This way, a possibly complex calculation to decide which part was clicked is only done once in \hyperlink{class_q_c_p_item_line_a7541e5d9378ca121d07b0df3b24f7178}{select\+Test}. The result (i.\+e. the actually clicked part) can then be placed in {\itshape details}. So in the subsequent select\+Event, the decision which part was selected doesn\textquotesingle{}t have to be done a second time for a single selection operation.
  91. You may pass 0 as {\itshape details} to indicate that you are not interested in those selection details.
  92. \begin{DoxySeeAlso}{See also}
  93. select\+Event, deselect\+Event, \hyperlink{class_q_custom_plot_a5ee1e2f6ae27419deca53e75907c27e5}{Q\+Custom\+Plot\+::set\+Interactions}
  94. \end{DoxySeeAlso}
  95. Implements \hyperlink{class_q_c_p_abstract_item_a96d522d10ffc0413b9a366c6f7f0476b}{Q\+C\+P\+Abstract\+Item}.
  96. \hypertarget{class_q_c_p_item_line_aebf3d687114d584e0459db6759e2c3c3}{}\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}!set\+Head@{set\+Head}}
  97. \index{set\+Head@{set\+Head}!Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
  98. \subsubsection[{set\+Head}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Line\+::set\+Head (
  99. \begin{DoxyParamCaption}
  100. \item[{const {\bf Q\+C\+P\+Line\+Ending} \&}]{head}
  101. \end{DoxyParamCaption}
  102. )}\label{class_q_c_p_item_line_aebf3d687114d584e0459db6759e2c3c3}
  103. Sets the line ending style of the head. The head corresponds to the {\itshape end} position.
  104. Note that due to the overloaded \hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending} constructor, you may directly specify a \hyperlink{class_q_c_p_line_ending_a5ef16e6876b4b74959c7261d8d4c2cd5}{Q\+C\+P\+Line\+Ending\+::\+Ending\+Style} here, e.\+g.
  105. \begin{DoxyCode}
  106. \hyperlink{class_q_c_p_item_line_aebf3d687114d584e0459db6759e2c3c3}{setHead}(\hyperlink{class_q_c_p_line_ending_a5ef16e6876b4b74959c7261d8d4c2cd5ab9964d0d03f812d1e79de15edbeb2cbf}{QCPLineEnding::esSpikeArrow})
  107. \end{DoxyCode}
  108. \begin{DoxySeeAlso}{See also}
  109. \hyperlink{class_q_c_p_item_line_ac264222c3297a7efe33df9345c811a5f}{set\+Tail}
  110. \end{DoxySeeAlso}
  111. \hypertarget{class_q_c_p_item_line_a572528dab61c1abe205822fbd5db4b27}{}\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}!set\+Pen@{set\+Pen}}
  112. \index{set\+Pen@{set\+Pen}!Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
  113. \subsubsection[{set\+Pen}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Line\+::set\+Pen (
  114. \begin{DoxyParamCaption}
  115. \item[{const Q\+Pen \&}]{pen}
  116. \end{DoxyParamCaption}
  117. )}\label{class_q_c_p_item_line_a572528dab61c1abe205822fbd5db4b27}
  118. Sets the pen that will be used to draw the line
  119. \begin{DoxySeeAlso}{See also}
  120. \hyperlink{class_q_c_p_item_line_a3e2fec44503277e77717e9c24f87f1ea}{set\+Selected\+Pen}
  121. \end{DoxySeeAlso}
  122. \hypertarget{class_q_c_p_item_line_a3e2fec44503277e77717e9c24f87f1ea}{}\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}!set\+Selected\+Pen@{set\+Selected\+Pen}}
  123. \index{set\+Selected\+Pen@{set\+Selected\+Pen}!Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
  124. \subsubsection[{set\+Selected\+Pen}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Line\+::set\+Selected\+Pen (
  125. \begin{DoxyParamCaption}
  126. \item[{const Q\+Pen \&}]{pen}
  127. \end{DoxyParamCaption}
  128. )}\label{class_q_c_p_item_line_a3e2fec44503277e77717e9c24f87f1ea}
  129. Sets the pen that will be used to draw the line when selected
  130. \begin{DoxySeeAlso}{See also}
  131. \hyperlink{class_q_c_p_item_line_a572528dab61c1abe205822fbd5db4b27}{set\+Pen}, \hyperlink{class_q_c_p_abstract_item_a203de94ad586cc44d16c9565f49d3378}{set\+Selected}
  132. \end{DoxySeeAlso}
  133. \hypertarget{class_q_c_p_item_line_ac264222c3297a7efe33df9345c811a5f}{}\index{Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}!set\+Tail@{set\+Tail}}
  134. \index{set\+Tail@{set\+Tail}!Q\+C\+P\+Item\+Line@{Q\+C\+P\+Item\+Line}}
  135. \subsubsection[{set\+Tail}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Line\+::set\+Tail (
  136. \begin{DoxyParamCaption}
  137. \item[{const {\bf Q\+C\+P\+Line\+Ending} \&}]{tail}
  138. \end{DoxyParamCaption}
  139. )}\label{class_q_c_p_item_line_ac264222c3297a7efe33df9345c811a5f}
  140. Sets the line ending style of the tail. The tail corresponds to the {\itshape start} position.
  141. Note that due to the overloaded \hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending} constructor, you may directly specify a \hyperlink{class_q_c_p_line_ending_a5ef16e6876b4b74959c7261d8d4c2cd5}{Q\+C\+P\+Line\+Ending\+::\+Ending\+Style} here, e.\+g.
  142. \begin{DoxyCode}
  143. \hyperlink{class_q_c_p_item_line_ac264222c3297a7efe33df9345c811a5f}{setTail}(\hyperlink{class_q_c_p_line_ending_a5ef16e6876b4b74959c7261d8d4c2cd5ab9964d0d03f812d1e79de15edbeb2cbf}{QCPLineEnding::esSpikeArrow})
  144. \end{DoxyCode}
  145. \begin{DoxySeeAlso}{See also}
  146. \hyperlink{class_q_c_p_item_line_aebf3d687114d584e0459db6759e2c3c3}{set\+Head}
  147. \end{DoxySeeAlso}
  148. The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
  149. \item
  150. \hyperlink{qcustomplot_8h}{qcustomplot.\+h}\item
  151. \hyperlink{qcustomplot_8cpp}{qcustomplot.\+cpp}\end{DoxyCompactItemize}