00001
00002
00003
00004
00005
00006
00007
00008
00009
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
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 class TGeoPgon : public TGeoPcon
00033 {
00034 protected:
00035
00036 Int_t fNedges;
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
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
00055 virtual ~TGeoPgon();
00056
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 * , TGeoMatrix * ) 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)
00090 };
00091
00092 #endif