CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes
FWGeometryTableViewManager Class Reference

#include <Fireworks/Core/interface/FWGeometryTableViewManager.h>

Inheritance diagram for FWGeometryTableViewManager:
FWViewManagerBase

Public Member Functions

FWViewBasebuildView (TEveWindowSlot *iParent, const std::string &type)
 
void colorsChanged () override
 
 FWGeometryTableViewManager (FWGUIManager *, std::string fileName, std::string geoName)
 
TList * getListOfVolumes () const
 
TGeoNode * getTopTGeoNode ()
 
void newItem (const FWEventItem *) override
 
FWTypeToRepresentations supportedTypesAndRepresentations () const override
 
 ~FWGeometryTableViewManager () override
 
- Public Member Functions inherited from FWViewManagerBase
void colorsChangedSlot ()
 
const fireworks::Contextcontext () const
 
virtual void eventBegin ()
 
virtual void eventEnd ()
 
void modelChangesComingSlot ()
 
void modelChangesDoneSlot ()
 
void setChangeManager (FWModelChangeManager *iCM)
 
void setColorManager (FWColorManager *iCM)
 
virtual void setContext (const fireworks::Context *x)
 
virtual ~FWViewManagerBase ()
 

Static Public Member Functions

static TGeoManager * getGeoMangeur ()
 
static void setGeoManagerRuntime (TGeoManager *)
 

Protected Member Functions

void modelChangesComing () override
 
void modelChangesDone () override
 
- Protected Member Functions inherited from FWViewManagerBase
FWModelChangeManagerchangeManager () const
 
FWColorManagercolorManager () const
 
void * createInstanceOf (const TClass *iBaseClass, const char *iNameOfClass)
 
 FWViewManagerBase ()
 

Protected Attributes

std::vector< std::shared_ptr< FWGeometryTableViewBase > > m_views
 

Private Member Functions

void beingDestroyed (const FWViewBase *iView)
 
 FWGeometryTableViewManager (const FWGeometryTableViewManager &)
 
const FWGeometryTableViewManageroperator= (const FWGeometryTableViewManager &)
 
void setGeoManagerFromFile ()
 

Private Attributes

std::string m_fileName
 
std::string m_TGeoName
 

Static Private Attributes

static TGeoManager * s_geoManager = nullptr
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 29 of file FWGeometryTableViewManager.h.

Constructor & Destructor Documentation

FWGeometryTableViewManager::FWGeometryTableViewManager ( FWGUIManager iGUIMgr,
std::string  fileName,
std::string  geoName 
)

Definition at line 33 of file FWGeometryTableViewManager.cc.

References buildView(), f, FWViewType::idToName(), FWViewType::kGeometryTable, FWViewType::kOverlapTable, and FWGUIManager::registerViewBuilder().

36  m_TGeoName(geoName)
37 {
39  f=boost::bind(&FWGeometryTableViewManager::buildView, this, _1, _2);
42 }
boost::function2< FWViewBase *, TEveWindowSlot *, const std::string & > ViewBuildFunctor
Definition: FWGUIManager.h:98
void registerViewBuilder(const std::string &iName, ViewBuildFunctor &iBuilder)
double f[11][100]
static const std::string & idToName(int)
Definition: FWViewType.cc:89
FWViewBase * buildView(TEveWindowSlot *iParent, const std::string &type)
FWGeometryTableViewManager::~FWGeometryTableViewManager ( )
override

Definition at line 44 of file FWGeometryTableViewManager.cc.

45 {
46 }
FWGeometryTableViewManager::FWGeometryTableViewManager ( const FWGeometryTableViewManager )
private

Member Function Documentation

void FWGeometryTableViewManager::beingDestroyed ( const FWViewBase iView)
private

Definition at line 70 of file FWGeometryTableViewManager.cc.

References m_views.

Referenced by buildView().

71 {
72  for(std::vector<std::shared_ptr<FWGeometryTableViewBase> >::iterator it=m_views.begin(); it != m_views.end(); ++it) {
73  if(it->get() == iView) {
74  m_views.erase(it);
75  return;
76  }
77  }
78 }
std::vector< std::shared_ptr< FWGeometryTableViewBase > > m_views
FWViewBase * FWGeometryTableViewManager::buildView ( TEveWindowSlot *  iParent,
const std::string &  type 
)

Definition at line 50 of file FWGeometryTableViewManager.cc.

References beingDestroyed(), FWViewManagerBase::colorManager(), FWViewType::kGeometryTable, FWViewType::kOverlapTable, m_views, s_geoManager, setGeoManagerFromFile(), and FWViewType::sName.

Referenced by FWGeometryTableViewManager(), and newItem().

51 {
53  std::shared_ptr<FWGeometryTableViewBase> view;
54 
56  if (typeId == FWViewType::kGeometryTable)
57  view.reset( new FWGeometryTableView(iParent, &colorManager()));
58  else
59  view.reset( new FWOverlapTableView(iParent, &colorManager()));
60 
61  view->setBackgroundColor();
62  m_views.push_back(std::shared_ptr<FWGeometryTableViewBase> (view));
63  view->beingDestroyed_.connect(boost::bind(&FWGeometryTableViewManager::beingDestroyed, this,_1));
64 
65  return view.get();
66 }
type
Definition: HCALResponse.h:21
std::vector< std::shared_ptr< FWGeometryTableViewBase > > m_views
FWColorManager & colorManager() const
static std::string sName[kTypeSize]
Definition: FWViewType.h:62
void beingDestroyed(const FWViewBase *iView)
void FWGeometryTableViewManager::colorsChanged ( )
overridevirtual

Implements FWViewManagerBase.

Definition at line 81 of file FWGeometryTableViewManager.cc.

References m_views.

Referenced by newItem().

82 {
83  for(std::vector<std::shared_ptr<FWGeometryTableViewBase> >::iterator it=m_views.begin(); it != m_views.end(); ++it)
84  (*it)->setBackgroundColor();
85 }
std::vector< std::shared_ptr< FWGeometryTableViewBase > > m_views
TGeoManager * FWGeometryTableViewManager::getGeoMangeur ( )
static
TList* FWGeometryTableViewManager::getListOfVolumes ( ) const

Referenced by newItem().

TGeoNode* FWGeometryTableViewManager::getTopTGeoNode ( )

Referenced by newItem().

void FWGeometryTableViewManager::modelChangesComing ( )
inlineoverrideprotectedvirtual

called when models have changed and so the display must be updated

Implements FWViewManagerBase.

Definition at line 50 of file FWGeometryTableViewManager.h.

50 {}
void FWGeometryTableViewManager::modelChangesDone ( )
inlineoverrideprotectedvirtual

Implements FWViewManagerBase.

Definition at line 51 of file FWGeometryTableViewManager.h.

51 {}
void FWGeometryTableViewManager::newItem ( const FWEventItem )
inlineoverridevirtual
const FWGeometryTableViewManager& FWGeometryTableViewManager::operator= ( const FWGeometryTableViewManager )
private
void FWGeometryTableViewManager::setGeoManagerFromFile ( )
private

Definition at line 108 of file FWGeometryTableViewManager.cc.

References MillePedeFileConverter_cfg::e, cmsRelvalreport::exit, FrontierConditions_GlobalTag_cff::file, FWGeometry::findFile(), fwLog, fwlog::kError, fwlog::kInfo, m_fileName, m_TGeoName, and s_geoManager.

Referenced by buildView().

109 {
110  TFile* file = FWGeometry::findFile( m_fileName.c_str() );
111  fwLog(fwlog::kInfo) << "Geometry table file: " << m_fileName.c_str() << std::endl;
112  try
113  {
114  if ( ! file )
115  throw std::runtime_error("No root file.");
116 
117  file->ls();
118 
119  s_geoManager = (TGeoManager*) file->Get( m_TGeoName.c_str());
120  if ( ! s_geoManager)
121  throw std::runtime_error("Can't find TGeoManager object in selected file.");
122 
123  }
124  catch (std::runtime_error &e)
125  {
126  fwLog(fwlog::kError) << "Failed to find simulation geometry file. Please set the file path with --sim-geom-file option.\n";
127  exit(0);
128  }
129 }
static TFile * findFile(const char *fileName)
Definition: FWGeometry.cc:30
#define fwLog(_level_)
Definition: fwLog.h:50
void FWGeometryTableViewManager::setGeoManagerRuntime ( TGeoManager *  x)
static

Definition at line 99 of file FWGeometryTableViewManager.cc.

References s_geoManager, and x.

Referenced by newItem(), and FWFFLooper::remakeGeometry().

100 {
101  // Function called from FWFFLooper to set geometry created in runtime.
102 
103  s_geoManager = x;
104 }
FWTypeToRepresentations FWGeometryTableViewManager::supportedTypesAndRepresentations ( ) const
inlineoverridevirtual

Member Data Documentation

std::string FWGeometryTableViewManager::m_fileName
private

Definition at line 61 of file FWGeometryTableViewManager.h.

Referenced by setGeoManagerFromFile().

std::string FWGeometryTableViewManager::m_TGeoName
private

Definition at line 62 of file FWGeometryTableViewManager.h.

Referenced by setGeoManagerFromFile().

std::vector<std::shared_ptr<FWGeometryTableViewBase> > FWGeometryTableViewManager::m_views
protected

Definition at line 53 of file FWGeometryTableViewManager.h.

Referenced by beingDestroyed(), buildView(), and colorsChanged().

TGeoManager * FWGeometryTableViewManager::s_geoManager = nullptr
staticprivate