TGeoPgon.h

Go to the documentation of this file.
00001 // @(#)root/geom:$Id: TGeoPgon.h 24870 2008-07-17 16:30:58Z brun $
00002 // Author: Andrei Gheata   31/01/02
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_TGeoPgon
00013 #define ROOT_TGeoPgon
00014 
00015 #ifndef ROOT_TGeoPcon
00016 #include "TGeoPcon.h"
00017 #endif
00018 
00019   
00020 ////////////////////////////////////////////////////////////////////////////
00021 //                                                                        //
00022 // TGeoPgon - a polygone. It has at least 10 parameters :                 //
00023 //            - the lower phi limit;                                      //
00024 //            - the range in phi;                                         //
00025 //            - the number of edges on each z plane;                      //
00026 //            - the number of z planes (at least two) where the inner/outer //
00027 //              radii are changing;                                       //
00028 //            - z coordinate, inner and outer radius for each z plane     //
00029 //                                                                        //
00030 ////////////////////////////////////////////////////////////////////////////
00031 
00032 class TGeoPgon : public TGeoPcon
00033 {
00034 protected:
00035    // data members
00036    Int_t                 fNedges;    // number of edges (at least one)
00037    
00038    Int_t                 GetPhiCrossList(Double_t *point, Double_t *dir, Int_t istart, Double_t *sphi, Int_t *iphi, Double_t stepmax=TGeoShape::Big()) const;
00039    Bool_t                IsCrossingSlice(Double_t *point, Double_t *dir, Int_t iphi, Double_t sstart, Int_t &ipl, Double_t &snext, Double_t stepmax) const;
00040    void                  LocatePhi(Double_t *point, Int_t &ipsec) const;
00041    Double_t              Rpg(Double_t z, Int_t ipl, Bool_t inner, Double_t &a, Double_t &b) const;
00042    Double_t              Rproj(Double_t z,Double_t *point, Double_t *dir, Double_t cphi, Double_t sphi, Double_t &a, Double_t &b) const; 
00043    Bool_t                SliceCrossing(Double_t *point, Double_t *dir, Int_t nphi, Int_t *iphi, Double_t *sphi, Double_t &snext, Double_t stepmax) const;
00044    Bool_t                SliceCrossingIn(Double_t *point, Double_t *dir, Int_t ipl, Int_t nphi, Int_t *iphi, Double_t *sphi, Double_t &snext, Double_t stepmax) const;
00045    Bool_t                SliceCrossingZ(Double_t *point, Double_t *dir, Int_t nphi, Int_t *iphi, Double_t *sphi, Double_t &snext, Double_t stepmax) const;
00046    Bool_t                SliceCrossingInZ(Double_t *point, Double_t *dir, Int_t nphi, Int_t *iphi, Double_t *sphi, Double_t &snext, Double_t stepmax) const;
00047 
00048 public:
00049    // constructors
00050    TGeoPgon();
00051    TGeoPgon(Double_t phi, Double_t dphi, Int_t nedges, Int_t nz);
00052    TGeoPgon(const char *name, Double_t phi, Double_t dphi, Int_t nedges, Int_t nz);
00053    TGeoPgon(Double_t *params);
00054    // destructor
00055    virtual ~TGeoPgon();
00056    // methods
00057    virtual Double_t      Capacity() const;
00058    virtual void          ComputeBBox();
00059    virtual void          ComputeNormal(Double_t *point, Double_t *dir, Double_t *norm);
00060    virtual Bool_t        Contains(Double_t *point) const;
00061    virtual Double_t      DistFromInside(Double_t *point, Double_t *dir, Int_t iact=1, 
00062                                    Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00063    virtual Double_t      DistFromOutside(Double_t *point, Double_t *dir, Int_t iact=1, 
00064                                    Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00065    virtual Int_t         DistancetoPrimitive(Int_t px, Int_t py);
00066    virtual TGeoVolume   *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, 
00067                                 Double_t start, Double_t step);
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 64+12*fNz;}
00071    virtual TGeoShape    *GetMakeRuntimeShape(TGeoShape * /*mother*/, TGeoMatrix * /*mat*/) const {return 0;}
00072    virtual void          GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const;
00073    Int_t                 GetNedges() const   {return fNedges;}
00074    virtual Int_t         GetNmeshVertices() const;
00075    virtual Int_t         GetNsegments() const {return fNedges;}     
00076    virtual Bool_t        GetPointsOnSegments(Int_t npoints, Double_t *array) const {return TGeoBBox::GetPointsOnSegments(npoints,array);}
00077    virtual void          InspectShape() const;
00078    virtual TBuffer3D    *MakeBuffer3D() const;
00079    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
00080    Double_t              SafetyToSegment(Double_t *point, Int_t ipl, Int_t iphi, Bool_t in, Double_t safphi, Double_t safmin=TGeoShape::Big()) const;
00081    virtual void          SavePrimitive(ostream &out, Option_t *option = "");
00082    virtual void          SetDimensions(Double_t *param);
00083    void                  SetNedges(Int_t ne) {if (ne>2) fNedges=ne;}
00084    virtual void          SetPoints(Double_t *points) const;
00085    virtual void          SetPoints(Float_t *points) const;
00086    virtual void          SetSegsAndPols(TBuffer3D &buff) const;
00087    virtual void          Sizeof3D() const;
00088 
00089    ClassDef(TGeoPgon, 1)         // polygone class 
00090 };
00091 
00092 #endif

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