#include <Geometry.h>
Collaboration diagram for Rectangle:
Public Methods | |
Rectangle (VecPosition pos, VecPosition pos2) | |
void | show (ostream &os=cout) |
bool | isInside (VecPosition pos) |
void | setRectanglePoints (VecPosition pos1, VecPosition pos2) |
bool | setPosLeftTop (VecPosition pos) |
VecPosition | getPosLeftTop (VecPosition pos) |
bool | setPosRightBottom (VecPosition pos) |
VecPosition | getPosRightBottom (VecPosition pos) |
Private Attributes | |
VecPosition | m_posLeftTop |
VecPosition | m_posRightBottom |
Definition at line 300 of file Geometry.h.
|
This is the constructor of a Rectangle. Two points will be given. The order does not matter as long as two opposite points are given (left top and right bottom or right top and left bottom).
Definition at line 1513 of file Geometry.C. References setRectanglePoints(). |
|
This method returns the top left position of the rectangle
Definition at line 1560 of file Geometry.C. References m_posLeftTop. |
|
This method returns the right bottom position of the rectangle
Definition at line 1576 of file Geometry.C. References m_posRightBottom. |
|
This method determines whether the given position lies inside the current rectangle.
Definition at line 1542 of file Geometry.C. References VecPosition::getX(), VecPosition::getY(), VecPosition::isBetweenX(), VecPosition::isBetweenY(), m_posLeftTop, and m_posRightBottom. |
|
This method sets the top left position of the rectangle
Definition at line 1552 of file Geometry.C. References m_posLeftTop. |
|
This method sets the right bottom position of the rectangle
Definition at line 1568 of file Geometry.C. References m_posRightBottom. |
|
This method sets the upper left and right bottom point of the current rectangle.
Definition at line 1522 of file Geometry.C. References VecPosition::getX(), VecPosition::getY(), m_posLeftTop, m_posRightBottom, max(), min(), VecPosition::setX(), and VecPosition::setY(). Referenced by Rectangle(). |
|
This method prints the rectangle to the specified output stream in the format rect( top_left_point, bottom_right_point ).
Definition at line 1533 of file Geometry.C. References m_posLeftTop, and m_posRightBottom. |
|
top left position of the rectangle Definition at line 302 of file Geometry.h. Referenced by getPosLeftTop(), isInside(), setPosLeftTop(), setRectanglePoints(), and show(). |
|
bottom right position of the rectangle Definition at line 303 of file Geometry.h. Referenced by getPosRightBottom(), isInside(), setPosRightBottom(), setRectanglePoints(), and show(). |