Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# KeosRectangle.h

Go to the documentation of this file.

    00001 #ifndef KEOS_RECTANGLE_H
    00002 #define KEOS_RECTANGLE_H
    00003
    00004 #include "KeosPrerequisites.h"
    00005
    00006 namespace Keos
    00007 {
    00008     //-----------------------------------------------------------------------
    00012     class KEOS_EXPORT CRectangle
    00013     {
    00014     public :
    00015
    00020         CRectangle(const TVector2I& Start = TVector2I(0, 0), const TVector2I& Size = TVector2I(0, 0));
    00021
    00024         CRectangle(int nLeft, int nTop, int nWidth, int nHeight);
    00025
    00028         void Set(int nLeft, int nTop, int nWidth, int nHeight);
    00029
    00032         int Left() const;
    00033
    00036         int Right() const;
    00037
    00040         int Top() const;
    00041
    00044         int Bottom() const;
    00045
    00048         int Width() const;
    00049
    00052         int Height() const;
    00053
    00056         TVector2I Size() const;
    00057
    00062         TIntersection Intersects(const TVector2I& Point) const;
    00063
    00068         TIntersection Intersects(const CRectangle& Rect) const;
    00069
    00070         // Operators == and !=
    00071         bool operator ==(const CRectangle& Rect) const;
    00072         bool operator !=(const CRectangle& Rect) const;
    00073
    00075         TVector2I Origin;
    00077         TVector2I End;
    00078     };
    00079
    00080     // Globals functions
    00081     KEOS_EXPORT std::istream& operator >>(std::ostream& Stream, CRectangle& Rect);
    00082     KEOS_EXPORT std::ostream& operator <<(std::ostream& Stream, const CRectangle& Rect);
    00083
    00084 } // namespace Keos
    00085
    00086
    00087 #endif // KEOS_RECTANGLE_H