Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:27:10

0001 // -*- C++ -*-
0002 //
0003 // Package:     Core
0004 // Class  :     FWEveLegoView
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:
0010 //         Created:  Mon May 31 13:09:53 CEST 2010
0011 //
0012 
0013 // system include files
0014 #include "TEveManager.h"
0015 
0016 // user include files
0017 #include "TEveCalo.h"
0018 #include "TEveStraightLineSet.h"
0019 #include "Fireworks/Core/interface/FWEveLegoView.h"
0020 #include "Fireworks/Core/interface/Context.h"
0021 #include "Fireworks/Core/interface/FWColorManager.h"
0022 #include "Fireworks/Core/interface/FWViewEnergyScale.h"
0023 #include "Fireworks/Core/interface/FWViewContext.h"
0024 #include "Fireworks/Core/interface/FWGUIManager.h"
0025 
0026 #include "Fireworks/Core/interface/FWViewEnergyScale.h"
0027 #include "Fireworks/Core/interface/fwLog.h"
0028 
0029 //
0030 // constructors and destructor
0031 //
0032 FWEveLegoView::FWEveLegoView(TEveWindowSlot* slot, FWViewType::EType typeId)
0033     : FWLegoViewBase(slot, typeId), m_boundaries(nullptr) {}
0034 
0035 FWEveLegoView::~FWEveLegoView() {}
0036 
0037 void FWEveLegoView::setContext(const fireworks::Context& ctx) {
0038   FWLegoViewBase::setContext(ctx);
0039 
0040   // add calorimeter boundaries
0041   m_boundaries = new TEveStraightLineSet("m_boundaries");
0042   m_boundaries->SetPickable(kFALSE);
0043   m_boundaries->SetLineWidth(2);
0044   m_boundaries->SetLineStyle(7);
0045   m_boundaries->AddLine(-1.479, -3.1416, 0.001, -1.479, 3.1416, 0.001);
0046   m_boundaries->AddLine(1.479, -3.1416, 0.001, 1.479, 3.1416, 0.001);
0047   m_boundaries->AddLine(-2.964, -3.1416, 0.001, -2.964, 3.1416, 0.001);
0048   m_boundaries->AddLine(2.964, -3.1416, 0.001, 2.964, 3.1416, 0.001);
0049   m_boundaries->SetLineColor(ctx.colorManager()->isColorSetDark() ? kGray + 2 : kGray + 1);
0050   m_lego->AddElement(m_boundaries);
0051 }
0052 
0053 void FWEveLegoView::setBackgroundColor(Color_t c) {
0054   m_boundaries->SetLineColor(context().colorManager()->isColorSetDark() ? kGray + 2 : kGray + 1);
0055   FWEveView::setBackgroundColor(c);
0056 }