No Description

class_q_c_p_item_straight_line.tex 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. \hypertarget{class_q_c_p_item_straight_line}{}\section{Referencia de la Clase Q\+C\+P\+Item\+Straight\+Line}
  2. \label{class_q_c_p_item_straight_line}\index{Q\+C\+P\+Item\+Straight\+Line@{Q\+C\+P\+Item\+Straight\+Line}}
  3. A straight line that spans infinitely in both directions.
  4. Diagrama de herencias de Q\+C\+P\+Item\+Straight\+Line\begin{figure}[H]
  5. \begin{center}
  6. \leavevmode
  7. \includegraphics[height=4.000000cm]{class_q_c_p_item_straight_line}
  8. \end{center}
  9. \end{figure}
  10. \subsection*{Métodos públicos}
  11. \begin{DoxyCompactItemize}
  12. \item
  13. \hyperlink{class_q_c_p_item_straight_line_a41fd2e1f006983449eca9830930c3b10}{Q\+C\+P\+Item\+Straight\+Line} (\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot} $\ast$parent\+Plot)
  14. \item
  15. \hypertarget{class_q_c_p_item_straight_line_ad858ab1a444391aab778f765453ea222}{}Q\+Pen {\bfseries pen} () const \label{class_q_c_p_item_straight_line_ad858ab1a444391aab778f765453ea222}
  16. \item
  17. \hypertarget{class_q_c_p_item_straight_line_a9e33ae966a7e2ea1083b3b9aeabeaea5}{}Q\+Pen {\bfseries selected\+Pen} () const \label{class_q_c_p_item_straight_line_a9e33ae966a7e2ea1083b3b9aeabeaea5}
  18. \item
  19. void \hyperlink{class_q_c_p_item_straight_line_a9f36c9c9e60d7d9ac084c80380ac8601}{set\+Pen} (const Q\+Pen \&pen)
  20. \item
  21. void \hyperlink{class_q_c_p_item_straight_line_a5c33559498d33543fa95cf0a36e851ff}{set\+Selected\+Pen} (const Q\+Pen \&pen)
  22. \item
  23. virtual double \hyperlink{class_q_c_p_item_straight_line_a64cc3796f58ce856012732603edb2f1c}{select\+Test} (const Q\+Point\+F \&pos, bool only\+Selectable, Q\+Variant $\ast$details=0) const
  24. \end{DoxyCompactItemize}
  25. \subsection*{Atributos públicos}
  26. \begin{DoxyCompactItemize}
  27. \item
  28. \hypertarget{class_q_c_p_item_straight_line_ac131a6ffe456f2cc7364dce541fe0120}{}\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$const {\bfseries point1}\label{class_q_c_p_item_straight_line_ac131a6ffe456f2cc7364dce541fe0120}
  29. \item
  30. \hypertarget{class_q_c_p_item_straight_line_ad26c0a732e471f63f75d481dcd48cfc9}{}\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position} $\ast$const {\bfseries point2}\label{class_q_c_p_item_straight_line_ad26c0a732e471f63f75d481dcd48cfc9}
  31. \end{DoxyCompactItemize}
  32. \subsection*{Métodos protegidos}
  33. \begin{DoxyCompactItemize}
  34. \item
  35. \hypertarget{class_q_c_p_item_straight_line_a2daa1e1253216c26565d56a2d5530170}{}virtual void {\bfseries draw} (\hyperlink{class_q_c_p_painter}{Q\+C\+P\+Painter} $\ast$painter)\label{class_q_c_p_item_straight_line_a2daa1e1253216c26565d56a2d5530170}
  36. \item
  37. \hypertarget{class_q_c_p_item_straight_line_adc9b6c5bd33c7f806b748b79dfa25926}{}double {\bfseries dist\+To\+Straight\+Line} (const Q\+Vector2\+D \&point1, const Q\+Vector2\+D \&vec, const Q\+Vector2\+D \&point) const \label{class_q_c_p_item_straight_line_adc9b6c5bd33c7f806b748b79dfa25926}
  38. \item
  39. \hypertarget{class_q_c_p_item_straight_line_af18ac29577b5b96fece15b0ffea70177}{}Q\+Line\+F {\bfseries get\+Rect\+Clipped\+Straight\+Line} (const Q\+Vector2\+D \&point1, const Q\+Vector2\+D \&vec, const Q\+Rect \&rect) const \label{class_q_c_p_item_straight_line_af18ac29577b5b96fece15b0ffea70177}
  40. \item
  41. \hypertarget{class_q_c_p_item_straight_line_a63ef39814c5b560dbb7b13e3fec1d940}{}Q\+Pen {\bfseries main\+Pen} () const \label{class_q_c_p_item_straight_line_a63ef39814c5b560dbb7b13e3fec1d940}
  42. \end{DoxyCompactItemize}
  43. \subsection*{Atributos protegidos}
  44. \begin{DoxyCompactItemize}
  45. \item
  46. \hypertarget{class_q_c_p_item_straight_line_a15106ddc2ebd73ed5c1bc57aa92bee8f}{}Q\+Pen {\bfseries m\+Pen}\label{class_q_c_p_item_straight_line_a15106ddc2ebd73ed5c1bc57aa92bee8f}
  47. \item
  48. \hypertarget{class_q_c_p_item_straight_line_a0307a0d56a018656adbf798bc84c2a4b}{}Q\+Pen {\bfseries m\+Selected\+Pen}\label{class_q_c_p_item_straight_line_a0307a0d56a018656adbf798bc84c2a4b}
  49. \end{DoxyCompactItemize}
  50. \subsection*{Otros miembros heredados}
  51. \subsection{Descripción detallada}
  52. A straight line that spans infinitely in both directions.
  53. It has two positions, {\itshape point1} and {\itshape point2}, which define the straight line.
  54. \subsection{Documentación del constructor y destructor}
  55. \hypertarget{class_q_c_p_item_straight_line_a41fd2e1f006983449eca9830930c3b10}{}\index{Q\+C\+P\+Item\+Straight\+Line@{Q\+C\+P\+Item\+Straight\+Line}!Q\+C\+P\+Item\+Straight\+Line@{Q\+C\+P\+Item\+Straight\+Line}}
  56. \index{Q\+C\+P\+Item\+Straight\+Line@{Q\+C\+P\+Item\+Straight\+Line}!Q\+C\+P\+Item\+Straight\+Line@{Q\+C\+P\+Item\+Straight\+Line}}
  57. \subsubsection[{Q\+C\+P\+Item\+Straight\+Line}]{\setlength{\rightskip}{0pt plus 5cm}Q\+C\+P\+Item\+Straight\+Line\+::\+Q\+C\+P\+Item\+Straight\+Line (
  58. \begin{DoxyParamCaption}
  59. \item[{{\bf Q\+Custom\+Plot} $\ast$}]{parent\+Plot}
  60. \end{DoxyParamCaption}
  61. )}\label{class_q_c_p_item_straight_line_a41fd2e1f006983449eca9830930c3b10}
  62. Creates a straight line item and sets default values.
  63. The constructed item can be added to the plot with \hyperlink{class_q_custom_plot_aa500620379262321685cb7a7674cbd2a}{Q\+Custom\+Plot\+::add\+Item}.
  64. \subsection{Documentación de las funciones miembro}
  65. \hypertarget{class_q_c_p_item_straight_line_a64cc3796f58ce856012732603edb2f1c}{}\index{Q\+C\+P\+Item\+Straight\+Line@{Q\+C\+P\+Item\+Straight\+Line}!select\+Test@{select\+Test}}
  66. \index{select\+Test@{select\+Test}!Q\+C\+P\+Item\+Straight\+Line@{Q\+C\+P\+Item\+Straight\+Line}}
  67. \subsubsection[{select\+Test}]{\setlength{\rightskip}{0pt plus 5cm}double Q\+C\+P\+Item\+Straight\+Line\+::select\+Test (
  68. \begin{DoxyParamCaption}
  69. \item[{const Q\+Point\+F \&}]{pos, }
  70. \item[{bool}]{only\+Selectable, }
  71. \item[{Q\+Variant $\ast$}]{details = {\ttfamily 0}}
  72. \end{DoxyParamCaption}
  73. ) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{class_q_c_p_item_straight_line_a64cc3796f58ce856012732603edb2f1c}
  74. This function is used to decide whether a click hits a layerable object or not.
  75. {\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.
  76. 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.
  77. 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).
  78. 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.
  79. {\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_straight_line_a64cc3796f58ce856012732603edb2f1c}{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.
  80. You may pass 0 as {\itshape details} to indicate that you are not interested in those selection details.
  81. \begin{DoxySeeAlso}{Ver también}
  82. select\+Event, deselect\+Event, \hyperlink{class_q_custom_plot_a5ee1e2f6ae27419deca53e75907c27e5}{Q\+Custom\+Plot\+::set\+Interactions}
  83. \end{DoxySeeAlso}
  84. Implementa \hyperlink{class_q_c_p_abstract_item_a96d522d10ffc0413b9a366c6f7f0476b}{Q\+C\+P\+Abstract\+Item}.
  85. \hypertarget{class_q_c_p_item_straight_line_a9f36c9c9e60d7d9ac084c80380ac8601}{}\index{Q\+C\+P\+Item\+Straight\+Line@{Q\+C\+P\+Item\+Straight\+Line}!set\+Pen@{set\+Pen}}
  86. \index{set\+Pen@{set\+Pen}!Q\+C\+P\+Item\+Straight\+Line@{Q\+C\+P\+Item\+Straight\+Line}}
  87. \subsubsection[{set\+Pen}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Straight\+Line\+::set\+Pen (
  88. \begin{DoxyParamCaption}
  89. \item[{const Q\+Pen \&}]{pen}
  90. \end{DoxyParamCaption}
  91. )}\label{class_q_c_p_item_straight_line_a9f36c9c9e60d7d9ac084c80380ac8601}
  92. Sets the pen that will be used to draw the line
  93. \begin{DoxySeeAlso}{Ver también}
  94. \hyperlink{class_q_c_p_item_straight_line_a5c33559498d33543fa95cf0a36e851ff}{set\+Selected\+Pen}
  95. \end{DoxySeeAlso}
  96. \hypertarget{class_q_c_p_item_straight_line_a5c33559498d33543fa95cf0a36e851ff}{}\index{Q\+C\+P\+Item\+Straight\+Line@{Q\+C\+P\+Item\+Straight\+Line}!set\+Selected\+Pen@{set\+Selected\+Pen}}
  97. \index{set\+Selected\+Pen@{set\+Selected\+Pen}!Q\+C\+P\+Item\+Straight\+Line@{Q\+C\+P\+Item\+Straight\+Line}}
  98. \subsubsection[{set\+Selected\+Pen}]{\setlength{\rightskip}{0pt plus 5cm}void Q\+C\+P\+Item\+Straight\+Line\+::set\+Selected\+Pen (
  99. \begin{DoxyParamCaption}
  100. \item[{const Q\+Pen \&}]{pen}
  101. \end{DoxyParamCaption}
  102. )}\label{class_q_c_p_item_straight_line_a5c33559498d33543fa95cf0a36e851ff}
  103. Sets the pen that will be used to draw the line when selected
  104. \begin{DoxySeeAlso}{Ver también}
  105. \hyperlink{class_q_c_p_item_straight_line_a9f36c9c9e60d7d9ac084c80380ac8601}{set\+Pen}, \hyperlink{class_q_c_p_abstract_item_a203de94ad586cc44d16c9565f49d3378}{set\+Selected}
  106. \end{DoxySeeAlso}
  107. La documentación para esta clase fue generada a partir de los siguientes ficheros\+:\begin{DoxyCompactItemize}
  108. \item
  109. \hyperlink{qcustomplot_8h}{qcustomplot.\+h}\item
  110. \hyperlink{qcustomplot_8cpp}{qcustomplot.\+cpp}\end{DoxyCompactItemize}