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)
 
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
 

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 
)

Definition at line 33 of file FWGeometryTableViewManager.cc.

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

33  :
36 {
38  f=boost::bind(&FWGeometryTableViewManager::buildView, this, _1, _2);
41 }
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 43 of file FWGeometryTableViewManager.cc.

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

Member Function Documentation

void FWGeometryTableViewManager::beingDestroyed ( const FWViewBase iView)
private

Definition at line 69 of file FWGeometryTableViewManager.cc.

References m_views.

Referenced by buildView().

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

Definition at line 49 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().

50 {
52  std::shared_ptr<FWGeometryTableViewBase> view;
53 
55  if (typeId == FWViewType::kGeometryTable)
56  view.reset( new FWGeometryTableView(iParent, &colorManager()));
57  else
58  view.reset( new FWOverlapTableView(iParent, &colorManager()));
59 
60  view->setBackgroundColor();
61  m_views.push_back(std::shared_ptr<FWGeometryTableViewBase> (view));
62  view->beingDestroyed_.connect(boost::bind(&FWGeometryTableViewManager::beingDestroyed, this,_1));
63 
64  return view.get();
65 }
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 80 of file FWGeometryTableViewManager.cc.

References m_views.

Referenced by newItem().

81 {
82  for(std::vector<std::shared_ptr<FWGeometryTableViewBase> >::iterator it=m_views.begin(); it != m_views.end(); ++it)
83  (*it)->setBackgroundColor();
84 }
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 107 of file FWGeometryTableViewManager.cc.

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

Referenced by buildView().

108 {
109  TFile* file = FWGeometry::findFile( m_fileName.c_str() );
110  fwLog(fwlog::kInfo) << "Geometry table file: " << m_fileName.c_str() << std::endl;
111  try
112  {
113  if ( ! file )
114  throw std::runtime_error("No root file.");
115 
116  file->ls();
117 
118  s_geoManager = (TGeoManager*) file->Get("cmsGeo;1");
119  if ( ! s_geoManager)
120  throw std::runtime_error("Can't find TGeoManager object in selected file.");
121 
122  }
123  catch (std::runtime_error &e)
124  {
125  fwLog(fwlog::kError) << "Failed to find simulation geomtery file. Please set the file path with --sim-geom-file option.\n";
126  exit(0);
127  }
128 }
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 98 of file FWGeometryTableViewManager.cc.

References s_geoManager, and x.

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

99 {
100  // Function called from FWFFLooper to set geometry created in runtime.
101 
102  s_geoManager = x;
103 }
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::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