Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGeoAtt.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/geom:$Id$
0002 // Author: Andrei Gheata   01/11/01
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGeoAtt
0013 #define ROOT_TGeoAtt
0014 
0015 #include "Rtypes.h"
0016 
0017 class TGeoAtt {
0018 public:
0019    enum {
0020       kBitMask = 0x00ffffff // bit mask
0021    };
0022 
0023    enum EGeoVisibilityAtt {
0024       kVisOverride = BIT(0),    // volume's vis. attributes are overridden
0025       kVisNone = BIT(1),        // the volume/node is invisible, as well as daughters
0026       kVisThis = BIT(2),        // this volume/node is visible
0027       kVisDaughters = BIT(3),   // all leaves are visible
0028       kVisOneLevel = BIT(4),    // first level daughters are visible
0029       kVisStreamed = BIT(5),    // true if attributes have been streamed
0030       kVisTouched = BIT(6),     // true if attributes are changed after closing geom
0031       kVisOnScreen = BIT(7),    // true if volume is visible on screen
0032       kVisContainers = BIT(12), // all containers visible
0033       kVisOnly = BIT(13),       // just this visible
0034       kVisBranch = BIT(14),     // only a given branch visible
0035       kVisRaytrace = BIT(15)    // raytracing flag
0036    };                           // visibility attributes
0037 
0038    enum EGeoActivityAtt {
0039       kActOverride = BIT(8),  // volume's activity attributes are overridden
0040       kActNone = BIT(9),      // the volume/node is ignored by tracking, as well as daughters
0041       kActThis = BIT(10),     // this volume/node is active for tracking
0042       kActDaughters = BIT(11) // all leaves are active
0043    };                         // activity flags
0044 
0045    enum EGeoOptimizationAtt {
0046       kUseBoundingBox = BIT(16), // use bounding box for tracking
0047       kUseVoxels = BIT(17),      // compute and use voxels
0048       kUseGsord = BIT(18)        // use slicing in G3 style
0049    };                            // tracking optimization attributes
0050    enum EGeoSavePrimitiveAtt { kSavePrimitiveAtt = BIT(19), kSaveNodesAtt = BIT(20) }; // save primitive bits
0051 protected:
0052    // data members
0053    UInt_t fGeoAtt; // option flags
0054 public:
0055    // constructors
0056    TGeoAtt();
0057    TGeoAtt(Option_t *vis_opt, Option_t *activity_opt = "", Option_t *optimization_opt = "");
0058    // destructor
0059    virtual ~TGeoAtt();
0060    // methods
0061    void SetAttBit(UInt_t f) { fGeoAtt |= f & kBitMask; }
0062    void SetAttBit(UInt_t f, Bool_t set) { (set) ? SetAttBit(f) : ResetAttBit(f); };
0063    void ResetAttBit(UInt_t f) { fGeoAtt &= ~(f & kBitMask); }
0064    Bool_t TestAttBit(UInt_t f) const { return (Bool_t)((fGeoAtt & f) != 0); }
0065 
0066    void SetVisRaytrace(Bool_t flag = kTRUE) { SetAttBit(kVisRaytrace, flag); }
0067    void SetVisBranch();
0068    virtual void SetVisContainers(Bool_t flag = kTRUE);
0069    virtual void SetVisLeaves(Bool_t flag = kTRUE);
0070    virtual void SetVisOnly(Bool_t flag = kTRUE);
0071    virtual void SetVisibility(Bool_t vis = kTRUE);
0072    void SetVisDaughters(Bool_t vis = kTRUE);
0073    void SetVisStreamed(Bool_t vis = kTRUE);
0074    void SetVisTouched(Bool_t vis = kTRUE);
0075    void SetActivity(Bool_t flag = kTRUE) { SetAttBit(kActThis, flag); }
0076    void SetActiveDaughters(Bool_t flag = kTRUE) { SetAttBit(kActDaughters, flag); }
0077 
0078    void SetOptimization(Option_t *option);
0079 
0080    Bool_t IsActive() const { return TestAttBit(kActThis); }
0081    Bool_t IsActiveDaughters() const { return TestAttBit(kActDaughters); }
0082    Bool_t IsVisRaytrace() const { return TestAttBit(kVisRaytrace); }
0083    Bool_t IsVisible() const { return TestAttBit(kVisThis); }
0084    Bool_t IsVisDaughters() const { return TestAttBit(kVisDaughters); }
0085    Bool_t IsVisBranch() const { return TestAttBit(kVisBranch); }
0086    Bool_t IsVisContainers() const { return TestAttBit(kVisContainers); }
0087    Bool_t IsVisLeaves() const { return !TestAttBit(kVisContainers | kVisOnly | kVisBranch); }
0088    Bool_t IsVisOnly() const { return TestAttBit(kVisOnly); }
0089 
0090    Bool_t IsVisStreamed() const { return TestAttBit(kVisStreamed); }
0091    Bool_t IsVisTouched() const { return TestAttBit(kVisTouched); }
0092 
0093    ClassDef(TGeoAtt, 1) // class for visibility, activity and optimization attributes for volumes/nodes
0094 };
0095 
0096 #endif