11 #include "TGFileDialog.h"
13 #include "TGStatusBar.h"
21 : TGMainFrame(gClient->GetRoot(), 600, 500),
22 m_mode(this,
"Mode:", 1
l, 0
l, 1
l),
23 m_filter(this,
"Materials:",std::string()),
24 m_autoExpand(this,
"AutoExpand:", 5
l, 0
l, 1000
l),
25 m_maxDaughters(this,
"MaxChildren:", 999
l, 0
l, 1000
l),
26 m_guiManager(guiManager),
37 TGTextButton*
m_fileOpen =
new TGTextButton (
this,
"Open Geometry File");
38 this->AddFrame(m_fileOpen,
new TGLayoutHints( kLHintsExpandX , 4, 2, 2, 2));
39 m_fileOpen->Connect(
"Clicked()",
"FWGeometryBrowser",
this,
"browse()");
43 this->AddFrame(
m_settersFrame,
new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
47 AddFrame(
m_tableWidget,
new TGLayoutHints(kLHintsExpandX|kLHintsExpandY,2,2,2,2));
51 m_tableWidget->Connect(
"cellClicked(Int_t,Int_t,Int_t,Int_t,Int_t,Int_t)",
52 "FWGeometryBrowser",
this,
53 "cellClicked(Int_t,Int_t,Int_t,Int_t,Int_t,Int_t)");
57 m_statBar =
new TGStatusBar(
this, this->GetWidth(), 12);
58 m_statBar->SetText(
"No simulation geomtery loaded.");
59 AddFrame(
m_statBar,
new TGLayoutHints(kLHintsExpandX));
61 SetWindowName(
"Geometry Browser");
62 this->Connect(
"CloseWindow()",
"FWGeometryBrowser",
this,
"windowIsClosing()");
66 gVirtualX->SelectInput(GetId(), kKeyPressMask | kKeyReleaseMask | kExposureMask |
67 kPointerMotionMask | kStructureNotifyMask | kFocusChangeMask |
68 kEnterWindowMask | kLeaveWindowMask);
80 TGFrameElement *el = (TGFrameElement*)
m_settersFrame->GetList()->First();
98 ptr->attach(param,
this);
100 TGFrame* pframe = ptr->build(frame,
false);
101 frame->AddFrame(pframe,
new TGLayoutHints(kLHintsExpandX));
124 (*it)->setFrom(iFrom);
134 if (iButton != kButton1)
140 if (iButton == kButton1 && iColumn == 0)
148 if (!fBindList)
return kFALSE;
150 TIter next(fBindList);
154 while ((m = (TGMapKey *) next())) {
155 if (m->fKeyCode == event->fCode) {
156 w = (TGFrame *) m->fWindow;
157 if (w->HandleKey(event))
return kTRUE;
172 if (iSelectedRow == -1)
184 throw std::runtime_error(
"No root file.");
189 throw std::runtime_error(
"Can't find TGeoManager object in selected file.");
191 TGeoManager* m_geoManager = (TGeoManager*)
m_geometryFile->Get(
"cmsGeo;1");
196 catch (std::runtime_error &
e)
206 std::cout<<
"FWGeometryBrowser::openFile()"<<std::endl;
210 const char* kRootType[] = {
"ROOT files",
"*.root", 0, 0};
212 fi.fFileTypes = kRootType;
216 new TGFileDialog(gClient->GetDefaultRoot(),
void updateStatusBar(const char *status)
std::vector< FWParameterBase * >::const_iterator const_iterator
FWStringParameter m_filter
const_iterator begin() const
TGTextButton * m_fileOpen
void cellClicked(Int_t iRow, Int_t iColumn, Int_t iButton, Int_t iKeyMod, Int_t iGlobalX, Int_t iGlobalY)
void newIndexSelected(int, int)
TGCompositeFrame * m_settersFrame
virtual ~FWGeometryBrowser()
static boost::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes...
void updateStatus(const char *status)
FWGeometryBrowser(FWGUIManager *)
void makeSetter(TGCompositeFrame *frame, FWParameterBase *param)
const_iterator end() const
bool addEntry(Long_t id, const std::string &txt)
FWLongParameter m_maxDaughters
Bool_t HandleKey(Event_t *event)
FWGUIManager * m_guiManager
CmsShowMainFrame * getMainFrame() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void loadGeometry(TGeoManager *geoManager)
virtual void addTo(FWConfiguration &) const
friend class FWGeometryTableManager
std::vector< boost::shared_ptr< FWParameterSetterBase > > m_setters
FWGeometryTableManager * m_tableManager
perl if(1 lt scalar(@::datatypes))
FWLongParameter m_autoExpand
void firstColumnClicked(int row)
virtual void setFrom(const FWConfiguration &)
FWTableWidget * m_tableWidget
virtual void addTo(FWConfiguration &) const