Rectangle Class Reference
#include <rectangle.h>
Inheritance diagram for Rectangle:
Collaboration diagram for Rectangle:
Public Member Functions | |
Rectangle (int l, int w, int x, int y) | |
Rectangle (int l, int w, Point c) | |
virtual std::string | getType () const |
virtual double | getArea () const |
Public Member Functions inherited from Shape | |
Shape (int x, int y) | |
Shape (Point c) | |
Point | getCenter () const |
void | setCenter (Point c) |
Additional Inherited Members | |
Protected Attributes inherited from Shape | |
Point | center |
Detailed Description
A class that represents a rectangle on a 2D plane. Its only members are its length and width. It inherits all of its functionality from the Shape class.
Constructor & Destructor Documentation
◆ Rectangle() [1/2]
Rectangle::Rectangle | ( | int | l, |
int | w, | ||
int | x, | ||
int | y | ||
) |
Overloaded constructor that takes in a length, a width, and an (x,y) coordinate.
- Parameters
-
l The length of the rectangle (must be greater than 0) w The width of the rectangle (must be greater than 0) x The X coordinate of the rectangle's center point in 2D space y The Y coordinate of the rectangle's center point in 2D space
◆ Rectangle() [2/2]
Rectangle::Rectangle | ( | int | l, |
int | w, | ||
Point | c | ||
) |
Overloaded constructor that takes in a length, a width, and a center Point.
- Parameters
-
l The length of the rectangle (must be greater than 0) w The width of the rectangle (must be greater than 0) c The center point of the rectangle in 2D space
Member Function Documentation
◆ getArea()
|
virtual |
◆ getType()
|
virtual |
The documentation for this class was generated from the following files:
- /home/awalsh128/doxygen-themes/example_src/rectangle.h
- /home/awalsh128/doxygen-themes/example_src/rectangle.cpp