#include <FWGeometryBrowser.h>
Definition at line 34 of file FWGeometryBrowser.h.
FWGeometryBrowser::FWGeometryBrowser | ( | FWGUIManager * | guiManager | ) |
Definition at line 20 of file FWGeometryBrowser.cc.
References FWEnumParameter::addEntry(), FWTableWidget::disableGrowInWidth(), FWGeometryTableManager, m_fileOpen, m_mode, m_settersFrame, m_statBar, m_tableManager, m_tableWidget, resetSetters(), FWTableWidget::SetBackgroundColor(), FWTableWidget::SetHeaderBackgroundColor(), and FWTableWidget::SetLineSeparatorColor().
: TGMainFrame(gClient->GetRoot(), 600, 500), m_mode(this, "Mode:", 1l, 0l, 1l), m_filter(this,"Materials:",std::string()), m_autoExpand(this,"AutoExpand:", 5l, 0l, 1000l), m_maxDaughters(this,"MaxChildren:", 999l, 0l, 1000l), // debug m_guiManager(guiManager), m_tableManager(0), m_geometryFile(0), m_fileOpen(0), m_settersFrame(0) { m_mode.addEntry(0, "Node"); m_mode.addEntry(1, "Volume"); m_tableManager = new FWGeometryTableManager(this); TGTextButton* m_fileOpen = new TGTextButton (this, "Open Geometry File"); this->AddFrame(m_fileOpen, new TGLayoutHints( kLHintsExpandX , 4, 2, 2, 2)); m_fileOpen->Connect("Clicked()","FWGeometryBrowser",this,"browse()"); m_settersFrame = new TGHorizontalFrame(this); this->AddFrame( m_settersFrame,new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2)); m_settersFrame->SetCleanup(kDeepCleanup); m_tableWidget = new FWTableWidget(m_tableManager, this); AddFrame(m_tableWidget,new TGLayoutHints(kLHintsExpandX|kLHintsExpandY,2,2,2,2)); m_tableWidget->SetBackgroundColor(0xffffff); m_tableWidget->SetLineSeparatorColor(0x000000); m_tableWidget->SetHeaderBackgroundColor(0xececec); m_tableWidget->Connect("cellClicked(Int_t,Int_t,Int_t,Int_t,Int_t,Int_t)", "FWGeometryBrowser",this, "cellClicked(Int_t,Int_t,Int_t,Int_t,Int_t,Int_t)"); m_tableWidget->disableGrowInWidth(); resetSetters(); m_statBar = new TGStatusBar(this, this->GetWidth(), 12); m_statBar->SetText("No simulation geomtery loaded."); AddFrame(m_statBar, new TGLayoutHints(kLHintsExpandX)); SetWindowName("Geometry Browser"); this->Connect("CloseWindow()","FWGeometryBrowser",this,"windowIsClosing()"); Layout(); MapSubwindows(); gVirtualX->SelectInput(GetId(), kKeyPressMask | kKeyReleaseMask | kExposureMask | kPointerMotionMask | kStructureNotifyMask | kFocusChangeMask | kEnterWindowMask | kLeaveWindowMask); }
FWGeometryBrowser::~FWGeometryBrowser | ( | ) | [virtual] |
Definition at line 71 of file FWGeometryBrowser.cc.
{}
FWGeometryBrowser::FWGeometryBrowser | ( | const FWGeometryBrowser & | ) | [private] |
void FWGeometryBrowser::addTo | ( | FWConfiguration & | iTo | ) | const [virtual] |
Reimplemented from FWConfigurableParameterizable.
Definition at line 109 of file FWGeometryBrowser.cc.
Referenced by FWGUIManager::addTo().
{ FWConfigurableParameterizable::addTo(iTo); }
void FWGeometryBrowser::browse | ( | ) |
Definition at line 204 of file FWGeometryBrowser.cc.
References FWGUIManager::clearStatus(), gather_cfg::cout, geodebug, FWGUIManager::getMainFrame(), m_geometryFile, m_guiManager, readFile(), and FWGUIManager::updateStatus().
Referenced by FWGUIManager::showGeometryBrowser().
{ std::cout<<"FWGeometryBrowser::openFile()"<<std::endl; if (!geodebug) { const char* kRootType[] = {"ROOT files","*.root", 0, 0}; TGFileInfo fi; fi.fFileTypes = kRootType; m_guiManager->updateStatus("opening geometry file..."); new TGFileDialog(gClient->GetDefaultRoot(), (TGWindow*) m_guiManager->getMainFrame(), kFDOpen, &fi); m_guiManager->updateStatus("loading geometry file..."); m_geometryFile = new TFile(fi.fFilename, "READ"); } else { // AMT developing environment m_geometryFile = new TFile("cmsSimGeom-14.root", "READ"); } m_guiManager->clearStatus(); readFile(); }
void FWGeometryBrowser::cellClicked | ( | Int_t | iRow, |
Int_t | iColumn, | ||
Int_t | iButton, | ||
Int_t | iKeyMod, | ||
Int_t | iGlobalX, | ||
Int_t | iGlobalY | ||
) |
Definition at line 132 of file FWGeometryBrowser.cc.
References FWGeometryTableManager::firstColumnClicked(), and m_tableManager.
{ if (iButton != kButton1) { // m_tableManager->setSelection(iRow, iColumn, iKeyMod); return; } if (iButton == kButton1 && iColumn == 0) { m_tableManager->firstColumnClicked(iRow); } }
FWGeometryBrowser::ClassDef | ( | FWGeometryBrowser | , |
0 | |||
) | [private] |
bool FWGeometryBrowser::HandleKey | ( | Event_t * | event | ) |
Definition at line 146 of file FWGeometryBrowser.cc.
void FWGeometryBrowser::makeSetter | ( | TGCompositeFrame * | frame, |
FWParameterBase * | param | ||
) | [private] |
Definition at line 95 of file FWGeometryBrowser.cc.
References m_setters, and FWParameterSetterBase::makeSetterFor().
Referenced by resetSetters().
{ boost::shared_ptr<FWParameterSetterBase> ptr( FWParameterSetterBase::makeSetterFor(param) ); ptr->attach(param, this); TGFrame* pframe = ptr->build(frame, false); frame->AddFrame(pframe, new TGLayoutHints(kLHintsExpandX)); m_setters.push_back(ptr); }
void FWGeometryBrowser::newIndexSelected | ( | int | iSelectedRow, |
int | iSelectedColumn | ||
) |
Definition at line 170 of file FWGeometryBrowser.cc.
References FWTableManagerBase::dataChanged(), and m_tableManager.
{ if (iSelectedRow == -1) return; m_tableManager->dataChanged(); }
const FWGeometryBrowser& FWGeometryBrowser::operator= | ( | const FWGeometryBrowser & | ) | [private] |
void FWGeometryBrowser::readFile | ( | ) |
Definition at line 179 of file FWGeometryBrowser.cc.
References ExpressReco_HICollisions_FallBack::e, fwLog, fwlog::kError, FWGeometryTableManager::loadGeometry(), m_geometryFile, m_tableManager, and updateStatusBar().
Referenced by browse().
{ try { if ( ! m_geometryFile ) throw std::runtime_error("No root file."); m_geometryFile->ls(); if ( !m_geometryFile->Get("cmsGeo;1")) throw std::runtime_error("Can't find TGeoManager object in selected file."); TGeoManager* m_geoManager = (TGeoManager*) m_geometryFile->Get("cmsGeo;1"); m_tableManager->loadGeometry(m_geoManager); MapRaised(); } catch (std::runtime_error &e) { fwLog(fwlog::kError) << "Failed to load simulation geomtery.\n"; updateStatusBar("Failed to load simulation geomtery from file"); } }
void FWGeometryBrowser::resetSetters | ( | ) | [private] |
Definition at line 75 of file FWGeometryBrowser.cc.
References geodebug, m_autoExpand, m_filter, m_maxDaughters, m_mode, m_setters, m_settersFrame, and makeSetter().
Referenced by FWGeometryBrowser(), and setFrom().
{ if (!m_settersFrame->GetList()->IsEmpty()) { m_setters.clear(); TGFrameElement *el = (TGFrameElement*) m_settersFrame->GetList()->First(); m_settersFrame->RemoveFrame(el->fFrame); } TGHorizontalFrame* frame = new TGHorizontalFrame(m_settersFrame); m_settersFrame->AddFrame(frame); makeSetter(frame, &m_mode); makeSetter(frame, &m_filter); makeSetter(frame, &m_autoExpand); if (geodebug) makeSetter(frame, &m_maxDaughters); m_settersFrame->MapSubwindows(); Layout(); }
void FWGeometryBrowser::setFrom | ( | const FWConfiguration & | iFrom | ) | [virtual] |
Reimplemented from FWConfigurableParameterizable.
Definition at line 115 of file FWGeometryBrowser.cc.
References FWParameterizable::begin(), FWParameterizable::end(), geodebug, m_maxDaughters, and resetSetters().
Referenced by FWGUIManager::setFrom().
{ for(const_iterator it =begin(), itEnd = end(); it != itEnd; ++it) { if (!geodebug && (&m_maxDaughters == (*it))) continue; (*it)->setFrom(iFrom); } resetSetters(); }
void FWGeometryBrowser::updateStatusBar | ( | const char * | status | ) |
Definition at line 233 of file FWGeometryBrowser.cc.
References m_statBar.
Referenced by FWGeometryTableManager::loadGeometry(), readFile(), and FWGeometryTableManager::setTableContent().
void FWGeometryBrowser::windowIsClosing | ( | ) |
Definition at line 164 of file FWGeometryBrowser.cc.
{ UnmapWindow(); }
friend class FWGeometryTableManager [friend] |
Definition at line 39 of file FWGeometryBrowser.h.
Referenced by FWGeometryBrowser().
FWLongParameter FWGeometryBrowser::m_autoExpand [protected] |
Definition at line 68 of file FWGeometryBrowser.h.
Referenced by FWGeometryTableManager::FWGeometryTableManager(), resetSetters(), and FWGeometryTableManager::setTableContent().
TGTextButton* FWGeometryBrowser::m_fileOpen [private] |
Definition at line 82 of file FWGeometryBrowser.h.
Referenced by FWGeometryBrowser().
FWStringParameter FWGeometryBrowser::m_filter [protected] |
Definition at line 67 of file FWGeometryBrowser.h.
Referenced by FWGeometryTableManager::filterOff(), FWGeometryTableManager::FWGeometryTableManager(), resetSetters(), FWGeometryTableManager::setTableContent(), and FWGeometryTableManager::updateFilter().
TFile* FWGeometryBrowser::m_geometryFile [private] |
Definition at line 81 of file FWGeometryBrowser.h.
Referenced by browse(), and readFile().
FWGUIManager* FWGeometryBrowser::m_guiManager [private] |
Definition at line 76 of file FWGeometryBrowser.h.
Referenced by browse().
FWLongParameter FWGeometryBrowser::m_maxDaughters [protected] |
Definition at line 69 of file FWGeometryBrowser.h.
Referenced by FWGeometryTableManager::FWGeometryTableManager(), resetSetters(), setFrom(), and FWGeometryTableManager::setTableContent().
FWEnumParameter FWGeometryBrowser::m_mode [protected] |
Definition at line 66 of file FWGeometryBrowser.h.
Referenced by FWGeometryBrowser(), FWGeometryTableManager::FWGeometryTableManager(), resetSetters(), and FWGeometryTableManager::setTableContent().
std::vector<boost::shared_ptr<FWParameterSetterBase> > FWGeometryBrowser::m_setters [private] |
Definition at line 87 of file FWGeometryBrowser.h.
Referenced by makeSetter(), and resetSetters().
TGCompositeFrame* FWGeometryBrowser::m_settersFrame [private] |
Definition at line 84 of file FWGeometryBrowser.h.
Referenced by FWGeometryBrowser(), and resetSetters().
TGStatusBar* FWGeometryBrowser::m_statBar [private] |
Definition at line 83 of file FWGeometryBrowser.h.
Referenced by FWGeometryBrowser(), and updateStatusBar().
Definition at line 79 of file FWGeometryBrowser.h.
Referenced by cellClicked(), FWGeometryBrowser(), newIndexSelected(), and readFile().
FWTableWidget* FWGeometryBrowser::m_tableWidget [private] |
Definition at line 78 of file FWGeometryBrowser.h.
Referenced by FWGeometryBrowser().