ImagingTools Core SDK
CRulerShape.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// Qt includes
6#include <QtGui/QMouseEvent>
7
8// ImtCore includes
9#include <imt3dgui/CShape3dBase.h>
10#include <imt3d/CPointCloud3d.h>
11
12
13namespace imt3dgui
14{
15
16
17class CRulerShape: public CShape3dBase
18{
19public:
20 CRulerShape();
21
22 void SetSlaveShape(const CShape3dBase* slaveShapePtr);
23 bool OnMousePress(QMouseEvent& e);
24 bool OnMouseMove(QMouseEvent& e);
25 bool OnMouseRelease(QMouseEvent& e);
26
27protected:
28 // reimplemented (imt3dgui::CShape3dBase)
29 virtual void UpdateShapeGeometry(const istd::IChangeable::ChangeSet& changeSet) override;
30 virtual void DrawShapeGl(QOpenGLShaderProgram& program, QOpenGLFunctions& functions) override;
31 virtual void Draw(QPainter& painter) override;
32
33private:
34 const CShape3dBase* m_slaveShapePtr;
35 int m_movingVertexIndex;
36 QPoint m_mousePrevPos;
37 static const float s_moveSpeed;
38 static const QVector3D s_color;
39 static const QVector3D s_selectionColor;
40 imt3d::IPointsBasedObject::PointXyzwRgba32* m_vertices;
42};
43
44
45} // namespace imt3dgui
46
47