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