00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #if !defined(IPOINT_HPP)
00012 #define IPOINT_HPP
00013
00014 #include "gtypes.h"
00015 #include <iostream.h>
00016 #include <stdlib.h>
00017 #include <math.h>
00018
00019 class IPoint
00020 {
00021 public:
00022 IPoint();
00023 ~IPoint();
00024 friend ostream& operator<<(ostream &, IPoint &);
00025
00026 inline GBOOL operator==(IPoint &p)
00027 { return (p.i1==i1 && p.i2==i2 && p.i3==i3); }
00028
00029 inline GBOOL operator!=(IPoint &p)
00030 { return !this->operator==(p); }
00031
00032 inline void operator=(IPoint &p)
00033 { i1 = p.i1; i2 = p.i2; i3 = p.i3;}
00034
00035 inline void operator=(GINT f)
00036 { i1 = i2 = i3 = f; }
00037
00038 inline GINT &operator()(GINT i)
00039 { if ( i<0 || i>=3 ) { cout << "IPoint::(): access error; bad index:" << i << endl; exit(1); }
00040 return *pix_[i]; }
00041
00042 inline GINT &operator[](GINT i)
00043 { if ( i<0 || i>=3 ) { cout << "IPoint::[]: access error; bad index:" << i << endl; exit(1); }
00044 return *pix_[i]; }
00045
00046 GINT i1;
00047 GINT i2;
00048 GINT i3;
00049 GINT *pix_[3];
00050
00051 };
00052
00053 #endif