#include <Geometry.h>
Collaboration diagram for Rect:
Public Methods | |
Rect (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 () |
bool | setPosRightBottom (VecPosition pos) |
VecPosition | getPosRightBottom () |
Private Attributes | |
VecPosition | m_posLeftTop |
VecPosition | m_posRightBottom |
Definition at line 313 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 1643 of file Geometry.cpp. References setRectanglePoints(). |
|
This method returns the top left position of the rectangle
Definition at line 1690 of file Geometry.cpp. References m_posLeftTop. |
|
This method returns the right bottom position of the rectangle
Definition at line 1706 of file Geometry.cpp. References m_posRightBottom. |
|
This method determines whether the given position lies inside the current rectangle.
Definition at line 1672 of file Geometry.cpp. References VecPosition::getX(), VecPosition::getY(), VecPosition::isBetweenX(), VecPosition::isBetweenY(), m_posLeftTop, and m_posRightBottom. Referenced by WorldModel::getNrInSetInRectangle(). |
|
This method sets the top left position of the rectangle
Definition at line 1682 of file Geometry.cpp. References m_posLeftTop. |
|
This method sets the right bottom position of the rectangle
Definition at line 1698 of file Geometry.cpp. References m_posRightBottom. |
|
This method sets the upper left and right bottom point of the current rectangle.
Definition at line 1652 of file Geometry.cpp. References VecPosition::getX(), VecPosition::getY(), m_posLeftTop, m_posRightBottom, max(), min(), VecPosition::setX(), and VecPosition::setY(). Referenced by Rect(). |
|
This method prints the rectangle to the specified output stream in the format rect( top_left_point, bottom_right_point ).
Definition at line 1663 of file Geometry.cpp. References m_posLeftTop, and m_posRightBottom. |
|
top left position of the rectangle Definition at line 315 of file Geometry.h. Referenced by getPosLeftTop(), isInside(), setPosLeftTop(), setRectanglePoints(), and show(). |
|
bottom right position of the rectangle Definition at line 316 of file Geometry.h. Referenced by getPosRightBottom(), isInside(), setPosRightBottom(), setRectanglePoints(), and show(). |