Logo ROOT   6.10/09
Reference Guide
TGeoAtt.h
Go to the documentation of this file.
1 // @(#)root/geom:$Id$
2 // Author: Andrei Gheata 01/11/01
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 #ifndef ROOT_TGeoAtt
13 #define ROOT_TGeoAtt
14 
15 #include "TObject.h"
16 
17 class TGeoAtt
18 {
19 public:
20  enum {
21  kBitMask = 0x00ffffff // bit mask
22  };
23 
25  kVisOverride = BIT(0), // volume's vis. attributes are overidden
26  kVisNone = BIT(1), // the volume/node is invisible, as well as daughters
27  kVisThis = BIT(2), // this volume/node is visible
28  kVisDaughters = BIT(3), // all leaves are visible
29  kVisOneLevel = BIT(4), // first level daughters are visible
30  kVisStreamed = BIT(5), // true if attributes have been streamed
31  kVisTouched = BIT(6), // true if attributes are changed after closing geom
32  kVisOnScreen = BIT(7), // true if volume is visible on screen
33  kVisContainers = BIT(12), // all containers visible
34  kVisOnly = BIT(13), // just this visible
35  kVisBranch = BIT(14), // only a given branch visible
36  kVisRaytrace = BIT(15) // raytracing flag
37  }; // visibility attributes
38 
40  kActOverride = BIT(8), // volume's activity attributes are overidden
41  kActNone = BIT(9), // the volume/node is ignored by tracking, as well as daughters
42  kActThis = BIT(10), // this volume/node is active for tracking
43  kActDaughters = BIT(11) // all leaves are active
44  }; // activity flags
45 
47  kUseBoundingBox = BIT(16), // use bounding box for tracking
48  kUseVoxels = BIT(17), // compute and use voxels
49  kUseGsord = BIT(18) // use slicing in G3 style
50  }; // tracking optimization attributes
54  }; // save primitive bits
55 protected :
56 // data members
57  UInt_t fGeoAtt; // option flags
58 public:
59  // constructors
60  TGeoAtt();
61  TGeoAtt(Option_t *vis_opt, Option_t *activity_opt="", Option_t *optimization_opt="");
62  // destructor
63  virtual ~TGeoAtt();
64  // methods
65  void SetAttBit(UInt_t f) {fGeoAtt |= f & kBitMask;}
66  void SetAttBit(UInt_t f, Bool_t set) {(set)?SetAttBit(f):ResetAttBit(f);};
67  void ResetAttBit(UInt_t f) {fGeoAtt &= ~(f & kBitMask);}
68  Bool_t TestAttBit(UInt_t f) const {return (Bool_t)((fGeoAtt & f) != 0);}
69 
71  void SetVisBranch();
72  virtual void SetVisContainers(Bool_t flag=kTRUE);
73  virtual void SetVisLeaves(Bool_t flag=kTRUE);
74  virtual void SetVisOnly(Bool_t flag=kTRUE);
75  virtual void SetVisibility(Bool_t vis=kTRUE);
76  void SetVisDaughters(Bool_t vis=kTRUE);
77  void SetVisStreamed(Bool_t vis=kTRUE);
78  void SetVisTouched(Bool_t vis=kTRUE);
79  void SetActivity(Bool_t flag=kTRUE) {SetAttBit(kActThis, flag);}
81 
82  void SetOptimization(Option_t *option);
83 
84 
85  Bool_t IsActive() const {return TestAttBit(kActThis);}
88  Bool_t IsVisible() const {return TestAttBit(kVisThis);}
93  Bool_t IsVisOnly() const {return TestAttBit(kVisOnly);}
94 
97 
98  ClassDef(TGeoAtt, 1) // class for visibility, activity and optimization attributes for volumes/nodes
99 };
100 
101 #endif
102 
Bool_t IsVisible() const
Definition: TGeoAtt.h:88
void ResetAttBit(UInt_t f)
Definition: TGeoAtt.h:67
Bool_t TestAttBit(UInt_t f) const
Definition: TGeoAtt.h:68
virtual void SetVisContainers(Bool_t flag=kTRUE)
Set branch type visibility.
Definition: TGeoAtt.cxx:77
Bool_t IsActive() const
Definition: TGeoAtt.h:85
const char Option_t
Definition: RtypesCore.h:62
Visualization and tracking attributes for volumes and nodes.
Definition: TGeoAtt.h:17
virtual void SetVisibility(Bool_t vis=kTRUE)
Set visibility for this object.
Definition: TGeoAtt.cxx:105
#define BIT(n)
Definition: Rtypes.h:75
void SetVisBranch()
Set branch type visibility.
Definition: TGeoAtt.cxx:67
bool Bool_t
Definition: RtypesCore.h:59
void SetAttBit(UInt_t f, Bool_t set)
Definition: TGeoAtt.h:66
void SetVisRaytrace(Bool_t flag=kTRUE)
Definition: TGeoAtt.h:70
#define ClassDef(name, id)
Definition: Rtypes.h:297
void SetVisStreamed(Bool_t vis=kTRUE)
Mark attributes as "streamed to file".
Definition: TGeoAtt.cxx:123
virtual void SetVisLeaves(Bool_t flag=kTRUE)
Set branch type visibility.
Definition: TGeoAtt.cxx:85
Bool_t IsVisLeaves() const
Definition: TGeoAtt.h:92
void SetActivity(Bool_t flag=kTRUE)
Definition: TGeoAtt.h:79
EGeoVisibilityAtt
Definition: TGeoAtt.h:24
Bool_t IsVisStreamed() const
Definition: TGeoAtt.h:95
virtual void SetVisOnly(Bool_t flag=kTRUE)
Set branch type visibility.
Definition: TGeoAtt.cxx:95
unsigned int UInt_t
Definition: RtypesCore.h:42
EGeoOptimizationAtt
Definition: TGeoAtt.h:46
Bool_t IsVisRaytrace() const
Definition: TGeoAtt.h:87
virtual ~TGeoAtt()
Destructor.
Definition: TGeoAtt.cxx:60
void SetOptimization(Option_t *option)
Set optimization flags.
Definition: TGeoAtt.cxx:139
EGeoActivityAtt
Definition: TGeoAtt.h:39
double f(double x)
void SetActiveDaughters(Bool_t flag=kTRUE)
Definition: TGeoAtt.h:80
EGeoSavePrimitiveAtt
Definition: TGeoAtt.h:51
Bool_t IsActiveDaughters() const
Definition: TGeoAtt.h:86
Bool_t IsVisContainers() const
Definition: TGeoAtt.h:91
void SetAttBit(UInt_t f)
Definition: TGeoAtt.h:65
Bool_t IsVisDaughters() const
Definition: TGeoAtt.h:89
Bool_t IsVisTouched() const
Definition: TGeoAtt.h:96
void SetVisDaughters(Bool_t vis=kTRUE)
Set visibility for the daughters.
Definition: TGeoAtt.cxx:114
Bool_t IsVisOnly() const
Definition: TGeoAtt.h:93
UInt_t fGeoAtt
Definition: TGeoAtt.h:57
void SetVisTouched(Bool_t vis=kTRUE)
Mark visualization attributes as "modified".
Definition: TGeoAtt.cxx:131
Bool_t IsVisBranch() const
Definition: TGeoAtt.h:90
const Bool_t kTRUE
Definition: RtypesCore.h:91
TGeoAtt()
Default constructor.
Definition: TGeoAtt.cxx:31