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 30 of file FWGeometryTableViewManager.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file FWGeometryTableViewManager.cc.

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

34  :
37 {
39  f=boost::bind(&FWGeometryTableViewManager::buildView, this, _1, _2);
42 }
boost::function2< FWViewBase *, TEveWindowSlot *, const std::string & > ViewBuildFunctor
Definition: FWGUIManager.h:100
void registerViewBuilder(const std::string &iName, ViewBuildFunctor &iBuilder)
double f[11][100]
static const std::string & idToName(int)
Definition: FWViewType.cc:90
FWViewBase * buildView(TEveWindowSlot *iParent, const std::string &type)
FWGeometryTableViewManager::~FWGeometryTableViewManager ( )
virtual

Definition at line 44 of file FWGeometryTableViewManager.cc.

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

Member Function Documentation

void FWGeometryTableViewManager::beingDestroyed ( const FWViewBase iView)
private

Definition at line 70 of file FWGeometryTableViewManager.cc.

References m_views.

Referenced by buildView().

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

Definition at line 50 of file FWGeometryTableViewManager.cc.

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

Referenced by FWGeometryTableViewManager().

51 {
53  boost::shared_ptr<FWGeometryTableViewBase> view;
54 
56  if (typeId == FWViewType::kGeometryTable)
57  view.reset( new FWGeometryTableView(iParent, &colorManager()));
58  else
59  view.reset( new FWOverlapTableView(iParent, &colorManager()));
60 
61  view->setBackgroundColor();
62  m_views.push_back(boost::shared_ptr<FWGeometryTableViewBase> (view));
63  view->beingDestroyed_.connect(boost::bind(&FWGeometryTableViewManager::beingDestroyed, this,_1));
64 
65  return view.get();
66 }
type
Definition: HCALResponse.h:22
FWColorManager & colorManager() const
static std::string sName[kTypeSize]
Definition: FWViewType.h:63
void beingDestroyed(const FWViewBase *iView)
std::vector< boost::shared_ptr< FWGeometryTableViewBase > > m_views
void FWGeometryTableViewManager::colorsChanged ( )
virtual

Implements FWViewManagerBase.

Definition at line 81 of file FWGeometryTableViewManager.cc.

References m_views.

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

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

Implements FWViewManagerBase.

Definition at line 52 of file FWGeometryTableViewManager.h.

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

Implements FWViewManagerBase.

Definition at line 38 of file FWGeometryTableViewManager.h.

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

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

109 {
110  TFile* file = FWGeometry::findFile( m_fileName.c_str() );
111  fwLog(fwlog::kInfo) << "Geometry table file: " << m_fileName.c_str() << std::endl;
112  try
113  {
114  if ( ! file )
115  throw std::runtime_error("No root file.");
116 
117  file->ls();
118 
119  s_geoManager = (TGeoManager*) file->Get("cmsGeo;1");
120  if ( ! s_geoManager)
121  throw std::runtime_error("Can't find TGeoManager object in selected file.");
122 
123  }
124  catch (std::runtime_error &e)
125  {
126  fwLog(fwlog::kError) << "Failed to find simulation geomtery file. Please set the file path with --sim-geom-file option.\n";
127  exit(0);
128  }
129 }
static TFile * findFile(const char *fileName)
Definition: FWGeometry.cc:25
#define fwLog(_level_)
Definition: fwLog.h:51
void FWGeometryTableViewManager::setGeoManagerRuntime ( TGeoManager *  x)
static

Definition at line 99 of file FWGeometryTableViewManager.cc.

References s_geoManager, and vdt::x.

Referenced by FWFFLooper::remakeGeometry().

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

Member Data Documentation

std::string FWGeometryTableViewManager::m_fileName
private

Definition at line 62 of file FWGeometryTableViewManager.h.

Referenced by setGeoManagerFromFile().

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

Definition at line 54 of file FWGeometryTableViewManager.h.

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

TGeoManager * FWGeometryTableViewManager::s_geoManager = 0
staticprivate