|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "ZxObjLine.h"
|
|
|
|
|
|
|
|
|
|
class I_PLOTCURVE_T_EXPORT ZxObjLineSlr : public ZxObjLine
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
ZX_DECLARE_DYNAMIC
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
ZxObjLineSlr();
|
|
|
|
|
ZxObjLineSlr(const QString& sName,
|
|
|
|
|
ZxSubAxisX* pAxisX,
|
|
|
|
|
ZxSubAxisY* pAxisY);
|
|
|
|
|
~ZxObjLineSlr();
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
// 鼠标移动时,限制斜率得到的新点
|
|
|
|
|
QPointF calFitPoint(const QPointF& ptNew);
|
|
|
|
|
|
|
|
|
|
// 封装
|
|
|
|
|
virtual void initTools();
|
|
|
|
|
|
|
|
|
|
// 辅助信息
|
|
|
|
|
virtual void initSubObjs();
|
|
|
|
|
|
|
|
|
|
virtual void resetOthers();
|
|
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
|
|
// 根据某点以及斜率,计算两点,屏幕坐标
|
|
|
|
|
// fLen如果为-1.f则默认取坐标轴网格长度的一半
|
|
|
|
|
virtual QVector<QPointF> calLinePoints(const QPointF& pt,
|
|
|
|
|
float fRatio,
|
|
|
|
|
float fLen = -1.f);
|
|
|
|
|
// 根据某点以及斜率,计算两点,屏幕坐标
|
|
|
|
|
static QVector<QPointF> calLinePointsEx(const QPointF& pt,
|
|
|
|
|
float fRatio,
|
|
|
|
|
float fLen);
|
|
|
|
|
|
|
|
|
|
// 特征线斜率 Special line ratio
|
|
|
|
|
// 斜率
|
|
|
|
|
void setSlope(float f);
|
|
|
|
|
virtual float getSlope() const;
|
|
|
|
|
|
|
|
|
|
// 计算线斜率,得到字符串
|
|
|
|
|
virtual QString getLineExp();
|
|
|
|
|
|
|
|
|
|
// 默认的长度
|
|
|
|
|
void setLen(float f);
|
|
|
|
|
float getLen() const;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
float m_fSlope; //这是针对特征线时后的斜率值
|
|
|
|
|
float m_fLen; //默认的长度
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|