#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 308 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 1518 of file Geometry.C. References setRectanglePoints(). |
|
This method returns the top left position of the rectangle
Definition at line 1565 of file Geometry.C. References m_posLeftTop. |
|
This method returns the right bottom position of the rectangle
Definition at line 1581 of file Geometry.C. References m_posRightBottom. |
|
This method determines whether the given position lies inside the current rectangle.
Definition at line 1547 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 1557 of file Geometry.C. References m_posLeftTop. |
|
This method sets the right bottom position of the rectangle
Definition at line 1573 of file Geometry.C. References m_posRightBottom. |
|
This method sets the upper left and right bottom point of the current rectangle.
Definition at line 1527 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 1538 of file Geometry.C. References m_posLeftTop, and m_posRightBottom. |
|
top left position of the rectangle Definition at line 310 of file Geometry.h. Referenced by getPosLeftTop(), isInside(), setPosLeftTop(), setRectanglePoints(), and show(). |
|
bottom right position of the rectangle Definition at line 311 of file Geometry.h. Referenced by getPosRightBottom(), isInside(), setPosRightBottom(), setRectanglePoints(), and show(). |