62 const GPUSettingsDisplayRenderer&
cfgR()
const {
return mCfgR; }
63 const GPUSettingsDisplayLight&
cfgL()
const {
return mCfgL; }
64 const GPUSettingsDisplayHeavy&
cfgH()
const {
return mCfgH; }
65 const GPUSettingsDisplay&
cfg()
const {
return mConfig; }
85 static constexpr float GL_SCALE_FACTOR = (1.f / 100.f);
87 static constexpr const int32_t N_POINTS_TYPE = 15;
88 static constexpr const int32_t N_POINTS_TYPE_TPC = 9;
89 static constexpr const int32_t N_POINTS_TYPE_TRD = 2;
90 static constexpr const int32_t N_POINTS_TYPE_TOF = 2;
91 static constexpr const int32_t N_POINTS_TYPE_ITS = 2;
92 static constexpr const int32_t N_LINES_TYPE = 7;
93 static constexpr const int32_t N_FINAL_TYPE = 4;
94 static constexpr int32_t TRACK_TYPE_ID_LIMIT = 100;
95 enum PointTypes { tCLUSTER = 0,
101 tEXTRAPOLATEDTRACK = 6,
110 enum LineTypes { RESERVED = 0 };
114 struct threadVertexBuffer {
119 threadVertexBuffer() :
buffer()
121 for (int32_t
i = 0;
i < N_FINAL_TYPE;
i++) {
128 for (int32_t
i = 0;
i < N_FINAL_TYPE;
i++) {
138 opengl_spline() : ma(), mb(), mc(), md(), mx() {}
140 float evaluate(
float x);
141 void setVerbose() { mVerbose =
true; }
145 bool mVerbose =
false;
148 static const GPUSettingsDisplay& GetConfig(GPUChainTracking*
chain);
149 static const GPUSettingsProcessing& GetProcessingConfig(GPUChainTracking*
chain);
151 void DrawGLScene_internal(
float animateTime = -1.f,
bool renderToMixBuffer =
false);
152 void DrawGLScene_updateEventData();
153 void DrawGLScene_cameraAndAnimation(
float animateTime,
float& mixSlaveImage,
hmm_mat4& nextViewMatrix);
154 size_t DrawGLScene_updateVertexList();
155 void DrawGLScene_drawCommands();
156 int32_t InitDisplay_internal();
157 int32_t getNumThreads();
158 void updateOptions();
159 void disableUnsupportedOptions();
160 int32_t buildTrackFilter();
161 const GPUTPCTracker& sectorTracker(int32_t iSector);
162 const GPUTRDGeometry* trdGeometry();
163 const GPUTrackingInOutPointers* mIOPtrs =
nullptr;
165 void insertVertexList(int32_t iSector,
size_t first,
size_t last);
166 template <
typename... Args>
167 void SetInfo(Args... args);
168 void PrintGLHelpText(
float colorValue);
169 void calcXYZ(
const float*);
170 void mAnimationCloseAngle(
float& newangle,
float lastAngle);
171 void mAnimateCloseQuaternion(
float*
v,
float lastx,
float lasty,
float lastz,
float lastw);
172 void setAnimationPoint();
173 void resetAnimation();
174 void removeAnimationPoint();
175 void startAnimation();
176 int32_t animateCamera(
float& animateTime,
float& mixSlaveImage,
hmm_mat4& nextViewMatrix);
177 void showInfo(
const char* info);
178 void ActivateColor();
182 void SetColorClusters();
183 void SetColorInitLinks();
184 void SetColorLinks();
185 void SetColorSeeds();
186 void SetColorTracklets();
187 void SetColorTracks();
188 void SetColorExtrapolatedTracks();
189 void SetColorFinal();
191 void SetColorGridTRD();
192 void SetColorMarked();
193 void SetCollisionColor(int32_t
col);
195 void drawPointLinestrip(int32_t iSector, int32_t cid, int32_t
id, int32_t id_limit = TRACK_TYPE_ID_LIMIT);
196 void DrawClusters(int32_t iSector);
197 vboList DrawSpacePointsTRD(int32_t iSector, int32_t
select, int32_t iCol);
198 vboList DrawSpacePointsTOF(int32_t iSector, int32_t
select, int32_t iCol);
199 vboList DrawSpacePointsITS(int32_t iSector, int32_t
select, int32_t iCol);
200 vboList DrawLinks(
const GPUTPCTracker& tracker, int32_t
id,
bool dodown =
false);
201 vboList DrawSeeds(
const GPUTPCTracker& tracker);
202 vboList DrawTracklets(
const GPUTPCTracker& tracker);
203 vboList DrawTracks(
const GPUTPCTracker& tracker, int32_t global);
204 void DrawTrackITS(int32_t trackId, int32_t iSector);
205 GPUDisplay::vboList DrawFinalITS();
207 void DrawFinal(int32_t iSector, int32_t ,
const GPUTPCGMPropagator* prop, std::array<
vecpod<int32_t>, 2>& trackList, threadVertexBuffer& threadBuffer);
208 vboList DrawGrid(
const GPUTPCTracker& tracker);
209 vboList DrawGridTRD(int32_t sector);
210 void DoScreenshot(
const char*
filename, std::vector<char>&
pixels,
float animateTime = -1.f);
212 void createQuaternionFromMatrix(
float*
v,
const float* mat);
214 void OpenGLPrint(
const char* s,
float x,
float y,
float r,
float g,
float b,
float a,
bool fromBotton =
true);
216 GPUDisplayFrontend* mFrontend =
nullptr;
217 std::unique_ptr<GPUDisplayBackend> mBackend;
218 GPUChainTracking* mChain =
nullptr;
219 const GPUParam* mParam =
nullptr;
221 const GPUSettingsDisplay& mConfig;
222 GPUSettingsDisplayLight mCfgL;
223 GPUSettingsDisplayHeavy mCfgH;
224 GPUSettingsDisplayRenderer mCfgR;
225 const GPUSettingsProcessing& mProcessingSettings;
228 qSem mSemLockDisplay;
229 std::mutex mMutexLoadAndShowEvent;
230 std::condition_variable mCVLoadAndShowEvent;
232 bool mDrawTextInCompatMode =
false;
233 int32_t mDrawTextFontSize = 0;
235 int32_t mNDrawCalls = 0;
237 bool mUseMultiVBO =
false;
239 std::array<float, 4> mDrawColor = {1.f, 1.f, 1.f, 1.f};
241 int32_t mTestSetting = 0;
243 float mAngleRollOrigin = -1e9;
244 float mMaxClusterZ = -1;
247 float*
const mViewMatrixP = &mViewMatrix.
Elements[0][0];
254 int32_t mNCollissions = 1;
259 std::vector<std::array<uint32_t, N_POINTS_TYPE_TPC>> mClusterBufferSizeCache[NSECTORS];
261 std::unique_ptr<float4[]> mGlobalPosPtr;
262 std::unique_ptr<float4[]> mGlobalPosPtrTRD;
263 std::unique_ptr<float4[]> mGlobalPosPtrTRD2;
264 std::unique_ptr<float4[]> mGlobalPosPtrITS;
265 std::unique_ptr<float4[]> mGlobalPosPtrTOF;
271 int32_t mNMaxClusters = 0;
272 int32_t mNMaxSpacePointsTRD = 0;
273 int32_t mNMaxClustersITS = 0;
274 int32_t mNMaxClustersTOF = 0;
275 int32_t mCurrentClusters = 0;
276 int32_t mCurrentSpacePointsTRD = 0;
277 int32_t mCurrentClustersITS = 0;
278 int32_t mCurrentClustersTOF = 0;
281 std::vector<bool> mTrackFilter;
283 volatile bool mUpdateTrackFilter =
false;
284 volatile bool mUpdateVertexLists =
true;
285 volatile bool mUpdateEventData =
false;
286 volatile bool mUpdateDrawCommands =
true;
287 volatile bool mUpdateRenderPipeline =
false;
288 volatile bool mResetScene =
false;
289 volatile bool mLoadAndShowEvent =
false;
290 bool mTracksArePropagated =
false;
292 int32_t mAnimate = 0;
294 int32_t mAnimationFrame = 0;
295 int32_t mAnimationLastBase = 0;
296 int32_t mAnimateScreenshot = 0;
297 int32_t mAnimationExport = 0;
298 bool mAnimationChangeConfig =
true;
299 float mAnimationDelay = 2.f;
302 opengl_spline mAnimationSplines[8];
304 int32_t mPrintInfoText = 1;
305 bool mPrintInfoTextAlways = 0;
306 char mInfoText2[1024];
309 std::vector<threadVertexBuffer> mThreadBuffers;
310 std::vector<std::vector<std::array<std::array<vecpod<int32_t>, 2>, NSECTORS>>> mThreadTracks;
311 volatile int32_t mInitResult = 0;
313 float mFPSScale = 1, mFPSScaleadjust = 0;
314 int32_t mFramesDone = 0, mFramesDoneFPS = 0;
316 vboList mGlDLLines[NSECTORS][N_LINES_TYPE];
318 vboList mGlDLFinalITS;
320 vboList mGlDLGrid[NSECTORS];
321 vboList mGlDLGridTRD[NSECTORS / 2];
323 bool mRequestScreenshot =
false;
324 std::string mScreenshotFile;
326 float mYFactor = 1.0f;