ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 #ifndef ROOT_TShape
25 #include "TShape.h"
26 #endif
27 #ifndef ROOT_TAttLine
28 #include "TAttLine.h"
29 #endif
30 #ifndef ROOT_TAttFill
31 #include "TAttFill.h"
32 #endif
33 #ifndef ROOT_TAtt3D
34 #include "TAtt3D.h"
35 #endif
36 
37 #ifndef ROOT_TRotMatrix
38 #include "TRotMatrix.h"
39 #endif
40 
41 class TBrowser;
42 
43 class TNode : public TNamed , public TAttLine, public TAttFill, public TAtt3D {
44 
45 protected:
46  enum { kSonsInvisible = BIT(17) };
47 
48  Double_t fX; //X offset with respect to parent object
49  Double_t fY; //Y offset with respect to parent object
50  Double_t fZ; //Z offset with respect to parent object
51  TRotMatrix *fMatrix; //Pointer to rotation matrix
52  TShape *fShape; //Pointer to shape definition
53  TNode *fParent; //Pointer to parent positioned volume
54  TList *fNodes; //List of son nodes (if any)
55  TString fOption; //List of options if any
56  Int_t fVisibility; //Visibility flag
57 
58  TNode(const TNode&);
59  TNode& operator=(const TNode&);
60 
61 public:
62  TNode();
63  TNode(const char *name, const char *title, const char *shapename, Double_t x=0, Double_t y=0, Double_t z=0,
64  const char *matrixname="", Option_t *option="");
65  TNode(const char *name, const char *title, TShape *shape, Double_t x=0, Double_t y=0, Double_t z=0,
66  TRotMatrix *matrix=0, Option_t *option="");
67  virtual ~TNode();
68  virtual void Browse(TBrowser *b);
69  virtual void BuildListOfNodes();
70  virtual void cd(const char *path=0); // *MENU*
72  virtual void Draw(Option_t *option=""); // *MENU*
73  virtual void DrawOnly(Option_t *option="");
74  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
75  TList *GetListOfNodes() const {return fNodes;}
76  virtual TRotMatrix *GetMatrix() const {return fMatrix;}
77  virtual TNode *GetNode(const char *name) const;
78  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
79  const Option_t *GetOption() const { return fOption.Data();}
80  virtual TNode *GetParent() const {return fParent;}
81  TShape *GetShape() const {return fShape;}
82  Int_t GetVisibility() const {return fVisibility;}
83  virtual Double_t GetX() const {return fX;}
84  virtual Double_t GetY() const {return fY;}
85  virtual Double_t GetZ() const {return fZ;}
86  virtual void ImportShapeAttributes();
87  Bool_t IsFolder() const;
88  virtual void Local2Master(const Double_t *local, Double_t *master);
89  virtual void Local2Master(const Float_t *local, Float_t *master);
90  virtual void ls(Option_t *option="2") const; // *MENU*
91  virtual void Master2Local(const Double_t *master, Double_t *local);
92  virtual void Master2Local(const Float_t *master, Float_t *local);
93  virtual void Paint(Option_t *option="");
94  virtual void RecursiveRemove(TObject *obj);
95  virtual void SetMatrix(TRotMatrix *matrix=0) {fMatrix = matrix;}
96  virtual void SetName(const char *name);
97  virtual void SetParent(TNode *parent);
98  virtual void SetNameTitle(const char *name, const char *title);
99  virtual void SetPosition( Double_t x=0, Double_t y=0, Double_t z=0) {fX=x; fY=y; fZ=z;}
100  virtual void SetVisibility(Int_t vis=1); // *MENU*
101  virtual void Sizeof3D() const;
102  virtual void UpdateMatrix();
103  virtual void UpdateTempMatrix(const Double_t *dx1,const Double_t *rmat1,
104  Double_t x, Double_t y, Double_t z, Double_t *matrix,
105  Double_t *dxnew, Double_t *rmatnew);
106 
107  ClassDef(TNode,3) //Description of parameters to position a 3-D geometry object
108 };
109 
110 #endif
virtual void Draw(Option_t *option="")
Draw Referenced node with current parameters.
Definition: TNode.cxx:323
virtual Double_t GetY() const
Definition: TNode.h:84
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from the list of nodes of this node.
Definition: TNode.cxx:686
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
Int_t fVisibility
Definition: TNode.h:56
virtual void Local2Master(const Double_t *local, Double_t *master)
Convert one point from local system to master reference system.
Definition: TNode.cxx:446
virtual void SetNameTitle(const char *name, const char *title)
Change the name and title of this Node.
Definition: TNode.cxx:708
#define BIT(n)
Definition: Rtypes.h:120
virtual void cd(const char *path=0)
Change Current Reference node to this.
Definition: TNode.cxx:250
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:29
TNode description.
Definition: TNode.h:43
virtual void DrawOnly(Option_t *option="")
Draw only Sons of this node.
Definition: TNode.cxx:357
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual TNode * GetNode(const char *name) const
Return pointer to node with name in the node tree.
Definition: TNode.cxx:378
virtual ~TNode()
Node default destructor.
Definition: TNode.cxx:216
Float_t py
Definition: hprod.C:33
virtual void Paint(Option_t *option="")
Paint Referenced node with current parameters.
Definition: TNode.cxx:622
virtual void Sizeof3D() const
Return total size of this 3-D Node with its attributes.
Definition: TNode.cxx:799
const char * Data() const
Definition: TString.h:349
Fill Area Attributes class.
Definition: TAttFill.h:32
Double_t x[n]
Definition: legend1.C:17
virtual void SetVisibility(Int_t vis=1)
Set visibility for this node and its sons.
Definition: TNode.cxx:759
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
Double_t fX
Definition: TNode.h:48
TList * fNodes
Definition: TNode.h:54
virtual void SetParent(TNode *parent)
Set the pointer to the parent, keep parents informed about who they have.
Definition: TNode.cxx:723
Double_t fZ
Definition: TNode.h:50
ClassDef(TAttLine, 2)
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TNode.cxx:369
Int_t GetVisibility() const
Definition: TNode.h:82
Float_t z[5]
Definition: Ifit.C:16
TShape * fShape
Definition: TNode.h:52
A doubly linked list.
Definition: TList.h:47
virtual Double_t GetX() const
Definition: TNode.h:83
TRotMatrix * fMatrix
Definition: TNode.h:51
Bool_t IsFolder() const
Return TRUE if node contains nodes, FALSE otherwise.
Definition: TNode.cxx:432
const Option_t * GetOption() const
Definition: TNode.h:79
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
TShape * GetShape() const
Definition: TNode.h:81
virtual void SetPosition(Double_t x=0, Double_t y=0, Double_t z=0)
Definition: TNode.h:99
virtual void UpdateMatrix()
Update global rotation matrix/translation vector for this node this function must be called before in...
Definition: TNode.cxx:854
This is the base class for all geometry shapes.
Definition: TShape.h:47
Manages a detector rotation matrix.
Definition: TRotMatrix.h:30
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
virtual void SetMatrix(TRotMatrix *matrix=0)
Definition: TNode.h:95
virtual void BuildListOfNodes()
Create the list to support sons of this node.
Definition: TNode.cxx:242
virtual Double_t GetZ() const
Definition: TNode.h:85
TString fOption
Definition: TNode.h:55
TList * GetListOfNodes() const
Definition: TNode.h:75
virtual void UpdateTempMatrix(const Double_t *dx1, const Double_t *rmat1, Double_t x, Double_t y, Double_t z, Double_t *matrix, Double_t *dxnew, Double_t *rmatnew)
Compute new translation vector and global matrix.
Definition: TNode.cxx:889
virtual void ImportShapeAttributes()
Copy shape attributes as node attributes.
Definition: TNode.cxx:410
double Double_t
Definition: RtypesCore.h:55
Double_t y[n]
Definition: legend1.C:17
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a Node.
Definition: TNode.cxx:261
Mother of all ROOT objects.
Definition: TObject.h:58
Float_t px
Definition: hprod.C:33
virtual TRotMatrix * GetMatrix() const
Definition: TNode.h:76
virtual void ls(Option_t *option="2") const
List Referenced object with current parameters.
Definition: TNode.cxx:509
TNode * fParent
Definition: TNode.h:53
virtual void Master2Local(const Double_t *master, Double_t *local)
Convert one point from master system to local reference system.
Definition: TNode.cxx:568
virtual TNode * GetParent() const
Definition: TNode.h:80
virtual void Browse(TBrowser *b)
Browse.
Definition: TNode.cxx:229
virtual void SetName(const char *name)
Change the name of this Node.
Definition: TNode.cxx:694
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Get object info.
Definition: TNode.cxx:398
TObject * obj
TNode & operator=(const TNode &)
assignment operator
Definition: TNode.cxx:193
Double_t fY
Definition: TNode.h:49
Line Attributes class.
Definition: TAttLine.h:32