Belle II Software development
|
Control TEve browser user interface. More...
#include <DisplayUI.h>
Classes | |
struct | Parameter |
Wraps a module parameter that can be toggled from the UI. More... | |
Public Member Functions | |
DisplayUI (bool automatic=false, bool advance=false) | |
Constructor. | |
~DisplayUI () | |
Destructor. | |
void | addParameter (const std::string &label, ModuleParam< bool > ¶m, int level) |
Generate UI elements so the given module parameter can be changed at run time. | |
void | next () |
Go to next event. | |
void | prev () |
Go to previous event. | |
void | goToEvent (Long_t id) |
Go to event with index id. | |
void | goToEvent (Long_t event, Long_t run, Long_t experiment) |
Go to the event specified, using the input file's index. | |
void | goToEventWidget () |
go to the event given by m_eventNumberWidget. | |
void | autoAdvanceDelayChanged () |
m_autoAdvanceDelay was changed, update m_timer if enabled. | |
void | togglePlayPause () |
Handle Play/Pause button clicks. | |
void | showJumpToEventDialog () |
Show a dialog to to enter exp, run, event numbers. | |
void | clearEvent () |
remove all event data in current event. | |
void | startAutomaticRun () |
switch to automatic mode, where visualisations are saved for each event, with no interactive control. | |
void | automaticEvent () |
The actual per-event functionality for automatic saving. | |
bool | startDisplay () |
Start interactive display for current event. | |
void | setTitle (const std::string &fileName="") |
Set title of Eve window. | |
void | allowFlaggingEvents (const std::string &description="") |
Show control for flagging events (to set module return value). | |
bool | getReturnValue () const |
Return value for current event, only makes sense if allowFlaggingEvents(true) was called. | |
void | hideObjects (const std::vector< std::string > &names) |
hide objects with the given names. | |
void | toggleColorScheme () |
Toggle between light and dark color scheme for viewers. | |
void | toggleUndock () |
dock/undock active viewer. | |
void | handleParameterChange (int id) |
Called when one of the module parameters is changed via UI. | |
void | savePicture (bool highres=false) |
Save the current view to a user-defined filename. | |
void | saveHiResPicture () |
alias for savePicture(true). | |
SplitGLView * | getViewPane () |
return right-side pane with viewers. | |
void | pollNewEvents () |
Check if new events are available, and go to next event. | |
void | closeAndExit () |
Close window and exit immediately. | |
void | showUserData (const DisplayData &displayData) |
Add user-defined data (histograms, etc.). | |
bool | cumulativeIsOn () const |
If true, DisplayModule shouldn't clear previous data (i.e. | |
void | toggleCumulative () |
toggle cumulative mode. | |
void | selectionHandler (TEveElement *eveObj) |
Handle special actions when objects are selected. | |
void | handleEvent (Event_t *event) |
Handles keyboard shortcuts. | |
Private Member Functions | |
void | makeGui () |
Build the buttons for event navigation. | |
void | updateUI () |
Update UI after a new event was loaded, as well as m_currentEntry. | |
Private Attributes | |
long | m_currentEntry {0} |
Current entry id. | |
bool | m_guiInitialized {false} |
Was GUI already built? | |
bool | m_reshowCurrentEvent {false} |
Show current event again after startDisplay() returns? | |
bool | m_automatic {false} |
If true, disable interactive control and call automaticEvent() instead. | |
bool | m_advance {false} |
If true, start advancing through the events on startup. | |
bool | m_cumulative {false} |
If true, DisplayModule shouldn't clear previous data (i.e. | |
std::vector< Parameter > | m_paramList |
List of run time configurable module parameters. | |
TGButton * | m_prevButton {nullptr} |
Button to switch to previous event. | |
TGButton * | m_nextButton {nullptr} |
Button to switch to next event. | |
TGNumberEntry * | m_eventNumberWidget {nullptr} |
Event switcher with numeric entry. | |
TGNumberEntry * | m_autoAdvanceDelay {nullptr} |
Delay for automatic advance, in seconds. | |
TGPictureButton * | m_playPauseButton {nullptr} |
Play / Pause button. | |
TGCheckButton * | m_flagEvent {nullptr} |
Show control for flagging events (to set module return value). | |
TGLabel * | m_eventLabel {nullptr} |
show event/run/exp number for current event. | |
TGTextEntry * | m_autoFileNamePrefix {nullptr} |
File name prefix (prefix + event number + "_" + projection + ".png"). | |
TGNumberEntry * | m_autoPictureWidth {nullptr} |
width of saved PNGs. | |
TEveElementList * | m_eventData {nullptr} |
List of event data, including projections. | |
SplitGLView * | m_viewPane {nullptr} |
pointer to right-side pane with viewers. | |
TTimer * | m_timer {nullptr} |
Polling/auto-advance timer. | |
std::vector< std::string > | m_hideObjects |
objects which are to be hidden (can be manually re-enabled in tree view). | |
Control TEve browser user interface.
Mostly responsible for interactive elements like buttons etc.
Definition at line 41 of file DisplayUI.h.
|
explicit |
Constructor.
automatic | if true, hide window and save events using automaticEvent() |
advance | if true, start advancing through the events on startup. |
Definition at line 58 of file DisplayUI.cc.
~DisplayUI | ( | ) |
void addParameter | ( | const std::string & | label, |
ModuleParam< bool > & | param, | ||
int | level | ||
) |
Generate UI elements so the given module parameter can be changed at run time.
Will result in a checkbox with given label indented by the amount in level (0 being leftmost). Clicking the checkbox will toggle the parameter and reload the event.
Definition at line 87 of file DisplayUI.cc.
void allowFlaggingEvents | ( | const std::string & | description = "" | ) |
Show control for flagging events (to set module return value).
Needs to be called in initialize().
Definition at line 124 of file DisplayUI.cc.
void autoAdvanceDelayChanged | ( | ) |
m_autoAdvanceDelay was changed, update m_timer if enabled.
Definition at line 233 of file DisplayUI.cc.
void automaticEvent | ( | ) |
The actual per-event functionality for automatic saving.
Definition at line 763 of file DisplayUI.cc.
void clearEvent | ( | ) |
remove all event data in current event.
Definition at line 282 of file DisplayUI.cc.
void closeAndExit | ( | ) |
Close window and exit immediately.
Definition at line 803 of file DisplayUI.cc.
|
inline |
If true, DisplayModule shouldn't clear previous data (i.e.
we want to show multiple events)
Definition at line 148 of file DisplayUI.h.
bool getReturnValue | ( | ) | const |
Return value for current event, only makes sense if allowFlaggingEvents(true) was called.
Return value for current event, only makes sense if allowFlaggingEvents() was called.
Definition at line 134 of file DisplayUI.cc.
|
inline |
void goToEvent | ( | Long_t | event, |
Long_t | run, | ||
Long_t | experiment | ||
) |
Go to the event specified, using the input file's index.
Definition at line 216 of file DisplayUI.cc.
void goToEvent | ( | Long_t | id | ) |
Go to event with index id.
Definition at line 182 of file DisplayUI.cc.
void goToEventWidget | ( | ) |
go to the event given by m_eventNumberWidget.
Definition at line 228 of file DisplayUI.cc.
void handleEvent | ( | Event_t * | event | ) |
Handles keyboard shortcuts.
Definition at line 312 of file DisplayUI.cc.
void handleParameterChange | ( | int | id | ) |
Called when one of the module parameters is changed via UI.
Definition at line 641 of file DisplayUI.cc.
|
inline |
hide objects with the given names.
Definition at line 112 of file DisplayUI.h.
|
private |
Build the buttons for event navigation.
Definition at line 406 of file DisplayUI.cc.
void next | ( | ) |
Go to next event.
Definition at line 96 of file DisplayUI.cc.
void pollNewEvents | ( | ) |
Check if new events are available, and go to next event.
Only useful for AsyncDisplay.
Definition at line 789 of file DisplayUI.cc.
void prev | ( | ) |
Go to previous event.
Definition at line 104 of file DisplayUI.cc.
|
inline |
alias for savePicture(true).
Definition at line 130 of file DisplayUI.h.
void savePicture | ( | bool | highres = false | ) |
Save the current view to a user-defined filename.
highres | save picture with 4000px width instead of screen size |
Definition at line 703 of file DisplayUI.cc.
void selectionHandler | ( | TEveElement * | eveObj | ) |
Handle special actions when objects are selected.
Definition at line 297 of file DisplayUI.cc.
void setTitle | ( | const std::string & | fileName = "" | ) |
Set title of Eve window.
Add fileName, if given.
Definition at line 113 of file DisplayUI.cc.
void showJumpToEventDialog | ( | ) |
Show a dialog to to enter exp, run, event numbers.
Definition at line 259 of file DisplayUI.cc.
void showUserData | ( | const DisplayData & | displayData | ) |
Add user-defined data (histograms, etc.).
Definition at line 831 of file DisplayUI.cc.
void startAutomaticRun | ( | ) |
switch to automatic mode, where visualisations are saved for each event, with no interactive control.
Definition at line 752 of file DisplayUI.cc.
bool startDisplay | ( | ) |
Start interactive display for current event.
Returns only after user presses prev/next, or closes the window.
Definition at line 337 of file DisplayUI.cc.
void toggleColorScheme | ( | ) |
Toggle between light and dark color scheme for viewers.
Definition at line 655 of file DisplayUI.cc.
|
inline |
void togglePlayPause | ( | ) |
Handle Play/Pause button clicks.
Definition at line 241 of file DisplayUI.cc.
void toggleUndock | ( | ) |
dock/undock active viewer.
Definition at line 674 of file DisplayUI.cc.
|
private |
Update UI after a new event was loaded, as well as m_currentEntry.
Definition at line 139 of file DisplayUI.cc.
|
private |
If true, start advancing through the events on startup.
Definition at line 189 of file DisplayUI.h.
|
private |
Delay for automatic advance, in seconds.
Definition at line 207 of file DisplayUI.h.
|
private |
File name prefix (prefix + event number + "_" + projection + ".png").
Definition at line 219 of file DisplayUI.h.
|
private |
If true, disable interactive control and call automaticEvent() instead.
Definition at line 186 of file DisplayUI.h.
|
private |
width of saved PNGs.
Definition at line 222 of file DisplayUI.h.
|
private |
If true, DisplayModule shouldn't clear previous data (i.e.
we want to show multiple events)
Definition at line 192 of file DisplayUI.h.
|
private |
Current entry id.
Definition at line 177 of file DisplayUI.h.
|
private |
List of event data, including projections.
Definition at line 225 of file DisplayUI.h.
|
private |
show event/run/exp number for current event.
Definition at line 216 of file DisplayUI.h.
|
private |
Event switcher with numeric entry.
Definition at line 204 of file DisplayUI.h.
|
private |
Show control for flagging events (to set module return value).
Definition at line 213 of file DisplayUI.h.
|
private |
Was GUI already built?
Definition at line 180 of file DisplayUI.h.
|
private |
objects which are to be hidden (can be manually re-enabled in tree view).
Names correspond to the object names in the 'Event Scene'.
Definition at line 234 of file DisplayUI.h.
|
private |
Button to switch to next event.
Definition at line 201 of file DisplayUI.h.
|
private |
List of run time configurable module parameters.
Definition at line 195 of file DisplayUI.h.
|
private |
Play / Pause button.
Definition at line 210 of file DisplayUI.h.
|
private |
Button to switch to previous event.
Definition at line 198 of file DisplayUI.h.
|
private |
Show current event again after startDisplay() returns?
Definition at line 183 of file DisplayUI.h.
|
private |
Polling/auto-advance timer.
Definition at line 231 of file DisplayUI.h.
|
private |
pointer to right-side pane with viewers.
Definition at line 228 of file DisplayUI.h.