00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGeoOverlap
00013 #define ROOT_TGeoOverlap
00014
00015 #ifndef ROOT_TNamed
00016 #include "TNamed.h"
00017 #endif
00018
00019 #ifndef ROOT_TAttLine
00020 #include "TAttLine.h"
00021 #endif
00022
00023 #ifndef ROOT_TAttFill
00024 #include "TAttFill.h"
00025 #endif
00026
00027 #ifndef ROOT_TAtt3D
00028 #include "TAtt3D.h"
00029 #endif
00030
00031 #ifndef ROOT_TGeoMatrix
00032 #include "TGeoMatrix.h"
00033 #endif
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 class TGeoVolume;
00044 class TPolyMarker3D;
00045 class TBrowser;
00046
00047 class TGeoOverlap : public TNamed,
00048 public TAttLine,
00049 public TAttFill,
00050 public TAtt3D
00051 {
00052 public:
00053 enum EOverlapType {
00054 kGeoOverlap = BIT(14),
00055 kGeoExtrusion = BIT(15)
00056 };
00057
00058 private:
00059 TGeoOverlap(const TGeoOverlap&);
00060 TGeoOverlap& operator=(const TGeoOverlap&);
00061
00062 protected:
00063 Double_t fOverlap;
00064 TGeoVolume *fVolume1;
00065 TGeoVolume *fVolume2;
00066 TGeoHMatrix *fMatrix1;
00067 TGeoHMatrix *fMatrix2;
00068 TPolyMarker3D *fMarker;
00069
00070 public:
00071 TGeoOverlap();
00072 TGeoOverlap(const char *name, TGeoVolume *vol1, TGeoVolume *vol2,
00073 const TGeoMatrix *matrix1, const TGeoMatrix *matrix2,
00074 Bool_t isovlp=kTRUE, Double_t ovlp=0.01);
00075 virtual ~TGeoOverlap();
00076
00077 void Browse(TBrowser *b);
00078 virtual Int_t Compare(const TObject *obj) const;
00079 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
00080 virtual void Draw(Option_t *option="");
00081 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
00082 TPolyMarker3D *GetPolyMarker() const {return fMarker;}
00083 TGeoVolume *GetFirstVolume() const {return fVolume1;}
00084 TGeoVolume *GetSecondVolume() const {return fVolume2;}
00085 TGeoHMatrix *GetFirstMatrix() const {return fMatrix1;}
00086 TGeoHMatrix *GetSecondMatrix() const {return fMatrix2;}
00087 Double_t GetOverlap() const {return fOverlap;}
00088 Bool_t IsExtrusion() const {return TObject::TestBit(kGeoExtrusion);}
00089 Bool_t IsOverlap() const {return TObject::TestBit(kGeoOverlap);}
00090 Bool_t IsFolder() const {return kFALSE;}
00091 virtual Bool_t IsSortable() const {return kTRUE;}
00092 virtual void Paint(Option_t *option="");
00093 virtual void Print(Option_t *option="") const;
00094 virtual void PrintInfo() const;
00095 virtual void Sizeof3D() const;
00096 void SampleOverlap(Int_t npoints=1000000);
00097 void SetIsExtrusion(Bool_t flag=kTRUE) {TObject::SetBit(kGeoExtrusion,flag); TObject::SetBit(kGeoOverlap,!flag);}
00098 void SetIsOverlap(Bool_t flag=kTRUE) {TObject::SetBit(kGeoOverlap,flag); TObject::SetBit(kGeoExtrusion,!flag);}
00099 void SetNextPoint(Double_t x, Double_t y, Double_t z);
00100 void SetFirstVolume(TGeoVolume *vol) {fVolume1=vol;}
00101 void SetSecondVolume(TGeoVolume *vol) {fVolume2=vol;}
00102 void SetFirstMatrix(TGeoMatrix *matrix) {*fMatrix1 = matrix;}
00103 void SetSecondMatrix(TGeoMatrix *matrix) {*fMatrix2 = matrix;}
00104 void SetOverlap(Double_t ovlp) {fOverlap=ovlp;}
00105 void Validate() const;
00106
00107 ClassDef(TGeoOverlap, 2)
00108 };
00109
00110 #endif
00111