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
18{
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 virtual void FillBuffer3D(TBuffer3D & buffer, Int_t reqSections, Bool_t localFrame) const;
27
28 TGeoBBox(const TGeoBBox&) = delete;
29 TGeoBBox& operator=(const TGeoBBox&) = delete;
30
31public:
32 // constructors
33 TGeoBBox();
34 TGeoBBox(Double_t dx, Double_t dy, Double_t dz, Double_t *origin=0);
35 TGeoBBox(const char *name, Double_t dx, Double_t dy, Double_t dz, Double_t *origin=0);
36 TGeoBBox(Double_t *param);
37 // destructor
38 virtual ~TGeoBBox();
39 // methods
40 static Bool_t AreOverlapping(const TGeoBBox *box1, const TGeoMatrix *mat1, const TGeoBBox *box2, const TGeoMatrix *mat2);
41 virtual Double_t Capacity() const;
42 virtual void ComputeBBox();
43 virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm);
44 virtual void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize);
45 virtual Bool_t Contains(const Double_t *point) const;
46 virtual void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const;
47 static Bool_t Contains(const Double_t *point, Double_t dx, Double_t dy, Double_t dz, const Double_t *origin);
48 virtual Bool_t CouldBeCrossed(const Double_t *point, const Double_t *dir) const;
49 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
50 virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1,
51 Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
52 virtual void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const;
53 static Double_t DistFromInside(const Double_t *point,const Double_t *dir,
54 Double_t dx, Double_t dy, Double_t dz, const Double_t *origin, Double_t stepmax=TGeoShape::Big());
55 virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1,
56 Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
57 virtual void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const;
58 static Double_t DistFromOutside(const Double_t *point,const Double_t *dir,
59 Double_t dx, Double_t dy, Double_t dz, const Double_t *origin, Double_t stepmax=TGeoShape::Big());
60 virtual TGeoVolume *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv,
61 Double_t start, Double_t step);
62 virtual const char *GetAxisName(Int_t iaxis) const;
63 virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const;
64 virtual void GetBoundingCylinder(Double_t *param) const;
65 virtual const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
66 virtual Int_t GetByteCount() const {return 36;}
67 virtual Double_t GetFacetArea(Int_t index=0) const;
68 virtual Bool_t GetPointsOnFacet(Int_t index, Int_t npoints, Double_t *array) const;
69 virtual Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const;
70 virtual Int_t GetFittingBox(const TGeoBBox *parambox, TGeoMatrix *mat, Double_t &dx, Double_t &dy, Double_t &dz) const;
71 virtual TGeoShape *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const;
72 virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const;
73 virtual Int_t GetNmeshVertices() const {return 8;}
74 virtual Double_t GetDX() const {return fDX;}
75 virtual Double_t GetDY() const {return fDY;}
76 virtual Double_t GetDZ() const {return fDZ;}
77 virtual const Double_t *GetOrigin() const {return fOrigin;}
78 virtual void InspectShape() const;
79 virtual Bool_t IsCylType() const {return kFALSE;}
80 virtual Bool_t IsValidBox() const {return ((fDX<0)||(fDY<0)||(fDZ<0))?kFALSE:kTRUE;}
81 virtual Bool_t IsNullBox() const {return ((fDX<1.E-16)&&(fDY<1.E-16)&&(fDZ<1.E-16))?kTRUE:kFALSE;}
82 virtual TBuffer3D *MakeBuffer3D() const;
83 virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const;
84 virtual void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const;
85 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
86 void SetBoxDimensions(Double_t dx, Double_t dy, Double_t dz, Double_t *origin=0);
87 virtual void SetDimensions(Double_t *param);
88 void SetBoxPoints(Double_t *points) const;
89 virtual void SetPoints(Double_t *points) const;
90 virtual void SetPoints(Float_t *points) const;
91 virtual void SetSegsAndPols(TBuffer3D &buffer) const;
92 virtual void Sizeof3D() const;
93
94 ClassDef(TGeoBBox, 1) // box primitive
95};
96
97#endif
int Int_t
Definition RtypesCore.h:45
const Bool_t kFALSE
Definition RtypesCore.h:101
bool Bool_t
Definition RtypesCore.h:63
double Double_t
Definition RtypesCore.h:59
float Float_t
Definition RtypesCore.h:57
const Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
point * points
Definition X3DBuffer.c:22
Generic 3D primitive description class.
Definition TBuffer3D.h:18
Box class.
Definition TGeoBBox.h:18
virtual const Double_t * GetOrigin() const
Definition TGeoBBox.h:77
virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const
Returns numbers of vertices, segments and polygons composing the shape mesh.
Definition TGeoBBox.cxx:809
Double_t fDX
Definition TGeoBBox.h:21
virtual Bool_t GetPointsOnFacet(Int_t index, Int_t npoints, Double_t *array) const
Fills array with n random points located on the surface of indexed facet.
Definition TGeoBBox.cxx:654
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
Computes the closest distance from given point to this shape.
Definition TGeoBBox.cxx:881
virtual Int_t GetFittingBox(const TGeoBBox *parambox, TGeoMatrix *mat, Double_t &dx, Double_t &dy, Double_t &dz) const
Fills real parameters of a positioned box inside this one. Returns 0 if successful.
Definition TGeoBBox.cxx:754
virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
Compute distance from outside point to surface of the box.
Definition TGeoBBox.cxx:458
virtual TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
Divide this box shape belonging to volume "voldiv" into ndiv equal volumes called divname,...
Definition TGeoBBox.cxx:317
TGeoBBox(const TGeoBBox &)=delete
virtual void InspectShape() const
Prints shape parameters.
Definition TGeoBBox.cxx:819
virtual Double_t GetDX() const
Definition TGeoBBox.h:74
virtual Double_t GetFacetArea(Int_t index=0) const
Get area in internal units of the facet with a given index.
Definition TGeoBBox.cxx:623
void SetBoxPoints(Double_t *points) const
Fill box vertices to an array.
Definition TGeoBBox.cxx:966
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const
Get range of shape for a given axis.
Definition TGeoBBox.cxx:580
virtual Double_t GetDZ() const
Definition TGeoBBox.h:76
virtual void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const
Check the inside status for each of the points in the array.
virtual void Sizeof3D() const
virtual TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const
In case shape has some negative parameters, these has to be computed in order to fit the mother.
Definition TGeoBBox.cxx:794
virtual Int_t GetNmeshVertices() const
Definition TGeoBBox.h:73
virtual Double_t GetDY() const
Definition TGeoBBox.h:75
virtual void ComputeBBox()
Compute bounding box - nothing to do in this case.
Definition TGeoBBox.cxx:361
virtual void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const
Compute safe distance from each of the points in the input array.
static Bool_t AreOverlapping(const TGeoBBox *box1, const TGeoMatrix *mat1, const TGeoBBox *box2, const TGeoMatrix *mat2)
Check if 2 positioned boxes overlap.
Definition TGeoBBox.cxx:217
Double_t fOrigin[3]
Definition TGeoBBox.h:24
virtual void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specified by dirs. Store output in dist...
virtual ~TGeoBBox()
Destructor.
Definition TGeoBBox.cxx:210
virtual void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize)
Compute the normal for an array o points so that norm.dot.dir is positive Input: Arrays of point coor...
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
Definition TGeoBBox.cxx:258
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute closest distance from point px,py to each corner.
Definition TGeoBBox.cxx:305
virtual void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specified by dirs. Store output in dist...
virtual Bool_t CouldBeCrossed(const Double_t *point, const Double_t *dir) const
Decides fast if the bounding box could be crossed by a vector.
Definition TGeoBBox.cxx:281
virtual Bool_t IsNullBox() const
Definition TGeoBBox.h:81
Double_t fDY
Definition TGeoBBox.h:22
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
virtual Int_t GetByteCount() const
Definition TGeoBBox.h:66
virtual Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const
Fills array with n random points located on the line segments of the shape mesh.
Definition TGeoBBox.cxx:717
virtual Bool_t IsCylType() const
Definition TGeoBBox.h:79
virtual const char * GetAxisName(Int_t iaxis) const
Returns name of axis IAXIS.
Definition TGeoBBox.cxx:563
virtual void SetSegsAndPols(TBuffer3D &buffer) const
Fills TBuffer3D structure for segments and polygons.
Definition TGeoBBox.cxx:847
virtual Bool_t Contains(const Double_t *point) const
Test if point is inside this shape.
Definition TGeoBBox.cxx:368
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition TGeoBBox.cxx:903
Double_t fDZ
Definition TGeoBBox.h:23
virtual void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const
Fills the supplied buffer, with sections in desired frame See TBuffer3D.h for explanation of sections...
TGeoBBox & operator=(const TGeoBBox &)=delete
void SetBoxDimensions(Double_t dx, Double_t dy, Double_t dz, Double_t *origin=0)
Set parameters of the box.
Definition TGeoBBox.cxx:926
virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
Compute distance from inside point to surface of the box.
Definition TGeoBBox.cxx:392
virtual TBuffer3D * MakeBuffer3D() const
Creates a TBuffer3D describing this shape.
Definition TGeoBBox.cxx:832
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Computes normal to closest surface from POINT.
Definition TGeoBBox.cxx:266
TGeoBBox()
Default constructor.
Definition TGeoBBox.cxx:164
virtual void SetDimensions(Double_t *param)
Set dimensions based on the array of parameters param[0] - half-length in x param[1] - half-length in...
Definition TGeoBBox.cxx:948
virtual void GetBoundingCylinder(Double_t *param) const
Fill vector param[4] with the bounding cylinder parameters.
Definition TGeoBBox.cxx:609
virtual Bool_t IsValidBox() const
Definition TGeoBBox.h:80
virtual void SetPoints(Double_t *points) const
Fill box points.
Definition TGeoBBox.cxx:974
Geometrical transformation package.
Definition TGeoMatrix.h:41
Base abstract class for all shapes.
Definition TGeoShape.h:26
static Double_t Big()
Definition TGeoShape.h:88
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:49