63 const GPUSettingsDisplayRenderer&
cfgR()
const {
return mCfgR; }
64 const GPUSettingsDisplayLight&
cfgL()
const {
return mCfgL; }
65 const GPUSettingsDisplayHeavy&
cfgH()
const {
return mCfgH; }
66 const GPUSettingsDisplay&
cfg()
const {
return mConfig; }
86 static constexpr float GL_SCALE_FACTOR = (1.f / 100.f);
88 static constexpr const int32_t N_POINTS_TYPE = 15;
89 static constexpr const int32_t N_POINTS_TYPE_TPC = 9;
90 static constexpr const int32_t N_POINTS_TYPE_TRD = 2;
91 static constexpr const int32_t N_POINTS_TYPE_TOF = 2;
92 static constexpr const int32_t N_POINTS_TYPE_ITS = 2;
93 static constexpr const int32_t N_LINES_TYPE = 7;
94 static constexpr const int32_t N_FINAL_TYPE = 4;
95 static constexpr int32_t TRACK_TYPE_ID_LIMIT = 100;
96 enum PointTypes { tCLUSTER = 0,
102 tEXTRAPOLATEDTRACK = 6,
111 enum LineTypes { RESERVED = 0 };
115 struct threadVertexBuffer {
120 threadVertexBuffer() :
buffer()
122 for (int32_t
i = 0;
i < N_FINAL_TYPE;
i++) {
129 for (int32_t
i = 0;
i < N_FINAL_TYPE;
i++) {
139 opengl_spline() : ma(), mb(), mc(), md(), mx() {}
141 float evaluate(
float x);
142 void setVerbose() { mVerbose =
true; }
146 bool mVerbose =
false;
149 static const GPUSettingsDisplay& GetConfig(GPUChainTracking*
chain);
150 static const GPUSettingsProcessing& GetProcessingConfig(GPUChainTracking*
chain);
152 void DrawGLScene_internal(
float animateTime = -1.f,
bool renderToMixBuffer =
false);
153 void DrawGLScene_updateEventData();
154 void DrawGLScene_cameraAndAnimation(
float animateTime,
float& mixSlaveImage,
hmm_mat4& nextViewMatrix);
155 size_t DrawGLScene_updateVertexList();
156 void DrawGLScene_drawCommands();
157 int32_t InitDisplay_internal();
158 int32_t getNumThreads();
159 void updateOptions();
160 void disableUnsupportedOptions();
161 int32_t buildTrackFilter();
162 const GPUTPCTracker& sectorTracker(int32_t iSector);
163 const GPUTRDGeometry* trdGeometry();
164 const GPUTrackingInOutPointers* mIOPtrs =
nullptr;
166 void insertVertexList(int32_t iSector,
size_t first,
size_t last);
167 template <
typename... Args>
168 void SetInfo(Args... args);
169 void PrintGLHelpText(
float colorValue);
170 void calcXYZ(
const float*);
171 void mAnimationCloseAngle(
float& newangle,
float lastAngle);
172 void mAnimateCloseQuaternion(
float*
v,
float lastx,
float lasty,
float lastz,
float lastw);
173 void setAnimationPoint();
174 void resetAnimation();
175 void removeAnimationPoint();
176 void startAnimation();
177 int32_t animateCamera(
float& animateTime,
float& mixSlaveImage,
hmm_mat4& nextViewMatrix);
178 void showInfo(
const char* info);
179 void ActivateColor();
183 void SetColorClusters();
184 void SetColorInitLinks();
185 void SetColorLinks();
186 void SetColorSeeds();
187 void SetColorTracklets();
188 void SetColorTracks();
189 void SetColorExtrapolatedTracks();
190 void SetColorFinal();
192 void SetColorGridTRD();
193 void SetColorMarked();
194 void SetCollisionColor(int32_t
col);
196 void drawPointLinestrip(int32_t iSector, int32_t cid, int32_t
id, int32_t id_limit = TRACK_TYPE_ID_LIMIT);
197 void DrawClusters(int32_t iSector);
198 vboList DrawSpacePointsTRD(int32_t iSector, int32_t
select, int32_t iCol);
199 vboList DrawSpacePointsTOF(int32_t iSector, int32_t
select, int32_t iCol);
200 vboList DrawSpacePointsITS(int32_t iSector, int32_t
select, int32_t iCol);
201 vboList DrawLinks(
const GPUTPCTracker& tracker, int32_t
id,
bool dodown =
false);
202 vboList DrawSeeds(
const GPUTPCTracker& tracker);
203 vboList DrawTracklets(
const GPUTPCTracker& tracker);
204 vboList DrawTracks(
const GPUTPCTracker& tracker, int32_t global);
205 void DrawTrackITS(int32_t trackId, int32_t iSector);
206 GPUDisplay::vboList DrawFinalITS();
208 void DrawFinal(int32_t iSector, int32_t ,
const GPUTPCGMPropagator* prop, std::array<
vecpod<int32_t>, 2>& trackList, threadVertexBuffer& threadBuffer);
209 vboList DrawGrid(
const GPUTPCTracker& tracker);
210 vboList DrawGridTRD(int32_t sector);
211 void DoScreenshot(
const char*
filename, std::vector<char>&
pixels,
float animateTime = -1.f);
213 void createQuaternionFromMatrix(
float*
v,
const float* mat);
215 void OpenGLPrint(
const char* s,
float x,
float y,
float r,
float g,
float b,
float a,
bool fromBotton =
true);
217 GPUDisplayFrontend* mFrontend =
nullptr;
218 std::unique_ptr<GPUDisplayBackend> mBackend;
219 GPUChainTracking* mChain =
nullptr;
220 const GPUParam* mParam =
nullptr;
222 const GPUSettingsDisplay& mConfig;
223 GPUSettingsDisplayLight mCfgL;
224 GPUSettingsDisplayHeavy mCfgH;
225 GPUSettingsDisplayRenderer mCfgR;
226 const GPUSettingsProcessing& mProcessingSettings;
229 qSem mSemLockDisplay;
230 std::mutex mMutexLoadAndShowEvent;
231 std::condition_variable mCVLoadAndShowEvent;
233 bool mDrawTextInCompatMode =
false;
234 int32_t mDrawTextFontSize = 0;
236 int32_t mNDrawCalls = 0;
238 bool mUseMultiVBO =
false;
240 std::array<float, 4> mDrawColor = {1.f, 1.f, 1.f, 1.f};
242 int32_t mTestSetting = 0;
244 float mAngleRollOrigin = -1e9;
245 float mMaxClusterZ = -1;
248 float*
const mViewMatrixP = &mViewMatrix.
Elements[0][0];
255 int32_t mNCollissions = 1;
260 std::vector<std::array<uint32_t, N_POINTS_TYPE_TPC>> mClusterBufferSizeCache[NSECTORS];
262 std::unique_ptr<float4[]> mGlobalPosPtr;
263 std::unique_ptr<float4[]> mGlobalPosPtrTRD;
264 std::unique_ptr<float4[]> mGlobalPosPtrTRD2;
265 std::unique_ptr<float4[]> mGlobalPosPtrITS;
266 std::unique_ptr<float4[]> mGlobalPosPtrTOF;
272 int32_t mNMaxClusters = 0;
273 int32_t mNMaxSpacePointsTRD = 0;
274 int32_t mNMaxClustersITS = 0;
275 int32_t mNMaxClustersTOF = 0;
276 int32_t mCurrentClusters = 0;
277 int32_t mCurrentSpacePointsTRD = 0;
278 int32_t mCurrentClustersITS = 0;
279 int32_t mCurrentClustersTOF = 0;
282 std::vector<bool> mTrackFilter;
284 volatile bool mUpdateTrackFilter =
false;
285 volatile bool mUpdateVertexLists =
true;
286 volatile bool mUpdateEventData =
false;
287 volatile bool mUpdateDrawCommands =
true;
288 volatile bool mUpdateRenderPipeline =
false;
289 volatile bool mResetScene =
false;
290 volatile bool mLoadAndShowEvent =
false;
291 bool mTracksArePropagated =
false;
293 int32_t mAnimate = 0;
295 int32_t mAnimationFrame = 0;
296 int32_t mAnimationLastBase = 0;
297 int32_t mAnimateScreenshot = 0;
298 int32_t mAnimationExport = 0;
299 bool mAnimationChangeConfig =
true;
300 float mAnimationDelay = 2.f;
303 opengl_spline mAnimationSplines[8];
305 int32_t mPrintInfoText = 1;
306 bool mPrintInfoTextAlways = 0;
307 char mInfoText2[1024];
310 std::vector<threadVertexBuffer> mThreadBuffers;
311 std::vector<std::vector<std::array<std::array<vecpod<int32_t>, 2>, NSECTORS>>> mThreadTracks;
312 volatile int32_t mInitResult = 0;
314 float mFPSScale = 1, mFPSScaleadjust = 0;
315 int32_t mFramesDone = 0, mFramesDoneFPS = 0;
317 vboList mGlDLLines[NSECTORS][N_LINES_TYPE];
319 vboList mGlDLFinalITS;
321 vboList mGlDLGrid[NSECTORS];
322 vboList mGlDLGridTRD[NSECTORS / 2];
324 bool mRequestScreenshot =
false;
325 std::string mScreenshotFile;
327 float mYFactor = 1.0f;