TGeoAtt.cxx

Go to the documentation of this file.
00001 // @(#)root/geom:$Id: TGeoAtt.cxx 21494 2007-12-19 15:50:40Z brun $
00002 // Author: Andrei Gheata   01/11/01
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 //_____________________________________________________________________________
00013 //   TGeoAtt - visualization and tracking attributes for volumes and nodes
00014 // ==========
00015 // The TGeoAtt class is a utility for volume/node visibility and tracking 
00016 // activity. By default the attributes are set to visible/active
00017 //_____________________________________________________________________________
00018 
00019 #include "TGeoManager.h"
00020 #include "TGeoAtt.h"
00021 
00022 ClassImp(TGeoAtt)
00023 
00024 //-----------------------------------------------------------------------------
00025 TGeoAtt::TGeoAtt()
00026 {
00027 // Default constructor
00028    fGeoAtt = 0;
00029    if (!gGeoManager) return;
00030    SetActivity(kTRUE);
00031    SetActiveDaughters(kTRUE);
00032    SetVisibility(kTRUE);
00033    SetVisDaughters(kTRUE);
00034    SetVisStreamed(kFALSE);
00035    SetVisTouched(kFALSE);
00036    SetVisLeaves();
00037 }
00038 //-----------------------------------------------------------------------------
00039 TGeoAtt::TGeoAtt(Option_t * /*vis_opt*/, Option_t * /*activity_opt*/, Option_t * /*optimization_opt*/)
00040 {
00041 // Constructor
00042    fGeoAtt = 0;
00043    SetActivity(kTRUE);
00044    SetActiveDaughters(kTRUE);
00045    SetVisibility(kTRUE);
00046    SetVisDaughters(kTRUE);
00047    SetVisStreamed(kFALSE);
00048    SetVisTouched(kFALSE);
00049    SetVisLeaves();
00050 }
00051 //-----------------------------------------------------------------------------
00052 TGeoAtt::~TGeoAtt()
00053 {
00054 // Destructor
00055 }
00056 
00057 //-----------------------------------------------------------------------------
00058 void TGeoAtt::SetVisBranch()
00059 {
00060 // Set branch type visibility.
00061    SetAttBit(kVisBranch, kTRUE);
00062    SetAttBit(kVisContainers, kFALSE);
00063    SetAttBit(kVisOnly, kFALSE);
00064 }
00065 
00066 //-----------------------------------------------------------------------------
00067 void TGeoAtt::SetVisContainers(Bool_t flag)
00068 {
00069 // Set branch type visibility.
00070    SetVisLeaves(!flag);   
00071 }
00072 
00073 //-----------------------------------------------------------------------------
00074 void TGeoAtt::SetVisLeaves(Bool_t flag)
00075 {
00076 // Set branch type visibility.
00077    SetAttBit(kVisBranch, kFALSE);
00078    SetAttBit(kVisContainers, !flag);
00079    SetAttBit(kVisOnly, kFALSE);
00080 }
00081 
00082 //-----------------------------------------------------------------------------
00083 void TGeoAtt::SetVisOnly(Bool_t flag)
00084 {
00085 // Set branch type visibility.
00086    SetAttBit(kVisBranch, kFALSE);
00087    SetAttBit(kVisContainers, kFALSE);
00088    SetAttBit(kVisOnly, flag);
00089 }
00090 
00091 //-----------------------------------------------------------------------------
00092 void TGeoAtt::SetVisibility(Bool_t vis)
00093 {
00094 // Set visibility for this object
00095    if (vis)  SetAttBit(kVisThis);
00096    else      ResetAttBit(kVisThis);
00097    if (gGeoManager && gGeoManager->IsClosed()) SetVisTouched(kTRUE);
00098 }
00099 //-----------------------------------------------------------------------------
00100 void TGeoAtt::SetVisDaughters(Bool_t vis)
00101 {
00102 // Set visibility for the daughters.
00103    if (vis)  SetAttBit(kVisDaughters);
00104    else      ResetAttBit(kVisDaughters);
00105    if (gGeoManager && gGeoManager->IsClosed()) SetVisTouched(kTRUE);
00106 }
00107 //-----------------------------------------------------------------------------
00108 void TGeoAtt::SetVisStreamed(Bool_t vis)
00109 {
00110 // Mark attributes as "streamed to file".
00111    if (vis)  SetAttBit(kVisStreamed);
00112    else      ResetAttBit(kVisStreamed);
00113 }
00114 //-----------------------------------------------------------------------------
00115 void TGeoAtt::SetVisTouched(Bool_t vis)
00116 {
00117 // Mark visualization attributes as "modified".
00118    if (vis)  SetAttBit(kVisTouched);
00119    else      ResetAttBit(kVisTouched);
00120 }
00121 //-----------------------------------------------------------------------------
00122 void TGeoAtt::SetOptimization(Option_t * /*option*/)
00123 {
00124 // Set optimization flags. 
00125 }
00126 

Generated on Tue Jul 5 14:12:54 2011 for ROOT_528-00b_version by  doxygen 1.5.1