Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TNode.h
Go to the documentation of this file.
1 // @(#)root/g3d:$Id$
2 // Author: Rene Brun 14/09/95
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 
13 //////////////////////////////////////////////////////////////////////////
14 // //
15 // TNode //
16 // //
17 // Description of parameters to position a 3-D geometry object //
18 // //
19 //////////////////////////////////////////////////////////////////////////
20 
21 #ifndef ROOT_TNode
22 #define ROOT_TNode
23 
24 #include "TShape.h"
25 #include "TAttLine.h"
26 #include "TAttFill.h"
27 #include "TAtt3D.h"
28 
29 #include "TRotMatrix.h"
30 
31 class TBrowser;
32 
33 class TNode : public TNamed , public TAttLine, public TAttFill, public TAtt3D {
34 
35 protected:
36  enum { kSonsInvisible = BIT(17) };
37 
38  Double_t fX; //X offset with respect to parent object
39  Double_t fY; //Y offset with respect to parent object
40  Double_t fZ; //Z offset with respect to parent object
41  TRotMatrix *fMatrix; //Pointer to rotation matrix
42  TShape *fShape; //Pointer to shape definition
43  TNode *fParent; //Pointer to parent positioned volume
44  TList *fNodes; //List of son nodes (if any)
45  TString fOption; //List of options if any
46  Int_t fVisibility; //Visibility flag
47 
48  TNode(const TNode&);
49  TNode& operator=(const TNode&);
50 
51 public:
52  TNode();
53  TNode(const char *name, const char *title, const char *shapename, Double_t x=0, Double_t y=0, Double_t z=0,
54  const char *matrixname="", Option_t *option="");
55  TNode(const char *name, const char *title, TShape *shape, Double_t x=0, Double_t y=0, Double_t z=0,
56  TRotMatrix *matrix=0, Option_t *option="");
57  virtual ~TNode();
58  virtual void Browse(TBrowser *b);
59  virtual void BuildListOfNodes();
60  virtual void cd(const char *path=0); // *MENU*
61  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
62  virtual void Draw(Option_t *option=""); // *MENU*
63  virtual void DrawOnly(Option_t *option="");
64  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
65  TList *GetListOfNodes() const {return fNodes;}
66  virtual TRotMatrix *GetMatrix() const {return fMatrix;}
67  virtual TNode *GetNode(const char *name) const;
68  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
69  const Option_t *GetOption() const { return fOption.Data();}
70  virtual TNode *GetParent() const {return fParent;}
71  TShape *GetShape() const {return fShape;}
72  Int_t GetVisibility() const {return fVisibility;}
73  virtual Double_t GetX() const {return fX;}
74  virtual Double_t GetY() const {return fY;}
75  virtual Double_t GetZ() const {return fZ;}
76  virtual void ImportShapeAttributes();
77  Bool_t IsFolder() const;
78  virtual void Local2Master(const Double_t *local, Double_t *master);
79  virtual void Local2Master(const Float_t *local, Float_t *master);
80  virtual void ls(Option_t *option="2") const; // *MENU*
81  virtual void Master2Local(const Double_t *master, Double_t *local);
82  virtual void Master2Local(const Float_t *master, Float_t *local);
83  virtual void Paint(Option_t *option="");
84  virtual void RecursiveRemove(TObject *obj);
85  virtual void SetMatrix(TRotMatrix *matrix=0) {fMatrix = matrix;}
86  virtual void SetName(const char *name);
87  virtual void SetParent(TNode *parent);
88  virtual void SetNameTitle(const char *name, const char *title);
89  virtual void SetPosition( Double_t x=0, Double_t y=0, Double_t z=0) {fX=x; fY=y; fZ=z;}
90  virtual void SetVisibility(Int_t vis=1); // *MENU*
91  virtual void Sizeof3D() const;
92  virtual void UpdateMatrix();
93  virtual void UpdateTempMatrix(const Double_t *dx1,const Double_t *rmat1,
94  Double_t x, Double_t y, Double_t z, Double_t *matrix,
95  Double_t *dxnew, Double_t *rmatnew);
96 
97  ClassDef(TNode,3) //Description of parameters to position a 3-D geometry object
98 };
99 
100 #endif