You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dc52267
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: GPU/GPUTracking/display/GPUDisplay.h
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -149,6 +149,11 @@ class GPUDisplay : public GPUDisplayInterface
149
149
}
150
150
};
151
151
152
+
structanimationVector { // Animation point, its time is in mCfgC.animationPoints.values
153
+
float v[8]; // Camera, depending on cfgL.animationMode (setAnimationPoint)
154
+
GPUSettingsDisplayLight cfgL; // Settings at the point
155
+
};
156
+
152
157
classopengl_spline
153
158
{
154
159
public:
@@ -200,7 +205,13 @@ class GPUDisplay : public GPUDisplayInterface
200
205
voidrotateCamera(constfloat (&angles)[3]); // Yaw, pitch, roll in degrees relative to the view, as the keyboard
201
206
hmm_mat4 cameraRotation(constfloat (&angles)[3]) const; // Rotation of rotateCamera, applied to the view matrix also for keyboard / mouse
202
207
voidresetAnimation();
203
-
voidremoveAnimationPoint();
208
+
voidremoveAnimationPoint(int32_t i = -1); // -1: the selected one, the last one if none is selected
209
+
voidStopAnimation(); // Ends a running animation, camera and settings stay as they are; for changed settings (checkAndApplyConfigChanges), scene reset, changes of the animation points
210
+
voidsetCameraFromAnimationPoint(const animationVector& p); // Camera stored in the point, as the animation shows it there
211
+
voidselectAnimationPoint(int32_t i); // -1: none, otherwise also loads its light settings and camera
212
+
voidsetAnimationPointsFromGUI(const GPUDisplayMultiSliderValue& points); // New times from the Qt GUI: reorders the points, selection
213
+
voidupdateAnimationPointsGUI(); // Range end of the GUI multi slider: last time + animationDelay, progress 0 without animation
214
+
voidanimationViewMatrix(float (&vals)[8], int32_t mode, hmm_mat4& viewMatrix) const; // Camera of interpolated / stored animation values (v[1..8]), as animateCamera
AddVariable(guiDarkMode, int8_t, -1) // Dark mode of the Qt GUI, -1 = not yet set: the GUI reports the system scheme when it starts
42
42
AddVariable(guiScale, 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
43
AddVariable(showConsole, bool, false) // Console shown (^ key): all other keys go to the console
44
+
AddVariable(animationPoints, GPUDisplayMultiSliderValue, GPUDisplayMultiSliderValue()) // Times of the animation points (GPUDisplay::mAnimationVectors) and the selected one, shown in the Qt GUI
44
45
AddVariable(dummy, bool, false) // dummy value to reference for keys that do not change variables
Copy file name to clipboardExpand all lines: GPU/GPUTracking/display/GPUDisplayTypes.h
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,27 @@
15
15
#ifndef GPUDISPLAYTYPES_H
16
16
#defineGPUDISPLAYTYPES_H
17
17
18
+
#include"utils/vecpod.h"
19
+
#include<cstdint>
20
+
#include<ostream>
21
+
18
22
namespaceo2::gpu
19
23
{
24
+
structGPUDisplayMultiSliderValue { // Value of a Qt GUI multi slider (GUI_MULTI_SLIDER): positions in the order of the display, selected one (-1: none), end of the range, progress
25
+
vecpod<float> values;
26
+
int16_t selected = -1;
27
+
uint16_t progress = 0; // Fraction (of 65535) of the last position highlighted, e.g. a running animation; small types: GPUDisplayGUIValue must not grow
static std::vector<std::pair<std::string, GPUDisplayGUIValue>> guiSliderValues(std::initializer_list<GPUDisplayGUIValue> values) // Choices of GUI_SLIDER_VALUES, named by their value
throwstd::runtime_error("GUI element " + element.name + ": choices are needed for radio buttons and dropdown menus, and only allowed for them and sliders");
auto pointIndex = [this](constchar* command, const GPUDisplayConsole::consoleArg& a) -> std::optional<int32_t> { // Index of an animation point or -1, error message otherwise
151
+
constint64_t i = std::get<int64_t>(a);
152
+
if (i < -1 || i >= (int64_t)mDisplay->mAnimationVectors.size()) {
153
+
mConsole->consolePrint("%s: no animation point %lld (%zu points)", command, (longlong)i, mDisplay->mAnimationVectors.size());
154
+
return std::nullopt;
155
+
}
156
+
return i;
157
+
};
158
+
commands["removeAnimationPoint"] = {[this, pointIndex](args a) {
159
+
if (constauto i = pointIndex("removeAnimationPoint", a[0])) {
160
+
mDisplay->removeAnimationPoint(*i);
161
+
}
162
+
},
163
+
"i", "Remove the animation point with this index, -1: the selected one, or the last one if none is selected"};
164
+
commands["selectAnimationPoint"] = {[this, pointIndex](args a) {
165
+
if (constauto i = pointIndex("selectAnimationPoint", a[0])) {
166
+
mDisplay->selectAnimationPoint(*i);
167
+
}
168
+
},
169
+
"i", "Select an animation point (-1: none): loads its settings and camera, later changes of the light settings are stored in it"};
150
170
auto fileCommand = [this](std::string GPUDisplayControl::* file, void (GPUDisplay::*function)()) { // Sets the file name option (as in the GUI) and runs the function
auto transient = [this](uint32_t i) { // Control values that are actions / state, not settings: not saved, not reset with a group
192
212
constauto& e = mConfiguration->rttiEntries[i];
193
-
return e.type.starts_with("GPUDisplayCopyableAtomic") || e.name == "requestScreenshot" || e.name == "showConsole" || e.name == "dummy"; // TODO: Settings struct should be split in transient and none-transient, to get rid of these string compares
213
+
return e.type.starts_with("GPUDisplayCopyableAtomic") || e.name == "requestScreenshot" || e.name == "showConsole" || e.name == "dummy" || e.name == "animationPoints"; // TODO: Settings struct should be split in transient and none-transient, to get rid of these string compares
194
214
};
195
215
auto defaultValue = [this](uint32_t i) -> GPUDisplayConsole::consoleArg { // Default from the RTTI, as setValue expects it
196
216
constauto& e = mConfiguration->rttiEntries[i];
197
217
if (e.type == "std::string" || e.type == "bool") {
198
218
return e.defaultValue;
199
219
}
200
-
int64_t intValue;
220
+
int64_t intValue = 0;
201
221
constchar* end = e.defaultValue.c_str() + e.defaultValue.size();
202
222
if (std::from_chars(e.defaultValue.c_str(), end, intValue).ptr == end) { // Integers exactly, not through double
0 commit comments