CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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)
 
virtual void colorsChanged ()
 
 FWGeometryTableViewManager (FWGUIManager *, std::string fileName)
 
TList * getListOfVolumes () const
 
TGeoNode * getTopTGeoNode ()
 
virtual void newItem (const FWEventItem *)
 
virtual FWTypeToRepresentations supportedTypesAndRepresentations () const
 
virtual ~FWGeometryTableViewManager ()
 
- 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

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

Protected Attributes

std::vector< boost::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 = 0
 

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:99
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 ( )
virtual

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<boost::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< boost::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().

50 {
52  boost::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(boost::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
FWColorManager & colorManager() const
static std::string sName[kTypeSize]
Definition: FWViewType.h:62
void beingDestroyed(const FWViewBase *iView)
std::vector< boost::shared_ptr< FWGeometryTableViewBase > > m_views
void FWGeometryTableViewManager::colorsChanged ( )
virtual

Implements FWViewManagerBase.

Definition at line 80 of file FWGeometryTableViewManager.cc.

References m_views.

81 {
82  for(std::vector<boost::shared_ptr<FWGeometryTableViewBase> >::iterator it=m_views.begin(); it != m_views.end(); ++it)
83  (*it)->setBackgroundColor();
84 }
std::vector< boost::shared_ptr< FWGeometryTableViewBase > > m_views
TGeoManager * FWGeometryTableViewManager::getGeoMangeur ( )
static
TList* FWGeometryTableViewManager::getListOfVolumes ( ) const
TGeoNode* FWGeometryTableViewManager::getTopTGeoNode ( )
virtual void FWGeometryTableViewManager::modelChangesComing ( )
inlineprotectedvirtual

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

Implements FWViewManagerBase.

Definition at line 50 of file FWGeometryTableViewManager.h.

50 {}
virtual void FWGeometryTableViewManager::modelChangesDone ( )
inlineprotectedvirtual

Implements FWViewManagerBase.

Definition at line 51 of file FWGeometryTableViewManager.h.

51 {}
virtual void FWGeometryTableViewManager::newItem ( const FWEventItem )
inlinevirtual

Implements FWViewManagerBase.

Definition at line 37 of file FWGeometryTableViewManager.h.

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

Definition at line 107 of file FWGeometryTableViewManager.cc.

References alignCSCRings::e, cmsRelvalreport::exit, mergeVDriftHistosByStation::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:25
#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 FWFFLooper::remakeGeometry().

99 {
100  // Function called from FWFFLooper to set geometry created in runtime.
101 
102  s_geoManager = x;
103 }
Definition: DDAxes.h:10
virtual FWTypeToRepresentations FWGeometryTableViewManager::supportedTypesAndRepresentations ( ) const
inlinevirtual

Member Data Documentation

std::string FWGeometryTableViewManager::m_fileName
private

Definition at line 61 of file FWGeometryTableViewManager.h.

Referenced by setGeoManagerFromFile().

std::vector<boost::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 = 0
staticprivate