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.1 KiB
C
49 lines
1.1 KiB
C
|
3 weeks ago
|
#pragma once
|
||
|
|
|
||
|
|
#include "nmObjToolBase.h"
|
||
|
|
|
||
|
|
// 数值试井绘图对象之工具(圆形)
|
||
|
|
class NM_PLOT_EXPORT nmObjRoundTool : public nmObjToolBase
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
|
||
|
|
public:
|
||
|
|
|
||
|
|
nmObjRoundTool();
|
||
|
|
|
||
|
|
public:
|
||
|
|
|
||
|
|
// 鼠标各种响应
|
||
|
|
virtual bool onLeftDown(const QPointF& pt) override;
|
||
|
|
virtual bool onLeftUp(const QPointF& pt) override;
|
||
|
|
virtual bool onMouseMove(const QPointF& pt) override;
|
||
|
|
virtual bool onLeftDoubleClick(const QPointF& pt) override;
|
||
|
|
|
||
|
|
//渲染
|
||
|
|
void onRender(QPainter* painter, const ZxPaintParam& param);
|
||
|
|
|
||
|
|
// 绘制
|
||
|
|
virtual void onPaint(QPainter* painter, const ZxPaintParam& param)override;
|
||
|
|
|
||
|
|
private:
|
||
|
|
|
||
|
|
// 绑定数据对象情况下绘制(真实)
|
||
|
|
void paintTrackingRealObj(QPainter* painter, const ZxPaintParam& param);
|
||
|
|
|
||
|
|
// 尚未绑定数据对象情况下绘制(虚拟)
|
||
|
|
void paintTrackingVirtualObj(QPainter* painter, const ZxPaintParam& param);
|
||
|
|
|
||
|
|
protected:
|
||
|
|
|
||
|
|
// 根据鼠标当前选择情况确定不同的光标类型
|
||
|
|
virtual Qt::CursorShape getCursorBy(const int& nOption,
|
||
|
|
const int& nSubIndex) override;
|
||
|
|
|
||
|
|
protected:
|
||
|
|
|
||
|
|
// 记录矩形四个点的坐标
|
||
|
|
QVector<QPointF> m_vecPoints;
|
||
|
|
};
|
||
|
|
|
||
|
|
|