Logo ROOT  
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
TNode::IsFolder
Bool_t IsFolder() const
Return TRUE if node contains nodes, FALSE otherwise.
Definition: TNode.cxx:433
TNode::Local2Master
virtual void Local2Master(const Double_t *local, Double_t *master)
Convert one point from local system to master reference system.
Definition: TNode.cxx:447
TNode::RecursiveRemove
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from the list of nodes of this node.
Definition: TNode.cxx:687
TNode::SetName
virtual void SetName(const char *name)
Change the name of this Node.
Definition: TNode.cxx:695
TBrowser
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
TRotMatrix
Manages a detector rotation matrix.
Definition: TRotMatrix.h:28
Option_t
const char Option_t
Definition: RtypesCore.h:66
TNode::GetZ
virtual Double_t GetZ() const
Definition: TNode.h:75
TNode::DrawOnly
virtual void DrawOnly(Option_t *option="")
Draw only Sons of this node.
Definition: TNode.cxx:358
TNode::SetNameTitle
virtual void SetNameTitle(const char *name, const char *title)
Change the name and title of this Node.
Definition: TNode.cxx:709
TString::Data
const char * Data() const
Definition: TString.h:369
TNode::GetShape
TShape * GetShape() const
Definition: TNode.h:71
TNode::GetX
virtual Double_t GetX() const
Definition: TNode.h:73
Float_t
float Float_t
Definition: RtypesCore.h:57
Int_t
int Int_t
Definition: RtypesCore.h:45
TNode::SetParent
virtual void SetParent(TNode *parent)
Set the pointer to the parent, keep parents informed about who they have.
Definition: TNode.cxx:724
x
Double_t x[n]
Definition: legend1.C:17
TNode::fShape
TShape * fShape
Definition: TNode.h:42
TNode::Sizeof3D
virtual void Sizeof3D() const
Return total size of this 3-D Node with its attributes.
Definition: TNode.cxx:800
TString
Basic string class.
Definition: TString.h:136
TAtt3D
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
b
#define b(i)
Definition: RSha256.hxx:100
TNode::UpdateMatrix
virtual void UpdateMatrix()
Update global rotation matrix/translation vector for this node this function must be called before in...
Definition: TNode.cxx:855
TNode::~TNode
virtual ~TNode()
Node default destructor.
Definition: TNode.cxx:217
TNode::fX
Double_t fX
Definition: TNode.h:38
TAttLine.h
TNode::Paint
virtual void Paint(Option_t *option="")
Paint Referenced node with current parameters.
Definition: TNode.cxx:623
TNode::UpdateTempMatrix
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:890
TShape.h
TAttFill.h
TAttLine
Line Attributes class.
Definition: TAttLine.h:18
TRotMatrix.h
TAtt3D.h
TNode::GetOption
const Option_t * GetOption() const
Definition: TNode.h:69
TNode::SetVisibility
virtual void SetVisibility(Int_t vis=1)
Set visibility for this node and its sons.
Definition: TNode.cxx:760
TNode::BuildListOfNodes
virtual void BuildListOfNodes()
Create the list to support sons of this node.
Definition: TNode.cxx:243
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TNode::SetPosition
virtual void SetPosition(Double_t x=0, Double_t y=0, Double_t z=0)
Definition: TNode.h:89
TNode::GetY
virtual Double_t GetY() const
Definition: TNode.h:74
TNode::fZ
Double_t fZ
Definition: TNode.h:40
TNode::fOption
TString fOption
Definition: TNode.h:45
TNode::ExecuteEvent
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TNode.cxx:370
TNode::fNodes
TList * fNodes
Definition: TNode.h:44
BIT
#define BIT(n)
Definition: Rtypes.h:85
y
Double_t y[n]
Definition: legend1.C:17
TNode::GetNode
virtual TNode * GetNode(const char *name) const
Return pointer to node with name in the node tree.
Definition: TNode.cxx:379
TShape
This is the base class for all geometry shapes.
Definition: TShape.h:35
TNode::SetMatrix
virtual void SetMatrix(TRotMatrix *matrix=0)
Definition: TNode.h:85
TNode::fMatrix
TRotMatrix * fMatrix
Definition: TNode.h:41
TNode
TNode description.
Definition: TNode.h:33
TNode::GetObjectInfo
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Get object info.
Definition: TNode.cxx:399
TNode::kSonsInvisible
@ kSonsInvisible
Definition: TNode.h:36
TNode::DistancetoPrimitive
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a Node.
Definition: TNode.cxx:262
Double_t
double Double_t
Definition: RtypesCore.h:59
TNode::ImportShapeAttributes
virtual void ImportShapeAttributes()
Copy shape attributes as node attributes.
Definition: TNode.cxx:411
TNode::Master2Local
virtual void Master2Local(const Double_t *master, Double_t *local)
Convert one point from master system to local reference system.
Definition: TNode.cxx:569
TNode::operator=
TNode & operator=(const TNode &)
assignment operator
Definition: TNode.cxx:194
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
TNode::fParent
TNode * fParent
Definition: TNode.h:43
TNode::TNode
TNode()
Node default constructor.
Definition: TNode.cxx:61
TNode::Draw
virtual void Draw(Option_t *option="")
Draw Referenced node with current parameters.
Definition: TNode.cxx:324
TAttFill
Fill Area Attributes class.
Definition: TAttFill.h:19
TNode::fY
Double_t fY
Definition: TNode.h:39
TNode::ls
virtual void ls(Option_t *option="2") const
List Referenced object with current parameters.
Definition: TNode.cxx:510
TNode::Browse
virtual void Browse(TBrowser *b)
Browse.
Definition: TNode.cxx:230
TNode::GetParent
virtual TNode * GetParent() const
Definition: TNode.h:70
TNode::GetVisibility
Int_t GetVisibility() const
Definition: TNode.h:72
TNode::GetListOfNodes
TList * GetListOfNodes() const
Definition: TNode.h:65
TNode::cd
virtual void cd(const char *path=0)
Change Current Reference node to this.
Definition: TNode.cxx:251
TList
A doubly linked list.
Definition: TList.h:44
TNode::GetMatrix
virtual TRotMatrix * GetMatrix() const
Definition: TNode.h:66
int
TNode::fVisibility
Int_t fVisibility
Definition: TNode.h:46