]> git.uio.no Git - u/mrichter/AliRoot.git/blob - GEODB/AliGNode.h
This commit was generated by cvs2svn to compensate for changes in r209,
[u/mrichter/AliRoot.git] / GEODB / AliGNode.h
1 #ifndef ALIGNODE_H
2 #define ALIGNODE_H
3
4 #include <TObjArray.h>
5 #include <TNamed.h>
6 #include <TArrayI.h>
7 #include <TFile.h>
8 #include "AliGTransform.h"
9 #include "AliGShape.h"
10 #include "AliGBox.h"
11 #include "AliGSphere.h"
12 #include "AliGTube.h"
13 #include "AliGCone.h"
14 #include "AliGPCone.h"
15 #include "AliGTRD1.h"
16 #include "AliGMaterial.h"
17 #include "AliGConfig.h"
18
19 class AliGNode : public TNamed {
20
21 protected:
22     AliGConfig*   fConfig;
23     Int_t         fId;        /* node id number                                    */
24     AliGMaterial* fMaterial;  /* material                                          */
25     TArrayI*      fNcopy;     /* copy numbers list (associated with the sons list) */
26     TString       fNname;     /* node 'short' name                                 */
27     TArrayI*      fNnode;     /* Sons list                                         */
28     TObjArray*    fNode;      /* list of all nodes below                           */
29     Int_t         fNsons;     /* Number of elements in fNnode                      */
30     TArrayI*      fNtrans;    /* transf list (associated with the sons list)       */
31     AliGNode*     fParent;    /* Pointer to the parent node                        */
32     AliGShape*    fShape;     /* shape                                             */
33     TObjArray*    fTrans;     /* list of all the transformations involved          */
34     Int_t         fVis;       /* Visibility                                        */
35     
36
37 public:
38     AliGNode( AliGNode* node=NULL ); /* Copy or Default Constructor */
39
40     AliGNode( Text_t* name, Int_t id, Text_t* title, AliGBox* box, AliGMaterial* material=NULL, const Text_t* matrixname="", AliGConfig* config=NULL ); /* AliGNode Constructor for AliGBox shape */
41
42     AliGNode( Text_t* name, Int_t id, Text_t* title, AliGSphere* sphere, AliGMaterial* material=NULL, const Text_t* matrixname="", AliGConfig* config=NULL ); /* AliGNode Constructor for AliGSphere shape */
43
44     AliGNode( Text_t* name, Int_t id, Text_t* title, AliGTube* tube, AliGMaterial* material=NULL, const Text_t* matrixname="", AliGConfig* config=NULL ); /* AliGNode Constructor for AliGTube shape */
45
46     AliGNode( Text_t* name, Int_t id, Text_t* title, AliGCone* cone, AliGMaterial* material=NULL, const Text_t* matrixname="", AliGConfig* config=NULL ); /* AliGNode Constructor for AliGCone shape */
47     
48     AliGNode( Text_t* name, Int_t id, Text_t* title, AliGPCone* pcone,AliGMaterial* material=NULL, const Text_t* matrixname="", AliGConfig* config=NULL ); /* AliGNode Constructor for AliGPCone shape */
49     
50     AliGNode( Text_t* name, Int_t id, Text_t* title, AliGShape* shape, AliGMaterial* material=NULL, const Text_t* matrixname="", AliGConfig* config=NULL ); /* AliGNode Constructor for an AliGShape */
51
52     AliGNode( Text_t* name, Int_t id, Text_t* title, AliGTRD1* trd1, AliGMaterial* material=NULL, const Text_t* matrixname="", AliGConfig* config=NULL );
53
54     virtual ~AliGNode(); /* Destructor */
55     AliGNode* operator=( const AliGNode* node ); /* Operator = */
56     virtual AliGMaterial *Material() const { return fMaterial;}
57  
58             void           Add(AliGNode *son,AliGTransform *tran);
59             void           AddConf(AliGConfig* configname) { fConfig = configname;}
60             void           AddConfig(Text_t* name, Text_t* title, Text_t* detail="",Int_t beg=0, Int_t end=0);
61             void           AddMaterial(AliGMaterial* materialname) { fMaterial = materialname;}
62             void           AddShape( AliGShape* shapename) { fShape = shapename;}
63             Int_t          DistancetoPrimitive( Int_t px, Int_t py);
64             void           Draw( Option_t* option);
65             void           DrawShape( Option_t* option); /* MENU   */
66             void           EndConstructor( Text_t* name, Int_t id, Text_t* title, AliGMaterial *material, const Text_t *matrixname, AliGConfig* config );
67             AliGConfig*    GetConfig() {return fConfig;}
68             
69             TArrayI*       GetfNnode() {return fNnode;}
70             TObjArray*     GetfNode()  {return fNode;}
71             Int_t          GetfNsons() {return fNsons;}
72             TArrayI*       GetfNtrans(){return fNtrans;}
73             TArrayI*       GetfNcopy(){return fNcopy;}
74             TObjArray*     GetfTrans() {return fTrans;}
75             AliGMaterial*  GetMaterial() {return fMaterial;}
76             AliGNode*      GetNodeFromfNnode(int position) {return (AliGNode*)
77             this->fNode->At(fNnode->At(position));}
78             const Text_t*        GetFamName() {return fNname;}
79             AliGNode*      GetNodeFromfNode(int position) {return (AliGNode*)
80             this->fNode->At(position);}
81             AliGNode*      GetParent() {return fParent;}
82             Text_t*        GetPath();
83             AliGShape*     GetShape()  {return fShape;}
84             AliGTransform* GetTransFromfTrans(int position) {return (AliGTransform*) this->fTrans->At(position);}
85             //void           IncreaseSize(const Int_t total, TArrayI** array);
86             void           IncreaseSize(Int_t total,TArrayI &array);
87             void           Paint( Option_t *option);
88             void           Save(TFile* file);
89             void           SaveAll(TFile* file);
90             Int_t          SizefNode() {return this->fNode->GetSize();}
91             //void           Streamer(TBuffer &b);
92             void           SetVis(Int_t val) {fVis = val;}
93
94     ClassDef(AliGNode,1) //Node class
95 };
96
97 //R__EXTERN TArrayF* gMatrix;
98
99 #endif