00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef ROOT_TNode
00022 #define ROOT_TNode
00023
00024 #ifndef ROOT_TShape
00025 #include "TShape.h"
00026 #endif
00027 #ifndef ROOT_TAttLine
00028 #include "TAttLine.h"
00029 #endif
00030 #ifndef ROOT_TAttFill
00031 #include "TAttFill.h"
00032 #endif
00033 #ifndef ROOT_TAtt3D
00034 #include "TAtt3D.h"
00035 #endif
00036
00037 #ifndef ROOT_TRotMatrix
00038 #include "TRotMatrix.h"
00039 #endif
00040
00041 class TBrowser;
00042
00043 class TNode : public TNamed , public TAttLine, public TAttFill, public TAtt3D {
00044
00045 protected:
00046 enum { kSonsInvisible = BIT(17) };
00047
00048 Double_t fX;
00049 Double_t fY;
00050 Double_t fZ;
00051 TRotMatrix *fMatrix;
00052 TShape *fShape;
00053 TNode *fParent;
00054 TList *fNodes;
00055 TString fOption;
00056 Int_t fVisibility;
00057
00058 TNode(const TNode&);
00059 TNode& operator=(const TNode&);
00060
00061 public:
00062 TNode();
00063 TNode(const char *name, const char *title, const char *shapename, Double_t x=0, Double_t y=0, Double_t z=0,
00064 const char *matrixname="", Option_t *option="");
00065 TNode(const char *name, const char *title, TShape *shape, Double_t x=0, Double_t y=0, Double_t z=0,
00066 TRotMatrix *matrix=0, Option_t *option="");
00067 virtual ~TNode();
00068 virtual void Browse(TBrowser *b);
00069 virtual void BuildListOfNodes();
00070 virtual void cd(const char *path=0);
00071 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
00072 virtual void Draw(Option_t *option="");
00073 virtual void DrawOnly(Option_t *option="");
00074 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
00075 TList *GetListOfNodes() const {return fNodes;}
00076 virtual TRotMatrix *GetMatrix() const {return fMatrix;}
00077 virtual TNode *GetNode(const char *name) const;
00078 virtual char *GetObjectInfo(Int_t px, Int_t py) const;
00079 const Option_t *GetOption() const { return fOption.Data();}
00080 virtual TNode *GetParent() const {return fParent;}
00081 TShape *GetShape() const {return fShape;}
00082 Int_t GetVisibility() const {return fVisibility;}
00083 virtual Double_t GetX() const {return fX;}
00084 virtual Double_t GetY() const {return fY;}
00085 virtual Double_t GetZ() const {return fZ;}
00086 virtual void ImportShapeAttributes();
00087 Bool_t IsFolder() const;
00088 virtual void Local2Master(const Double_t *local, Double_t *master);
00089 virtual void Local2Master(const Float_t *local, Float_t *master);
00090 virtual void ls(Option_t *option="2") const;
00091 virtual void Master2Local(const Double_t *master, Double_t *local);
00092 virtual void Master2Local(const Float_t *master, Float_t *local);
00093 virtual void Paint(Option_t *option="");
00094 virtual void RecursiveRemove(TObject *obj);
00095 virtual void SetMatrix(TRotMatrix *matrix=0) {fMatrix = matrix;}
00096 virtual void SetName(const char *name);
00097 virtual void SetParent(TNode *parent);
00098 virtual void SetNameTitle(const char *name, const char *title);
00099 virtual void SetPosition( Double_t x=0, Double_t y=0, Double_t z=0) {fX=x; fY=y; fZ=z;}
00100 virtual void SetVisibility(Int_t vis=1);
00101 virtual void Sizeof3D() const;
00102 virtual void UpdateMatrix();
00103 virtual void UpdateTempMatrix(const Double_t *dx1,const Double_t *rmat1,
00104 Double_t x, Double_t y, Double_t z, Double_t *matrix,
00105 Double_t *dxnew, Double_t *rmatnew);
00106
00107 ClassDef(TNode,3)
00108 };
00109
00110 #endif