Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TGeoBBox.h
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Andrei Gheata 24/10/01
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TGeoBBox
13#define ROOT_TGeoBBox
14
15#include "TGeoShape.h"
16#include "Math/Vector3D.h"
17
18class TGeoBBox : public TGeoShape {
19protected:
20 // data members
21 Double_t fDX; // X half-length
22 Double_t fDY; // Y half-length
23 Double_t fDZ; // Z half-length
24 Double_t fOrigin[3]; // box origin
25 // methods
26 void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const override;
27
28 TGeoBBox(const TGeoBBox &) = delete;
29 TGeoBBox &operator=(const TGeoBBox &) = delete;
30
31public:
32 // constructors
34 TGeoBBox(Double_t dx, Double_t dy, Double_t dz, Double_t *origin = nullptr);
35 TGeoBBox(const char *name, Double_t dx, Double_t dy, Double_t dz, Double_t *origin = nullptr);
37 // destructor
38 ~TGeoBBox() override;
39 // methods
40
41 Double_t Capacity() const override;
42 void ComputeBBox() override;
43 void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override;
44 void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override;
45 Bool_t Contains(const Double_t *point) const override;
46 void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override;
47 static Bool_t Contains(const Double_t *point, Double_t dx, Double_t dy, Double_t dz, const Double_t *origin);
48 Bool_t CouldBeCrossed(const Double_t *point, const Double_t *dir) const override;
50 Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact = 1, Double_t step = TGeoShape::Big(),
51 Double_t *safe = nullptr) const override;
52 void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
53 Double_t *step) const override;
54 static Double_t DistFromInside(const Double_t *point, const Double_t *dir, Double_t dx, Double_t dy, Double_t dz,
55 const Double_t *origin, Double_t stepmax = TGeoShape::Big());
56 Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact = 1,
57 Double_t step = TGeoShape::Big(), Double_t *safe = nullptr) const override;
58 void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
59 Double_t *step) const override;
60 static Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Double_t dx, Double_t dy, Double_t dz,
61 const Double_t *origin, Double_t stepmax = TGeoShape::Big());
63 Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override;
64 const char *GetAxisName(Int_t iaxis) const override;
65 Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override;
66 void GetBoundingCylinder(Double_t *param) const override;
67 const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override;
68 Int_t GetByteCount() const override { return 36; }
70 virtual Double_t GetFacetArea(Int_t index = 0) const;
71 virtual Bool_t GetPointsOnFacet(Int_t index, Int_t npoints, Double_t *array) const;
72 Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override;
73 Int_t
74 GetFittingBox(const TGeoBBox *parambox, TGeoMatrix *mat, Double_t &dx, Double_t &dy, Double_t &dz) const override;
75 TGeoShape *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override;
76 void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override;
77 Int_t GetNmeshVertices() const override { return 8; }
78 virtual Double_t GetDX() const { return fDX; }
79 virtual Double_t GetDY() const { return fDY; }
80 virtual Double_t GetDZ() const { return fDZ; }
81 virtual const Double_t *GetOrigin() const { return fOrigin; }
83 void InspectShape() const override;
84 Bool_t IsConvex() const override { return kTRUE; }
85 Bool_t IsCylType() const override { return kFALSE; }
86 Bool_t IsValidBox() const override { return ((fDX < 0) || (fDY < 0) || (fDZ < 0)) ? kFALSE : kTRUE; }
87 virtual Bool_t IsNullBox() const { return ((fDX < 1.E-16) && (fDY < 1.E-16) && (fDZ < 1.E-16)) ? kTRUE : kFALSE; }
92 const ROOT::Math::XYZVector &dA, const ROOT::Math::XYZVector &dB, Double_t tol);
93 TBuffer3D *MakeBuffer3D() const override;
94 static bool MayIntersect(const TGeoBBox *boxA, const TGeoMatrix *mA, const TGeoBBox *boxB, const TGeoMatrix *mB);
95 Double_t Safety(const Double_t *point, Bool_t in = kTRUE) const override;
96 void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override;
97 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
98 void SetBoxDimensions(Double_t dx, Double_t dy, Double_t dz, Double_t *origin = nullptr);
99 void SetDimensions(Double_t *param) override;
101 void SetPoints(Double_t *points) const override;
102 void SetPoints(Float_t *points) const override;
103 void SetSegsAndPols(TBuffer3D &buffer) const override;
104 void Sizeof3D() const override;
105
106 ClassDefOverride(TGeoBBox, 1) // box primitive
107};
108
109#endif
start
Definition Rotated.cxx:223
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
float Float_t
Float 4 bytes (float).
Definition RtypesCore.h:71
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char).
Definition RtypesCore.h:80
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
char name[80]
Definition TGX11.cxx:148
point * points
Definition X3DBuffer.c:22
Generic 3D primitive description class.
Definition TBuffer3D.h:18
ROOT::Math::XYZVector GetWorldCenter(const TGeoMatrix *m) const
void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const override
Fill the supplied buffer, with sections in desired frame See TBuffer3D.h for explanation of sections,...
virtual Double_t GetFacetArea(Int_t index=0) const
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
virtual const Double_t * GetOrigin() const
Definition TGeoBBox.h:81
Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
static Double_t DistFromInside(const Double_t *point, const Double_t *dir, Double_t dx, Double_t dy, Double_t dz, const Double_t *origin, Double_t stepmax=TGeoShape::Big())
void SetPoints(Float_t *points) const override
Double_t fDX
Definition TGeoBBox.h:21
const char * GetAxisName(Int_t iaxis) const override
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
void GetBoundingCylinder(Double_t *param) const override
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
void SetPoints(Double_t *points) const override
void SetBoxDimensions(Double_t dx, Double_t dy, Double_t dz, Double_t *origin=nullptr)
TGeoBBox(Double_t *param)
static Bool_t Contains(const Double_t *point, Double_t dx, Double_t dy, Double_t dz, const Double_t *origin)
TGeoBBox(Double_t dx, Double_t dy, Double_t dz, Double_t *origin=nullptr)
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
TGeoBBox(const TGeoBBox &)=delete
static bool MayIntersect(const TGeoBBox *boxA, const TGeoMatrix *mA, const TGeoBBox *boxB, const TGeoMatrix *mB)
Double_t Capacity() const override
virtual Double_t GetDX() const
Definition TGeoBBox.h:78
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Computes distance from point (px,py) to the object.
Bool_t CouldBeCrossed(const Double_t *point, const Double_t *dir) const override
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
void SetBoxPoints(Double_t *points) const
Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override
virtual Double_t GetDZ() const
Definition TGeoBBox.h:80
virtual Double_t GetDY() const
Definition TGeoBBox.h:79
Int_t GetFittingBox(const TGeoBBox *parambox, TGeoMatrix *mat, Double_t &dx, Double_t &dy, Double_t &dz) const override
Double_t fOrigin[3]
Definition TGeoBBox.h:24
Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override
TBuffer3D * MakeBuffer3D() const override
void InspectShape() const override
TGeoBBox(const char *name, Double_t dx, Double_t dy, Double_t dz, Double_t *origin=nullptr)
Bool_t IsValidBox() const override
Definition TGeoBBox.h:86
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Bool_t Contains(const Double_t *point) const override
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
ROOT::Math::XYZVector GetDimensions() const
Definition TGeoBBox.h:69
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
void Sizeof3D() const override
TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override
Int_t GetByteCount() const override
Definition TGeoBBox.h:68
virtual Bool_t IsNullBox() const
Definition TGeoBBox.h:87
Double_t fDY
Definition TGeoBBox.h:22
void SetSegsAndPols(TBuffer3D &buffer) const override
virtual Bool_t GetPointsOnFacet(Int_t index, Int_t npoints, Double_t *array) const
void SetDimensions(Double_t *param) override
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Stub implementation to avoid forcing implementation at this stage.
Int_t GetNmeshVertices() const override
Definition TGeoBBox.h:77
Double_t fDZ
Definition TGeoBBox.h:23
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
~TGeoBBox() override
TGeoBBox & operator=(const TGeoBBox &)=delete
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
void ComputeBBox() override
static Bool_t IsSeparatingAxis(const ROOT::Math::XYZVector &L, const ROOT::Math::XYZVector &D, const ROOT::Math::XYZVector &Ax, const ROOT::Math::XYZVector &Ay, const ROOT::Math::XYZVector &Az, const ROOT::Math::XYZVector &Bx, const ROOT::Math::XYZVector &By, const ROOT::Math::XYZVector &Bz, const ROOT::Math::XYZVector &dA, const ROOT::Math::XYZVector &dB, Double_t tol)
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
Bool_t IsCylType() const override
Definition TGeoBBox.h:85
static Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Double_t dx, Double_t dy, Double_t dz, const Double_t *origin, Double_t stepmax=TGeoShape::Big())
Bool_t IsConvex() const override
Definition TGeoBBox.h:84
Geometrical transformation package.
Definition TGeoMatrix.h:39
static Double_t Big()
Definition TGeoShape.h:95
TGeoShape()
Default constructor.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > XYZVector
3D Vector based on the cartesian coordinates x,y,z in double precision
Definition Vector3Dfwd.h:44
TMarker m
Definition textangle.C:8