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() [1/2]

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

◆ ~FWGeometryTableViewManager()

FWGeometryTableViewManager::~FWGeometryTableViewManager ( )
override

Definition at line 41 of file FWGeometryTableViewManager.cc.

41 {}

◆ FWGeometryTableViewManager() [2/2]

FWGeometryTableViewManager::FWGeometryTableViewManager ( const FWGeometryTableViewManager )
private

Member Function Documentation

◆ beingDestroyed()

void FWGeometryTableViewManager::beingDestroyed ( const FWViewBase iView)
private

Definition at line 62 of file FWGeometryTableViewManager.cc.

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 }

References m_views, and trackerHitRTTI::vector.

Referenced by buildView().

◆ buildView()

FWViewBase * FWGeometryTableViewManager::buildView ( TEveWindowSlot *  iParent,
const std::string &  type 
)

Definition at line 43 of file FWGeometryTableViewManager.cc.

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 }

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

Referenced by FWGeometryTableViewManager().

◆ colorsChanged()

void FWGeometryTableViewManager::colorsChanged ( )
overridevirtual

Implements FWViewManagerBase.

Definition at line 72 of file FWGeometryTableViewManager.cc.

72  {
73  for (std::vector<std::shared_ptr<FWGeometryTableViewBase> >::iterator it = m_views.begin(); it != m_views.end(); ++it)
74  (*it)->setBackgroundColor();
75 }

References m_views, and trackerHitRTTI::vector.

◆ getGeoMangeur()

TGeoManager * FWGeometryTableViewManager::getGeoMangeur ( )
static

◆ getListOfVolumes()

TList* FWGeometryTableViewManager::getListOfVolumes ( ) const

◆ getTopTGeoNode()

TGeoNode* FWGeometryTableViewManager::getTopTGeoNode ( )

◆ modelChangesComing()

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 {}

◆ modelChangesDone()

void FWGeometryTableViewManager::modelChangesDone ( )
inlineoverrideprotectedvirtual

Implements FWViewManagerBase.

Definition at line 50 of file FWGeometryTableViewManager.h.

50 {}

◆ newItem()

void FWGeometryTableViewManager::newItem ( const FWEventItem )
inlineoverridevirtual

Implements FWViewManagerBase.

Definition at line 36 of file FWGeometryTableViewManager.h.

36 {}

◆ operator=()

const FWGeometryTableViewManager& FWGeometryTableViewManager::operator= ( const FWGeometryTableViewManager )
private

◆ setGeoManagerFromFile()

void FWGeometryTableViewManager::setGeoManagerFromFile ( )
private

Definition at line 93 of file FWGeometryTableViewManager.cc.

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 }

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

Referenced by buildView().

◆ setGeoManagerRuntime()

void FWGeometryTableViewManager::setGeoManagerRuntime ( TGeoManager *  x)
static

Definition at line 86 of file FWGeometryTableViewManager.cc.

86  {
87  // Function called from FWFFLooper to set geometry created in runtime.
88 
89  s_geoManager = x;
90 }

References s_geoManager, and x.

Referenced by FWFFLooper::remakeGeometry().

◆ supportedTypesAndRepresentations()

FWTypeToRepresentations FWGeometryTableViewManager::supportedTypesAndRepresentations ( ) const
inlineoverridevirtual

Implements FWViewManagerBase.

Definition at line 35 of file FWGeometryTableViewManager.h.

35 { return FWTypeToRepresentations(); }

Member Data Documentation

◆ m_fileName

std::string FWGeometryTableViewManager::m_fileName
private

Definition at line 60 of file FWGeometryTableViewManager.h.

Referenced by setGeoManagerFromFile().

◆ m_TGeoName

std::string FWGeometryTableViewManager::m_TGeoName
private

Definition at line 61 of file FWGeometryTableViewManager.h.

Referenced by setGeoManagerFromFile().

◆ m_views

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

Definition at line 52 of file FWGeometryTableViewManager.h.

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

◆ s_geoManager

TGeoManager * FWGeometryTableViewManager::s_geoManager = nullptr
staticprivate
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
FWViewType::idToName
static const std::string & idToName(int)
Definition: FWViewType.cc:72
FWViewType::EType
EType
Definition: FWViewType.h:31
FWViewType::kGeometryTable
Definition: FWViewType.h:44
FWGUIManager::registerViewBuilder
void registerViewBuilder(const std::string &iName, ViewBuildFunctor &iBuilder)
Definition: FWGUIManager.cc:273
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
FWViewManagerBase::colorManager
FWColorManager & colorManager() const
Definition: FWViewManagerBase.cc:123
cms::cuda::assert
assert(be >=bs)
FWGeometryTableViewManager::buildView
FWViewBase * buildView(TEveWindowSlot *iParent, const std::string &type)
Definition: FWGeometryTableViewManager.cc:43
DDAxes::x
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
FWGeometryTableViewManager::m_views
std::vector< std::shared_ptr< FWGeometryTableViewBase > > m_views
Definition: FWGeometryTableViewManager.h:52
FWViewType::kOverlapTable
Definition: FWViewType.h:45
FWGeometryTableViewManager::setGeoManagerFromFile
void setGeoManagerFromFile()
Definition: FWGeometryTableViewManager.cc:93
FWViewType::sName
static std::string sName[kTypeSize]
Definition: FWViewType.h:71
FWGeometryTableView
Definition: FWGeometryTableView.h:28
FWGeometryTableViewManager::m_TGeoName
std::string m_TGeoName
Definition: FWGeometryTableViewManager.h:61
FWViewManagerBase::FWViewManagerBase
FWViewManagerBase()
Definition: FWViewManagerBase.cc:36
FWGUIManager::ViewBuildFunctor
std::function< FWViewBase *(TEveWindowSlot *, const std::string &)> ViewBuildFunctor
Definition: FWGUIManager.h:98
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
FWGeometryTableViewManager::m_fileName
std::string m_fileName
Definition: FWGeometryTableViewManager.h:60
fwlog::kInfo
Definition: fwLog.h:35
FWGeometry::findFile
static TFile * findFile(const char *fileName)
Definition: FWGeometry.cc:38
FWTypeToRepresentations
Definition: FWTypeToRepresentations.h:33
FWGeometryTableViewManager::s_geoManager
static TGeoManager * s_geoManager
Definition: FWGeometryTableViewManager.h:59
fwlog::kError
Definition: fwLog.h:35
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
FWGeometryTableViewManager::beingDestroyed
void beingDestroyed(const FWViewBase *iView)
Definition: FWGeometryTableViewManager.cc:62
FWOverlapTableView
Definition: FWOverlapTableView.h:32
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37