00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGeoPhysicalNode
00013 #define ROOT_TGeoPhysicalNode
00014
00015 #ifndef ROOT_TNamed
00016 #include "TNamed.h"
00017 #endif
00018
00019 #ifndef ROOT_TObjArray
00020 #include "TObjArray.h"
00021 #endif
00022
00023 #ifndef ROOT_TAttLine
00024 #include "TAttLine.h"
00025 #endif
00026
00027
00028 class TGeoHMatrix;
00029 class TGeoMatrix;
00030 class TGeoVolume;
00031 class TGeoNode;
00032 class TGeoShape;
00033
00034
00035
00036
00037
00038
00039
00040
00041 class TGeoPhysicalNode : public TNamed,
00042 public TAttLine
00043 {
00044 protected:
00045 Int_t fLevel;
00046 TObjArray *fMatrices;
00047 TObjArray *fNodes;
00048 TGeoHMatrix *fMatrixOrig;
00049
00050 TGeoPhysicalNode(const TGeoPhysicalNode&);
00051 TGeoPhysicalNode& operator=(const TGeoPhysicalNode&);
00052
00053 void SetAligned(Bool_t flag=kTRUE) {TObject::SetBit(kGeoPNodeAligned,flag);}
00054 Bool_t SetPath(const char *path);
00055 void SetBranchAsState();
00056
00057 public:
00058 enum {
00059 kGeoPNodeFull = BIT(10),
00060 kGeoPNodeVisible = BIT(11),
00061 kGeoPNodeVolAtt = BIT(12),
00062 kGeoPNodeAligned = BIT(13)
00063 };
00064
00065
00066 TGeoPhysicalNode();
00067 TGeoPhysicalNode(const char *path);
00068
00069 virtual ~TGeoPhysicalNode();
00070
00071 void Align(TGeoMatrix *newmat=0, TGeoShape *newshape=0, Bool_t check=kFALSE, Double_t ovlp=0.001);
00072 void cd() const;
00073 void Draw(Option_t *option="");
00074 Int_t GetLevel() const {return fLevel;}
00075 TGeoHMatrix *GetMatrix(Int_t level=-1) const;
00076 TGeoHMatrix *GetOriginalMatrix() const {return fMatrixOrig;}
00077 TGeoNode *GetMother(Int_t levup=1) const;
00078 TGeoNode *GetNode(Int_t level=-1) const;
00079 TGeoShape *GetShape(Int_t level=-1) const;
00080 TGeoVolume *GetVolume(Int_t level=-1) const;
00081
00082
00083 Bool_t IsAligned() const {return TObject::TestBit(kGeoPNodeAligned);}
00084 Bool_t IsVolAttributes() const {return TObject::TestBit(kGeoPNodeVolAtt);}
00085 Bool_t IsVisible() const {return TObject::TestBit(kGeoPNodeVisible);}
00086 Bool_t IsVisibleFull() const {return TObject::TestBit(kGeoPNodeFull);}
00087
00088 virtual void Print(Option_t *option="") const;
00089 void Refresh();
00090
00091 void SetMatrixOrig(const TGeoMatrix *local);
00092 void SetIsVolAtt(Bool_t flag=kTRUE) {TObject::SetBit(kGeoPNodeVolAtt,flag);}
00093 void SetVisibility(Bool_t flag=kTRUE) {TObject::SetBit(kGeoPNodeVisible,flag);}
00094 void SetVisibleFull(Bool_t flag=kTRUE) {TObject::SetBit(kGeoPNodeFull,flag);}
00095 virtual void Paint(Option_t *option = "");
00096
00097
00098 ClassDef(TGeoPhysicalNode, 1)
00099 };
00100
00101
00102
00103
00104
00105
00106
00107
00108 class TGeoPNEntry : public TNamed
00109 {
00110 private:
00111 enum EPNEntryFlags {
00112 kPNEntryOwnMatrix = BIT(14)
00113 };
00114 TGeoPhysicalNode *fNode;
00115 const TGeoHMatrix *fMatrix;
00116 TGeoHMatrix *fGlobalOrig;
00117
00118 protected:
00119 TGeoPNEntry(const TGeoPNEntry& pne)
00120 : TNamed(pne), fNode(pne.fNode), fMatrix(NULL), fGlobalOrig(NULL) { }
00121 TGeoPNEntry& operator=(const TGeoPNEntry& pne)
00122 {if(this!=&pne) {TNamed::operator=(pne); fNode=pne.fNode; fMatrix=pne.fMatrix;}
00123 return *this;}
00124
00125 public:
00126 TGeoPNEntry();
00127 TGeoPNEntry(const char *unique_name, const char *path);
00128 virtual ~TGeoPNEntry();
00129
00130 inline const char *GetPath() const {return GetTitle();}
00131 const TGeoHMatrix *GetMatrix() const {return fMatrix;}
00132 TGeoHMatrix *GetMatrixOrig() const {if (fNode) return fNode->GetOriginalMatrix(); else return NULL;};
00133 TGeoHMatrix *GetGlobalOrig() const {return fGlobalOrig;}
00134 TGeoPhysicalNode *GetPhysicalNode() const {return fNode;}
00135 void SetMatrix(const TGeoHMatrix *matrix);
00136 void SetPhysicalNode(TGeoPhysicalNode *node);
00137
00138 ClassDef(TGeoPNEntry, 4)
00139 };
00140
00141 #endif
00142