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