00001 #ifndef __RECT_H__
00002 #define __RECT_H__
00003
00004 #include "Common/CommonDll.h"
00005 #include "Common/Point.h"
00006
00007
00008 class COMMON_API KRect
00009 {
00010 public:
00011 s32 x1;
00012 s32 y1;
00013 s32 x2;
00014 s32 y2;
00015
00016 inline KRect()
00017 {
00018 x1 = 0;
00019 y1 = 0;
00020 x2 = 0;
00021 y2 = 0;
00022 }
00023
00024 inline KRect( s32 x1, s32 y1, s32 x2, s32 y2 )
00025 {
00026 this->x1 = x1;
00027 this->y1 = y1;
00028 this->x2 = x2;
00029 this->y2 = y2;
00030 }
00031
00032 inline bool IsInside( KPt& Pos )
00033 {
00034 if( ( Pos.x >= x1 ) &&
00035 ( Pos.x <= x2 ) &&
00036 ( Pos.y >= y1 ) &&
00037 ( Pos.y <= y2 ))
00038 return true;
00039
00040 return false;
00041 }
00042 };
00043
00044
00045 class COMMON_API KFRect
00046 {
00047 public:
00048 float x1;
00049 float y1;
00050 float x2;
00051 float y2;
00052
00053 inline KFRect()
00054 {
00055 x1 = 0;
00056 y1 = 0;
00057 x2 = 0;
00058 y2 = 0;
00059 }
00060
00061 inline KFRect( float x1, float y1, float x2, float y2 )
00062 {
00063 this->x1 = x1;
00064 this->y1 = y1;
00065 this->x2 = x2;
00066 this->y2 = y2;
00067 }
00068
00069 inline bool IsInside( KFPt& Pos )
00070 {
00071 if( ( Pos.x >= x1 ) &&
00072 ( Pos.x <= x2 ) &&
00073 ( Pos.y >= y1 ) &&
00074 ( Pos.y <= y2 ))
00075 return true;
00076
00077 return false;
00078 }
00079 };
00080
00081 #endif // __RECT_H__