Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

plpoint.h

Go to the documentation of this file.
00001 /*
00002 /--------------------------------------------------------------------
00003 |
00004 |      $Id: plpoint.h,v 1.1 2004/05/21 21:02:53 maxx Exp $
00005 |
00006 |      Copyright (c) 1996-1998 Ulrich von Zadow
00007 |
00008 \--------------------------------------------------------------------
00009 */
00010 
00011 #ifndef INCL_PLPOINT
00012 #define INCL_PLPOINT
00013 
00017 class PLPoint
00018 {
00019 public:
00020   int x;
00021   int y;
00022 
00024   PLPoint
00025   ();
00026 
00028   PLPoint
00029   ( int X,
00030     int Y
00031   );
00032 
00034   bool operator ==
00035   ( const PLPoint & pt
00036   ) const;
00037 
00039   bool operator !=
00040   ( const PLPoint & pt
00041   ) const;
00042 
00044   void operator +=
00045   ( const PLPoint & pt
00046   );
00047 
00049   void operator -=
00050   ( const PLPoint & pt
00051   );
00052 
00054   PLPoint operator -
00055   () const;
00056 
00058   PLPoint operator +
00059   ( const PLPoint & pt
00060   ) const;
00061 
00063   PLPoint operator -
00064   ( const PLPoint & pt
00065   ) const;
00066 
00068   PLPoint operator /
00069   ( double f
00070   ) const;
00071 };
00072 
00073 inline PLPoint::PLPoint
00074 ()
00075 {}
00076 
00077 
00078 inline PLPoint::PLPoint
00079 ( int X,
00080   int Y
00081 )
00082 {
00083   x = X;
00084   y = Y;
00085 }
00086 
00087 inline bool PLPoint::operator ==
00088 ( const PLPoint & pt
00089 ) const
00090 {
00091   return (x == pt.x && y == pt.y);
00092 }
00093 
00094 inline bool PLPoint::operator !=
00095 ( const PLPoint & pt
00096 ) const
00097 {
00098   return (x != pt.x || y != pt.y);
00099 }
00100 
00101 inline void PLPoint::operator +=
00102 ( const PLPoint & pt
00103 )
00104 {
00105   x += pt.x;
00106   y += pt.y;
00107 }
00108 
00109 inline void PLPoint::operator -=
00110 ( const PLPoint & pt
00111 )
00112 {
00113   x -= pt.x;
00114   y -= pt.y;
00115 }
00116 
00117 inline PLPoint PLPoint::operator -
00118 () const
00119 {
00120   return PLPoint(-x, -y);
00121 }
00122 
00123 inline PLPoint PLPoint::operator +
00124 ( const PLPoint & pt
00125 ) const
00126 {
00127   return PLPoint(x + pt.x, y + pt.y);
00128 }
00129 
00130 inline PLPoint PLPoint::operator -
00131 ( const PLPoint & pt
00132 ) const
00133 {
00134   return PLPoint(x - pt.x, y - pt.y);
00135 }
00136 
00137 inline PLPoint PLPoint::operator /
00138   ( double f
00139   ) const
00140 {
00141   return PLPoint (int(x/f), int(y/f));
00142 }
00143 
00144 #endif
00145 
00146 /*
00147 /--------------------------------------------------------------------
00148 |
00149 |      $Log: plpoint.h,v $
00150 |      Revision 1.1  2004/05/21 21:02:53  maxx
00151 |      Initial Version of vuVolume, moderatly changed to make it compile on my windows and linux machine.
00152 |
00153 |      Revision 1.1  2002/11/13 01:58:22  mspindle
00154 |      *** empty log message ***
00155 |
00156 |      Revision 1.7  2001/10/16 17:12:26  uzadow
00157 |      Added support for resolution information (Luca Piergentili)
00158 |
00159 |      Revision 1.6  2001/09/28 19:50:56  uzadow
00160 |      Added some 24 bpp stuff & other minor features.
00161 |
00162 |      Revision 1.5  2001/09/24 14:18:42  uzadow
00163 |      Added operator -, improved const-correctness.
00164 |
00165 |      Revision 1.4  2001/09/16 19:03:22  uzadow
00166 |      Added global name prefix PL, changed most filenames.
00167 |
00168 |      Revision 1.3  2000/11/21 20:20:36  uzadow
00169 |      Changed bool to bool.
00170 |
00171 |      Revision 1.2  2000/01/10 23:52:59  Ulrich von Zadow
00172 |      Changed formatting & removed tabs.
00173 |
00174 |      Revision 1.1  1999/12/09 16:35:58  Ulrich von Zadow
00175 |      Added PLPoint.
00176 |
00177 |
00178 \--------------------------------------------------------------------
00179 */

Generated on Wed Dec 15 21:20:30 2004 for vuVolume by  doxygen 1.3.9.1