|
12 | 12 | /// \file GPUDisplayControl.h |
13 | 13 | /// \author David Rohr |
14 | 14 |
|
15 | | -#ifndef GPUDISPLAYCONTROL_H |
16 | | -#define GPUDISPLAYCONTROL_H |
| 15 | +// No include guard: included multiple times by qconfig with different macro definitions |
17 | 16 |
|
18 | 17 | #include <atomic> |
19 | 18 | #include <cstdint> |
20 | 19 | #include <string> |
| 20 | +#include "GPUDisplayTypes.h" |
21 | 21 |
|
22 | | -namespace o2::gpu |
23 | | -{ |
24 | | -template <class T> |
25 | | -struct GPUDisplayCopyableAtomic : std::atomic<T> { // std::atomic deletes the copy, here it copies the value |
26 | | - using std::atomic<T>::atomic; |
27 | | - GPUDisplayCopyableAtomic(const GPUDisplayCopyableAtomic& o) : std::atomic<T>(o.load()) {} |
28 | | - GPUDisplayCopyableAtomic& operator=(const GPUDisplayCopyableAtomic& o) |
29 | | - { |
30 | | - this->store(o.load()); |
31 | | - return *this; |
32 | | - } |
33 | | -}; |
34 | | - |
35 | | -struct GPUDisplayControl { // Settings of the display without RTTI, copied to the Qt GUI |
36 | | - GPUDisplayCopyableAtomic<int32_t> mDisplayControl = 0; // Control for next event (=1) or quit (=2) |
37 | | - GPUDisplayCopyableAtomic<bool> mResetScene = false; |
38 | | - int32_t mPrintInfoText = 1; |
39 | | - bool mPrintInfoTextAlways = false; |
40 | | - bool mRequestScreenshot = false; |
41 | | - int32_t mAnimateScreenshot = 0; |
42 | | - bool mAnimationChangeConfig = true; |
43 | | - float mAnimationDelay = 2.f; |
44 | | - bool mPrintInfoTextGUI = true; // Send the status and info text to the Qt GUI, shown at its bottom |
45 | | - bool mGuiPrintInfo = false; // Show the info of options changed with Qt GUI elements (not for key presses in the GUI) |
46 | | - bool mRotateModel = false; // Rotate the model instead of the camera, like holding RCTRL (set in the Qt GUI) |
47 | | - bool mRotateAroundZ = false; // Rotate the TPC around the beamline, like holding RALT (set in the Qt GUI) |
48 | | - std::string mFilterMacroCustom; // Code of the custom track filter ROOT macro (trackFilter = filterMacros.size() + 1), set in the Qt GUI |
49 | | - std::string mScreenShotname = "screenshot"; // Name of screenshot and animation frame files, followed by numbers |
50 | | - std::string mGLPosFile = "glpos.tmp"; // File for saving / loading the camera position |
51 | | - std::string mGLAnimationFile = "glanimation.tmp"; // File for saving / loading the animation path |
52 | | - int8_t mGuiDarkMode = -1; // Dark mode of the Qt GUI, -1 = not yet set: the GUI reports the system scheme when it starts |
53 | | - float mGuiScale = 1.f; // Scale factor of text and elements of the Qt GUI (on top of the system scaling), Ctrl + mouse wheel / Ctrl + 0 in the GUI |
54 | | - bool dummy = false; // dummy value to reference for keys that do not change variables |
55 | | -}; |
56 | | -} // namespace o2::gpu |
57 | | - |
58 | | -#endif |
| 22 | +// clang-format off |
| 23 | +BeginNamespace(o2::gpu) |
| 24 | +BeginHiddenConfig(GPUDisplayControl, control) |
| 25 | + AddVariable(mDisplayControl, GPUDisplayCopyableAtomic<int32_t>, 0) // Control for next event (=1) or quit (=2) |
| 26 | + AddVariable(mResetScene, GPUDisplayCopyableAtomic<bool>, false) |
| 27 | + AddVariable(mPrintInfoText, int32_t, 1) |
| 28 | + AddVariable(mPrintInfoTextAlways, bool, false) |
| 29 | + AddVariable(mRequestScreenshot, bool, false) |
| 30 | + AddVariable(mAnimateScreenshot, int32_t, 0) |
| 31 | + AddVariable(mAnimationChangeConfig, bool, true) |
| 32 | + AddVariable(mAnimationDelay, float, 2.f) |
| 33 | + AddVariable(mPrintInfoTextGUI, bool, true) // Send the status and info text to the Qt GUI, shown at its bottom |
| 34 | + AddVariable(mGuiPrintInfo, bool, false) // Show the info of options changed with Qt GUI elements (not for key presses in the GUI) |
| 35 | + AddVariable(mRotateModel, bool, false) // Rotate the model instead of the camera, like holding RCTRL (set in the Qt GUI) |
| 36 | + AddVariable(mRotateAroundZ, bool, false) // Rotate the TPC around the beamline, like holding RALT (set in the Qt GUI) |
| 37 | + AddVariable(mFilterMacroCustom, std::string, "") // Code of the custom track filter ROOT macro (trackFilter = filterMacros.size() + 1), set in the Qt GUI |
| 38 | + AddVariable(mScreenShotname, std::string, "screenshot") // Name of screenshot and animation frame files, followed by numbers |
| 39 | + AddVariable(mGLPosFile, std::string, "glpos.tmp") // File for saving / loading the camera position |
| 40 | + AddVariable(mGLAnimationFile, std::string, "glanimation.tmp") // File for saving / loading the animation path |
| 41 | + AddVariable(mGuiDarkMode, int8_t, -1) // Dark mode of the Qt GUI, -1 = not yet set: the GUI reports the system scheme when it starts |
| 42 | + AddVariable(mGuiScale, float, 1.f) // Scale factor of text and elements of the Qt GUI (on top of the system scaling), Ctrl + mouse wheel / Ctrl + 0 in the GUI |
| 43 | + AddVariable(dummy, bool, false) // dummy value to reference for keys that do not change variables |
| 44 | +EndConfig() |
| 45 | +EndNamespace() // o2::gpu |
0 commit comments