File indexing completed on 2025-09-17 09:15:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGeoBBox
0013 #define ROOT_TGeoBBox
0014
0015 #include "TGeoShape.h"
0016
0017 class TGeoBBox : public TGeoShape {
0018 protected:
0019
0020 Double_t fDX;
0021 Double_t fDY;
0022 Double_t fDZ;
0023 Double_t fOrigin[3];
0024
0025 void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const override;
0026
0027 TGeoBBox(const TGeoBBox &) = delete;
0028 TGeoBBox &operator=(const TGeoBBox &) = delete;
0029
0030 public:
0031
0032 TGeoBBox();
0033 TGeoBBox(Double_t dx, Double_t dy, Double_t dz, Double_t *origin = nullptr);
0034 TGeoBBox(const char *name, Double_t dx, Double_t dy, Double_t dz, Double_t *origin = nullptr);
0035 TGeoBBox(Double_t *param);
0036
0037 ~TGeoBBox() override;
0038
0039
0040 Double_t Capacity() const override;
0041 void ComputeBBox() override;
0042 void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override;
0043 void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override;
0044 Bool_t Contains(const Double_t *point) const override;
0045 void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override;
0046 static Bool_t Contains(const Double_t *point, Double_t dx, Double_t dy, Double_t dz, const Double_t *origin);
0047 Bool_t CouldBeCrossed(const Double_t *point, const Double_t *dir) const override;
0048 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0049 Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact = 1, Double_t step = TGeoShape::Big(),
0050 Double_t *safe = nullptr) const override;
0051 void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
0052 Double_t *step) const override;
0053 static Double_t DistFromInside(const Double_t *point, const Double_t *dir, Double_t dx, Double_t dy, Double_t dz,
0054 const Double_t *origin, Double_t stepmax = TGeoShape::Big());
0055 Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact = 1,
0056 Double_t step = TGeoShape::Big(), Double_t *safe = nullptr) const override;
0057 void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
0058 Double_t *step) const override;
0059 static Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Double_t dx, Double_t dy, Double_t dz,
0060 const Double_t *origin, Double_t stepmax = TGeoShape::Big());
0061 TGeoVolume *
0062 Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override;
0063 const char *GetAxisName(Int_t iaxis) const override;
0064 Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override;
0065 void GetBoundingCylinder(Double_t *param) const override;
0066 const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override;
0067 Int_t GetByteCount() const override { return 36; }
0068 virtual Double_t GetFacetArea(Int_t index = 0) const;
0069 virtual Bool_t GetPointsOnFacet(Int_t index, Int_t npoints, Double_t *array) const;
0070 Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override;
0071 Int_t
0072 GetFittingBox(const TGeoBBox *parambox, TGeoMatrix *mat, Double_t &dx, Double_t &dy, Double_t &dz) const override;
0073 TGeoShape *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override;
0074 void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override;
0075 Int_t GetNmeshVertices() const override { return 8; }
0076 virtual Double_t GetDX() const { return fDX; }
0077 virtual Double_t GetDY() const { return fDY; }
0078 virtual Double_t GetDZ() const { return fDZ; }
0079 virtual const Double_t *GetOrigin() const { return fOrigin; }
0080 void InspectShape() const override;
0081 Bool_t IsCylType() const override { return kFALSE; }
0082 Bool_t IsValidBox() const override { return ((fDX < 0) || (fDY < 0) || (fDZ < 0)) ? kFALSE : kTRUE; }
0083 virtual Bool_t IsNullBox() const { return ((fDX < 1.E-16) && (fDY < 1.E-16) && (fDZ < 1.E-16)) ? kTRUE : kFALSE; }
0084 TBuffer3D *MakeBuffer3D() const override;
0085 Double_t Safety(const Double_t *point, Bool_t in = kTRUE) const override;
0086 void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override;
0087 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0088 void SetBoxDimensions(Double_t dx, Double_t dy, Double_t dz, Double_t *origin = nullptr);
0089 void SetDimensions(Double_t *param) override;
0090 void SetBoxPoints(Double_t *points) const;
0091 void SetPoints(Double_t *points) const override;
0092 void SetPoints(Float_t *points) const override;
0093 void SetSegsAndPols(TBuffer3D &buffer) const override;
0094 void Sizeof3D() const override;
0095
0096 ClassDefOverride(TGeoBBox, 1)
0097 };
0098
0099 #endif