00001
00002
00003
00004
00005
00006 #ifndef __XYCOORD_H
00007 #define __XYCOORD_H
00008
00009 class XYObject;
00010
00011
00012
00013
00014 class XYCoordinate
00015 {
00016 public:
00017
00018
00019
00020 enum TypesCoordinates {
00021 pixel = 0,
00022 world,
00023 relative
00024 };
00025
00026
00027
00028 enum Where {
00029 before = 0,
00030 left = before,
00031 bottom = before,
00032 after = 1,
00033 right = after,
00034 top = after
00035 };
00036
00037
00038
00039 XYCoordinate (
00040 double p)
00041 : _p(p),
00042 _type(world),
00043 _ref(0),
00044 _dir(before),
00045 _gap(0) {};
00046
00047
00048 XYCoordinate (
00049 int p)
00050 : _pp(p),
00051 _type(pixel),
00052 _ref(0),
00053 _dir(before),
00054 _gap(0) {};
00055
00056
00057 XYCoordinate (
00058 const XYObject* r,
00059 Where d,
00060 int g)
00061 : _p(0),
00062 _type(relative),
00063 _ref(r),
00064 _dir(d),
00065 _gap(g) {};
00066
00067
00068 XYCoordinate ()
00069 : _p(0.0),
00070 _pp(0),
00071 _type(world),
00072 _ref(0),
00073 _dir(before),
00074 _gap(0) {};
00075
00076
00077 virtual ~XYCoordinate () {}
00078
00079
00080
00081 virtual void set (const XYObject* r, Where d, int g);
00082 virtual void set (double p);
00083 virtual void set (int p);
00084
00085
00086 virtual void get (double* p) const;
00087 virtual void get (int* pp) const;
00088
00089
00090 virtual void type (int t);
00091
00092 virtual int type (void) const;
00093
00094
00095 virtual void reference (const XYObject* obj);
00096
00097 virtual const XYObject* reference (void) const;
00098
00099
00100 virtual void direction (Where d);
00101
00102 virtual int direction (void) const;
00103
00104
00105 virtual void gap (int g);
00106
00107 virtual int gap (void) const;
00108
00109 private:
00110
00111 double _p;
00112 int _pp;
00113 int _type;
00114 const XYObject* _ref;
00115 Where _dir;
00116 int _gap;
00117 };
00118
00119 #endif
00120