StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TVolume.h
1 // @(#)root/table:$Id$
2 // Author: Valery Fine 10/12/98
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 
13 // //
14 // TVolume //
15 // //
16 // Description of parameters to position a 3-D geometry object //
17 // //
19 
20 #ifndef ROOT_TVolume
21 #define ROOT_TVolume
22 
23 #include "TObjectSet.h"
24 
25 #include "TNode.h"
26 
27 #include "TShape.h"
28 #include "TAttLine.h"
29 #include "TAttFill.h"
30 
31 class TBrowser;
32 class TVolumePosition;
33 class TRotMatrix;
34 class TList;
35 
36 class TVolume : public TObjectSet, public TAttLine, public TAttFill, public TAtt3D {
37 public:
38  enum ENodeSEEN {kBothVisible = 00, //'00'
39  kSonUnvisible = 1, //'01'
40  kThisUnvisible= 2, //'10'
41  kNoneVisible = kThisUnvisible | kSonUnvisible}; //'11'
42 protected:
43  TShape *fShape; //Pointer to the "master" shape definition
44  TList *fListOfShapes; //Pointer to the list of the shape definitions
45  TString fOption; //List of options if any
46  ENodeSEEN fVisibility; //Visibility flag 00 - everything visible,
47  // 10 - this unvisible, but sons are visible
48  // 01 - this visible but sons
49  // 11 - neither this nor its sons are visible
50 
51  virtual void Add(TDataSet *dataset);
52  virtual void Add(TVolumePosition *position);
53  virtual TVolumePosition *Add(TVolume *node, TVolumePosition *nodePosition);
54  virtual Int_t DistancetoNodePrimitive(Int_t px, Int_t py,TVolumePosition *position=0);
55  void SetPositionsList(TList *list=0){AddObject((TObject *)list);}
56  virtual void PaintNodePosition(Option_t *option="",TVolumePosition *postion=0);
57  friend class TPolyLineShape;
58 public:
59  TVolume();
60  TVolume(const char *name, const char *title, const char *shapename, Option_t *option="");
61  TVolume(const char *name, const char *title, TShape *shape, Option_t *option="");
62  TVolume(TNode &node);
63  virtual ~TVolume();
64  virtual TVolumePosition *Add(TVolume *node, Double_t x=0, Double_t y=0, Double_t z=0, TRotMatrix *matrix=0, UInt_t id=0, Option_t *option="");
65  virtual TVolumePosition *Add(TVolume *node, Double_t x, Double_t y, Double_t z, const char *matrixname, UInt_t id=0, Option_t *option="");
66  static Int_t MapStNode2GEANTVis(ENodeSEEN vis);
67  static Int_t MapGEANT2StNodeVis(Int_t vis);
68  virtual void Add(TShape *shape, Bool_t IsMaster=kFALSE);
69  virtual void Browse(TBrowser *b);
70  virtual TNode *CreateTNode(const TVolumePosition *position=0);
71  virtual void DeletePosition(TVolumePosition *position);
72  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
73  virtual void Draw(Option_t *depth="3"); // *MENU*
74  virtual void DrawOnly(Option_t *option="");
75  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
76  static TRotMatrix *GetIdentity();
77  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
78  const Option_t *GetOption() const { return fOption.Data();}
79  TShape *GetShape() const {return fShape;}
80  TList *GetListOfShapes() const {return fListOfShapes;}
81  virtual void GetLocalRange(Float_t *min, Float_t *max);
82  virtual ENodeSEEN GetVisibility() const {return fVisibility;}
83  virtual TList *GetListOfPositions() { return (TList *)(GetObject());}
84  virtual ULong_t Hash() const { return TObject::Hash();}
85  virtual void ImportShapeAttributes();
86  virtual Bool_t IsMarked() const;
87  virtual Bool_t Is3D() const {return kTRUE;}
88  virtual TList *Nodes() const { return GetList(); }
89  virtual void Paint(Option_t *option="");
90  virtual void PaintShape(Option_t *option="");
91  virtual void SetVisibility(ENodeSEEN vis=TVolume::kBothVisible); // *MENU*
92  virtual void Sizeof3D() const;
93 
94  ClassDef(TVolume,1) //Description of parameters to position a 3-D geometry object
95 };
96 
97 inline Bool_t TVolume::IsMarked() const { return TestBit(kMark); }
98 
99 #endif
virtual void DeletePosition(TVolumePosition *position)
Definition: TVolume.cxx:699
static Int_t MapGEANT2StNodeVis(Int_t vis)
Definition: TVolume.cxx:152
virtual TObject * AddObject(TObject *obj, Bool_t makeOwner=kTRUE)
Aliase for SetObject method.
Definition: TObjectSet.cxx:57
static Int_t MapStNode2GEANTVis(ENodeSEEN vis)
Definition: TVolume.cxx:142
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
forward the ExecuteEvent call to the decorated object
virtual void Paint(Option_t *opt)
to be documented
virtual void Draw(Option_t *depth="3")
Definition: TVolume.cxx:433
virtual void PaintShape(Option_t *option="")
Definition: TVolume.cxx:641
virtual void SetVisibility(ENodeSEEN vis=TVolume::kBothVisible)
Definition: TVolume.cxx:753
static TRotMatrix * GetIdentity()
Return a pointer the "identity" matrix.
Definition: TVolume.cxx:507
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
to be documented
Definition: TVolume.cxx:345
virtual void Sizeof3D() const
Return total X3D size of this shape with its attributes.
virtual void PaintNodePosition(Option_t *option="", TVolumePosition *postion=0)
Definition: TVolume.cxx:591
virtual void Browse(TBrowser *b)
to be documented
Definition: TVolume.cxx:324
virtual TNode * CreateTNode(const TVolumePosition *position=0)
Convert a TVolume object into a TNode.
Definition: TVolume.cxx:203
TVolume()
Definition: TVolume.cxx:75
virtual char * GetObjectInfo(Int_t px, Int_t py) const
to be documented
Definition: TVolume.cxx:531
virtual Int_t DistancetoNodePrimitive(Int_t px, Int_t py, TVolumePosition *position=0)
Definition: TVolume.cxx:359
virtual void GetLocalRange(Float_t *min, Float_t *max)
Definition: TVolume.cxx:727
virtual TObject * GetObject() const
The depricated method (left here for the sake of the backward compatibility)
Definition: TObjectSet.h:56