29 lines
614 B
C++
29 lines
614 B
C++
#ifndef SNAPPING_H
|
|
#define SNAPPING_H
|
|
|
|
#include <gp_Pnt.hxx>
|
|
#include <QPoint>
|
|
|
|
class ViewportWidget;
|
|
|
|
class Snapping
|
|
{
|
|
public:
|
|
explicit Snapping(ViewportWidget* viewport);
|
|
|
|
bool update(const QPoint& mousePos);
|
|
void paintGL() const;
|
|
|
|
bool isSnappingOrigin() const { return m_isSnappingOrigin; }
|
|
bool isSnappingVertex() const { return m_isSnappingVertex; }
|
|
const gp_Pnt& snapVertex() const { return m_snapVertex; }
|
|
|
|
private:
|
|
ViewportWidget* m_viewport = nullptr;
|
|
bool m_isSnappingOrigin = false;
|
|
bool m_isSnappingVertex = false;
|
|
gp_Pnt m_snapVertex;
|
|
};
|
|
|
|
#endif // SNAPPING_H
|