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
40 Double_t Capacity() const override;
41 void ComputeBBox() override;
42 void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) override;
43 void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override;
44 Bool_t Contains(const Double_t *point) const override;
45 void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override;
46 static Bool_t Contains(const Double_t *point, Double_t dx, Double_t dy, Double_t dz, const Double_t *origin);
47 Bool_t CouldBeCrossed(const Double_t *point, const Double_t *dir) const override;
49 Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact = 1, Double_t step = TGeoShape::Big(),
50 Double_t *safe = nullptr) const override;
51 void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
52 Double_t *step) const override;
53 static Double_t DistFromInside(const Double_t *point, const Double_t *dir, Double_t dx, Double_t dy, Double_t dz,
54 const Double_t *origin, Double_t stepmax = TGeoShape::Big());
55 Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact = 1,
56 Double_t step = TGeoShape::Big(), Double_t *safe = nullptr) const override;
57 void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
58 Double_t *step) const override;
59 static Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Double_t dx, Double_t dy, Double_t dz,
60 const Double_t *origin, Double_t stepmax = TGeoShape::Big());
62 Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override;
63 const char *GetAxisName(Int_t iaxis) const override;
64 Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override;
65 void GetBoundingCylinder(Double_t *param) const override;
66 const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override;
67 Int_t GetByteCount() const override { return 36; }
68 virtual Double_t GetFacetArea(Int_t index = 0) const;
69 virtual Bool_t GetPointsOnFacet(Int_t index, Int_t npoints, Double_t *array) const;
70 Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override;
71 Int_t
72 GetFittingBox(const TGeoBBox *parambox, TGeoMatrix *mat, Double_t &dx, Double_t &dy, Double_t &dz) const override;
73 TGeoShape *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override;
74 void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override;
75 Int_t GetNmeshVertices() const override { return 8; }
76 virtual Double_t GetDX() const { return fDX; }
77 virtual Double_t GetDY() const { return fDY; }
78 virtual Double_t GetDZ() const { return fDZ; }
79 virtual const Double_t *GetOrigin() const { return fOrigin; }
80 void InspectShape() const override;
81 Bool_t IsCylType() const override { return kFALSE; }
82 Bool_t IsValidBox() const override { return ((fDX < 0) || (fDY < 0) || (fDZ < 0)) ? kFALSE : kTRUE; }
83 virtual Bool_t IsNullBox() const { return ((fDX < 1.E-16) && (fDY < 1.E-16) && (fDZ < 1.E-16)) ? kTRUE : kFALSE; }
84 TBuffer3D *MakeBuffer3D() const override;
85 Double_t Safety(const Double_t *point, Bool_t in = kTRUE) const override;
86 void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override;
87 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
88 void SetBoxDimensions(Double_t dx, Double_t dy, Double_t dz, Double_t *origin = nullptr);
89 void SetDimensions(Double_t *param) override;
91 void SetPoints(Double_t *points) const override;
92 void SetPoints(Float_t *points) const override;
93 void SetSegsAndPols(TBuffer3D &buffer) const override;
94 void Sizeof3D() const override;
95
96 ClassDefOverride(TGeoBBox, 1) // box primitive
97};
98
99#endif
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:79
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: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)
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
Double_t Capacity() const override
virtual Double_t GetDX() const
Definition TGeoBBox.h:76
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:78
virtual Double_t GetDY() const
Definition TGeoBBox.h:77
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: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:82
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
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:67
virtual Bool_t IsNullBox() const
Definition TGeoBBox.h:83
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.
Int_t GetNmeshVertices() const override
Definition TGeoBBox.h:75
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:81
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())
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