No Description

class_drawing_window.tex 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. \hypertarget{class_drawing_window}{}\section{Drawing\+Window Class Reference}
  2. \label{class_drawing_window}\index{Drawing\+Window@{Drawing\+Window}}
  3. Inheritance diagram for Drawing\+Window\+:\begin{figure}[H]
  4. \begin{center}
  5. \leavevmode
  6. \includegraphics[height=2.000000cm]{class_drawing_window}
  7. \end{center}
  8. \end{figure}
  9. \subsection*{Public Member Functions}
  10. \begin{DoxyCompactItemize}
  11. \item
  12. \hyperlink{class_drawing_window_aff3d1b3cbeee8f0e92b49c050d8ca494}{Drawing\+Window} (Q\+Widget $\ast$parent=0)
  13. \begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item
  14. void \hyperlink{class_drawing_window_a3097e096223530c9f93737441d77422f}{add\+Line} (int x0, int y0, int x1, int y1, int width, Q\+Color color)
  15. \begin{DoxyCompactList}\small\item\em Add a line to the window, specifying coordinates of the starting and end points. \end{DoxyCompactList}\item
  16. void \hyperlink{class_drawing_window_ae03504caa7648347ec56eb58cf5b5db4}{add\+Line\+Polar} (int x0, int y0, int length, double angle, int width, Q\+Color color)
  17. \begin{DoxyCompactList}\small\item\em Add a line to the window, specifying coordinates of the starting point, the length and angle. \end{DoxyCompactList}\item
  18. void \hyperlink{class_drawing_window_a34dec0c13dc01eaa303589e28acecf95}{box} (int x, int y, int side\+Length, Q\+Color c)
  19. \begin{DoxyCompactList}\small\item\em Draws a box with sides of size side\+Length. \end{DoxyCompactList}\item
  20. void \hyperlink{class_drawing_window_aa58d7247e92b513920c788523187fcbd}{boxes} (int x, int y, int side\+Length, double shrink\+Factor, int smallest\+Length, Q\+Color c)
  21. \begin{DoxyCompactList}\small\item\em Recursive function that draws smaller boxes inside the four corners of the boxes. \end{DoxyCompactList}\item
  22. void \hyperlink{class_drawing_window_a5a5f640d60404722d029ec14896692a0}{snow\+Helper} (int size, int level)
  23. \begin{DoxyCompactList}\small\item\em interface function for the snowflake recursive function \end{DoxyCompactList}\item
  24. void \hyperlink{class_drawing_window_a13d52d1571e4a34d1bd3cb09a71dfa5f}{snowflake} (int x, int y, int size, double angle, int level, Q\+Color c)
  25. \begin{DoxyCompactList}\small\item\em Recursive figure, the snowflake presented at\+: \href{https://sites.google.com/a/wellesley.edu/wellesley-cs118-spring13/lectures-labs/lab-6-turtle-recursion}{\tt https\+://sites.\+google.\+com/a/wellesley.\+edu/wellesley-\/cs118-\/spring13/lectures-\/labs/lab-\/6-\/turtle-\/recursion} sf = sf(n-\/1) + 60 degrees sf(n-\/1) + 60 degrees sf(n-\/1) + s(n-\/1) sf(0) = line. \end{DoxyCompactList}\end{DoxyCompactItemize}
  26. \subsection*{Protected Member Functions}
  27. \begin{DoxyCompactItemize}
  28. \item
  29. \hypertarget{class_drawing_window_aceb9c5cc4f2ef40d99aca7d3fbd4e91a}{}void \hyperlink{class_drawing_window_aceb9c5cc4f2ef40d99aca7d3fbd4e91a}{paint\+Event} (Q\+Paint\+Event $\ast$)\label{class_drawing_window_aceb9c5cc4f2ef40d99aca7d3fbd4e91a}
  30. \begin{DoxyCompactList}\small\item\em Function called in a paint event. \end{DoxyCompactList}\end{DoxyCompactItemize}
  31. \subsection*{Private Attributes}
  32. \begin{DoxyCompactItemize}
  33. \item
  34. \hypertarget{class_drawing_window_ad58ced401c1eaf6cfaf67a0f8f94ce18}{}Ui\+::\+Drawing\+Window $\ast$ {\bfseries ui}\label{class_drawing_window_ad58ced401c1eaf6cfaf67a0f8f94ce18}
  35. \item
  36. \hypertarget{class_drawing_window_a6e1effc34bb2f2c43becfd1df203b693}{}vector$<$ \hyperlink{class_line}{Line} $\ast$ $>$ $\ast$ {\bfseries v\+L}\label{class_drawing_window_a6e1effc34bb2f2c43becfd1df203b693}
  37. \end{DoxyCompactItemize}
  38. \subsection{Constructor \& Destructor Documentation}
  39. \hypertarget{class_drawing_window_aff3d1b3cbeee8f0e92b49c050d8ca494}{}\index{Drawing\+Window@{Drawing\+Window}!Drawing\+Window@{Drawing\+Window}}
  40. \index{Drawing\+Window@{Drawing\+Window}!Drawing\+Window@{Drawing\+Window}}
  41. \subsubsection[{Drawing\+Window}]{\setlength{\rightskip}{0pt plus 5cm}Drawing\+Window\+::\+Drawing\+Window (
  42. \begin{DoxyParamCaption}
  43. \item[{Q\+Widget $\ast$}]{parent = {\ttfamily 0}}
  44. \end{DoxyParamCaption}
  45. )\hspace{0.3cm}{\ttfamily [explicit]}}\label{class_drawing_window_aff3d1b3cbeee8f0e92b49c050d8ca494}
  46. Constructor.
  47. \begin{DoxyParams}{Parameters}
  48. {\em parent} & when creating a \hyperlink{class_drawing_window}{Drawing\+Window} in the main function, leave this parameter empty \\
  49. \hline
  50. \end{DoxyParams}
  51. \subsection{Member Function Documentation}
  52. \hypertarget{class_drawing_window_a3097e096223530c9f93737441d77422f}{}\index{Drawing\+Window@{Drawing\+Window}!add\+Line@{add\+Line}}
  53. \index{add\+Line@{add\+Line}!Drawing\+Window@{Drawing\+Window}}
  54. \subsubsection[{add\+Line}]{\setlength{\rightskip}{0pt plus 5cm}void Drawing\+Window\+::add\+Line (
  55. \begin{DoxyParamCaption}
  56. \item[{int}]{x0, }
  57. \item[{int}]{y0, }
  58. \item[{int}]{x1, }
  59. \item[{int}]{y1, }
  60. \item[{int}]{width, }
  61. \item[{Q\+Color}]{color}
  62. \end{DoxyParamCaption}
  63. )}\label{class_drawing_window_a3097e096223530c9f93737441d77422f}
  64. Add a line to the window, specifying coordinates of the starting and end points.
  65. \begin{DoxyParams}{Parameters}
  66. {\em x0} & starting x \\
  67. \hline
  68. {\em y0} & starting y \\
  69. \hline
  70. {\em x1} & end x \\
  71. \hline
  72. {\em y1} & end y \\
  73. \hline
  74. {\em width} & -\/ line width \\
  75. \hline
  76. {\em color} & -\/ line color \\
  77. \hline
  78. \end{DoxyParams}
  79. \hypertarget{class_drawing_window_ae03504caa7648347ec56eb58cf5b5db4}{}\index{Drawing\+Window@{Drawing\+Window}!add\+Line\+Polar@{add\+Line\+Polar}}
  80. \index{add\+Line\+Polar@{add\+Line\+Polar}!Drawing\+Window@{Drawing\+Window}}
  81. \subsubsection[{add\+Line\+Polar}]{\setlength{\rightskip}{0pt plus 5cm}void Drawing\+Window\+::add\+Line\+Polar (
  82. \begin{DoxyParamCaption}
  83. \item[{int}]{x0, }
  84. \item[{int}]{y0, }
  85. \item[{int}]{length, }
  86. \item[{double}]{angle, }
  87. \item[{int}]{width, }
  88. \item[{Q\+Color}]{color}
  89. \end{DoxyParamCaption}
  90. )}\label{class_drawing_window_ae03504caa7648347ec56eb58cf5b5db4}
  91. Add a line to the window, specifying coordinates of the starting point, the length and angle.
  92. \begin{DoxyParams}{Parameters}
  93. {\em x0} & starting x \\
  94. \hline
  95. {\em y0} & starting y \\
  96. \hline
  97. {\em length} & length of the line \\
  98. \hline
  99. {\em angle} & angle \\
  100. \hline
  101. {\em width} & line width \\
  102. \hline
  103. {\em color} & line color \\
  104. \hline
  105. \end{DoxyParams}
  106. \hypertarget{class_drawing_window_a34dec0c13dc01eaa303589e28acecf95}{}\index{Drawing\+Window@{Drawing\+Window}!box@{box}}
  107. \index{box@{box}!Drawing\+Window@{Drawing\+Window}}
  108. \subsubsection[{box}]{\setlength{\rightskip}{0pt plus 5cm}void Drawing\+Window\+::box (
  109. \begin{DoxyParamCaption}
  110. \item[{int}]{x, }
  111. \item[{int}]{y, }
  112. \item[{int}]{side\+Length, }
  113. \item[{Q\+Color}]{c}
  114. \end{DoxyParamCaption}
  115. )}\label{class_drawing_window_a34dec0c13dc01eaa303589e28acecf95}
  116. Draws a box with sides of size side\+Length.
  117. \begin{DoxyParams}{Parameters}
  118. {\em x} & initial x coordinate of the box \\
  119. \hline
  120. {\em y} & initial y coordinate of the box \\
  121. \hline
  122. {\em side\+Length} & length of the sides of the box \\
  123. \hline
  124. {\em c} & color of the box \\
  125. \hline
  126. \end{DoxyParams}
  127. \hypertarget{class_drawing_window_aa58d7247e92b513920c788523187fcbd}{}\index{Drawing\+Window@{Drawing\+Window}!boxes@{boxes}}
  128. \index{boxes@{boxes}!Drawing\+Window@{Drawing\+Window}}
  129. \subsubsection[{boxes}]{\setlength{\rightskip}{0pt plus 5cm}void Drawing\+Window\+::boxes (
  130. \begin{DoxyParamCaption}
  131. \item[{int}]{x, }
  132. \item[{int}]{y, }
  133. \item[{int}]{side\+Length, }
  134. \item[{double}]{shrink\+Factor, }
  135. \item[{int}]{smallest\+Length, }
  136. \item[{Q\+Color}]{c}
  137. \end{DoxyParamCaption}
  138. )}\label{class_drawing_window_aa58d7247e92b513920c788523187fcbd}
  139. Recursive function that draws smaller boxes inside the four corners of the boxes.
  140. \begin{DoxyParams}{Parameters}
  141. {\em x} & initial coordinate x \\
  142. \hline
  143. {\em y} & initial coordinate y \\
  144. \hline
  145. {\em side\+Length} & length of the sides of the box \\
  146. \hline
  147. {\em shrink\+Factor} & factor to decreese the side\+Length in the recursion for the interior boxes \\
  148. \hline
  149. {\em smallest\+Length} & smallest length of the size of the side of the boxes \\
  150. \hline
  151. {\em c} & color of the boxes \\
  152. \hline
  153. \end{DoxyParams}
  154. \hypertarget{class_drawing_window_a13d52d1571e4a34d1bd3cb09a71dfa5f}{}\index{Drawing\+Window@{Drawing\+Window}!snowflake@{snowflake}}
  155. \index{snowflake@{snowflake}!Drawing\+Window@{Drawing\+Window}}
  156. \subsubsection[{snowflake}]{\setlength{\rightskip}{0pt plus 5cm}void Drawing\+Window\+::snowflake (
  157. \begin{DoxyParamCaption}
  158. \item[{int}]{x, }
  159. \item[{int}]{y, }
  160. \item[{int}]{size, }
  161. \item[{double}]{angle, }
  162. \item[{int}]{level, }
  163. \item[{Q\+Color}]{c}
  164. \end{DoxyParamCaption}
  165. )}\label{class_drawing_window_a13d52d1571e4a34d1bd3cb09a71dfa5f}
  166. Recursive figure, the snowflake presented at\+: \href{https://sites.google.com/a/wellesley.edu/wellesley-cs118-spring13/lectures-labs/lab-6-turtle-recursion}{\tt https\+://sites.\+google.\+com/a/wellesley.\+edu/wellesley-\/cs118-\/spring13/lectures-\/labs/lab-\/6-\/turtle-\/recursion} sf = sf(n-\/1) + 60 degrees sf(n-\/1) + 60 degrees sf(n-\/1) + s(n-\/1) sf(0) = line.
  167. \begin{DoxyParams}{Parameters}
  168. {\em x} & initial coordinate x \\
  169. \hline
  170. {\em y} & initial coordinate y \\
  171. \hline
  172. {\em size} & size of the snowflake \\
  173. \hline
  174. {\em angle} & angle of a line of the snowflake \\
  175. \hline
  176. {\em level} & recursion depth \\
  177. \hline
  178. {\em c} & color of the lines (snowflake) \\
  179. \hline
  180. \end{DoxyParams}
  181. \hypertarget{class_drawing_window_a5a5f640d60404722d029ec14896692a0}{}\index{Drawing\+Window@{Drawing\+Window}!snow\+Helper@{snow\+Helper}}
  182. \index{snow\+Helper@{snow\+Helper}!Drawing\+Window@{Drawing\+Window}}
  183. \subsubsection[{snow\+Helper}]{\setlength{\rightskip}{0pt plus 5cm}void Drawing\+Window\+::snow\+Helper (
  184. \begin{DoxyParamCaption}
  185. \item[{int}]{size, }
  186. \item[{int}]{level}
  187. \end{DoxyParamCaption}
  188. )}\label{class_drawing_window_a5a5f640d60404722d029ec14896692a0}
  189. interface function for the snowflake recursive function
  190. \begin{DoxyParams}{Parameters}
  191. {\em size} & snowflake size \\
  192. \hline
  193. {\em level} & recursion depth \\
  194. \hline
  195. \end{DoxyParams}
  196. The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
  197. \item
  198. drawing\+Window.\+h\item
  199. boxes.\+cpp\item
  200. drawing\+Window.\+cpp\item
  201. snowflake.\+cpp\end{DoxyCompactItemize}