My Project
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
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
parentwhen 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
x0starting x
y0starting y
x1end x
y1end 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
x0starting x
y0starting y
lengthlength of the line
angleangle
widthline width
colorline color
void DrawingWindow::box ( int  x,
int  y,
int  sideLength,
QColor  c 
)

Draws a box with sides of size sideLength.

Parameters
xinitial x coordinate of the box
yinitial y coordinate of the box
sideLengthlength of the sides of the box
ccolor 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
xinitial coordinate x
yinitial coordinate y
sideLengthlength of the sides of the box
shrinkFactorfactor to decreese the sideLength in the recursion for the interior boxes
smallestLengthsmallest length of the size of the side of the boxes
ccolor 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
xinitial coordinate x
yinitial coordinate y
sizesize of the snowflake
angleangle of a line of the snowflake
levelrecursion depth
ccolor of the lines (snowflake)
void DrawingWindow::snowHelper ( int  size,
int  level 
)

interface function for the snowflake recursive function

Parameters
sizesnowflake size
levelrecursion depth

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