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

Protected Member Functions

virtual void modelChangesComing ()
virtual void modelChangesDone ()

Protected Attributes

std::vector< boost::shared_ptr
< FWGeometryTableView > > 
m_views

Private Member Functions

void beingDestroyed (const FWViewBase *iView)
 FWGeometryTableViewManager (const FWGeometryTableViewManager &)
void initGeoManager ()
const FWGeometryTableViewManageroperator= (const FWGeometryTableViewManager &)

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 38 of file FWGeometryTableViewManager.cc.

{ 
}
FWGeometryTableViewManager::FWGeometryTableViewManager ( const FWGeometryTableViewManager ) [private]

Member Function Documentation

void FWGeometryTableViewManager::beingDestroyed ( const FWViewBase iView) [private]

Definition at line 59 of file FWGeometryTableViewManager.cc.

References m_views.

Referenced by buildView().

{
   for(std::vector<boost::shared_ptr<FWGeometryTableView> >::iterator it=m_views.begin(); it != m_views.end(); ++it) {
      if(it->get() == iView) {
         m_views.erase(it);
         return;
      }
   }
}
class FWViewBase * FWGeometryTableViewManager::buildView ( TEveWindowSlot *  iParent,
const std::string &  type 
)

Definition at line 44 of file FWGeometryTableViewManager.cc.

References beingDestroyed(), FWViewManagerBase::colorManager(), initGeoManager(), m_views, and s_geoManager.

Referenced by FWGeometryTableViewManager().

{
   boost::shared_ptr<FWGeometryTableView> view;
   if (!s_geoManager) initGeoManager();
   view.reset( new FWGeometryTableView(iParent, &colorManager(), s_geoManager->GetTopNode(),  s_geoManager->GetListOfVolumes()));

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

Implements FWViewManagerBase.

Definition at line 70 of file FWGeometryTableViewManager.cc.

References m_views.

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

Definition at line 80 of file FWGeometryTableViewManager.cc.

References mergeVDriftHistosByStation::file, fwLog, fwlog::kError, m_fileName, and s_geoManager.

Referenced by buildView().

{ 
   TGeoManager  *old    = gGeoManager;
   TGeoIdentity *old_id = gGeoIdentity;
   gGeoManager = 0;
   

   TString filePath = m_fileName;

   if (gSystem->AccessPathName(filePath.Data()))
   {
      if( m_fileName[0] == '.' &&  m_fileName[1] == '/' )
      {
         filePath = Form("%s/%s", gSystem->Getenv( "PWD" ), &m_fileName.c_str()[1]);
      }
      else 
      {
         // look in PWD
         // printf("look in PWD \n");
         filePath = Form("%s/%s",  gSystem->Getenv( "PWD" ),m_fileName.c_str() );
         // look in CMSSW_BASE
         if(gSystem->AccessPathName(filePath.Data())) {
            //  printf("look in CMSSW \n");
            filePath = Form("%s/%s",  gSystem->Getenv( "CMSSW_BASE" ),m_fileName.c_str() );
         }
      }
   }

   //   printf("Sim geom file %s \n", filePath.Data());
   if( !gSystem->AccessPathName(filePath.Data()))
   {
      TFile* file = new TFile( filePath.Data(), "READ");
      try {
         if ( ! file )
            throw std::runtime_error("No root file.");
  
         file->ls();
      
         if ( !file->Get("cmsGeo;1"))
            throw std::runtime_error("Can't find TGeoManager object in selected file.");
         s_geoManager = (TGeoManager*) file->Get("cmsGeo;1");

      }
      catch (std::runtime_error &e)
      {
         fwLog(fwlog::kError) << "Failed to load simulation geomtery.\n";
      }
   }

   gGeoManager  = old;
   gGeoIdentity = old_id;
}
virtual void FWGeometryTableViewManager::modelChangesComing ( ) [inline, protected, virtual]

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

Implements FWViewManagerBase.

Definition at line 50 of file FWGeometryTableViewManager.h.

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

Implements FWViewManagerBase.

Definition at line 51 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]
virtual FWTypeToRepresentations FWGeometryTableViewManager::supportedTypesAndRepresentations ( ) const [inline, virtual]

Implements FWViewManagerBase.

Definition at line 37 of file FWGeometryTableViewManager.h.


Member Data Documentation

Definition at line 61 of file FWGeometryTableViewManager.h.

Referenced by initGeoManager().

std::vector<boost::shared_ptr<FWGeometryTableView> > FWGeometryTableViewManager::m_views [protected]

Definition at line 53 of file FWGeometryTableViewManager.h.

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

TGeoManager * FWGeometryTableViewManager::s_geoManager = 0 [static, private]

Definition at line 60 of file FWGeometryTableViewManager.h.

Referenced by buildView(), getGeoMangeur(), and initGeoManager().