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
17class TGeoBBox : public TGeoShape {
18protected:
19 // data members
20 Double_t fDX; // X half-length
21 Double_t fDY; // Y half-length
22 Double_t fDZ; // Z half-length
23 Double_t fOrigin[3]; // box origin
24 // methods
25 void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const override;
26
27 TGeoBBox(const TGeoBBox &) = delete;
28 TGeoBBox &operator=(const TGeoBBox &) = delete;
29
30public:
31 // constructors
33 TGeoBBox(Double_t dx, Double_t dy, Double_t dz, Double_t *origin = nullptr);
34 TGeoBBox(const char *name, Double_t dx, Double_t dy, Double_t dz, Double_t *origin = nullptr);
36 // destructor
37 ~TGeoBBox() override;
38 // methods
39 static Bool_t
40 AreOverlapping(const TGeoBBox *box1, const TGeoMatrix *mat1, const TGeoBBox *box2, const TGeoMatrix *mat2)
41 R__DEPRECATED(6, 36, "DEPRECATED, DO NOT USE ! The overlap detection does not work for all cases");
42
43 Double_t Capacity() const override;
44 void ComputeBBox() override;
45 void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) override;
46 void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override;
47 Bool_t Contains(const Double_t *point) const override;
48 void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override;
49 static Bool_t Contains(const Double_t *point, Double_t dx, Double_t dy, Double_t dz, const Double_t *origin);
50 Bool_t CouldBeCrossed(const Double_t *point, const Double_t *dir) const override;
52 Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact = 1, Double_t step = TGeoShape::Big(),
53 Double_t *safe = nullptr) const override;
54 void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
55 Double_t *step) const override;
56 static Double_t DistFromInside(const Double_t *point, const Double_t *dir, Double_t dx, Double_t dy, Double_t dz,
57 const Double_t *origin, Double_t stepmax = TGeoShape::Big());
58 Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact = 1,
59 Double_t step = TGeoShape::Big(), Double_t *safe = nullptr) const override;
60 void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
61 Double_t *step) const override;
62 static Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Double_t dx, Double_t dy, Double_t dz,
63 const Double_t *origin, Double_t stepmax = TGeoShape::Big());
65 Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override;
66 const char *GetAxisName(Int_t iaxis) const override;
67 Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override;
68 void GetBoundingCylinder(Double_t *param) const override;
69 const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override;
70 Int_t GetByteCount() const override { return 36; }
71 virtual Double_t GetFacetArea(Int_t index = 0) const;
72 virtual Bool_t GetPointsOnFacet(Int_t index, Int_t npoints, Double_t *array) const;
73 Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override;
74 Int_t
75 GetFittingBox(const TGeoBBox *parambox, TGeoMatrix *mat, Double_t &dx, Double_t &dy, Double_t &dz) const override;
76 TGeoShape *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override;
77 void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override;
78 Int_t GetNmeshVertices() const override { return 8; }
79 virtual Double_t GetDX() const { return fDX; }
80 virtual Double_t GetDY() const { return fDY; }
81 virtual Double_t GetDZ() const { return fDZ; }
82 virtual const Double_t *GetOrigin() const { return fOrigin; }
83 void InspectShape() const override;
84 Bool_t IsCylType() const override { return kFALSE; }
85 Bool_t IsValidBox() const override { return ((fDX < 0) || (fDY < 0) || (fDZ < 0)) ? kFALSE : kTRUE; }
86 virtual Bool_t IsNullBox() const { return ((fDX < 1.E-16) && (fDY < 1.E-16) && (fDZ < 1.E-16)) ? kTRUE : kFALSE; }
87 TBuffer3D *MakeBuffer3D() const override;
88 Double_t Safety(const Double_t *point, Bool_t in = kTRUE) const override;
89 void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override;
90 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
91 void SetBoxDimensions(Double_t dx, Double_t dy, Double_t dz, Double_t *origin = nullptr);
92 void SetDimensions(Double_t *param) override;
94 void SetPoints(Double_t *points) const override;
95 void SetPoints(Float_t *points) const override;
96 void SetSegsAndPols(TBuffer3D &buffer) const override;
97 void Sizeof3D() const override;
98
99 ClassDefOverride(TGeoBBox, 1) // box primitive
100};
101
102#endif
#define R__DEPRECATED(MAJOR, MINOR, REASON)
Definition RConfig.hxx:512
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
char name[80]
Definition TGX11.cxx:110
Generic 3D primitive description class.
Definition TBuffer3D.h:18
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:82
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
void SetPoints(Float_t *points) const override
Double_t fDX
Definition TGeoBBox.h:20
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 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)
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
Double_t Capacity() const override
virtual Double_t GetDX() const
Definition TGeoBBox.h:79
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:81
virtual Double_t GetDY() const
Definition TGeoBBox.h:80
Int_t GetFittingBox(const TGeoBBox *parambox, TGeoMatrix *mat, Double_t &dx, Double_t &dy, Double_t &dz) const override
static Bool_t DEPRECATED
Definition TGeoBBox.h:41
Double_t fOrigin[3]
Definition TGeoBBox.h:23
Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) 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:85
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
static Bool_t DO NOT USE !The overlap detection does not work for all cases
Definition TGeoBBox.h:41
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:70
virtual Bool_t IsNullBox() const
Definition TGeoBBox.h:86
Double_t fDY
Definition TGeoBBox.h:21
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.
static Bool_t AreOverlapping(const TGeoBBox *box1, const TGeoMatrix *mat1, const TGeoBBox *box2, const TGeoMatrix *mat2) R__DEPRECATED(6
Int_t GetNmeshVertices() const override
Definition TGeoBBox.h:78
Double_t fDZ
Definition TGeoBBox.h:22
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
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:84
Geometrical transformation package.
Definition TGeoMatrix.h:38
Base abstract class for all shapes.
Definition TGeoShape.h:25
static Double_t Big()
Definition TGeoShape.h:87
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
for(Int_t i=0;i< n;i++)
Definition legend1.C:18