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.
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "ZxObjBase.h"
|
|
|
|
|
|
|
|
|
|
class I_PLOTCURVE_T_EXPORT ZxObjPoint : public ZxObjBase
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
ZX_DECLARE_DYNAMIC
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
ZxObjPoint();
|
|
|
|
|
ZxObjPoint(const QString& sName,
|
|
|
|
|
ZxSubAxisX* pAxisX,
|
|
|
|
|
ZxSubAxisY* pAxisY);
|
|
|
|
|
~ZxObjPoint();
|
|
|
|
|
|
|
|
|
|
virtual void init(const QString& sName,
|
|
|
|
|
ZxSubAxisX* pAxisX,
|
|
|
|
|
ZxSubAxisY* pAxisY);
|
|
|
|
|
|
|
|
|
|
// 击中
|
|
|
|
|
virtual bool hitTest(const QPointF& pt);
|
|
|
|
|
|
|
|
|
|
// 具体击中实现的函数,单纯击中,不做选项的改变
|
|
|
|
|
// nOption用int是因为Rect类的击中选项不一致
|
|
|
|
|
// nOption为负值,表示未击中,此时返回false
|
|
|
|
|
virtual bool _runHitTest(const QPointF& pt, int& nOption, int& nSubIndex);
|
|
|
|
|
|
|
|
|
|
// 击中后,ButtonUp后的处理
|
|
|
|
|
// pt1:鼠标Down点,pt2:鼠标Up点
|
|
|
|
|
virtual bool runMove(const QPointF& pt1, const QPointF& pt2);
|
|
|
|
|
|
|
|
|
|
// 获取中心点
|
|
|
|
|
virtual QPointF getCenterPos();
|
|
|
|
|
|
|
|
|
|
// 封装
|
|
|
|
|
virtual void initTools();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 设置图元对象的属性标志
|
|
|
|
|
virtual void initFlags();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
virtual void paintBack(QPainter* painter,
|
|
|
|
|
const ZxPaintParam& param);
|
|
|
|
|
virtual void onSerialize(ZxSerializer* ser);
|
|
|
|
|
virtual void onDeserialize(ZxSerializer* ser);
|
|
|
|
|
|
|
|
|
|
virtual void onLoadTempl(ZxSerializer* ser);
|
|
|
|
|
virtual void onSaveTempl(ZxSerializer* ser);
|
|
|
|
|
|
|
|
|
|
virtual void fillPtyPano(IxPtyPano* sheet);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
// XY的位置信息
|
|
|
|
|
void setValueX(float x);
|
|
|
|
|
float getValueX();
|
|
|
|
|
void setValueY(float y);
|
|
|
|
|
float getValueY();
|
|
|
|
|
|
|
|
|
|
// 描述
|
|
|
|
|
void setDesc(QString s);
|
|
|
|
|
QString getDesc();
|
|
|
|
|
|
|
|
|
|
// 点数据
|
|
|
|
|
void setDataByPos(const QPointF& pt, QString sDesc);
|
|
|
|
|
|
|
|
|
|
void resetBounds();
|
|
|
|
|
virtual QRectF getBounds4Update();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
QString m_sDesc; ///描述字符串
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|