Logo ROOT   6.08/07
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 #ifndef ROOT_TShape
28 #include "TShape.h"
29 #endif
30 #ifndef ROOT_TAttLine
31 #include "TAttLine.h"
32 #endif
33 #ifndef ROOT_TAttFill
34 #include "TAttFill.h"
35 #endif
36 
37 class TBrowser;
38 class TVolumePosition;
39 class TRotMatrix;
40 class TList;
41 
42 class TVolume : public TObjectSet, public TAttLine, public TAttFill, public TAtt3D {
43 public:
44  enum ENodeSEEN {kBothVisible = 00, //'00'
45  kSonUnvisible = 1, //'01'
46  kThisUnvisible= 2, //'10'
48 protected:
49  TShape *fShape; //Pointer to the "master" shape definition
50  TList *fListOfShapes; //Pointer to the list of the shape definitions
51  TString fOption; //List of options if any
52  ENodeSEEN fVisibility; //Visibility flag 00 - everything visible,
53  // 10 - this unvisible, but sons are visible
54  // 01 - this visible but sons
55  // 11 - neither this nor its sons are visible
56 
57  virtual void Add(TDataSet *dataset);
58  virtual void Add(TVolumePosition *position);
59  virtual TVolumePosition *Add(TVolume *node, TVolumePosition *nodePosition);
60  virtual Int_t DistancetoNodePrimitive(Int_t px, Int_t py,TVolumePosition *position=0);
61  void SetPositionsList(TList *list=0){AddObject((TObject *)list);}
62  virtual void PaintNodePosition(Option_t *option="",TVolumePosition *postion=0);
63  friend class TPolyLineShape;
64 public:
65  TVolume();
66  TVolume(const char *name, const char *title, const char *shapename, Option_t *option="");
67  TVolume(const char *name, const char *title, TShape *shape, Option_t *option="");
68  TVolume(TNode &node);
69  virtual ~TVolume();
70  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="");
71  virtual TVolumePosition *Add(TVolume *node, Double_t x, Double_t y, Double_t z, const char *matrixname, UInt_t id=0, Option_t *option="");
73  static Int_t MapGEANT2StNodeVis(Int_t vis);
74  virtual void Add(TShape *shape, Bool_t IsMaster=kFALSE);
75  virtual void Browse(TBrowser *b);
76  virtual TNode *CreateTNode(const TVolumePosition *position=0);
77  virtual void DeletePosition(TVolumePosition *position);
78  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
79  virtual void Draw(Option_t *depth="3"); // *MENU*
80  virtual void DrawOnly(Option_t *option="");
81  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
82  static TRotMatrix *GetIdentity();
83  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
84  const Option_t *GetOption() const { return fOption.Data();}
85  TShape *GetShape() const {return fShape;}
86  TList *GetListOfShapes() const {return fListOfShapes;}
87  virtual void GetLocalRange(Float_t *min, Float_t *max);
88  virtual ENodeSEEN GetVisibility() const {return fVisibility;}
89  virtual TList *GetListOfPositions() { return (TList *)(GetObject());}
90  virtual ULong_t Hash() const { return TObject::Hash();}
91  virtual void ImportShapeAttributes();
92  virtual Bool_t IsMarked() const;
93  virtual Bool_t Is3D() const {return kTRUE;}
94  virtual TList *Nodes() const { return GetList(); }
95  virtual void Paint(Option_t *option="");
96  virtual void PaintShape(Option_t *option="");
97  virtual void SetVisibility(ENodeSEEN vis=TVolume::kBothVisible); // *MENU*
98  virtual void Sizeof3D() const;
99 
100  ClassDef(TVolume,1) //Description of parameters to position a 3-D geometry object
101 };
102 
103 inline void TVolume::Add(TDataSet *dataset){ TDataSet::Add(dataset);}
104 inline Bool_t TVolume::IsMarked() const { return TestBit(kMark); }
105 
106 #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:690
virtual void Add(TDataSet *dataset)
Definition: TDataSet.h:150
virtual ENodeSEEN GetVisibility() const
Definition: TVolume.h:88
virtual ULong_t Hash() const
Return hash value for this object.
Definition: TObject.cxx:478
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:44
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:157
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:21
TNode description.
Definition: TNode.h:43
TList * fListOfShapes
Definition: TVolume.h:50
ENodeSEEN fVisibility
Definition: TVolume.h:52
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual void Draw(Option_t *depth="3")
Default Draw method for all objects.
Definition: TVolume.cxx:424
TList * GetListOfShapes() const
Definition: TVolume.h:86
virtual void PaintShape(Option_t *option="")
Paint shape of the volume To be called from the TObject::Paint method only.
Definition: TVolume.cxx:632
virtual ULong_t Hash() const
Return hash value for this object.
Definition: TVolume.h:90
Fill Area Attributes class.
Definition: TAttFill.h:24
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:565
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void Add(TDataSet *dataset)
Definition: TVolume.h:103
virtual void SetVisibility(ENodeSEEN vis=TVolume::kBothVisible)
Set visibility for this volume and its sons.
Definition: TVolume.cxx:744
virtual void ImportShapeAttributes()
Definition: TVolume.cxx:545
const Option_t * GetOption() const
Definition: TVolume.h:84
virtual TList * GetListOfPositions()
Definition: TVolume.h:89
TShape * fShape
Definition: TVolume.h:49
static TRotMatrix * GetIdentity()
Return a pointer the "identity" matrix.
Definition: TVolume.cxx:498
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
to be documented
Definition: TVolume.cxx:336
A doubly linked list.
Definition: TList.h:47
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
virtual Bool_t IsMarked() const
Definition: TVolume.h:104
virtual ~TVolume()
Definition: TVolume.cxx:239
This is the base class for all geometry shapes.
Definition: TShape.h:47
Manages a detector rotation matrix.
Definition: TRotMatrix.h:30
virtual void PaintNodePosition(Option_t *option="", TVolumePosition *postion=0)
Definition: TVolume.cxx:582
virtual Bool_t Is3D() const
Definition: TVolume.h:93
TList * GetList() const
Definition: TDataSet.h:106
virtual void Browse(TBrowser *b)
to be documented
Definition: TVolume.cxx:315
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:486
virtual TList * Nodes() const
Definition: TVolume.h:94
virtual void DrawOnly(Option_t *option="")
Definition: TVolume.cxx:473
virtual char * GetObjectInfo(Int_t px, Int_t py) const
to be documented
Definition: TVolume.cxx:522
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:752
Double_t y[n]
Definition: legend1.C:17
TString fOption
Definition: TVolume.h:51
void SetPositionsList(TList *list=0)
Definition: TVolume.h:61
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:350
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:85
virtual void GetLocalRange(Float_t *min, Float_t *max)
GetRange.
Definition: TVolume.cxx:718
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: Rtypes.h:91
Line Attributes class.
Definition: TAttLine.h:24
char name[80]
Definition: TGX11.cxx:109
const char * Data() const
Definition: TString.h:349