No Description

class_q_c_p_item_curve.tex 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. \hypertarget{class_q_c_p_item_curve}{}\section{Q\+C\+P\+Item\+Curve Class Reference}
  2. \label{class_q_c_p_item_curve}\index{Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}}
  3. A curved line from one point to another.
  4. Inheritance diagram for Q\+C\+P\+Item\+Curve\+:\begin{figure}[H]
  5. \begin{center}
  6. \leavevmode
  7. \includegraphics[height=4.000000cm]{class_q_c_p_item_curve}
  8. \end{center}
  9. \end{figure}
  10. \subsection*{Public Member Functions}
  11. \begin{DoxyCompactItemize}
  12. \item
  13. \hyperlink{class_q_c_p_item_curve_ac9b7508bb5c8827e1a7a6199f8c82bec}{Q\+C\+P\+Item\+Curve} (\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} $\ast$parent\+Plot)
  14. \item
  15. \hypertarget{class_q_c_p_item_curve_abc6321e55a9ba1a0c7df407843dfa252}{}Q\+Pen {\bfseries pen} () const \label{class_q_c_p_item_curve_abc6321e55a9ba1a0c7df407843dfa252}
  16. \item
  17. \hypertarget{class_q_c_p_item_curve_abd8b8be5b13bc4dafec4c1758c281336}{}Q\+Pen {\bfseries selected\+Pen} () const \label{class_q_c_p_item_curve_abd8b8be5b13bc4dafec4c1758c281336}
  18. \item
  19. \hypertarget{class_q_c_p_item_curve_afc067f0d1e60cd04812f2c2c7fdf36c3}{}\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending} {\bfseries head} () const \label{class_q_c_p_item_curve_afc067f0d1e60cd04812f2c2c7fdf36c3}
  20. \item
  21. \hypertarget{class_q_c_p_item_curve_a9adddfcc5275be0cf27e3c0c31c37c1a}{}\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending} {\bfseries tail} () const \label{class_q_c_p_item_curve_a9adddfcc5275be0cf27e3c0c31c37c1a}
  22. \item
  23. void \hyperlink{class_q_c_p_item_curve_a034be908440aec785c34b92843461221}{set\+Pen} (const Q\+Pen \&pen)
  24. \item
  25. void \hyperlink{class_q_c_p_item_curve_a375b917669f868c5a106bf2f1ab7c26d}{set\+Selected\+Pen} (const Q\+Pen \&pen)
  26. \item
  27. void \hyperlink{class_q_c_p_item_curve_a08a30d9cdd63995deea3d9e20430676f}{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_curve_ac3488d8b1a6489c845dc5bff3ef71124}{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_curve_a741375c11667b5f9c95b2683f93ee514}{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_curve_a20c3b5ea31c33764f4f30c2ec7ae518b}{}\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$const {\bfseries start}\label{class_q_c_p_item_curve_a20c3b5ea31c33764f4f30c2ec7ae518b}
  37. \item
  38. \hypertarget{class_q_c_p_item_curve_aa124bf66c09cc51c627fb49db8bf8a7b}{}\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$const {\bfseries start\+Dir}\label{class_q_c_p_item_curve_aa124bf66c09cc51c627fb49db8bf8a7b}
  39. \item
  40. \hypertarget{class_q_c_p_item_curve_a28181a9dee9cc3c3da83a883221bd2d0}{}\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$const {\bfseries end\+Dir}\label{class_q_c_p_item_curve_a28181a9dee9cc3c3da83a883221bd2d0}
  41. \item
  42. \hypertarget{class_q_c_p_item_curve_a24ecbb195b32a08b42b61c2cf08a1b4d}{}\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$const {\bfseries end}\label{class_q_c_p_item_curve_a24ecbb195b32a08b42b61c2cf08a1b4d}
  43. \end{DoxyCompactItemize}
  44. \subsection*{Protected Member Functions}
  45. \begin{DoxyCompactItemize}
  46. \item
  47. \hypertarget{class_q_c_p_item_curve_a56cb5b72cd02db2eda598274a39839a9}{}virtual void {\bfseries draw} (\hyperlink{class_q_c_p_painter}{Q\+C\+P\+Painter} $\ast$painter)\label{class_q_c_p_item_curve_a56cb5b72cd02db2eda598274a39839a9}
  48. \item
  49. \hypertarget{class_q_c_p_item_curve_a8089126f5645b6edfbaddea49d1e8390}{}Q\+Pen {\bfseries main\+Pen} () const \label{class_q_c_p_item_curve_a8089126f5645b6edfbaddea49d1e8390}
  50. \end{DoxyCompactItemize}
  51. \subsection*{Protected Attributes}
  52. \begin{DoxyCompactItemize}
  53. \item
  54. \hypertarget{class_q_c_p_item_curve_a7ef92988d1db2e4d0311e34c0a57fe42}{}Q\+Pen {\bfseries m\+Pen}\label{class_q_c_p_item_curve_a7ef92988d1db2e4d0311e34c0a57fe42}
  55. \item
  56. \hypertarget{class_q_c_p_item_curve_ab22cbab261b20be5aa8e4ca252149246}{}Q\+Pen {\bfseries m\+Selected\+Pen}\label{class_q_c_p_item_curve_ab22cbab261b20be5aa8e4ca252149246}
  57. \item
  58. \hypertarget{class_q_c_p_item_curve_af2cc26ff199570940dc96f5ec19a13f8}{}\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending} {\bfseries m\+Head}\label{class_q_c_p_item_curve_af2cc26ff199570940dc96f5ec19a13f8}
  59. \item
  60. \hypertarget{class_q_c_p_item_curve_af1dca285b97e3f5b892dab827a79f327}{}\hyperlink{class_q_c_p_line_ending}{Q\+C\+P\+Line\+Ending} {\bfseries m\+Tail}\label{class_q_c_p_item_curve_af1dca285b97e3f5b892dab827a79f327}
  61. \end{DoxyCompactItemize}
  62. \subsection*{Additional Inherited Members}
  63. \subsection{Detailed Description}
  64. A curved line from one point to another.
  65. It has four positions, {\itshape start} and {\itshape end}, which define the end points of the line, and two control points which define the direction the line exits from the start and the direction from which it approaches the end\+: {\itshape start\+Dir} and {\itshape end\+Dir}.
  66. With \hyperlink{class_q_c_p_item_curve_a08a30d9cdd63995deea3d9e20430676f}{set\+Head} and \hyperlink{class_q_c_p_item_curve_ac3488d8b1a6489c845dc5bff3ef71124}{set\+Tail} you may set different line ending styles, e.\+g. to create an arrow.
  67. Often it is desirable for the control points to stay at fixed relative positions to the start/end point. This can be achieved by setting the parent anchor e.\+g. of {\itshape start\+Dir} simply to {\itshape start}, and then specify the desired pixel offset with \hyperlink{class_q_c_p_item_position_aa988ba4e87ab684c9021017dcaba945f}{Q\+C\+P\+Item\+Position\+::set\+Coords} on {\itshape start\+Dir}.
  68. \subsection{Constructor \& Destructor Documentation}
  69. \hypertarget{class_q_c_p_item_curve_ac9b7508bb5c8827e1a7a6199f8c82bec}{}\index{Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}!Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}}
  70. \index{Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}!Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}}
  71. \subsubsection[{Q\+C\+P\+Item\+Curve}]{\setlength{\rightskip}{0pt plus 5cm}Q\+C\+P\+Item\+Curve\+::\+Q\+C\+P\+Item\+Curve (
  72. \begin{DoxyParamCaption}
  73. \item[{{\bf Q\+Custom\+Plot} $\ast$}]{parent\+Plot}
  74. \end{DoxyParamCaption}
  75. )}\label{class_q_c_p_item_curve_ac9b7508bb5c8827e1a7a6199f8c82bec}
  76. Creates a curve item and sets default values.
  77. The constructed item can be added to the plot with \hyperlink{class_q_custom_plot_aa500620379262321685cb7a7674cbd2a}{Q\+Custom\+Plot\+::add\+Item}.
  78. \subsection{Member Function Documentation}
  79. \hypertarget{class_q_c_p_item_curve_a741375c11667b5f9c95b2683f93ee514}{}\index{Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}!select\+Test@{select\+Test}}
  80. \index{select\+Test@{select\+Test}!Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}}
  81. \subsubsection[{select\+Test}]{\setlength{\rightskip}{0pt plus 5cm}double Q\+C\+P\+Item\+Curve\+::select\+Test (
  82. \begin{DoxyParamCaption}
  83. \item[{const Q\+Point\+F \&}]{pos, }
  84. \item[{bool}]{only\+Selectable, }
  85. \item[{Q\+Variant $\ast$}]{details = {\ttfamily 0}}
  86. \end{DoxyParamCaption}
  87. ) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{class_q_c_p_item_curve_a741375c11667b5f9c95b2683f93ee514}
  88. This function is used to decide whether a click hits a layerable object or not.
  89. {\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.
  90. 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.
  91. 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).
  92. 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.
  93. {\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_curve_a741375c11667b5f9c95b2683f93ee514}{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.
  94. You may pass 0 as {\itshape details} to indicate that you are not interested in those selection details.
  95. \begin{DoxySeeAlso}{See also}
  96. select\+Event, deselect\+Event, \hyperlink{class_q_custom_plot_a5ee1e2f6ae27419deca53e75907c27e5}{Q\+Custom\+Plot\+::set\+Interactions}
  97. \end{DoxySeeAlso}
  98. Implements \hyperlink{class_q_c_p_abstract_item_a96d522d10ffc0413b9a366c6f7f0476b}{Q\+C\+P\+Abstract\+Item}.
  99. \hypertarget{class_q_c_p_item_curve_a08a30d9cdd63995deea3d9e20430676f}{}\index{Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}!set\+Head@{set\+Head}}
  100. \index{set\+Head@{set\+Head}!Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}}
  101. \subsubsection[{set\+Head}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Curve\+::set\+Head (
  102. \begin{DoxyParamCaption}
  103. \item[{const {\bf Q\+C\+P\+Line\+Ending} \&}]{head}
  104. \end{DoxyParamCaption}
  105. )}\label{class_q_c_p_item_curve_a08a30d9cdd63995deea3d9e20430676f}
  106. Sets the line ending style of the head. The head corresponds to the {\itshape end} position.
  107. 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.
  108. \begin{DoxyCode}
  109. \hyperlink{class_q_c_p_item_curve_a08a30d9cdd63995deea3d9e20430676f}{setHead}(\hyperlink{class_q_c_p_line_ending_a5ef16e6876b4b74959c7261d8d4c2cd5ab9964d0d03f812d1e79de15edbeb2cbf}{QCPLineEnding::esSpikeArrow})
  110. \end{DoxyCode}
  111. \begin{DoxySeeAlso}{See also}
  112. \hyperlink{class_q_c_p_item_curve_ac3488d8b1a6489c845dc5bff3ef71124}{set\+Tail}
  113. \end{DoxySeeAlso}
  114. \hypertarget{class_q_c_p_item_curve_a034be908440aec785c34b92843461221}{}\index{Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}!set\+Pen@{set\+Pen}}
  115. \index{set\+Pen@{set\+Pen}!Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}}
  116. \subsubsection[{set\+Pen}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Curve\+::set\+Pen (
  117. \begin{DoxyParamCaption}
  118. \item[{const Q\+Pen \&}]{pen}
  119. \end{DoxyParamCaption}
  120. )}\label{class_q_c_p_item_curve_a034be908440aec785c34b92843461221}
  121. Sets the pen that will be used to draw the line
  122. \begin{DoxySeeAlso}{See also}
  123. \hyperlink{class_q_c_p_item_curve_a375b917669f868c5a106bf2f1ab7c26d}{set\+Selected\+Pen}
  124. \end{DoxySeeAlso}
  125. \hypertarget{class_q_c_p_item_curve_a375b917669f868c5a106bf2f1ab7c26d}{}\index{Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}!set\+Selected\+Pen@{set\+Selected\+Pen}}
  126. \index{set\+Selected\+Pen@{set\+Selected\+Pen}!Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}}
  127. \subsubsection[{set\+Selected\+Pen}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Curve\+::set\+Selected\+Pen (
  128. \begin{DoxyParamCaption}
  129. \item[{const Q\+Pen \&}]{pen}
  130. \end{DoxyParamCaption}
  131. )}\label{class_q_c_p_item_curve_a375b917669f868c5a106bf2f1ab7c26d}
  132. Sets the pen that will be used to draw the line when selected
  133. \begin{DoxySeeAlso}{See also}
  134. \hyperlink{class_q_c_p_item_curve_a034be908440aec785c34b92843461221}{set\+Pen}, \hyperlink{class_q_c_p_abstract_item_a203de94ad586cc44d16c9565f49d3378}{set\+Selected}
  135. \end{DoxySeeAlso}
  136. \hypertarget{class_q_c_p_item_curve_ac3488d8b1a6489c845dc5bff3ef71124}{}\index{Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}!set\+Tail@{set\+Tail}}
  137. \index{set\+Tail@{set\+Tail}!Q\+C\+P\+Item\+Curve@{Q\+C\+P\+Item\+Curve}}
  138. \subsubsection[{set\+Tail}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Curve\+::set\+Tail (
  139. \begin{DoxyParamCaption}
  140. \item[{const {\bf Q\+C\+P\+Line\+Ending} \&}]{tail}
  141. \end{DoxyParamCaption}
  142. )}\label{class_q_c_p_item_curve_ac3488d8b1a6489c845dc5bff3ef71124}
  143. Sets the line ending style of the tail. The tail corresponds to the {\itshape start} position.
  144. 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.
  145. \begin{DoxyCode}
  146. \hyperlink{class_q_c_p_item_curve_ac3488d8b1a6489c845dc5bff3ef71124}{setTail}(\hyperlink{class_q_c_p_line_ending_a5ef16e6876b4b74959c7261d8d4c2cd5ab9964d0d03f812d1e79de15edbeb2cbf}{QCPLineEnding::esSpikeArrow})
  147. \end{DoxyCode}
  148. \begin{DoxySeeAlso}{See also}
  149. \hyperlink{class_q_c_p_item_curve_a08a30d9cdd63995deea3d9e20430676f}{set\+Head}
  150. \end{DoxySeeAlso}
  151. The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
  152. \item
  153. \hyperlink{qcustomplot_8h}{qcustomplot.\+h}\item
  154. \hyperlink{qcustomplot_8cpp}{qcustomplot.\+cpp}\end{DoxyCompactItemize}