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.
nmWTAI-Platform/Include/nmNum/nmPlot/nmObjRound.h

77 lines
2.1 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include "nmObjBase.h"
#include "nmDefines.h"
#include "nmPlot_global.h"
// 数值试井绘图对象(圆形)
class NM_PLOT_EXPORT nmObjRound : public nmObjBase
{
Q_OBJECT
ZX_DECLARE_DYNAMIC
public:
nmObjRound();
nmObjRound(const QString& sName, \
ZxSubAxisX* pAxisX, \
ZxSubAxisY* pAxisY);
~nmObjRound();
// 设置初始参数
virtual void init(const QString& sName, \
ZxSubAxisX* pAxisX, \
ZxSubAxisY* pAxisY) override;
// 设置Tools
virtual void initTools() override;
protected:
// 设置图元对象的属性标志
virtual void initFlags() override;
public:
// 击中
virtual bool hitTest(const QPointF& pt) override;
// 具体击中实现的函数,单纯击中,不做选项的改变
// nOption用int是因为Rect类的击中选项不一致
// nOption为负值,表示未击中,此时返回false
virtual bool _runHitTest(const QPointF& pt, \
int& nOption, int& nSubIndex) override;
// 击中后,ButtonUp后的处理
// pt1:鼠标Down点,pt2:鼠标Up点
virtual bool runMove(const QPointF& pt1, const QPointF& pt2) override;
// 计算拖动后的绘图坐标,供工具预览和 runMove 提交共用;不修改图元或业务数据。
// ptStart、ptEnd 为鼠标按下和当前位置;oHitOption、nHitIndex 指定本次拖动的部位。
// 上下控制点只取纵向位移,左右控制点只取横向位移,内部拖动保持半径不变。
// vecPos 按圆心、半径占位、上/右/下/左控制点排列;操作无效时返回 false,不写入结果。
bool calculateMovePoints(const QPointF& ptStart, const QPointF& ptEnd,
ObjHitOption oHitOption, int nHitIndex,
QVector<QPointF>& vecPos) const;
public:
// 属性填充内容
virtual void fillPtyPano(IxPtyPano* sheet) override;
// 选中
virtual void paintBack(QPainter* painter, \
const ZxPaintParam& param) override;
public:
// 填充背景颜色
QColor getBackgrdColor() const;
void setBackgrdColor(QColor color);
public:
QColor m_clrBackgrd;//填充颜色
};