CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/Fireworks/Core/src/FW3DView.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     cmsShow36
00004 // Class  :     FW3DView
00005 // 
00006 // Implementation:
00007 //     [Notes on implementation]
00008 //
00009 // Original Author:  
00010 //         Created:  Wed Apr  7 14:40:47 CEST 2010
00011 // $Id: FW3DView.cc,v 1.54 2011/01/17 14:11:43 amraktad Exp $
00012 //
00013 
00014 // system include files
00015 #include <boost/bind.hpp>
00016 
00017 // user include files
00018 #include "TGLViewer.h"
00019 #include "TGLScenePad.h"
00020 #include "TEveCalo.h"
00021 #include "TEveScene.h"
00022 
00023 #include "Fireworks/Core/interface/FW3DView.h"
00024 #include "Fireworks/Core/interface/Context.h"
00025 #include "Fireworks/Core/interface/FWViewContext.h"
00026 #include "Fireworks/Core/interface/CmsShowViewPopup.h"
00027 #include "Fireworks/Core/interface/FWViewEnergyScale.h"
00028 
00029 //
00030 // constants, enums and typedefs
00031 //
00032 
00033 //
00034 // static data member definitions
00035 //
00036 
00037 //
00038 // constructors and destructor
00039 //
00040 FW3DView::FW3DView(TEveWindowSlot* slot, FWViewType::EType typeId):
00041    FW3DViewBase(slot, typeId),
00042    m_calo(0)
00043 {
00044    viewerGL()->CurrentCamera().SetFixDefCenter(kTRUE);  
00045 }
00046 
00047 FW3DView::~FW3DView()
00048 {
00049    m_calo->Destroy();
00050 }
00051 
00052 
00053 TEveCaloViz*
00054 FW3DView::getEveCalo() const
00055 {
00056    return static_cast<TEveCaloViz*>(m_calo);
00057 }
00058 
00059 void FW3DView::setContext(const fireworks::Context& ctx)
00060 { 
00061    FW3DViewBase::setContext(ctx);
00062    
00063    TEveCaloData* data = context().getCaloData();
00064    m_calo = new TEveCalo3D(data);
00065    m_calo->SetElementName("calo barrel");
00066 
00067    m_calo->SetBarrelRadius(context().caloR1(false));
00068    m_calo->SetEndCapPos(context().caloZ1(false));
00069    m_calo->SetFrameTransparency(80);
00070    m_calo->SetAutoRange(false);
00071    m_calo->SetScaleAbs(true);
00072    eventScene()->AddElement(m_calo);
00073 }