CMS 3D CMS Logo

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

List of all members.

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 ()

Static Public Member Functions

static TGeoManager * getGeoMangeur ()
static void setGeoManagerRuntime (TGeoManager *)

Protected Member Functions

virtual void modelChangesComing ()
virtual void modelChangesDone ()

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 
)
FWGeometryTableViewManager::~FWGeometryTableViewManager ( ) [virtual]

Definition at line 44 of file FWGeometryTableViewManager.cc.

{ 
}
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().

{
   for(std::vector<boost::shared_ptr<FWGeometryTableViewBase> >::iterator it=m_views.begin(); it != m_views.end(); ++it) {
      if(it->get() == iView) {
         m_views.erase(it);
         return;
      }
   }
}
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().

{
   if (!s_geoManager) setGeoManagerFromFile();
   boost::shared_ptr<FWGeometryTableViewBase> view;

   FWViewType::EType typeId = (type == FWViewType::sName[FWViewType::kGeometryTable]) ?  FWViewType::kGeometryTable : FWViewType::kOverlapTable;
   if (typeId == FWViewType::kGeometryTable)
      view.reset( new FWGeometryTableView(iParent, &colorManager()));
   else
      view.reset( new FWOverlapTableView(iParent, &colorManager()));

   view->setBackgroundColor();
   m_views.push_back(boost::shared_ptr<FWGeometryTableViewBase> (view));
   view->beingDestroyed_.connect(boost::bind(&FWGeometryTableViewManager::beingDestroyed, this,_1));
                                            
   return view.get();
}
void FWGeometryTableViewManager::colorsChanged ( ) [virtual]

Implements FWViewManagerBase.

Definition at line 81 of file FWGeometryTableViewManager.cc.

References m_views.

{
  for(std::vector<boost::shared_ptr<FWGeometryTableViewBase> >::iterator it=m_views.begin(); it != m_views.end(); ++it)
      (*it)->setBackgroundColor();
}
TGeoManager * FWGeometryTableViewManager::getGeoMangeur ( ) [static]
TList* FWGeometryTableViewManager::getListOfVolumes ( ) const
TGeoNode* FWGeometryTableViewManager::getTopTGeoNode ( )
virtual void FWGeometryTableViewManager::modelChangesComing ( ) [inline, protected, virtual]

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

Implements FWViewManagerBase.

Definition at line 51 of file FWGeometryTableViewManager.h.

{}
virtual void FWGeometryTableViewManager::modelChangesDone ( ) [inline, protected, virtual]

Implements FWViewManagerBase.

Definition at line 52 of file FWGeometryTableViewManager.h.

{}
virtual void FWGeometryTableViewManager::newItem ( const FWEventItem ) [inline, virtual]

Implements FWViewManagerBase.

Definition at line 38 of file FWGeometryTableViewManager.h.

{}  
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().

{ 
   TFile* file = FWGeometry::findFile( m_fileName.c_str() );
   fwLog(fwlog::kInfo) << "Geometry table file: " << m_fileName.c_str() << std::endl;
   try 
   {
      if ( ! file )
         throw std::runtime_error("No root file.");
      
      file->ls();
      
      s_geoManager = (TGeoManager*) file->Get("cmsGeo;1");      
      if ( ! s_geoManager)
         throw std::runtime_error("Can't find TGeoManager object in selected file.");

   }
   catch (std::runtime_error &e)
   {
      fwLog(fwlog::kError) << "Failed to find simulation geomtery file. Please set the file path with --sim-geom-file option.\n";
      exit(0);
   }
}
void FWGeometryTableViewManager::setGeoManagerRuntime ( TGeoManager *  x) [static]

Definition at line 99 of file FWGeometryTableViewManager.cc.

References s_geoManager, and x.

Referenced by FWFFLooper::remakeGeometry().

{
   // Function called from FWFFLooper to set geometry created in runtime.

   s_geoManager = x;
}
virtual FWTypeToRepresentations FWGeometryTableViewManager::supportedTypesAndRepresentations ( ) const [inline, virtual]

Implements FWViewManagerBase.

Definition at line 37 of file FWGeometryTableViewManager.h.


Member Data Documentation

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 [static, private]