ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 #ifndef ROOT_TNamed
16 #include "TNamed.h"
17 #endif
18 
19 #ifndef ROOT_TAttLine
20 #include "TAttLine.h"
21 #endif
22 
23 #ifndef ROOT_TAttFill
24 #include "TAttFill.h"
25 #endif
26 
27 #ifndef ROOT_TAtt3D
28 #include "TAtt3D.h"
29 #endif
30 
31 #ifndef ROOT_TGeoMatrix
32 #include "TGeoMatrix.h"
33 #endif
34 
35 ///////////////////////////////////////////////////////////////////////////
36 // //
37 // TGeoOverlap - base class describing geometry overlaps. Overlaps apply //
38 // to the nodes contained inside a volume. These should not overlap to //
39 // each other nor extrude the shape of their mother volume. //
40 // //
41 ///////////////////////////////////////////////////////////////////////////
42 
43 class TGeoVolume;
44 class TPolyMarker3D;
45 class TBrowser;
46 
47 class TGeoOverlap : public TNamed,
48  public TAttLine,
49  public TAttFill,
50  public TAtt3D
51 {
52 public:
56 };
57 
58 private:
59  TGeoOverlap(const TGeoOverlap&); // Not implemented
60  TGeoOverlap& operator=(const TGeoOverlap&); // Not implemented
61 
62 protected:
63  Double_t fOverlap; // overlap distance
64  TGeoVolume *fVolume1; // first volume
65  TGeoVolume *fVolume2; // second volume
66  TGeoHMatrix *fMatrix1; // positioning matrix for first volume
67  TGeoHMatrix *fMatrix2; // positioning matrix for second volume
68  TPolyMarker3D *fMarker; // points in the overlapping region
69 
70 public:
71  TGeoOverlap();
72  TGeoOverlap(const char *name, TGeoVolume *vol1, TGeoVolume *vol2,
73  const TGeoMatrix *matrix1, const TGeoMatrix *matrix2,
74  Bool_t isovlp=kTRUE, Double_t ovlp=0.01);
75  virtual ~TGeoOverlap();
76 
77  void Browse(TBrowser *b);
78  virtual Int_t Compare(const TObject *obj) const;
80  virtual void Draw(Option_t *option=""); // *MENU*
81  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
82  TPolyMarker3D *GetPolyMarker() const {return fMarker;}
83  TGeoVolume *GetFirstVolume() const {return fVolume1;}
84  TGeoVolume *GetSecondVolume() const {return fVolume2;}
85  TGeoHMatrix *GetFirstMatrix() const {return fMatrix1;}
87  Double_t GetOverlap() const {return fOverlap;}
90  Bool_t IsFolder() const {return kFALSE;}
91  virtual Bool_t IsSortable() const {return kTRUE;}
92  virtual void Paint(Option_t *option="");
93  virtual void Print(Option_t *option="") const; // *MENU*
94  virtual void PrintInfo() const;
95  virtual void Sizeof3D() const;
96  void SampleOverlap(Int_t npoints=1000000); // *MENU*
102  void SetFirstMatrix(TGeoMatrix *matrix) {*fMatrix1 = matrix;}
103  void SetSecondMatrix(TGeoMatrix *matrix) {*fMatrix2 = matrix;}
104  void SetOverlap(Double_t ovlp) {fOverlap=ovlp;}
105  void Validate() const; // *MENU*
106 
107  ClassDef(TGeoOverlap, 2) // base class for geometical overlaps
108 };
109 
110 #endif
111 
virtual Bool_t IsSortable() const
Definition: TGeoOverlap.h:91
Double_t fOverlap
Definition: TGeoOverlap.h:63
TGeoHMatrix * GetSecondMatrix() const
Definition: TGeoOverlap.h:86
TGeoVolume * GetSecondVolume() const
Definition: TGeoOverlap.h:84
void SetSecondMatrix(TGeoMatrix *matrix)
Definition: TGeoOverlap.h:103
const char Option_t
Definition: RtypesCore.h:62
#define BIT(n)
Definition: Rtypes.h:120
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Event interception.
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:29
void Browse(TBrowser *b)
Define double-click action.
Definition: TGeoOverlap.cxx:82
void SetFirstVolume(TGeoVolume *vol)
Definition: TGeoOverlap.h:100
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual Int_t Compare(const TObject *obj) const
Method to compare this overlap with another.
Definition: TGeoOverlap.cxx:94
Float_t py
Definition: hprod.C:33
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:732
Fill Area Attributes class.
Definition: TAttFill.h:32
Double_t x[n]
Definition: legend1.C:17
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
void SetSecondVolume(TGeoVolume *vol)
Definition: TGeoOverlap.h:101
Bool_t IsExtrusion() const
Definition: TGeoOverlap.h:88
ClassDef(TAttLine, 2)
TGeoOverlap & operator=(const TGeoOverlap &)
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Distance to primitive for an overlap.
Float_t z[5]
Definition: Ifit.C:16
void SetOverlap(Double_t ovlp)
Definition: TGeoOverlap.h:104
void SetIsOverlap(Bool_t flag=kTRUE)
Definition: TGeoOverlap.h:98
void SetFirstMatrix(TGeoMatrix *matrix)
Definition: TGeoOverlap.h:102
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
void SampleOverlap(Int_t npoints=1000000)
Draw overlap and sample with random points the overlapping region.
void SetIsExtrusion(Bool_t flag=kTRUE)
Definition: TGeoOverlap.h:97
virtual void Sizeof3D() const
Get 3D size of this.
void SetNextPoint(Double_t x, Double_t y, Double_t z)
Set next overlapping point.
Bool_t IsOverlap() const
Definition: TGeoOverlap.h:89
virtual ~TGeoOverlap()
Destructor.
Definition: TGeoOverlap.cxx:72
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:173
TGeoVolume * fVolume2
Definition: TGeoOverlap.h:65
Double_t GetOverlap() const
Definition: TGeoOverlap.h:87
TGeoVolume * fVolume1
Definition: TGeoOverlap.h:64
virtual void Paint(Option_t *option="")
Paint the overlap.
TGeoHMatrix * GetFirstMatrix() const
Definition: TGeoOverlap.h:85
double Double_t
Definition: RtypesCore.h:55
void Validate() const
Validate this overlap.
Double_t y[n]
Definition: legend1.C:17
#define name(a, b)
Definition: linkTestLib0.cpp:5
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TGeoOverlap.h:90
TGeoHMatrix * fMatrix2
Definition: TGeoOverlap.h:67
Mother of all ROOT objects.
Definition: TObject.h:58
Float_t px
Definition: hprod.C:33
TPolyMarker3D * GetPolyMarker() const
Definition: TGeoOverlap.h:82
A 3D polymarker.
Definition: TPolyMarker3D.h:40
virtual void Draw(Option_t *option="")
Draw the overlap.
virtual void PrintInfo() const
Print some info.
TGeoVolume * GetFirstVolume() const
Definition: TGeoOverlap.h:83
TPolyMarker3D * fMarker
Definition: TGeoOverlap.h:68
virtual void Print(Option_t *option="") const
Print detailed info.
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
Line Attributes class.
Definition: TAttLine.h:32
TGeoHMatrix * fMatrix1
Definition: TGeoOverlap.h:66