Logo ROOT   6.14/05
Reference Guide
TVolume.h
Go to the documentation of this file.
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 
12 //////////////////////////////////////////////////////////////////////////
13 // //
14 // TVolume //
15 // //
16 // Description of parameters to position a 3-D geometry object //
17 // //
18 //////////////////////////////////////////////////////////////////////////
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'
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="");
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 void TVolume::Add(TDataSet *dataset){ TDataSet::Add(dataset);}
98 inline Bool_t TVolume::IsMarked() const { return TestBit(kMark); }
99 
100 #endif
virtual void DeletePosition(TVolumePosition *position)
DeletePosition deletes the position of the TVolume *node from this TVolume and removes that volume fr...
Definition: TVolume.cxx:693
virtual void Add(TDataSet *dataset)
Definition: TDataSet.h:150
virtual ENodeSEEN GetVisibility() const
Definition: TVolume.h:82
virtual ULong_t Hash() const
Return hash value for this object.
Definition: TObject.cxx:433
static Int_t MapGEANT2StNodeVis(Int_t vis)
ENodeSEEN TVolume::MapGEANT2StNodeVis(Int_t vis) Maps the value of GEANT 3.21 "volume attributes" to ...
Definition: TVolume.cxx:146
virtual TObject * AddObject(TObject *obj, Bool_t makeOwner=kTRUE)
Aliase for SetObject method.
Definition: TObjectSet.cxx:57
float Float_t
Definition: RtypesCore.h:53
static Int_t MapStNode2GEANTVis(ENodeSEEN vis)
ENodeSEEN Visibility flag 00 - everything visible, 10 - this invisible, but sons are visible 01 - thi...
Definition: TVolume.cxx:136
const char Option_t
Definition: RtypesCore.h:62
ENodeSEEN
Definition: TVolume.h:38
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
TNode description.
Definition: TNode.h:33
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
TList * fListOfShapes
Definition: TVolume.h:44
ENodeSEEN fVisibility
Definition: TVolume.h:46
Basic string class.
Definition: TString.h:131
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void Draw(Option_t *depth="3")
Default Draw method for all objects.
Definition: TVolume.cxx:427
TList * GetListOfShapes() const
Definition: TVolume.h:80
virtual void PaintShape(Option_t *option="")
Paint shape of the volume To be called from the TObject::Paint method only.
Definition: TVolume.cxx:635
virtual ULong_t Hash() const
Return hash value for this object.
Definition: TVolume.h:84
Fill Area Attributes class.
Definition: TAttFill.h:19
Double_t x[n]
Definition: legend1.C:17
virtual void Paint(Option_t *option="")
This method must be overridden if a class wants to paint itself.
Definition: TVolume.cxx:568
#define ClassDef(name, id)
Definition: Rtypes.h:320
virtual void Add(TDataSet *dataset)
Definition: TVolume.h:97
virtual void SetVisibility(ENodeSEEN vis=TVolume::kBothVisible)
Set visibility for this volume and its sons.
Definition: TVolume.cxx:747
virtual void ImportShapeAttributes()
Definition: TVolume.cxx:548
const Option_t * GetOption() const
Definition: TVolume.h:78
virtual TList * GetListOfPositions()
Definition: TVolume.h:83
TShape * fShape
Definition: TVolume.h:43
static TRotMatrix * GetIdentity()
Return a pointer the "identity" matrix.
Definition: TVolume.cxx:501
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
to be documented
Definition: TVolume.cxx:339
A doubly linked list.
Definition: TList.h:44
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
virtual Bool_t IsMarked() const
Definition: TVolume.h:98
virtual ~TVolume()
Definition: TVolume.cxx:239
This is the base class for all geometry shapes.
Definition: TShape.h:35
Manages a detector rotation matrix.
Definition: TRotMatrix.h:28
virtual void PaintNodePosition(Option_t *option="", TVolumePosition *postion=0)
Definition: TVolume.cxx:585
virtual Bool_t Is3D() const
Definition: TVolume.h:87
TList * GetList() const
Definition: TDataSet.h:106
virtual void Browse(TBrowser *b)
to be documented
Definition: TVolume.cxx:318
virtual TNode * CreateTNode(const TVolumePosition *position=0)
Convert a TVolume object into a TNode.
Definition: TVolume.cxx:197
unsigned int UInt_t
Definition: RtypesCore.h:42
TVolume()
TVolume description.
Definition: TVolume.cxx:69
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to an event at (px,py).
Definition: TVolume.cxx:489
virtual TList * Nodes() const
Definition: TVolume.h:88
const Bool_t kFALSE
Definition: RtypesCore.h:88
virtual void DrawOnly(Option_t *option="")
Definition: TVolume.cxx:476
virtual char * GetObjectInfo(Int_t px, Int_t py) const
to be documented
Definition: TVolume.cxx:525
double Double_t
Definition: RtypesCore.h:55
unsigned long ULong_t
Definition: RtypesCore.h:51
virtual void Sizeof3D() const
Set total size of this 3D object (used by X3D interface).
Definition: TVolume.cxx:755
Double_t y[n]
Definition: legend1.C:17
TString fOption
Definition: TVolume.h:45
void SetPositionsList(TList *list=0)
Definition: TVolume.h:55
virtual Int_t DistancetoNodePrimitive(Int_t px, Int_t py, TVolumePosition *position=0)
Compute distance from point px,py to a TVolumeView.
Definition: TVolume.cxx:353
virtual TObject * GetObject() const
The depricated method (left here for the sake of the backward compatibility)
Definition: TObjectSet.h:56
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
TShape * GetShape() const
Definition: TVolume.h:79
virtual void GetLocalRange(Float_t *min, Float_t *max)
GetRange.
Definition: TVolume.cxx:721
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
const Bool_t kTRUE
Definition: RtypesCore.h:87
Line Attributes class.
Definition: TAttLine.h:18
char name[80]
Definition: TGX11.cxx:109
const char * Data() const
Definition: TString.h:364