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

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  f = std::bind(&FWGeometryTableViewManager::buildView, this, std::placeholders::_1, std::placeholders::_2);
39 }
void registerViewBuilder(const std::string &iName, ViewBuildFunctor &iBuilder)
double f[11][100]
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::~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.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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

◆ buildView()

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 }
FWColorManager & colorManager() const
std::vector< std::shared_ptr< FWGeometryTableViewBase > > m_views
static std::string sName[kTypeSize]
Definition: FWViewType.h:71
void beingDestroyed(const FWViewBase *iView)

◆ colorsChanged()

void FWGeometryTableViewManager::colorsChanged ( )
overridevirtual

Implements FWViewManagerBase.

Definition at line 72 of file FWGeometryTableViewManager.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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

◆ 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.

References MillePedeFileConverter_cfg::e, beamvalidation::exit(), geometryDiff::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
def exit(msg="")

◆ setGeoManagerRuntime()

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 }

◆ supportedTypesAndRepresentations()

FWTypeToRepresentations FWGeometryTableViewManager::supportedTypesAndRepresentations ( ) const
inlineoverridevirtual

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