/usr/include/root/TPoint.h is in libroot-core-dev 5.34.19+dfsg-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | /* @(#)root/base:$Id$ */
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TPoint
#define ROOT_TPoint
//////////////////////////////////////////////////////////////////////////
// //
// TPoint //
// //
// TPoint implements a 2D screen (device) point (see also TPoints). //
// //
// Don't add in dictionary since that will add a virtual table pointer //
// and that will destroy the data layout of an array of TPoint's which //
// should match the layout of an array of XPoint's (so no extra copying //
// needs to be done in the X11 drawing routines). //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif
class TPoint {
public: // for easy access
#if !defined(WIN32) && !defined(G__WIN32)
SCoord_t fX; //X device coordinate
SCoord_t fY; //Y device coordinate
#else
long fX; //X device coordinate
long fY; //Y device coordinate
#endif
public:
TPoint() : fX(0), fY(0) { }
TPoint(SCoord_t xy) : fX(xy), fY(xy) { }
TPoint(SCoord_t x, SCoord_t y) : fX(x), fY(y) { }
~TPoint() { }
SCoord_t GetX() const { return (SCoord_t)fX; }
SCoord_t GetY() const { return (SCoord_t)fY; }
void SetX(SCoord_t x) { fX = x; }
void SetY(SCoord_t y) { fY = y; }
TPoint& operator=(const TPoint& p) { fX = p.fX; fY = p.fY; return *this; }
friend bool operator==(const TPoint& p1, const TPoint& p2);
friend bool operator!=(const TPoint& p1, const TPoint& p2);
};
inline bool operator==(const TPoint& p1, const TPoint& p2)
{
return p1.fX == p2.fX && p1.fY == p2.fY;
}
inline bool operator!=(const TPoint& p1, const TPoint& p2)
{
return p1.fX != p2.fX || p1.fY != p2.fY;
}
#endif
|