DrawingWindow Class Reference
Inheritance diagram for DrawingWindow:

## Public Member Functions

| DrawingWindow (QWidget *parent=0)
| Constructor. More...
void | addLine (int x0, int y0, int x1, int y1, int width, QColor color)
| Add a line to the window, specifying coordinates of the starting and end points. More...
void | addLinePolar (int x0, int y0, int length, double angle, int width, QColor color)
| Add a line to the window, specifying coordinates of the starting point, the length and angle. More...
void | box (int x, int y, int sideLength, QColor c)
| Draws a box with sides of size sideLength. More...
void | boxes (int x, int y, int sideLength, double shrinkFactor, int smallestLength, QColor c)
| Recursive function that draws smaller boxes inside the four corners of the boxes. More...
void | snowHelper (int size, int level)
| interface function for the snowflake recursive function More...
void | snowflake (int x, int y, int size, double angle, int level, QColor c)
| Recursive figure, the snowflake presented at: 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. More...

## Protected Member Functions

void | paintEvent (QPaintEvent *)
| Function called in a paint event.

## Private Attributes

Ui::DrawingWindow * | ui
vector< Line * > * | vL

## Constructor & Destructor Documentation

DrawingWindow::DrawingWindow | ( | QWidget * | parent = `0` | ) |

explicit

Constructor.

Parameters

  parent | when creating a DrawingWindow in the main function, leave this parameter empty

## Member Function Documentation

void DrawingWindow::addLine | ( | int | x0,
|  | int | y0,
|  | int | x1,
|  | int | y1,
|  | int | width,
|  | QColor | color
| ) |  |

Add a line to the window, specifying coordinates of the starting and end points.

Parameters

  x0 | starting x
  y0 | starting y
  x1 | end x
  y1 | end y
  width | - line width
  color | - line color

void DrawingWindow::addLinePolar | ( | int | x0,
|  | int | y0,
|  | int | length,
|  | double | angle,
|  | int | width,
|  | QColor | color
| ) |  |

Add a line to the window, specifying coordinates of the starting point, the length and angle.

Parameters

  x0 | starting x
  y0 | starting y
  length | length of the line
  angle | angle
  width | line width
  color | line color

void DrawingWindow::box | ( | int | x,
|  | int | y,
|  | int | sideLength,
|  | QColor | c
| ) |  |

Draws a box with sides of size sideLength.

Parameters

  x | initial x coordinate of the box
  y | initial y coordinate of the box
  sideLength | length of the sides of the box
  c | color of the box

void DrawingWindow::boxes | ( | int | x,
|  | int | y,
|  | int | sideLength,
|  | double | shrinkFactor,
|  | int | smallestLength,
|  | QColor | c
| ) |  |

Recursive function that draws smaller boxes inside the four corners of the boxes.

Parameters

  x | initial coordinate x
  y | initial coordinate y
  sideLength | length of the sides of the box
  shrinkFactor | factor to decreese the sideLength in the recursion for the interior boxes
  smallestLength | smallest length of the size of the side of the boxes
  c | color of the boxes

void DrawingWindow::snowflake | ( | int | x,
|  | int | y,
|  | int | size,
|  | double | angle,
|  | int | level,
|  | QColor | c
| ) |  |

Recursive figure, the snowflake presented at: 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.

Parameters

  x | initial coordinate x
  y | initial coordinate y
  size | size of the snowflake
  angle | angle of a line of the snowflake
  level | recursion depth
  c | color of the lines (snowflake)

void DrawingWindow::snowHelper | ( | int | size,
|  | int | level
| ) |  |

interface function for the snowflake recursive function

Parameters

  size | snowflake size
  level | recursion depth

The documentation for this class was generated from the following files:

- drawingWindow.h
- boxes.cpp
- drawingWindow.cpp
- snowflake.cpp