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/iPlot/iPlotCurveT/Objects/ZxObjLineParallel.h

76 lines
2.0 KiB
C

#pragma once
#include "ZxObjLineSlr.h"
class I_PLOTCURVE_T_EXPORT ZxObjLineParallel : public ZxObjLineSlr
{
Q_OBJECT
ZX_DECLARE_DYNAMIC
public:
ZxObjLineParallel();
ZxObjLineParallel(const QString& sName,
ZxSubAxisX* pAxisX,
ZxSubAxisY* pAxisY);
~ZxObjLineParallel();
virtual void init(const QString& sName,
ZxSubAxisX* pAxisX,
ZxSubAxisY* pAxisY);
// 具体击中实现的函数,单纯击中,不做选项的改变
// 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 resetOthers();
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);
// 计算线斜率,得到字符串
virtual QString getLineExp();
// 默认的高度
void setH(float f);
float getH() const;
public:
float m_fH; //默认的高度
};