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.
nmWATI/Include/nmNum/nmPlot/nmObjPolygonTool.h

50 lines
1.1 KiB
C++

#pragma once
#include "nmObjToolBase.h"
// 数值试井绘图对象之工具(多边形)
class NM_PLOT_EXPORT nmObjPolygonTool : public nmObjToolBase
{
Q_OBJECT
public:
nmObjPolygonTool();
public:
// 鼠标各种响应
virtual bool onLeftDown(const QPointF& pt);
virtual bool onLeftUp(const QPointF& pt);
virtual bool onMouseMove(const QPointF& pt);
virtual bool onMouseWheel(const QPointF& pt, int delta);
virtual bool onLeftDoubleClick(const QPointF& pt);
// 绘制
virtual void onPaint(QPainter* painter, const ZxPaintParam& param);
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);
protected:
// 鼠标点缓存
QVector<QPointF> m_vecPoints;
};