Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __GELSIZE_H__
00017 #define __GELSIZE_H__
00018
00019 namespace gel
00020 {
00021 class GelSize
00022 {
00023 public:
00025
00026 GelSize() : width(0), height(0) {}
00027
00029
00030 GelSize( int n ) : width(n), height(n) {}
00031
00033
00035 GelSize( int w, int h ) : width(w), height(h) {}
00036
00038 GelSize( const GelSize &size) { width = size.width; height = size.height; }
00039
00040 GelSize operator+ ( const GelSize &s ) const { return GelSize( width+s.width, height+s.height ); }
00041 GelSize operator- ( const GelSize &s ) const { return GelSize( width-s.width, height-s.height ); }
00042 GelSize operator* ( const GelSize &s ) const { return GelSize( width*s.width, height*s.height ); }
00043 GelSize operator/ ( const GelSize &s ) const { return GelSize( width/s.width, height/s.height ); }
00044 GelSize operator= ( const GelSize &s ) { width=s.width; height=s.height; return *this; }
00045 GelSize operator+=( const GelSize &s ) { width+=s.width; height+=s.height; return *this; }
00046 GelSize operator-=( const GelSize &s ) { width-=s.width; height-=s.height; return *this; }
00047 GelSize operator*=( const GelSize &s ) { width*=s.width; height*=s.height; return *this; }
00048 GelSize operator/=( const GelSize &s ) { width/=s.width; height/=s.height; return *this; }
00049
00050 bool operator==( const GelSize &s ) const { return ( width==s.width && height==s.height ); }
00051 bool operator!=( const GelSize &s ) const { return ( width!=s.width || height!=s.height ); }
00052 bool operator< ( const GelSize &s ) const { return ( width<s.width || (width==s.width && height<s.height) ); }
00053 bool operator> ( const GelSize &s ) const { return ( width>s.width || (width==s.width && height>s.height) ); }
00054
00055 public:
00057 int width;
00059 int height;
00060 };
00061
00062 class GelPoint
00063 {
00064 public:
00066
00067 GelPoint() : x(0), y(0) {}
00068
00070
00071 GelPoint( int n ) : x(n), y(n) {}
00072
00074
00076 GelPoint( int _x, int _y ) : x(_x), y(_y) {}
00077
00079 GelPoint( const GelPoint &point) : x(point.x), y(point.y) {}
00080
00081 GelPoint operator+ ( const GelPoint &p ) const { return GelPoint( x+p.x, y+p.y ); }
00082 GelPoint operator- ( const GelPoint &p ) const { return GelPoint( x-p.x, y-p.y ); }
00083 GelPoint operator* ( const GelPoint &p ) const { return GelPoint( x*p.x, y*p.y ); }
00084 GelPoint operator/ ( const GelPoint &p ) const { return GelPoint( x/p.x, y/p.y ); }
00085 GelPoint operator= ( const GelPoint &p ) { x=p.x; y=p.y; return *this; }
00086 GelPoint operator+=( const GelPoint &p ) { x+=p.x; y+=p.y; return *this; }
00087 GelPoint operator-=( const GelPoint &p ) { x-=p.x; y-=p.y; return *this; }
00088 GelPoint operator*=( const GelPoint &p ) { x*=p.x; y*=p.y; return *this; }
00089 GelPoint operator/=( const GelPoint &p ) { x/=p.x; y/=p.y; return *this; }
00090
00091 bool operator==( const GelPoint &p ) const { return ( x==p.x && y==p.y ); }
00092 bool operator!=( const GelPoint &p ) const { return ( x!=p.x || y!=p.y ); }
00093 bool operator< ( const GelPoint &p ) const { return ( x<p.x || (x==p.x && y<p.y) ); }
00094 bool operator> ( const GelPoint &p ) const { return ( x>p.x || (x==p.x && y>p.y) ); }
00095
00096 public:
00098 int x;
00100 int y;
00101 };
00102 }
00103
00104 #endif // __GELSIZE_H__