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