32 #include <wx/gdicmn.h> 47 EDA_RECT(
const wxPoint& aPos,
const wxSize& aSize ) :
74 void Move(
const wxPoint& aMoveVector );
85 bool Contains(
const wxPoint& aPoint )
const;
193 SetEnd( wxPoint( x, y ) );
239 bool Intersects(
const wxPoint& aPoint1,
const wxPoint& aPoint2 )
const;
250 bool Intersects(
const wxPoint& aPoint1,
const wxPoint& aPoint2,
251 wxPoint* aIntersection1, wxPoint* aIntersection2 )
const;
285 operator wxRect()
const 330 void Merge(
const wxPoint& aPoint );
void Offset(int dx, int dy)
void Move(const wxPoint &aMoveVector)
Move the rectangle by the aMoveVector.
void Merge(const EDA_RECT &aRect)
Modify the position and size of the rectangle in order to contain aRect.
bool IntersectsCircle(const wxPoint &aCenter, const int aRadius) const
Test for a common area between a circle and this rectangle.
void SetOrigin(const wxPoint &pos)
bool IntersectsCircleEdge(const wxPoint &aCenter, const int aRadius, const int aWidth) const
Test for intersection between this rect and the edge (radius) of a circle.
EDA_RECT Common(const EDA_RECT &aRect) const
Return the area that is common with another rectangle.
void RevertYAxis()
Mirror the rectangle from the X axis (negate Y pos and size).
A 2D bounding box built on top of an origin point and size vector.
void SetSize(int w, int h)
bool Contains(const wxPoint &aPoint) const
const wxPoint GetEnd() const
EDA_RECT(const wxPoint &aPos, const wxSize &aSize)
const wxPoint GetOrigin() const
void SetEnd(int x, int y)
coord_type GetWidth() const
const wxPoint GetPosition() const
const wxPoint FarthestPointTo(const wxPoint &aPoint) const
Return the point in this rect that is farthest from the provided point.
double GetArea() const
Return the area of the rectangle.
const Vec & GetPosition() const
bool Contains(int x, int y) const
void Normalize()
Ensures that the height ant width are positive.
void SetSize(const wxSize &size)
EDA_RECT(const BOX2< T > aBox)
Handle the component boundary box.
coord_type GetHeight() const
void SetEnd(const wxPoint &pos)
bool Intersects(const EDA_RECT &aRect) const
Test for a common area between rectangles.
const EDA_RECT GetBoundingBoxRotated(const wxPoint &aRotCenter, double aAngle) const
Useful to calculate bounding box of rotated items, when rotation if not k*90 degrees.
const wxPoint GetCenter() const
void SetOrigin(int x, int y)
void Offset(const wxPoint &offset)
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
const wxSize GetSize() const
const wxPoint ClosestPointTo(const wxPoint &aPoint) const
Return the point in this rect that is closest to the provided point.