File indexing completed on 2025-01-18 10:10:47
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef ROOT7_RPadExtent
0010 #define ROOT7_RPadExtent
0011
0012 #include "ROOT/RPadLength.hxx"
0013
0014 #include <array>
0015 #include <string>
0016
0017 namespace ROOT {
0018 namespace Experimental {
0019
0020
0021
0022
0023
0024
0025
0026
0027 class RPadExtent {
0028
0029 RPadLength fHoriz;
0030
0031 RPadLength fVert;
0032
0033 public:
0034
0035 RPadExtent() = default;
0036
0037 RPadExtent(const RPadLength& horiz, const RPadLength& vert) : RPadExtent()
0038 {
0039 fHoriz = horiz;
0040 fVert = vert;
0041 }
0042
0043 RPadLength &Horiz() { return fHoriz; }
0044 const RPadLength &Horiz() const { return fHoriz; }
0045
0046 RPadLength &Vert() { return fVert; }
0047 const RPadLength &Vert() const { return fVert; }
0048
0049
0050
0051 friend RPadExtent operator+(RPadExtent lhs, const RPadExtent &rhs)
0052 {
0053 return {lhs.fHoriz + rhs.fHoriz, lhs.fVert + rhs.fVert};
0054 }
0055
0056
0057 friend RPadExtent operator-(RPadExtent lhs, const RPadExtent &rhs)
0058 {
0059 return {lhs.fHoriz - rhs.fHoriz, lhs.fVert - rhs.fVert};
0060 }
0061
0062
0063 RPadExtent &operator+=(const RPadExtent &rhs)
0064 {
0065 fHoriz += rhs.fHoriz;
0066 fVert += rhs.fVert;
0067 return *this;
0068 };
0069
0070
0071 RPadExtent &operator-=(const RPadExtent &rhs)
0072 {
0073 fHoriz -= rhs.fHoriz;
0074 fVert -= rhs.fVert;
0075 return *this;
0076 };
0077
0078
0079
0080
0081
0082 struct ScaleFactor {
0083 double fHoriz;
0084 double fVert;
0085 };
0086
0087
0088
0089 RPadExtent &operator*=(const ScaleFactor &scale)
0090 {
0091 fHoriz *= scale.fHoriz;
0092 fVert *= scale.fVert;
0093 return *this;
0094 };
0095 };
0096
0097
0098 }
0099 }
0100
0101 #endif