CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ()
 
 FWViewManagerBase (const FWViewManagerBase &)=delete
 
void modelChangesComingSlot ()
 
void modelChangesDoneSlot ()
 
const FWViewManagerBaseoperator= (const FWViewManagerBase &)=delete
 
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(), validate-o2o-wbm::f, FWViewType::idToName(), FWViewType::kGeometryTable, FWViewType::kOverlapTable, and FWGUIManager::registerViewBuilder().

36  f = std::bind(&FWGeometryTableViewManager::buildView, this, std::placeholders::_1, std::placeholders::_2);
39 }
void registerViewBuilder(const std::string &iName, ViewBuildFunctor &iBuilder)
std::function< FWViewBase *(TEveWindowSlot *, const std::string &)> ViewBuildFunctor
Definition: FWGUIManager.h:98
static const std::string & idToName(int)
Definition: FWViewType.cc:72
FWViewBase * buildView(TEveWindowSlot *iParent, const std::string &type)
FWGeometryTableViewManager::~FWGeometryTableViewManager ( )
override

Definition at line 41 of file FWGeometryTableViewManager.cc.

41 {}
FWGeometryTableViewManager::FWGeometryTableViewManager ( const FWGeometryTableViewManager )
private

Member Function Documentation

void FWGeometryTableViewManager::beingDestroyed ( const FWViewBase iView)
private

Definition at line 62 of file FWGeometryTableViewManager.cc.

References m_views, and trackerHitRTTI::vector.

Referenced by buildView().

62  {
63  for (std::vector<std::shared_ptr<FWGeometryTableViewBase> >::iterator it = m_views.begin(); it != m_views.end();
64  ++it) {
65  if (it->get() == iView) {
66  m_views.erase(it);
67  return;
68  }
69  }
70 }
std::vector< std::shared_ptr< FWGeometryTableViewBase > > m_views
FWViewBase * FWGeometryTableViewManager::buildView ( TEveWindowSlot *  iParent,
const std::string &  type 
)

Definition at line 43 of file FWGeometryTableViewManager.cc.

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

Referenced by FWGeometryTableViewManager().

43  {
44  if (!s_geoManager)
46  std::shared_ptr<FWGeometryTableViewBase> view;
47 
48  FWViewType::EType typeId =
50  if (typeId == FWViewType::kGeometryTable)
51  view.reset(new FWGeometryTableView(iParent, &colorManager()));
52  else
53  view.reset(new FWOverlapTableView(iParent, &colorManager()));
54 
55  view->setBackgroundColor();
56  m_views.push_back(std::shared_ptr<FWGeometryTableViewBase>(view));
57  view->beingDestroyed_.connect(std::bind(&FWGeometryTableViewManager::beingDestroyed, this, std::placeholders::_1));
58 
59  return view.get();
60 }
std::vector< std::shared_ptr< FWGeometryTableViewBase > > m_views
FWColorManager & colorManager() const
static std::string sName[kTypeSize]
Definition: FWViewType.h:71
void beingDestroyed(const FWViewBase *iView)
void FWGeometryTableViewManager::colorsChanged ( )
overridevirtual

Implements FWViewManagerBase.

Definition at line 72 of file FWGeometryTableViewManager.cc.

References m_views, and trackerHitRTTI::vector.

72  {
73  for (std::vector<std::shared_ptr<FWGeometryTableViewBase> >::iterator it = m_views.begin(); it != m_views.end(); ++it)
74  (*it)->setBackgroundColor();
75 }
std::vector< std::shared_ptr< FWGeometryTableViewBase > > m_views
TGeoManager * FWGeometryTableViewManager::getGeoMangeur ( )
static
TList* FWGeometryTableViewManager::getListOfVolumes ( ) const
TGeoNode* FWGeometryTableViewManager::getTopTGeoNode ( )
void FWGeometryTableViewManager::modelChangesComing ( )
inlineoverrideprotectedvirtual

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

Implements FWViewManagerBase.

Definition at line 49 of file FWGeometryTableViewManager.h.

49 {}
void FWGeometryTableViewManager::modelChangesDone ( )
inlineoverrideprotectedvirtual

Implements FWViewManagerBase.

Definition at line 50 of file FWGeometryTableViewManager.h.

50 {}
void FWGeometryTableViewManager::newItem ( const FWEventItem )
inlineoverridevirtual

Implements FWViewManagerBase.

Definition at line 36 of file FWGeometryTableViewManager.h.

36 {}
const FWGeometryTableViewManager& FWGeometryTableViewManager::operator= ( const FWGeometryTableViewManager )
private
void FWGeometryTableViewManager::setGeoManagerFromFile ( )
private

Definition at line 93 of file FWGeometryTableViewManager.cc.

References alignCSCRings::e, beamvalidation::exit(), mergeVDriftHistosByStation::file, FWGeometry::findFile(), fwLog, fwlog::kError, fwlog::kInfo, m_fileName, m_TGeoName, and s_geoManager.

Referenced by buildView().

93  {
94  TFile* file = FWGeometry::findFile(m_fileName.c_str());
95  fwLog(fwlog::kInfo) << "Geometry table file: " << m_fileName.c_str() << std::endl;
96  try {
97  if (!file) {
98  // Try it as a GDML file
99  s_geoManager = TGeoManager::Import(m_fileName.c_str(), m_TGeoName.c_str());
100  } else {
101  file->ls();
102  s_geoManager = (TGeoManager*)file->Get(m_TGeoName.c_str());
103  }
104  if (!s_geoManager)
105  throw std::runtime_error("Can't find TGeoManager object in selected file.");
106 
107  } catch (std::runtime_error& e) {
108  fwLog(fwlog::kError) << e.what();
109  exit(0);
110  }
111 }
static TFile * findFile(const char *fileName)
Definition: FWGeometry.cc:38
#define fwLog(_level_)
Definition: fwLog.h:45
void FWGeometryTableViewManager::setGeoManagerRuntime ( TGeoManager *  x)
static

Definition at line 86 of file FWGeometryTableViewManager.cc.

References s_geoManager, and x.

Referenced by FWFFLooper::remakeGeometry().

86  {
87  // Function called from FWFFLooper to set geometry created in runtime.
88 
89  s_geoManager = x;
90 }
FWTypeToRepresentations FWGeometryTableViewManager::supportedTypesAndRepresentations ( ) const
inlineoverridevirtual

Member Data Documentation

std::string FWGeometryTableViewManager::m_fileName
private

Definition at line 60 of file FWGeometryTableViewManager.h.

Referenced by setGeoManagerFromFile().

std::string FWGeometryTableViewManager::m_TGeoName
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 52 of file FWGeometryTableViewManager.h.

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

TGeoManager * FWGeometryTableViewManager::s_geoManager = nullptr
staticprivate