Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TGeoOverlap.h
Go to the documentation of this file.
1 // @(#)root/geom:$Id$
2 // Author: Andrei Gheata 09/02/03
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGeoOverlap
13 #define ROOT_TGeoOverlap
14 
15 #include "TNamed.h"
16 
17 #include "TAttLine.h"
18 
19 #include "TAttFill.h"
20 
21 #include "TAtt3D.h"
22 
23 #include "TGeoMatrix.h"
24 
25 ///////////////////////////////////////////////////////////////////////////
26 // //
27 // TGeoOverlap - base class describing geometry overlaps. Overlaps apply //
28 // to the nodes contained inside a volume. These should not overlap to //
29 // each other nor extrude the shape of their mother volume. //
30 // //
31 ///////////////////////////////////////////////////////////////////////////
32 
33 class TGeoVolume;
34 class TPolyMarker3D;
35 class TBrowser;
36 
37 class TGeoOverlap : public TNamed,
38  public TAttLine,
39  public TAttFill,
40  public TAtt3D
41 {
42 public:
43 enum EOverlapType {
44  kGeoOverlap = BIT(14),
45  kGeoExtrusion = BIT(15)
46 };
47 
48 private:
49  TGeoOverlap(const TGeoOverlap&); // Not implemented
50  TGeoOverlap& operator=(const TGeoOverlap&); // Not implemented
51 
52 protected:
53  Double_t fOverlap; // overlap distance
54  TGeoVolume *fVolume1; // first volume
55  TGeoVolume *fVolume2; // second volume
56  TGeoHMatrix *fMatrix1; // positioning matrix for first volume
57  TGeoHMatrix *fMatrix2; // positioning matrix for second volume
58  TPolyMarker3D *fMarker; // points in the overlapping region
59 
60 public:
61  TGeoOverlap();
62  TGeoOverlap(const char *name, TGeoVolume *vol1, TGeoVolume *vol2,
63  const TGeoMatrix *matrix1, const TGeoMatrix *matrix2,
64  Bool_t isovlp=kTRUE, Double_t ovlp=0.01);
65  virtual ~TGeoOverlap();
66 
67  void Browse(TBrowser *b);
68  virtual Int_t Compare(const TObject *obj) const;
69  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
70  virtual void Draw(Option_t *option=""); // *MENU*
71  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
72  TPolyMarker3D *GetPolyMarker() const {return fMarker;}
73  TGeoVolume *GetFirstVolume() const {return fVolume1;}
74  TGeoVolume *GetSecondVolume() const {return fVolume2;}
75  TGeoHMatrix *GetFirstMatrix() const {return fMatrix1;}
76  TGeoHMatrix *GetSecondMatrix() const {return fMatrix2;}
77  Double_t GetOverlap() const {return fOverlap;}
78  Bool_t IsExtrusion() const {return TObject::TestBit(kGeoExtrusion);}
79  Bool_t IsOverlap() const {return TObject::TestBit(kGeoOverlap);}
80  Bool_t IsFolder() const {return kFALSE;}
81  virtual Bool_t IsSortable() const {return kTRUE;}
82  virtual void Paint(Option_t *option="");
83  virtual void Print(Option_t *option="") const; // *MENU*
84  virtual void PrintInfo() const;
85  virtual void Sizeof3D() const;
86  void SampleOverlap(Int_t npoints=1000000); // *MENU*
87  void SetIsExtrusion(Bool_t flag=kTRUE) {TObject::SetBit(kGeoExtrusion,flag); TObject::SetBit(kGeoOverlap,!flag);}
88  void SetIsOverlap(Bool_t flag=kTRUE) {TObject::SetBit(kGeoOverlap,flag); TObject::SetBit(kGeoExtrusion,!flag);}
89  void SetNextPoint(Double_t x, Double_t y, Double_t z);
90  void SetFirstVolume(TGeoVolume *vol) {fVolume1=vol;}
91  void SetSecondVolume(TGeoVolume *vol) {fVolume2=vol;}
92  void SetFirstMatrix(TGeoMatrix *matrix) {*fMatrix1 = matrix;}
93  void SetSecondMatrix(TGeoMatrix *matrix) {*fMatrix2 = matrix;}
94  void SetOverlap(Double_t ovlp) {fOverlap=ovlp;}
95  void Validate() const; // *MENU*
96 
97  ClassDef(TGeoOverlap, 2) // base class for geometical overlaps
98 };
99 
100 #endif
101