GT RoboCup SSL
Soccer software, robot firmware
|
Represents a rectangle by storing two opposite corners. More...
Public Member Functions | |
Rect (Point p1) | |
Rect (Point p1, Point p2) | |
Rect (const Rect &other) | |
Shape * | clone () const override |
Rect & | operator+= (Point offset) |
Rect & | operator-= (Point offset) |
Rect | operator+ (Point offset) |
Rect | operator* (float s) |
Rect & | operator*= (float s) |
bool | containsRect (const Rect &other) const |
bool | containsPoint (Point other) const override |
bool | hit (Point pt) const override |
Returns true if the given point is within one robot radius of the shape. | |
bool | hit (const Segment &seg) const override |
Point | center () const |
void | expand (Point pt) |
void | expand (const Rect &rect) |
void | pad (float padding) |
float | minx () const |
float | miny () const |
float | maxx () const |
float | maxy () const |
std::vector< Point > | corners () |
bool | nearPoint (Point pt, float threshold) const override |
bool | nearSegment (const Segment &seg, float threshold) const |
bool | intersects (const Rect &other) const |
std::tuple< bool, std::vector< Point > > | intersects (const Segment &other) const |
std::string | toString () override |
Public Attributes | |
Point | pt [2] |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Rect &rect) |
Represents a rectangle by storing two opposite corners.
They may be upper- left and lower-right or any other pair of diagonal corners.