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