You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "nmObjToolBase.h"
|
|
#include "nmObjLineCrack.h"
|
|
|
|
// 数值试井绘图对象之工具(线)
|
|
class NM_PLOT_EXPORT nmObjLineCrackTool : public nmObjToolBase
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
nmObjLineCrackTool();
|
|
|
|
public:
|
|
|
|
// 鼠标各种响应
|
|
virtual bool onLeftDown(const QPointF& pt) override;
|
|
virtual bool onLeftUp(const QPointF& pt) override;
|
|
virtual bool onLeftDoubleClick(const QPointF& pt) override;
|
|
virtual bool onMouseMove(const QPointF& pt) override;
|
|
|
|
// 绘制
|
|
virtual void onPaint(QPainter* painter, const ZxPaintParam& param) override;
|
|
|
|
// 将当前绘制的临时点集交给公共退点逻辑,供视图处理 Backspace。
|
|
virtual bool stepBackCreation(bool autoRepeat) override;
|
|
|
|
private:
|
|
|
|
// 绑定数据对象情况下绘制(真实)
|
|
void paintTrackingRealObj(QPainter* painter, const ZxPaintParam& param);
|
|
|
|
// 尚未绑定数据对象情况下绘制(虚拟)
|
|
void paintTrackingVirtualObj(QPainter* painter, const ZxPaintParam& param);
|
|
|
|
protected:
|
|
|
|
// 由当前 Map 的 Binder 提供候选,按绑定的数据对象排除自身节点。
|
|
virtual QVector<QPointF> pointSnapCandidates() const override;
|
|
// Esc 退出绘制时丢弃未完成的点集,避免残留到后续鼠标事件。
|
|
virtual void clearCreationPoints() override;
|
|
|
|
protected:
|
|
|
|
QVector<QPointF> m_vecPoints; // 鼠标点缓存
|
|
|
|
ZxPlot* m_pCurPlot; // 获取当前画布
|
|
};
|