File indexing completed on 2026-09-21 09:26:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TBuffer3D
0013 #define ROOT_TBuffer3D
0014
0015 #include "TObject.h"
0016
0017 class TBuffer3D : public TObject
0018 {
0019 private:
0020 const Int_t fType;
0021
0022 UInt_t fNbPnts;
0023 UInt_t fNbSegs;
0024 UInt_t fNbPols;
0025
0026 UInt_t fPntsCapacity;
0027 UInt_t fSegsCapacity;
0028 UInt_t fPolsCapacity;
0029
0030 UInt_t fSections;
0031
0032 void Init();
0033
0034
0035 TBuffer3D(const TBuffer3D &) = delete;
0036 TBuffer3D & operator=(const TBuffer3D &) = delete;
0037
0038
0039 static UInt_t fgCSLevel;
0040
0041 public:
0042
0043 enum EBoolOpCode {kCSUnion, kCSIntersection, kCSDifference, kCSNoOp};
0044
0045 static UInt_t GetCSLevel();
0046 static void IncCSLevel();
0047 static UInt_t DecCSLevel();
0048
0049 enum ESection {
0050
0051 #if defined(__clang__) && __clang_major__ < 20
0052 #pragma clang diagnostic push
0053 #pragma clang diagnostic ignored "-Wshadow"
0054 #endif
0055 kNone = BIT(0),
0056 #if defined(__clang__) && __clang_major__ < 20
0057 #pragma clang diagnostic pop
0058 #endif
0059 kCore = BIT(1),
0060 kBoundingBox = BIT(2),
0061 kShapeSpecific = BIT(3),
0062 kRawSizes = BIT(4),
0063 kRaw = BIT(5),
0064 kAll = kCore|kBoundingBox|kShapeSpecific|kRawSizes|kRaw
0065 };
0066
0067 TBuffer3D(Int_t type,
0068 UInt_t reqPnts = 0, UInt_t reqPntsCapacity = 0,
0069 UInt_t reqSegs = 0, UInt_t reqSegsCapacity = 0,
0070 UInt_t reqPols = 0, UInt_t reqPolsCapacity = 0);
0071 virtual ~TBuffer3D();
0072
0073
0074 void SetSectionsValid(UInt_t mask) { fSections |= mask & kAll; }
0075 void ClearSectionsValid();
0076 Bool_t SectionsValid(UInt_t mask) const { return (Bool_t) (GetSections(mask) == mask); }
0077 UInt_t GetSections(UInt_t mask) const { return (UInt_t) (fSections & mask); }
0078
0079
0080 void SetLocalMasterIdentity();
0081 void SetAABoundingBox(const Double_t origin[3],
0082 const Double_t halfLengths[3]);
0083
0084
0085 Bool_t SetRawSizes(UInt_t reqPnts, UInt_t reqPntsCapacity,
0086 UInt_t reqSegs, UInt_t reqSegsCapacity,
0087 UInt_t reqPols, UInt_t reqPolsCapacity);
0088
0089 UInt_t NbPnts() const { return fNbPnts; }
0090 UInt_t NbSegs() const { return fNbSegs; }
0091 UInt_t NbPols() const { return fNbPols; }
0092
0093
0094 Int_t Type() const { return fType; }
0095
0096 TObject *fID;
0097 Int_t fColor;
0098 Short_t fTransparency;
0099 Bool_t fLocalFrame;
0100 Bool_t fReflection;
0101 Bool_t fScaled;
0102 Double_t fLocalMaster[16];
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117 Double_t fBBVertex[8][3];
0118
0119
0120
0121
0122 Double_t *fPnts;
0123 Int_t *fSegs;
0124 Int_t *fPols;
0125
0126
0127
0128 mutable UInt_t fPhysicalID;
0129
0130
0131 ClassDefOverride(TBuffer3D,0)
0132 };
0133
0134
0135
0136
0137
0138 class TBuffer3DSphere : public TBuffer3D
0139 {
0140 private:
0141
0142 TBuffer3DSphere(const TBuffer3DSphere &) = delete;
0143 TBuffer3DSphere & operator=(const TBuffer3DSphere &) = delete;
0144
0145 public:
0146 TBuffer3DSphere(UInt_t reqPnts = 0, UInt_t reqPntsCapacity = 0,
0147 UInt_t reqSegs = 0, UInt_t reqSegsCapacity = 0,
0148 UInt_t reqPols = 0, UInt_t reqPolsCapacity = 0);
0149
0150 Bool_t IsSolidUncut() const;
0151
0152
0153 Double_t fRadiusInner;
0154 Double_t fRadiusOuter;
0155 Double_t fThetaMin;
0156 Double_t fThetaMax;
0157 Double_t fPhiMin;
0158 Double_t fPhiMax;
0159 };
0160
0161
0162
0163
0164
0165 class TBuffer3DTube : public TBuffer3D
0166 {
0167 private:
0168
0169 TBuffer3DTube(const TBuffer3DTube &) = delete;
0170 TBuffer3DTube & operator=(const TBuffer3DTube &) = delete;
0171
0172 protected:
0173 TBuffer3DTube(Int_t type,
0174 UInt_t reqPnts = 0, UInt_t reqPntsCapacity = 0,
0175 UInt_t reqSegs = 0, UInt_t reqSegsCapacity = 0,
0176 UInt_t reqPols = 0, UInt_t reqPolsCapacity = 0);
0177
0178 public:
0179 TBuffer3DTube(UInt_t reqPnts = 0, UInt_t reqPntsCapacity = 0,
0180 UInt_t reqSegs = 0, UInt_t reqSegsCapacity = 0,
0181 UInt_t reqPols = 0, UInt_t reqPolsCapacity = 0);
0182
0183
0184 Double_t fRadiusInner;
0185 Double_t fRadiusOuter;
0186 Double_t fHalfLength;
0187 };
0188
0189
0190
0191
0192
0193 class TBuffer3DTubeSeg : public TBuffer3DTube
0194 {
0195 private:
0196
0197 TBuffer3DTubeSeg(const TBuffer3DTubeSeg &);
0198 TBuffer3DTubeSeg & operator=(const TBuffer3DTubeSeg &) = delete;
0199
0200 protected:
0201 TBuffer3DTubeSeg(Int_t type,
0202 UInt_t reqPnts = 0, UInt_t reqPntsCapacity = 0,
0203 UInt_t reqSegs = 0, UInt_t reqSegsCapacity = 0,
0204 UInt_t reqPols = 0, UInt_t reqPolsCapacity = 0);
0205
0206 public:
0207 TBuffer3DTubeSeg(UInt_t reqPnts = 0, UInt_t reqPntsCapacity = 0,
0208 UInt_t reqSegs = 0, UInt_t reqSegsCapacity = 0,
0209 UInt_t reqPols = 0, UInt_t reqPolsCapacity = 0);
0210
0211
0212 Double_t fPhiMin;
0213 Double_t fPhiMax;
0214 };
0215
0216
0217
0218
0219
0220 class TBuffer3DCutTube : public TBuffer3DTubeSeg
0221 {
0222 private:
0223
0224 TBuffer3DCutTube(const TBuffer3DTubeSeg &) = delete;
0225 TBuffer3DCutTube & operator=(const TBuffer3DTubeSeg &) = delete;
0226
0227 public:
0228 TBuffer3DCutTube(UInt_t reqPnts = 0, UInt_t reqPntsCapacity = 0,
0229 UInt_t reqSegs = 0, UInt_t reqSegsCapacity = 0,
0230 UInt_t reqPols = 0, UInt_t reqPolsCapacity = 0);
0231
0232
0233 Double_t fLowPlaneNorm[3];
0234 Double_t fHighPlaneNorm[3];
0235 };
0236
0237 #endif