Logo ROOT   6.08/07
Reference Guide
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;
79  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
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*
100  void SetFirstVolume(TGeoVolume *vol) {fVolume1=vol;}
101  void SetSecondVolume(TGeoVolume *vol) {fVolume2=vol;}
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 
Double_t fOverlap
Definition: TGeoOverlap.h:63
void SetSecondMatrix(TGeoMatrix *matrix)
Definition: TGeoOverlap.h:103
const char Option_t
Definition: RtypesCore.h:62
Geometrical transformation package.
Definition: TGeoMatrix.h:40
virtual void Sizeof3D() const
Get 3D size of this.
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:157
#define BIT(n)
Definition: Rtypes.h:120
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:61
virtual Int_t Compare(const TObject *obj) const
Method to compare this overlap with another.
Definition: TGeoOverlap.cxx:94
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:21
Bool_t IsExtrusion() const
Definition: TGeoOverlap.h:88
void Browse(TBrowser *b)
Define double-click action.
Definition: TGeoOverlap.cxx:82
Matrix class used for computing global transformations Should NOT be used for node definition...
Definition: TGeoMatrix.h:410
void SetFirstVolume(TGeoVolume *vol)
Definition: TGeoOverlap.h:100
TGeoVolume * GetFirstVolume() const
Definition: TGeoOverlap.h:83
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
TGeoHMatrix * GetFirstMatrix() const
Definition: TGeoOverlap.h:85
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:739
virtual void PrintInfo() const
Print some info.
Fill Area Attributes class.
Definition: TAttFill.h:24
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
void SetSecondVolume(TGeoVolume *vol)
Definition: TGeoOverlap.h:101
TGeoOverlap & operator=(const TGeoOverlap &)
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Distance to primitive for an overlap.
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
void SetNextPoint(Double_t x, Double_t y, Double_t z)
Set next overlapping point.
virtual ~TGeoOverlap()
Destructor.
Definition: TGeoOverlap.cxx:72
virtual Bool_t IsSortable() const
Definition: TGeoOverlap.h:91
TGeoVolume * fVolume2
Definition: TGeoOverlap.h:65
TGeoVolume * fVolume1
Definition: TGeoOverlap.h:64
void Validate() const
Validate this overlap.
TGeoHMatrix * GetSecondMatrix() const
Definition: TGeoOverlap.h:86
TGeoVolume * GetSecondVolume() const
Definition: TGeoOverlap.h:84
virtual void Paint(Option_t *option="")
Paint the overlap.
double Double_t
Definition: RtypesCore.h:55
Double_t y[n]
Definition: legend1.C:17
TGeoHMatrix * fMatrix2
Definition: TGeoOverlap.h:67
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
Bool_t IsOverlap() const
Definition: TGeoOverlap.h:89
A 3D polymarker.
Definition: TPolyMarker3D.h:40
virtual void Draw(Option_t *option="")
Draw the overlap.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
TPolyMarker3D * GetPolyMarker() const
Definition: TGeoOverlap.h:82
virtual void Print(Option_t *option="") const
Print detailed info.
TPolyMarker3D * fMarker
Definition: TGeoOverlap.h:68
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TGeoOverlap.h:90
const Bool_t kTRUE
Definition: Rtypes.h:91
TGeoOverlap()
Default ctor.
Definition: TGeoOverlap.cxx:37
Line Attributes class.
Definition: TAttLine.h:24
char name[80]
Definition: TGX11.cxx:109
TGeoHMatrix * fMatrix1
Definition: TGeoOverlap.h:66
Double_t GetOverlap() const
Definition: TGeoOverlap.h:87