CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/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.88 2010/11/21 11:18:13 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 {
00039 }
00040 
00041 
00042 FWEveLegoView::~FWEveLegoView()
00043 {
00044 }
00045 
00046 void
00047 FWEveLegoView::setContext(const fireworks::Context& ctx)
00048 {  
00049    FWLegoViewBase::setContext(ctx); 
00050 
00051    // add calorimeter boundaries
00052    m_boundaries = new TEveStraightLineSet("m_boundaries");
00053    m_boundaries->SetPickable(kFALSE);
00054    m_boundaries->SetLineWidth(2);
00055    m_boundaries->SetLineStyle(7);
00056    m_boundaries->AddLine(-1.479,-3.1416,0.001,-1.479,3.1416,0.001);
00057    m_boundaries->AddLine(1.479,-3.1416,0.001,1.479,3.1416,0.001);
00058    m_boundaries->AddLine(-2.964,-3.1416,0.001,-2.964,3.1416,0.001);
00059    m_boundaries->AddLine(2.964,-3.1416,0.001,2.964,3.1416,0.001);
00060    m_boundaries->SetLineColor(ctx.colorManager()->isColorSetDark() ? kGray+2 : kGray+1);
00061    m_lego->AddElement(m_boundaries);
00062 }
00063 
00064 void 
00065 FWEveLegoView::setBackgroundColor(Color_t c)
00066 {
00067    m_boundaries->SetLineColor(context().colorManager()->isColorSetDark() ? kGray+2 : kGray+1);
00068    FWEveView::setBackgroundColor(c);
00069 }