15 #include "TRootEmbeddedCanvas.h" 28 #include "cetlib_except/exception.h" 35 static std::vector<DisplayWindow*>
gsWindows(64);
42 static std::vector<std::string>
gsName;
50 for (
size_t i=0; i<
gsWindows.size(); ++i) {
59 for (
size_t i=0; i<
gsWindows.size(); ++i) {
75 for (
size_t i=0; i<
gsWindows.size(); ++i) {
97 const char* description,
102 gsName.push_back(std::string(name));
103 gsDescription.push_back(std::string(description));
104 gsHeight.push_back(h);
105 gsWidth.push_back(w);
106 gsCanvasCreator.push_back(creator);
119 if (type>0)
id = type;
120 if (
id>=gsName.size())
return 0;
146 <<
" cannot open DisplayWindow";
148 throw cet::exception(
"DisplayWindow") <<
"No ROOT global TClient";
150 const TGWindow* tgw = gClient->GetRoot();
157 unsigned int w = gsWidth[id];
158 unsigned int h = gsHeight[id];
159 fMain =
new TGMainFrame(tgw, w-1, h-1);
167 fMain->SetWindowName(gsName[
id].c_str());
170 fMain->MapSubwindows();
180 fMain->Connect(
"CloseWindow()",
"evdb::DisplayWindow",
this,
"CloseWindow()");
203 for (
unsigned int i=0; i<
gsWindows.size(); ++i) {
MenuBar * fMenuBar
Top menu bar.
void Connect()
Make signal/slot connections.
const art::Event * GetEvent() const
virtual void CloseWindow()
static std::vector< DisplayWindow * > gsWindows(64)
virtual void Draw(const char *opt="")
A status bar on the bottom of the display.
ButtonBar * fButtonBar
Top button bar.
static std::vector< unsigned int > gsWidth
static void SetServicesAll()
Canvas *(* CanvasCreator_t)(TGMainFrame *mf)
Manage all things related to colors for the event display.
static std::vector< CanvasCreator_t > gsCanvasCreator
Singleton to hold the current art::Event for the event display.
static int OpenWindow(int type=0)
Base class for define a detector display.
StatusBar * fStatusBar
Status bar running along the bottom.
static void SetRunEventAll(int run, int event)
static EventHolder * Instance()
static void Register(const char *name, const char *description, unsigned int h, unsigned int w, CanvasCreator_t creator)
Canvas * fDisplay
Display of detector event information.
static std::vector< std::string > gsName
void SetRunEvent(int run, int event)
static void DrawAll(const char *opt=0)
static const std::vector< std::string > & Names()
A status bar on the bottom of the display.
static std::vector< std::string > gsDescription
EventNumber_t event() const
A window containing a display of the detector or one of its components.
DisplayWindow(int window=0)
TGMainFrame * fMain
Main window.
virtual void Draw(const char *opt=0)=0
cet::coded_exception< error, detail::translate > exception
Event finding and building.
static std::vector< unsigned int > gsHeight