-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEllipse.h
127 lines (114 loc) · 4.85 KB
/
Ellipse.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#ifndef ELLIPSE_H
#define ELLIPSE_H
/*! \file */
#include "Shapes.h"
class Ellipse: public Shape
{
public:
/*!*****************************************************************
* @brief Constructor Ellipse: Class Ellipse
*___________________________________________________________________
* Constructs a fully instantiated object of the Ellipse class.
*___________________________________________________________________
* PRE-CONDITIONS
* int id - id of the shape
* ShapeType type - type of shape
*
* POST-CONDITIONS
* This function creates a Ellipse object of type ELLIPSE.
@param id - id of the shape
@param type - type of shape
*******************************************************************/
Ellipse(int id = -1, ShapeType type = NONE);
/*!*****************************************************************
* @brief Constructor Ellipse: Class Ellipse
*___________________________________________________________________
* Creates the default instance of the ellipse class.
*___________________________________________________________________
* PRE-CONDITIONS
* <none>
*
* POST-CONDITIONS
* This function creates a Ellipse object of type ELLIPSE.
*******************************************************************/
Ellipse();
/*!*****************************************************************
* @brief Destructor ~Ellipse: Class Ellipse
*___________________________________________________________________
* Destructs the ellipse object.
*___________________________________________________________________
* PRE-CONDITIONS
* <none>
*
* POST-CONDITIONS
* This function destructs the outstanding pointers in ellipse.
*******************************************************************/
~Ellipse() {}
/*!*****************************************************************
* @brief Method isCircle: Class Ellipse
*___________________________________________________________________
* This method will check if a ellipse is also a circle.
* Returns bool value.
*___________________________________________________________________
* PRE-CONDITIONS
* <none>
*
* POST-CONDITIONS
* Returns bool which determines if ellipse is circle.
@return Returns bool which determines if ellipse is circle.
*******************************************************************/
bool isCircle(); //checks if ellipse is circle
/*!*****************************************************************
* @brief Method draw: Class Ellipse
*___________________________________________________________________
* This method will draw an ellipse on the canvas. Returns nothing.
*___________________________________________________________________
* PRE-CONDITIONS
* <none>
*
* POST-CONDITIONS
* Returns nothing. Draws shape on canvas
*******************************************************************/
void draw(QPainter* shape) override;
/*!*****************************************************************
* @brief Method move: Class Ellipse
*___________________________________________________________________
* This method will move an ellipse using the integer array passed
* as a parameter to update the existing dimensions of the ellipse.
*___________________________________________________________________
* PRE-CONDITIONS
* int[] - array of ints with new coordinates for points
*
* POST-CONDITIONS
* Returns nothing. Moves shape on canvas.
*******************************************************************/
void move(int[]) override;
/*!*****************************************************************
* @brief Method perimeter: Class Ellipse
*___________________________________________________________________
* This virtual method will calculate the perimeter of an ellipse.
*___________________________________________________________________
* PRE-CONDITIONS
* <none>
*
* POST-CONDITIONS
* Returns integer perimeter of ellipse.
@return Returns integer perimeter of ellipse.
*******************************************************************/
int perimeter() override;
/*!*****************************************************************
* @brief Method area: Class Ellipse
*___________________________________________________________________
* This virtual method will calculate the area of a ellipse,
* which is always zero.
*___________________________________________________________________
* PRE-CONDITIONS
* <none>
*
* POST-CONDITIONS
* Returns integer area of ellipse.
@return Returns integer area of ellipse.
*******************************************************************/
int area() override;
};
#endif //ELLIPSE_H