Logo ROOT   6.14/05
Reference Guide
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
virtual void Draw(Option_t *option="")
Draw Referenced node with current parameters.
Definition: TNode.cxx:323
virtual TRotMatrix * GetMatrix() const
Definition: TNode.h:66
virtual TNode * GetParent() const
Definition: TNode.h:70
TList * GetListOfNodes() const
Definition: TNode.h:65
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
Bool_t IsFolder() const
Return TRUE if node contains nodes, FALSE otherwise.
Definition: TNode.cxx:432
const char Option_t
Definition: RtypesCore.h:62
Int_t fVisibility
Definition: TNode.h:46
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:78
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:19
TNode description.
Definition: TNode.h:33
virtual void DrawOnly(Option_t *option="")
Draw only Sons of this node.
Definition: TNode.cxx:357
Basic string class.
Definition: TString.h:131
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual Double_t GetX() const
Definition: TNode.h:73
virtual ~TNode()
Node default destructor.
Definition: TNode.cxx:216
virtual void Sizeof3D() const
Return total size of this 3-D Node with its attributes.
Definition: TNode.cxx:799
virtual void Paint(Option_t *option="")
Paint Referenced node with current parameters.
Definition: TNode.cxx:622
Fill Area Attributes class.
Definition: TAttFill.h:19
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:320
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:29
TShape * GetShape() const
Definition: TNode.h:71
Double_t fX
Definition: TNode.h:38
TList * fNodes
Definition: TNode.h:44
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:40
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TNode.cxx:369
TShape * fShape
Definition: TNode.h:42
virtual TNode * GetNode(const char *name) const
Return pointer to node with name in the node tree.
Definition: TNode.cxx:378
A doubly linked list.
Definition: TList.h:44
TRotMatrix * fMatrix
Definition: TNode.h:41
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
virtual void SetPosition(Double_t x=0, Double_t y=0, Double_t z=0)
Definition: TNode.h:89
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:35
Manages a detector rotation matrix.
Definition: TRotMatrix.h:28
const Option_t * GetOption() const
Definition: TNode.h:69
virtual void SetMatrix(TRotMatrix *matrix=0)
Definition: TNode.h:85
virtual void BuildListOfNodes()
Create the list to support sons of this node.
Definition: TNode.cxx:242
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Get object info.
Definition: TNode.cxx:398
TString fOption
Definition: TNode.h:45
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
virtual Double_t GetY() const
Definition: TNode.h:74
TNode()
Node default constructor.
Definition: TNode.cxx:60
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:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
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
TNode * fParent
Definition: TNode.h:43
virtual void ls(Option_t *option="2") const
List Referenced object with current parameters.
Definition: TNode.cxx:509
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 void Browse(TBrowser *b)
Browse.
Definition: TNode.cxx:229
virtual Double_t GetZ() const
Definition: TNode.h:75
virtual void SetName(const char *name)
Change the name of this Node.
Definition: TNode.cxx:694
TNode & operator=(const TNode &)
assignment operator
Definition: TNode.cxx:193
Double_t fY
Definition: TNode.h:39
Line Attributes class.
Definition: TAttLine.h:18
char name[80]
Definition: TGX11.cxx:109
Int_t GetVisibility() const
Definition: TNode.h:72
const char * Data() const
Definition: TString.h:364