refactor: Extract snapping logic into dedicated Snapping class
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user