TGeoBBox.h

Go to the documentation of this file.
00001 // @(#)root/geom:$Id: TGeoBBox.h 27731 2009-03-09 17:40:56Z brun $
00002 // Author: Andrei Gheata   24/10/01
00003    
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGeoBBox
00013 #define ROOT_TGeoBBox
00014 
00015 #ifndef ROOT_TGeoShape
00016 #include "TGeoShape.h"
00017 #endif
00018 
00019 ///////////////////////////////////////////////////////////////////////////////
00020 //                                                                           //
00021 // TGeoBBox - box class. All shape primitives inherit from this, their       //
00022 //   constructor filling automatically the parameters of the box that bounds //
00023 //   the given shape. Defined by 6 parameters :                              //
00024 //      fDX, fDY, fDZ - half lengths on X, Y and Z axis                      //
00025 //      fOrigin[3]    - position of box origin                               //
00026 //                                                                           //
00027 ///////////////////////////////////////////////////////////////////////////////
00028 
00029 class TGeoBBox : public TGeoShape
00030 {
00031 protected :
00032 // data members
00033    Double_t              fDX;        // X half-length
00034    Double_t              fDY;        // Y half-length
00035    Double_t              fDZ;        // Z half-length
00036    Double_t              fOrigin[3]; // box origin
00037 // methods
00038    virtual void FillBuffer3D(TBuffer3D & buffer, Int_t reqSections, Bool_t localFrame) const;
00039 public:
00040    // constructors
00041    TGeoBBox();
00042    TGeoBBox(Double_t dx, Double_t dy, Double_t dz, Double_t *origin=0);
00043    TGeoBBox(const char *name, Double_t dx, Double_t dy, Double_t dz, Double_t *origin=0);
00044    TGeoBBox(Double_t *param);
00045    // destructor
00046    virtual ~TGeoBBox();
00047    // methods
00048    static  Bool_t        AreOverlapping(const TGeoBBox *box1, const TGeoMatrix *mat1, const TGeoBBox *box2, const TGeoMatrix *mat2);
00049    virtual Double_t      Capacity() const;
00050    virtual void          ComputeBBox();
00051    virtual void          ComputeNormal(Double_t *point, Double_t *dir, Double_t *norm);
00052    virtual Bool_t        Contains(Double_t *point) const;
00053    static  Bool_t        Contains(const Double_t *point, Double_t dx, Double_t dy, Double_t dz, const Double_t *origin);
00054    virtual Bool_t        CouldBeCrossed(Double_t *point, Double_t *dir) const;
00055    virtual Int_t         DistancetoPrimitive(Int_t px, Int_t py);
00056    virtual Double_t      DistFromInside(Double_t *point, Double_t *dir, Int_t iact=1, 
00057                                    Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00058    static  Double_t      DistFromInside(const Double_t *point,const Double_t *dir, 
00059                                    Double_t dx, Double_t dy, Double_t dz, const Double_t *origin, Double_t stepmax=TGeoShape::Big());
00060    virtual Double_t      DistFromOutside(Double_t *point, Double_t *dir, Int_t iact=1, 
00061                                    Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00062    static  Double_t      DistFromOutside(const Double_t *point,const Double_t *dir, 
00063                                    Double_t dx, Double_t dy, Double_t dz, const Double_t *origin, Double_t stepmax=TGeoShape::Big());
00064    virtual TGeoVolume   *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, 
00065                                 Double_t start, Double_t step);
00066    virtual const char   *GetAxisName(Int_t iaxis) const;
00067    virtual Double_t      GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const;
00068    virtual void          GetBoundingCylinder(Double_t *param) const;
00069    virtual const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
00070    virtual Int_t         GetByteCount() const {return 36;}
00071    virtual Double_t      GetFacetArea(Int_t index=0) const;
00072    virtual Bool_t        GetPointsOnFacet(Int_t index, Int_t npoints, Double_t *array) const;
00073    virtual Bool_t        GetPointsOnSegments(Int_t npoints, Double_t *array) const;
00074    virtual Int_t         GetFittingBox(const TGeoBBox *parambox, TGeoMatrix *mat, Double_t &dx, Double_t &dy, Double_t &dz) const;
00075    virtual TGeoShape    *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const;
00076    virtual void          GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const;
00077    virtual Int_t         GetNmeshVertices() const {return 8;}
00078    virtual Double_t      GetDX() const  {return fDX;}
00079    virtual Double_t      GetDY() const  {return fDY;}
00080    virtual Double_t      GetDZ() const  {return fDZ;}
00081    virtual const Double_t *GetOrigin() const {return fOrigin;}
00082    virtual void          InspectShape() const;
00083    virtual Bool_t        IsCylType() const {return kFALSE;}
00084    virtual Bool_t        IsValidBox() const {return ((fDX<0)||(fDY<0)||(fDZ<0))?kFALSE:kTRUE;}
00085    virtual Bool_t        IsNullBox() const {return ((fDX<1.E-16)&&(fDY<1.E-16)&&(fDZ<1.E-16))?kTRUE:kFALSE;}
00086    virtual TBuffer3D    *MakeBuffer3D() const;
00087    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
00088    virtual void          SavePrimitive(ostream &out, Option_t *option = "");
00089    void                  SetBoxDimensions(Double_t dx, Double_t dy, Double_t dz, Double_t *origin=0);
00090    virtual void          SetDimensions(Double_t *param);
00091    void                  SetBoxPoints(Double_t *points) const;
00092    virtual void          SetPoints(Double_t *points) const;
00093    virtual void          SetPoints(Float_t *points) const;
00094    virtual void          SetSegsAndPols(TBuffer3D &buffer) const;
00095    virtual void          Sizeof3D() const;
00096 
00097    ClassDef(TGeoBBox, 1)         // box primitive
00098 };
00099 
00100 #endif

Generated on Tue Jul 5 14:12:12 2011 for ROOT_528-00b_version by  doxygen 1.5.1