#include <Fireworks/Core/interface/FWGeometryTableViewManager.h>
Public Member Functions | |
FWViewBase * | buildView (TEveWindowSlot *iParent, const std::string &type) |
virtual void | colorsChanged () |
FWGeometryTableViewManager (FWGUIManager *, std::string fileName) | |
TList * | getListOfVolumes () const |
TGeoNode * | getTopTGeoNode () |
virtual void | newItem (const FWEventItem *) |
virtual FWTypeToRepresentations | supportedTypesAndRepresentations () const |
virtual | ~FWGeometryTableViewManager () |
Static Public Member Functions | |
static TGeoManager * | getGeoMangeur () |
Protected Member Functions | |
virtual void | modelChangesComing () |
virtual void | modelChangesDone () |
Protected Attributes | |
std::vector< boost::shared_ptr < FWGeometryTableView > > | m_views |
Private Member Functions | |
void | beingDestroyed (const FWViewBase *iView) |
FWGeometryTableViewManager (const FWGeometryTableViewManager &) | |
void | initGeoManager () |
const FWGeometryTableViewManager & | operator= (const FWGeometryTableViewManager &) |
Private Attributes | |
std::string | m_fileName |
Static Private Attributes | |
static TGeoManager * | s_geoManager = 0 |
Description: [one line class summary]
Usage: <usage>
Definition at line 30 of file FWGeometryTableViewManager.h.
FWGeometryTableViewManager::FWGeometryTableViewManager | ( | FWGUIManager * | iGUIMgr, |
std::string | fileName | ||
) |
Definition at line 29 of file FWGeometryTableViewManager.cc.
References buildView(), f, FWViewType::idToName(), FWViewType::kGeometryTable, and FWGUIManager::registerViewBuilder().
: FWViewManagerBase(), m_fileName(fileName) { FWGUIManager::ViewBuildFunctor f; f=boost::bind(&FWGeometryTableViewManager::buildView, this, _1, _2); iGUIMgr->registerViewBuilder(FWViewType::idToName(FWViewType::kGeometryTable), f); }
FWGeometryTableViewManager::~FWGeometryTableViewManager | ( | ) | [virtual] |
Definition at line 38 of file FWGeometryTableViewManager.cc.
{ }
FWGeometryTableViewManager::FWGeometryTableViewManager | ( | const FWGeometryTableViewManager & | ) | [private] |
void FWGeometryTableViewManager::beingDestroyed | ( | const FWViewBase * | iView | ) | [private] |
Definition at line 59 of file FWGeometryTableViewManager.cc.
References m_views.
Referenced by buildView().
class FWViewBase * FWGeometryTableViewManager::buildView | ( | TEveWindowSlot * | iParent, |
const std::string & | type | ||
) |
Definition at line 44 of file FWGeometryTableViewManager.cc.
References beingDestroyed(), FWViewManagerBase::colorManager(), initGeoManager(), m_views, and s_geoManager.
Referenced by FWGeometryTableViewManager().
{ boost::shared_ptr<FWGeometryTableView> view; if (!s_geoManager) initGeoManager(); view.reset( new FWGeometryTableView(iParent, &colorManager(), s_geoManager->GetTopNode(), s_geoManager->GetListOfVolumes())); view->setBackgroundColor(); m_views.push_back(boost::shared_ptr<FWGeometryTableView> (view)); view->beingDestroyed_.connect(boost::bind(&FWGeometryTableViewManager::beingDestroyed, this,_1)); return view.get(); }
void FWGeometryTableViewManager::colorsChanged | ( | ) | [virtual] |
Implements FWViewManagerBase.
Definition at line 70 of file FWGeometryTableViewManager.cc.
References m_views.
static TGeoManager* FWGeometryTableViewManager::getGeoMangeur | ( | ) | [inline, static] |
Definition at line 46 of file FWGeometryTableViewManager.h.
References s_geoManager.
Referenced by FWGeoTopNode::Paint(), FWGeometryTableManager::setVisibility(), and FWGeometryTableManager::setVisibilityChld().
{ return s_geoManager; }
TList* FWGeometryTableViewManager::getListOfVolumes | ( | ) | const |
TGeoNode* FWGeometryTableViewManager::getTopTGeoNode | ( | ) |
void FWGeometryTableViewManager::initGeoManager | ( | ) | [private] |
Definition at line 80 of file FWGeometryTableViewManager.cc.
References mergeVDriftHistosByStation::file, fwLog, fwlog::kError, m_fileName, and s_geoManager.
Referenced by buildView().
{ TGeoManager *old = gGeoManager; TGeoIdentity *old_id = gGeoIdentity; gGeoManager = 0; TString filePath = m_fileName; if (gSystem->AccessPathName(filePath.Data())) { if( m_fileName[0] == '.' && m_fileName[1] == '/' ) { filePath = Form("%s/%s", gSystem->Getenv( "PWD" ), &m_fileName.c_str()[1]); } else { // look in PWD // printf("look in PWD \n"); filePath = Form("%s/%s", gSystem->Getenv( "PWD" ),m_fileName.c_str() ); // look in CMSSW_BASE if(gSystem->AccessPathName(filePath.Data())) { // printf("look in CMSSW \n"); filePath = Form("%s/%s", gSystem->Getenv( "CMSSW_BASE" ),m_fileName.c_str() ); } } } // printf("Sim geom file %s \n", filePath.Data()); if( !gSystem->AccessPathName(filePath.Data())) { TFile* file = new TFile( filePath.Data(), "READ"); try { if ( ! file ) throw std::runtime_error("No root file."); file->ls(); if ( !file->Get("cmsGeo;1")) throw std::runtime_error("Can't find TGeoManager object in selected file."); s_geoManager = (TGeoManager*) file->Get("cmsGeo;1"); } catch (std::runtime_error &e) { fwLog(fwlog::kError) << "Failed to load simulation geomtery.\n"; } } gGeoManager = old; gGeoIdentity = old_id; }
virtual void FWGeometryTableViewManager::modelChangesComing | ( | ) | [inline, protected, virtual] |
called when models have changed and so the display must be updated
Implements FWViewManagerBase.
Definition at line 50 of file FWGeometryTableViewManager.h.
{}
virtual void FWGeometryTableViewManager::modelChangesDone | ( | ) | [inline, protected, virtual] |
virtual void FWGeometryTableViewManager::newItem | ( | const FWEventItem * | ) | [inline, virtual] |
const FWGeometryTableViewManager& FWGeometryTableViewManager::operator= | ( | const FWGeometryTableViewManager & | ) | [private] |
virtual FWTypeToRepresentations FWGeometryTableViewManager::supportedTypesAndRepresentations | ( | ) | const [inline, virtual] |
Implements FWViewManagerBase.
Definition at line 37 of file FWGeometryTableViewManager.h.
{ return FWTypeToRepresentations();}
std::string FWGeometryTableViewManager::m_fileName [private] |
Definition at line 61 of file FWGeometryTableViewManager.h.
Referenced by initGeoManager().
std::vector<boost::shared_ptr<FWGeometryTableView> > FWGeometryTableViewManager::m_views [protected] |
Definition at line 53 of file FWGeometryTableViewManager.h.
Referenced by beingDestroyed(), buildView(), and colorsChanged().
TGeoManager * FWGeometryTableViewManager::s_geoManager = 0 [static, private] |
Definition at line 60 of file FWGeometryTableViewManager.h.
Referenced by buildView(), getGeoMangeur(), and initGeoManager().