CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/Fireworks/Core/src/FWEveLegoView.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     Core
00004 // Class  :     FWEveLegoView
00005 // 
00006 // Implementation:
00007 //     [Notes on implementation]
00008 //
00009 // Original Author:  
00010 //         Created:  Mon May 31 13:09:53 CEST 2010
00011 // $Id: FWEveLegoView.cc,v 1.89 2011/11/18 02:57:07 amraktad Exp $
00012 //
00013 
00014 // system include files
00015 #include "TEveManager.h"
00016 
00017 // user include files
00018 #include "TEveCalo.h"
00019 #include "TEveStraightLineSet.h"
00020 #include "Fireworks/Core/interface/FWEveLegoView.h"
00021 #include "Fireworks/Core/interface/Context.h"
00022 #include "Fireworks/Core/interface/FWColorManager.h"
00023 #include "Fireworks/Core/interface/FWViewEnergyScale.h"
00024 #include "Fireworks/Core/interface/FWViewContext.h"
00025 #include "Fireworks/Core/interface/FWGUIManager.h"
00026 
00027 #include "Fireworks/Core/interface/FWViewEnergyScale.h"
00028 #include "Fireworks/Core/interface/fwLog.h"
00029 
00030 
00031 
00032 
00033 //
00034 // constructors and destructor
00035 //
00036 FWEveLegoView::FWEveLegoView(TEveWindowSlot* slot, FWViewType::EType typeId):
00037   FWLegoViewBase(slot, typeId),
00038   m_boundaries(0)
00039 {
00040 }
00041 
00042 
00043 FWEveLegoView::~FWEveLegoView()
00044 {
00045 }
00046 
00047 void
00048 FWEveLegoView::setContext(const fireworks::Context& ctx)
00049 {  
00050    FWLegoViewBase::setContext(ctx); 
00051 
00052    // add calorimeter boundaries
00053    m_boundaries = new TEveStraightLineSet("m_boundaries");
00054    m_boundaries->SetPickable(kFALSE);
00055    m_boundaries->SetLineWidth(2);
00056    m_boundaries->SetLineStyle(7);
00057    m_boundaries->AddLine(-1.479,-3.1416,0.001,-1.479,3.1416,0.001);
00058    m_boundaries->AddLine(1.479,-3.1416,0.001,1.479,3.1416,0.001);
00059    m_boundaries->AddLine(-2.964,-3.1416,0.001,-2.964,3.1416,0.001);
00060    m_boundaries->AddLine(2.964,-3.1416,0.001,2.964,3.1416,0.001);
00061    m_boundaries->SetLineColor(ctx.colorManager()->isColorSetDark() ? kGray+2 : kGray+1);
00062    m_lego->AddElement(m_boundaries);
00063 }
00064 
00065 void 
00066 FWEveLegoView::setBackgroundColor(Color_t c)
00067 {
00068    m_boundaries->SetLineColor(context().colorManager()->isColorSetDark() ? kGray+2 : kGray+1);
00069    FWEveView::setBackgroundColor(c);
00070 }