TGeoOverlap.h

Go to the documentation of this file.
00001 // @(#)root/geom:$Id: TGeoOverlap.h 24893 2008-07-18 15:08:05Z brun $
00002 // Author: Andrei Gheata   09/02/03
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_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 // TGeoOverlap - base class describing geometry overlaps. Overlaps apply //
00038 //   to the nodes contained inside a volume. These should not overlap to //
00039 //   each other nor extrude the shape of their mother volume.            //
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&); // Not implemented
00060    TGeoOverlap& operator=(const TGeoOverlap&); // Not implemented
00061    
00062 protected:
00063    Double_t         fOverlap;     // overlap distance
00064    TGeoVolume      *fVolume1;     // first volume
00065    TGeoVolume      *fVolume2;     // second volume
00066    TGeoHMatrix     *fMatrix1;     // positioning matrix for first volume
00067    TGeoHMatrix     *fMatrix2;     // positioning matrix for second volume
00068    TPolyMarker3D   *fMarker;     // points in the overlapping region
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=""); // *MENU*
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; // *MENU*
00094    virtual void      PrintInfo() const;
00095    virtual void      Sizeof3D() const;
00096    void              SampleOverlap(Int_t npoints=1000000); // *MENU*
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; // *MENU*
00106    
00107    ClassDef(TGeoOverlap, 2)         // base class for geometical overlaps
00108 };
00109       
00110 #endif
00111  

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