ImagingTools Core SDK
CAxisShape.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ACF includes
6#include <istd/TRange.h>
7
8// ImtCore includes
9#include <imt3dgui/CShape3dBase.h>
10#include <imt3d/CPointCloud3d.h>
11
12
13namespace imt3dgui
14{
15
16
17class CAxisShape: public CShape3dBase
18{
19 typedef CShape3dBase BaseClass;
20
21public:
22 CAxisShape();
23
24 enum AxisType
25 {
26 AT_X,
27 AT_Y,
28 AT_Z
29 };
30
31
32 void SetAxisLength(AxisType axis, double axisLength);
33 void SetAxisRange(AxisType axis, const istd::CRange& range);
34 void SetAxisLineWidth(AxisType axis, double lineWidth);
35 void SetAxisLabel(AxisType axis, const QString& label);
36
37protected:
38 // reimplement (imt3dgui::CShape3dBase)
39 virtual void UpdateShapeGeometry(const istd::IChangeable::ChangeSet& changeSet) override;
40 virtual void DrawShapeGl(QOpenGLShaderProgram& program, QOpenGLFunctions& functions) override;
41
42 // reimplement (imt3dgui::IDrawable)
43 virtual void Draw(QPainter& painter) override;
44
45private:
46 QFont GetAxeLabelFont() const;
47
48private:
50
51 struct AxisConfig
52 {
53 double axisLength = 1.0;
54 istd::CRange axisRange = istd::CRange(0.0, 1.0);
55 double lineWidth = 2.0;
56 QString label;
57 };
58
59 QMap<AxisType, AxisConfig> m_axisConfigs;
60
61 static const float s_zoomFontFactor;
62 bool m_doUpdate;
63};
64
65
66} // namespace imt3dgui
67
68