55 extern const PMRect kEmptyRect;
62 bool16 IntersectOrAbut(
const PMRect& r1,
const PMRect& r2);
127 constexpr
PMRect() noexcept : left(0.0), top(0.0), right(0.0), bottom(0.0)
175 #if MACINTOSH //on Windows, an Int32Rect is a SysRect 226 bool16
IsEmpty() const noexcept;
317 friend bool16 Intersect_exact( const
PMRect&r1, const
PMRect& r2);
330 friend bool16 IntersectOrAbut_exact(const
PMRect&r1, const
PMRect& r2);
718 friend bool16 UnionIsRect(const
PMRect& r1, const
PMRect& r2);
731 friend bool16 operator ==(const
PMRect& a, const
PMRect& b) noexcept;
742 friend bool16 operator !=(const
PMRect& a, const
PMRect& b) noexcept;
774 #if (_MSC_VER >= 1200) // VC6 or greater 796 return ((left == right) || (top == bottom));
801 ASSERT_MSG(whichPoint >= kFirstPoint && whichPoint <= kLastPoint, "PMRect::IsCorner - whichPoint >= kFirstPoint && whichPoint <= kLastPoint
"); 802 return (whichPoint >= kLeftTop && whichPoint != kCenter); 805 inline bool16 PMRect::IsMiddle(PointIndex whichPoint) const noexcept 807 ASSERT_MSG(whichPoint >= kFirstPoint && whichPoint <= kLastPoint, "PMRect::IsMiddle - whichPoint >= kFirstPoint && whichPoint <= kLastPoint
"); 808 return (whichPoint >= kMiddleTop && whichPoint <= kRightMiddle); 811 inline bool16 PMRect::PointIn(const PMPoint& pt) const noexcept 813 return (pt.x >= left) && (pt.x <= right) && (pt.y >= top) && (pt.y <= bottom); 816 inline bool16 PMRect::ContainsPoint(const PMPoint& pt) const noexcept 819 ::ToDouble(pt.x) >= ::ToDouble(left) 820 && ::ToDouble(pt.x) <= ::ToDouble(right) 821 && ::ToDouble(pt.y) >= ::ToDouble(top) 822 && ::ToDouble(pt.y) <= ::ToDouble(bottom); 826 inline bool16 PMRect::RectIn(const PMRect& r) const noexcept 828 return (top <= r.top && bottom >= r.bottom) && (left <= r.left && right >= r.right); 831 inline bool16 PMRect::ContainsRect(const PMRect& r) const noexcept 834 ::ToDouble(top) <= ::ToDouble(r.top) 835 && ::ToDouble(bottom) >= ::ToDouble(r.bottom) 836 && ::ToDouble(left) <= ::ToDouble(r.left) 837 && ::ToDouble(right) >= ::ToDouble(r.right); 840 inline const PMReal& PMRect::Left() const noexcept 845 inline PMReal& PMRect::Left() noexcept 850 inline void PMRect::Left(const PMReal& c) noexcept 855 inline const PMReal& PMRect::Top() const noexcept 860 inline PMReal& PMRect::Top() noexcept 865 inline void PMRect::Top(const PMReal& c) noexcept 870 inline const PMReal& PMRect::Right() const noexcept 875 inline PMReal& PMRect::Right() noexcept 880 inline void PMRect::Right(const PMReal& c) noexcept 885 inline const PMReal& PMRect::Bottom() const noexcept 890 inline PMReal& PMRect::Bottom() noexcept 895 inline void PMRect::Bottom(const PMReal& c) noexcept 900 inline PMPoint PMRect::LeftTop() const noexcept 902 return PMPoint(left, top); 905 inline void PMRect::LeftTop(const PMPoint& pt) noexcept 907 left = pt.X(); top = pt.Y(); 910 inline PMPoint PMRect::RightBottom() const noexcept 912 return PMPoint(right, bottom); 915 inline void PMRect::RightBottom(const PMPoint& pt) noexcept 917 right = pt.X(); bottom = pt.Y(); 920 inline PMPoint PMRect::RightTop() const noexcept 922 return PMPoint(right, top); 925 inline void PMRect::RightTop(const PMPoint& pt) noexcept 927 right = pt.X(); top = pt.Y(); 930 inline PMPoint PMRect::LeftBottom() const noexcept 932 return PMPoint(left, bottom); 935 inline void PMRect::LeftBottom(const PMPoint& pt) noexcept 937 left = pt.X(); bottom = pt.Y(); 940 inline PMReal PMRect::Height() const noexcept 945 inline PMReal PMRect::Width() const noexcept 950 inline PMPoint PMRect::Dimensions() const noexcept 952 return PMPoint(Width(), Height()); 955 inline PMRect::PointIndex PMRect::GetOppositePointIndex(PointIndex whichPoint) const 957 return (whichPoint == kCenter) ? kCenter : 958 PointIndex((whichPoint + 2) % 4 + (IsCorner(whichPoint) ? 4 : 0)); 962 inline PMPoint PMRect::GetOppositePoint(PointIndex whichPoint) const 964 return GetPoint(GetOppositePointIndex(whichPoint)); 968 inline PMRect& PMRect::SetEmpty() noexcept 976 inline PMRect& PMRect::MoveRel(const PMReal& dx, const PMReal& dy) 978 left += dx; right += dx; top += dy; bottom += dy; 982 inline PMRect& PMRect::MoveRel(const PMPoint& point) 984 MoveRel(point.X(), point.Y()); 988 inline PMRect& PMRect::MoveTo(const PMReal& dx, const PMReal& dy) 990 right += (dx - left); bottom += (dy - top); left = dx; top = dy; 994 inline PMRect& PMRect::MoveTo(const PMPoint& point) 996 MoveTo(point.X(), point.Y()); 1000 inline PMRect& PMRect::CenterOn(const PMPoint& point) 1002 CenterOn(point.X(), point.Y()); 1006 inline PMRect& PMRect::Inset(const PMReal& dx, const PMReal& dy) 1008 left += dx; top += dy; right -= dx; bottom -= dy; 1012 inline bool16 operator ==(const PMRect& a, const PMRect& b) noexcept 1014 return (a.left == b.left && a.top == b.top && a.right == b.right && a.bottom == b.bottom); 1017 inline bool16 operator !=(const PMRect& a, const PMRect& b) noexcept 1019 return (a.left != b.left || a.top != b.top || a.right != b.right || a.bottom != b.bottom); 1022 constexpr PMRect kZeroRect; //zeroed out in default constructor