61 void HandleKey(uint8_t
key,
bool doNotHandleConfigChanges =
false);
66 void checkAndApplyConfigChanges(
const GPUSettingsDisplayHeavy& oldCfgH,
const GPUSettingsDisplayLight& oldCfgL,
const GPUSettingsDisplayRenderer& oldCfgR);
68 const GPUSettingsDisplayRenderer&
cfgR()
const {
return mCfgR; }
69 const GPUSettingsDisplayLight&
cfgL()
const {
return mCfgL; }
70 const GPUSettingsDisplayHeavy&
cfgH()
const {
return mCfgH; }
71 const GPUSettingsDisplay&
cfg()
const {
return mConfig; }
90 static constexpr int32_t NSECTORS = o2::tpc::constants::MAXSECTOR;
91 static constexpr float GL_SCALE_FACTOR = (1.f / 100.f);
93 static constexpr const int32_t N_POINTS_TYPE = 15;
94 static constexpr const int32_t N_POINTS_TYPE_TPC = 9;
95 static constexpr const int32_t N_POINTS_TYPE_TRD = 2;
96 static constexpr const int32_t N_POINTS_TYPE_TOF = 2;
97 static constexpr const int32_t N_POINTS_TYPE_ITS = 2;
98 static constexpr const int32_t N_LINES_TYPE = 7;
99 static constexpr const int32_t N_FINAL_TYPE = 4;
100 static constexpr int32_t TRACK_TYPE_ID_LIMIT = 100;
101 enum PointTypes { tCLUSTER = 0,
107 tEXTRAPOLATEDTRACK = 6,
116 enum LineTypes { RESERVED = 0 };
120 struct threadVertexBuffer {
125 threadVertexBuffer() :
buffer()
127 for (int32_t
i = 0;
i < N_FINAL_TYPE;
i++) {
134 for (int32_t
i = 0;
i < N_FINAL_TYPE;
i++) {
144 opengl_spline() : ma(), mb(), mc(), md(), mx() {}
146 float evaluate(
float x);
147 void setVerbose() { mVerbose =
true; }
151 bool mVerbose =
false;
154 static const GPUSettingsDisplay& GetConfig(GPUChainTracking*
chain);
155 static const GPUSettingsProcessing& GetProcessingConfig(GPUChainTracking*
chain);
157 void DrawGLScene_internal(
float animateTime = -1.f,
bool renderToMixBuffer =
false);
158 void DrawGLScene_updateEventData();
159 void DrawGLScene_cameraAndAnimation(
float animateTime,
float& mixSlaveImage,
hmm_mat4& nextViewMatrix);
160 size_t DrawGLScene_updateVertexList();
161 void DrawGLScene_drawCommands();
162 int32_t InitDisplay_internal();
163 int32_t getNumThreads();
164 void updateOptions();
165 void disableUnsupportedOptions();
166 int32_t buildTrackFilter();
167 const GPUTPCTracker& sectorTracker(int32_t
iSector);
168 const GPUTRDGeometry* trdGeometry();
169 const GPUTrackingInOutPointers* mIOPtrs =
nullptr;
171 void insertVertexList(int32_t
iSector,
size_t first,
size_t last);
172 template <
typename... Args>
173 void SetInfo(Args... args);
174 void PrintGLHelpText(
float colorValue);
175 void calcXYZ(
const float*);
176 void mAnimationCloseAngle(
float& newangle,
float lastAngle);
177 void mAnimateCloseQuaternion(
float*
v,
float lastx,
float lasty,
float lastz,
float lastw);
178 void setAnimationPoint();
179 void resetAnimation();
180 void removeAnimationPoint();
181 void startAnimation();
182 int32_t animateCamera(
float& animateTime,
float& mixSlaveImage,
hmm_mat4& nextViewMatrix);
183 void showInfo(
const char* info);
184 void ActivateColor();
188 void SetColorClusters();
189 void SetColorInitLinks();
190 void SetColorLinks();
191 void SetColorSeeds();
192 void SetColorTracklets();
193 void SetColorTracks();
194 void SetColorExtrapolatedTracks();
195 void SetColorFinal();
197 void SetColorGridTRD();
198 void SetColorMarked();
199 void SetCollisionColor(int32_t
col);
201 void drawPointLinestrip(int32_t
iSector, int32_t cid, int32_t
id, int32_t id_limit = TRACK_TYPE_ID_LIMIT);
202 void DrawClusters(int32_t
iSector);
203 vboList DrawSpacePointsTRD(int32_t
iSector, int32_t
select, int32_t iCol);
204 vboList DrawSpacePointsTOF(int32_t
iSector, int32_t
select, int32_t iCol);
205 vboList DrawSpacePointsITS(int32_t
iSector, int32_t
select, int32_t iCol);
206 vboList DrawLinks(
const GPUTPCTracker& tracker, int32_t
id,
bool dodown =
false);
207 vboList DrawSeeds(
const GPUTPCTracker& tracker);
208 vboList DrawTracklets(
const GPUTPCTracker& tracker);
209 vboList DrawTracks(
const GPUTPCTracker& tracker, int32_t global);
210 void DrawTrackITS(int32_t trackId, int32_t
iSector);
211 GPUDisplay::vboList DrawFinalITS();
213 void DrawFinal(int32_t
iSector, int32_t ,
const GPUTPCGMPropagator* prop, std::array<
vecpod<int32_t>, 2>& trackList, threadVertexBuffer& threadBuffer);
214 vboList DrawGrid(
const GPUTPCTracker& tracker);
215 vboList DrawGridTRD(int32_t sector);
216 void DoScreenshot(
const char*
filename, std::vector<char>&
pixels,
float animateTime = -1.f);
218 void createQuaternionFromMatrix(
float*
v,
const float* mat);
220 void OpenGLPrint(
const char* s,
float x,
float y,
float r,
float g,
float b,
float a,
bool fromBotton =
true);
223 std::unique_ptr<GPUDisplayBackend> mBackend;
224 GPUChainTracking* mChain =
nullptr;
225 const GPUParam* mParam =
nullptr;
227 const GPUSettingsDisplay& mConfig;
228 GPUSettingsDisplayLight mCfgL;
229 GPUSettingsDisplayHeavy mCfgH;
230 GPUSettingsDisplayRenderer mCfgR;
231 const GPUSettingsProcessing& mProcessingSettings;
234 qSem mSemLockDisplay;
235 std::mutex mMutexLoadAndShowEvent;
236 std::condition_variable mCVLoadAndShowEvent;
238 bool mDrawTextInCompatMode =
false;
239 int32_t mDrawTextFontSize = 0;
241 int32_t mNDrawCalls = 0;
243 bool mUseMultiVBO =
false;
245 std::array<float, 4> mDrawColor = {1.f, 1.f, 1.f, 1.f};
247 int32_t mTestSetting = 0;
249 float mAngleRollOrigin = -1e9;
250 float mMaxClusterZ = -1;
252 std::unique_ptr<hmm_mat4> mViewMatrix, mModelMatrix;
259 int32_t mNCollissions = 1;
264 std::vector<std::array<uint32_t, N_POINTS_TYPE_TPC>> mClusterBufferSizeCache[NSECTORS];
266 std::unique_ptr<float4[]> mGlobalPosPtr;
267 std::unique_ptr<float4[]> mGlobalPosPtrTRD;
268 std::unique_ptr<float4[]> mGlobalPosPtrTRD2;
269 std::unique_ptr<float4[]> mGlobalPosPtrITS;
270 std::unique_ptr<float4[]> mGlobalPosPtrTOF;
276 int32_t mNMaxClusters = 0;
277 int32_t mNMaxSpacePointsTRD = 0;
278 int32_t mNMaxClustersITS = 0;
279 int32_t mNMaxClustersTOF = 0;
280 int32_t mCurrentClusters = 0;
281 int32_t mCurrentSpacePointsTRD = 0;
282 int32_t mCurrentClustersITS = 0;
283 int32_t mCurrentClustersTOF = 0;
286 std::vector<bool> mTrackFilter;
288 volatile bool mUpdateTrackFilter =
false;
289 volatile bool mUpdateVertexLists =
true;
290 volatile bool mUpdateEventData =
false;
291 volatile bool mUpdateDrawCommands =
true;
292 volatile bool mUpdateRenderPipeline =
false;
293 volatile bool mResetScene =
false;
294 volatile bool mLoadAndShowEvent =
false;
295 bool mTracksArePropagated =
false;
297 int32_t mAnimate = 0;
299 int32_t mAnimationFrame = 0;
300 int32_t mAnimationLastBase = 0;
301 int32_t mAnimationMixBase = -1;
302 int32_t mAnimateScreenshot = 0;
303 int32_t mAnimationExport = 0;
304 bool mAnimationChangeConfig =
true;
305 float mAnimationDelay = 2.f;
308 opengl_spline mAnimationSplines[8];
310 int32_t mPrintInfoText = 1;
311 bool mPrintInfoTextAlways = 0;
312 char mInfoText2[1024];
315 std::vector<threadVertexBuffer> mThreadBuffers;
316 std::vector<std::vector<std::array<std::array<vecpod<int32_t>, 2>, NSECTORS>>> mThreadTracks;
317 volatile int32_t mInitResult = 0;
319 float mFPSScale = 1, mFPSScaleadjust = 0;
320 int32_t mFramesDone = 0, mFramesDoneFPS = 0;
322 vboList mGlDLLines[NSECTORS][N_LINES_TYPE];
324 vboList mGlDLFinalITS;
326 vboList mGlDLGrid[NSECTORS];
327 vboList mGlDLGridTRD[NSECTORS / 2];
329 bool mRequestScreenshot =
false;
330 std::string mScreenshotFile;
332 float mYFactor = 1.0f;