#pragma once #include "ZxObjCurveBase.h" class I_PLOTCURVE_T_EXPORT ZxObjCurve : public ZxObjCurveBase { Q_OBJECT ZX_DECLARE_DYNAMIC public: ZxObjCurve(); ZxObjCurve(const QString& sName, ZxSubAxisX* pAxisX, ZxSubAxisY* pAxisY); ~ZxObjCurve(void); virtual void init(const QString& sName, ZxSubAxisX* pAxisX, ZxSubAxisY* pAxisY); // 封装 virtual void initTools(); // 选择(from to) virtual bool selectRowRanges(int nFrom, int nTo); // 根据鼠标位置xPos获取在线上的位置点 virtual bool getPointByX(double& xPos, QPointF& ptPos); public: // 一点选中边界是的移动策略 enum CurveMoveMode { MM_Free = 0, //单条移动 MM_Point_Free, //线模式 MM_Line_Free, //线模式 MM_Self_WithP, //与压力计同步 MM_Whole_Hori, //整体水平移动(竖直不动) MM_Whole_Vert, //整体竖直移动(水平不动,暂时不用) MM_Whole_Free //整体移动 }; protected: // 设置图元对象的属性标志 virtual void initFlags(); // // 击中 // virtual bool hitTest(const QPointF& pt); // // 击中后,ButtonUp后的处理 // // pt1:鼠标Down点,pt2:鼠标Up点 // virtual bool runMove(const QPointF& pt1, // const QPointF& pt2); public: virtual void paintBack(QPainter* painter, const ZxPaintParam& param); virtual void drawPoint(QPainter* painter, QPointF arrPoints[], int nCount, ZxDot& dot); virtual void onSerialize(ZxSerializer* ser); virtual void onDeserialize(ZxSerializer* ser); virtual void fillPtyPano(IxPtyPano* sheet); public: void setMoveMode(int nMoveMode); int getMoveMode() const; protected: // 移动模式,仅仅对于竖线而言 CurveMoveMode m_oMoveMode; };