Logo ROOT   6.10/09
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 #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:
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;}
77  Double_t GetOverlap() const {return fOverlap;}
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*
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 
Double_t fOverlap
Definition: TGeoOverlap.h:53
void SetSecondMatrix(TGeoMatrix *matrix)
Definition: TGeoOverlap.h:93
const char Option_t
Definition: RtypesCore.h:62
Geometrical transformation package.
Definition: TGeoMatrix.h:38
virtual void Sizeof3D() const
Get 3D size of this.
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:159
#define BIT(n)
Definition: Rtypes.h:75
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:48
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:19
Bool_t IsExtrusion() const
Definition: TGeoOverlap.h:78
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:408
void SetFirstVolume(TGeoVolume *vol)
Definition: TGeoOverlap.h:90
TGeoVolume * GetFirstVolume() const
Definition: TGeoOverlap.h:73
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TGeoHMatrix * GetFirstMatrix() const
Definition: TGeoOverlap.h:75
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:687
virtual void PrintInfo() const
Print some info.
Fill Area Attributes class.
Definition: TAttFill.h:19
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:297
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
void SetSecondVolume(TGeoVolume *vol)
Definition: TGeoOverlap.h:91
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:94
void SetIsOverlap(Bool_t flag=kTRUE)
Definition: TGeoOverlap.h:88
void SetFirstMatrix(TGeoMatrix *matrix)
Definition: TGeoOverlap.h:92
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
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:87
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:81
TGeoVolume * fVolume2
Definition: TGeoOverlap.h:55
TGeoVolume * fVolume1
Definition: TGeoOverlap.h:54
const Bool_t kFALSE
Definition: RtypesCore.h:92
void Validate() const
Validate this overlap.
TGeoHMatrix * GetSecondMatrix() const
Definition: TGeoOverlap.h:76
TGeoVolume * GetSecondVolume() const
Definition: TGeoOverlap.h:74
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:57
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:79
A 3D polymarker.
Definition: TPolyMarker3D.h:32
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:72
virtual void Print(Option_t *option="") const
Print detailed info.
TPolyMarker3D * fMarker
Definition: TGeoOverlap.h:58
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TGeoOverlap.h:80
const Bool_t kTRUE
Definition: RtypesCore.h:91
TGeoOverlap()
Default ctor.
Definition: TGeoOverlap.cxx:37
Line Attributes class.
Definition: TAttLine.h:18
TGeoHMatrix * fMatrix1
Definition: TGeoOverlap.h:56
Double_t GetOverlap() const
Definition: TGeoOverlap.h:77