GT RoboCup SSL
Soccer software, robot firmware
Geometry2d::Rect Class Reference

Represents a rectangle by storing two opposite corners. More...

Public Member Functions

 Rect (Point p1)
 
 Rect (Point p1, Point p2)
 
 Rect (const Rect &other)
 
Shapeclone () const override
 
Rectoperator+= (Point offset)
 
Rectoperator-= (Point offset)
 
Rect operator+ (Point offset)
 
Rect operator* (float s)
 
Rectoperator*= (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< Pointcorners ()
 
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)
 

Detailed Description

Represents a rectangle by storing two opposite corners.

They may be upper- left and lower-right or any other pair of diagonal corners.

+ Inheritance diagram for Geometry2d::Rect:
+ Collaboration diagram for Geometry2d::Rect:

The documentation for this class was generated from the following files: