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