Logo ROOT   6.16/01
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
31class TBrowser;
32class TVolumePosition;
33class TRotMatrix;
34class TList;
35
36class TVolume : public TObjectSet, public TAttLine, public TAttFill, public TAtt3D {
37public:
38 enum ENodeSEEN {kBothVisible = 00, //'00'
39 kSonUnvisible = 1, //'01'
40 kThisUnvisible= 2, //'10'
42protected:
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;
58public:
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;}
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
97inline Bool_t TVolume::IsMarked() const { return TestBit(kMark); }
98
99#endif
#define b(i)
Definition: RSha256.hxx:100
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
unsigned long ULong_t
Definition: RtypesCore.h:51
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
Fill Area Attributes class.
Definition: TAttFill.h:19
Line Attributes class.
Definition: TAttLine.h:18
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
TList * GetList() const
Definition: TDataSet.h:106
@ kMark
Definition: TDataSet.h:75
A doubly linked list.
Definition: TList.h:44
TNode description.
Definition: TNode.h:33
virtual TObject * AddObject(TObject *obj, Bool_t makeOwner=kTRUE)
Aliase for SetObject method.
Definition: TObjectSet.cxx:57
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
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
virtual ULong_t Hash() const
Return hash value for this object.
Definition: TObject.cxx:433
Manages a detector rotation matrix.
Definition: TRotMatrix.h:28
This is the base class for all geometry shapes.
Definition: TShape.h:35
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364
virtual void Draw(Option_t *depth="3")
Default Draw method for all objects.
Definition: TVolume.cxx:433
virtual void Browse(TBrowser *b)
to be documented
Definition: TVolume.cxx:324
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:152
virtual void Sizeof3D() const
Set total size of this 3D object (used by X3D interface).
Definition: TVolume.cxx:761
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
to be documented
Definition: TVolume.cxx:345
virtual void Add(TDataSet *dataset)
Definition: TVolume.cxx:49
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:359
virtual ~TVolume()
Definition: TVolume.cxx:245
virtual void PaintNodePosition(Option_t *option="", TVolumePosition *postion=0)
Definition: TVolume.cxx:591
virtual TNode * CreateTNode(const TVolumePosition *position=0)
Convert a TVolume object into a TNode.
Definition: TVolume.cxx:203
TList * GetListOfShapes() const
Definition: TVolume.h:80
virtual void Paint(Option_t *option="")
This method must be overridden if a class wants to paint itself.
Definition: TVolume.cxx:574
virtual void DeletePosition(TVolumePosition *position)
DeletePosition deletes the position of the TVolume *node from this TVolume and removes that volume fr...
Definition: TVolume.cxx:699
virtual Bool_t IsMarked() const
Definition: TVolume.h:97
virtual ULong_t Hash() const
Return hash value for this object.
Definition: TVolume.h:84
virtual Bool_t Is3D() const
Definition: TVolume.h:87
virtual void DrawOnly(Option_t *option="")
Definition: TVolume.cxx:482
virtual char * GetObjectInfo(Int_t px, Int_t py) const
to be documented
Definition: TVolume.cxx:531
ENodeSEEN
Definition: TVolume.h:38
@ kNoneVisible
Definition: TVolume.h:41
@ kThisUnvisible
Definition: TVolume.h:40
@ kBothVisible
Definition: TVolume.h:38
@ kSonUnvisible
Definition: TVolume.h:39
TShape * fShape
Definition: TVolume.h:43
ENodeSEEN fVisibility
Definition: TVolume.h:46
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to an event at (px,py).
Definition: TVolume.cxx:495
TShape * GetShape() const
Definition: TVolume.h:79
void SetPositionsList(TList *list=0)
Definition: TVolume.h:55
const Option_t * GetOption() const
Definition: TVolume.h:78
virtual void GetLocalRange(Float_t *min, Float_t *max)
GetRange.
Definition: TVolume.cxx:727
virtual void PaintShape(Option_t *option="")
Paint shape of the volume To be called from the TObject::Paint method only.
Definition: TVolume.cxx:641
virtual TList * GetListOfPositions()
Definition: TVolume.h:83
virtual void ImportShapeAttributes()
Definition: TVolume.cxx:554
TVolume()
TVolume description.
Definition: TVolume.cxx:75
TList * fListOfShapes
Definition: TVolume.h:44
virtual ENodeSEEN GetVisibility() const
Definition: TVolume.h:82
static Int_t MapStNode2GEANTVis(ENodeSEEN vis)
ENodeSEEN Visibility flag 00 - everything visible, 10 - this invisible, but sons are visible 01 - thi...
Definition: TVolume.cxx:142
TString fOption
Definition: TVolume.h:45
static TRotMatrix * GetIdentity()
Return a pointer the "identity" matrix.
Definition: TVolume.cxx:507
virtual void SetVisibility(ENodeSEEN vis=TVolume::kBothVisible)
Set visibility for this volume and its sons.
Definition: TVolume.cxx:753
virtual TList * Nodes() const
Definition: TVolume.h:88
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17