DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventControl.h
Go to the documentation of this file.
1 // $Id: $
2 //==========================================================================
3 // AIDA Detector description implementation for LCD
4 //--------------------------------------------------------------------------
5 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
6 // All rights reserved.
7 //
8 // For the licensing terms see $DD4hepINSTALL/LICENSE.
9 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
10 //
11 // Author : M.Frank
12 //
13 //==========================================================================
14 #ifndef DD4HEP_DDEVE_EVENTCONTROL_H
15 #define DD4HEP_DDEVE_EVENTCONTROL_H
16 
17 // Framework include files
18 #include "DDEve/FrameControl.h"
20 
21 // Forward declarations
22 class TGPictureButton;
23 class TGLabel;
24 
26 namespace DD4hep {
27 
28  // Forward declarations
29  class Display;
30 
37  class EventControl : public FrameControl, public EventConsumer {
38  enum { NUM_DATA_LINES = 40 };
42  TGGroupFrame *m_dataGroup;
43  TGCompositeFrame *m_dataFrame;
45  TGGroupFrame *m_eventGroup;
46  TGCompositeFrame *m_numEvtFrame;
47  TGLabel *m_input1, *m_input2;
48  TGLabel *m_numEvtLabel;
49  TGPictureButton *m_open, *m_prev, *m_next, *m_goto;
50  typedef std::pair<TGLabel*,TGLabel*> Labels;
51  typedef std::pair<TGCompositeFrame*,Labels> Line;
52  typedef std::vector<Line > Lines;
54  public:
56  EventControl(Display* disp, unsigned int width, unsigned int height);
58  virtual ~EventControl();
59 
61  virtual void OnBuild();
63  TGCompositeFrame* CreateFrame();
64 
66  virtual bool Open();
68  virtual void NextEvent();
70  virtual void PreviousEvent();
72  virtual void GotoEvent();
73 
74 
76  virtual void OnNewEvent(EventHandler* handler);
77 
79  virtual void OnFileOpen(EventHandler* handler);
80 
81  ClassDef(EventControl,0) // Top level window frame
82  };
83 
84 
85 } /* End namespace DD4hep */
86 
87 
88 #endif /* DD4HEP_DDEVE_EVENTCONTROL_H */
89 
TGCompositeFrame * m_dataFrame
Definition: EventControl.h:43
virtual void OnNewEvent(EventHandler *handler)
EventConsumer overload: New consumer event data.
ClassDef(EventConsumer, 0)
virtual void OnFileOpen(EventHandler *handler)
EventConsumer overload: New event data file.
virtual void GotoEvent()
Goto a specified event.
virtual void OnBuild()
User callback to add elements to the control.
virtual void PreviousEvent()
Load the previous event.
Event handler base class. Interface to all DDEve I/O actions.
Definition: EventHandler.h:66
TGPictureButton * m_goto
Definition: EventControl.h:49
virtual void NextEvent()
Load the next event.
TGCompositeFrame * CreateFrame()
Create the frame for this control structure. Default: create horizontal frame.
std::vector< Line > Lines
Definition: EventControl.h:52
TGPictureButton * m_next
Definition: EventControl.h:49
std::pair< TGCompositeFrame *, Labels > Line
Definition: EventControl.h:51
TGGroupFrame * m_eventGroup
Data frame.
Definition: EventControl.h:45
EventControl(Display *disp, unsigned int width, unsigned int height)
Standard constructor.
TGCompositeFrame * m_numEvtFrame
Definition: EventControl.h:46
TGLabel * m_numEvtLabel
Definition: EventControl.h:48
TGPictureButton * m_prev
Definition: EventControl.h:49
std::pair< TGLabel *, TGLabel * > Labels
Definition: EventControl.h:50
TGGroupFrame * m_dataGroup
Data frame.
Definition: EventControl.h:42
class FrameControl FrameControl.h DDEve/FrameControl.h
Definition: FrameControl.h:37
Display * m_display
Refernece to the display object.
Definition: EventControl.h:40
TGPictureButton * m_open
Definition: EventControl.h:49
The main class of the DDEve display.
Definition: Display.h:57
virtual bool Open()
Open a new event data file.
virtual ~EventControl()
Default destructor.