00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGeoXtru
00013 #define ROOT_TGeoXtru
00014
00015 #ifndef ROOT_TGeoBBox
00016 #include "TGeoBBox.h"
00017 #endif
00018
00019 class TGeoPolygon;
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 class TGeoXtru : public TGeoBBox
00032 {
00033 protected:
00034
00035 Int_t fNvert;
00036 Int_t fNz;
00037 Double_t fZcurrent;
00038 TGeoPolygon *fPoly;
00039 Double_t *fX;
00040 Double_t *fY;
00041 Double_t *fXc;
00042 Double_t *fYc;
00043 Double_t *fZ;
00044 Double_t *fScale;
00045 Double_t *fX0;
00046 Double_t *fY0;
00047 Int_t fSeg;
00048 Int_t fIz;
00049
00050 TGeoXtru(const TGeoXtru&);
00051 TGeoXtru& operator=(const TGeoXtru&);
00052
00053
00054 Double_t DistToPlane(Double_t *point, Double_t *dir, Int_t iz, Int_t ivert, Double_t stepmax, Bool_t in) const;
00055 void GetPlaneVertices(Int_t iz, Int_t ivert, Double_t *vert) const;
00056 void GetPlaneNormal(const Double_t *vert, Double_t *norm) const;
00057 Bool_t IsPointInsidePlane(Double_t *point, Double_t *vert, Double_t *norm) const;
00058 Double_t SafetyToSector(Double_t *point, Int_t iz, Double_t safmin);
00059 void SetIz(Int_t iz) {fIz = iz;}
00060 void SetSeg(Int_t iseg) {fSeg = iseg;}
00061
00062 public:
00063
00064 TGeoXtru();
00065 TGeoXtru(Int_t nz);
00066 TGeoXtru(Double_t *param);
00067
00068 virtual ~TGeoXtru();
00069
00070 virtual Double_t Capacity() const;
00071 virtual void ComputeBBox();
00072 virtual void ComputeNormal(Double_t *point, Double_t *dir, Double_t *norm);
00073 virtual Bool_t Contains(Double_t *point) const;
00074 Bool_t DefinePolygon(Int_t nvert, const Double_t *xv, const Double_t *yv);
00075 virtual void DefineSection(Int_t snum, Double_t z, Double_t x0=0., Double_t y0=0., Double_t scale=1.);
00076 virtual Double_t DistFromInside(Double_t *point, Double_t *dir, Int_t iact=1,
00077 Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00078 virtual Double_t DistFromOutside(Double_t *point, Double_t *dir, Int_t iact=1,
00079 Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00080 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
00081 virtual const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
00082
00083 Int_t GetNz() const {return fNz;}
00084 Int_t GetNvert() const {return fNvert;}
00085 Double_t GetX(Int_t i) const {return (i<fNvert&&i>-1 &&fX!=0) ? fX[i] : -1.0E10;}
00086 Double_t GetY(Int_t i) const {return (i<fNvert&&i>-1 &&fY!=0) ? fY[i] : -1.0E10;}
00087 Double_t GetXOffset(Int_t i) const {return (i<fNz&&i>-1 && fX0!=0) ? fX0[i] : 0.0;}
00088 Double_t GetYOffset(Int_t i) const {return (i<fNz&&i>-1 && fY0!=0) ? fY0[i] : 0.0;}
00089 Double_t GetScale(Int_t i) const {return (i<fNz&&i>-1 && fScale!=0) ? fScale[i] : 1.0;}
00090 Double_t *GetZ() const {return fZ;}
00091 Double_t GetZ(Int_t ipl) const;
00092 virtual TGeoShape *GetMakeRuntimeShape(TGeoShape * , TGeoMatrix * ) const {return 0;}
00093 virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const;
00094 virtual Int_t GetNmeshVertices() const;
00095 virtual void InspectShape() const;
00096 virtual TBuffer3D *MakeBuffer3D() const;
00097 Double_t &Z(Int_t ipl) {return fZ[ipl];}
00098 virtual Double_t Safety(Double_t *point, Bool_t in=kTRUE) const;
00099 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00100 void SetCurrentZ(Double_t z, Int_t iz);
00101 void SetCurrentVertices(Double_t x0, Double_t y0, Double_t scale);
00102 virtual void SetDimensions(Double_t *param);
00103 virtual void SetPoints(Double_t *points) const;
00104 virtual void SetPoints(Float_t *points) const;
00105 virtual void SetSegsAndPols(TBuffer3D &buff) const;
00106 virtual void Sizeof3D() const;
00107
00108 ClassDef(TGeoXtru, 2)
00109 };
00110
00111 #endif