File indexing completed on 2025-12-15 10:30:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef ROOT_TPoint
0012 #define ROOT_TPoint
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #include "RtypesCore.h"
0029
0030
0031 class TPoint {
0032
0033 public:
0034 #if !defined(WIN32) && !defined(G__WIN32)
0035 SCoord_t fX;
0036 SCoord_t fY;
0037 #else
0038 long fX;
0039 long fY;
0040 #endif
0041
0042 public:
0043 TPoint() : fX(0), fY(0) { }
0044 TPoint(SCoord_t xy) : fX(xy), fY(xy) { }
0045 TPoint(SCoord_t x, SCoord_t y) : fX(x), fY(y) { }
0046 SCoord_t GetX() const { return (SCoord_t)fX; }
0047 SCoord_t GetY() const { return (SCoord_t)fY; }
0048 void SetX(SCoord_t x) { fX = x; }
0049 void SetY(SCoord_t y) { fY = y; }
0050
0051 friend bool operator==(const TPoint& p1, const TPoint& p2);
0052 friend bool operator!=(const TPoint& p1, const TPoint& p2);
0053 };
0054
0055 inline bool operator==(const TPoint& p1, const TPoint& p2)
0056 {
0057 return p1.fX == p2.fX && p1.fY == p2.fY;
0058 }
0059
0060 inline bool operator!=(const TPoint& p1, const TPoint& p2)
0061 {
0062 return p1.fX != p2.fX || p1.fY != p2.fY;
0063 }
0064
0065 #endif