#pragma once #include "ZxObjLine.h" #include "mGuiPlot_global.h" #include "ZxObjBdyRect.h" class ZxObjBdyPoint; //平行边界类型(垂直或者水平) enum eTriType { TriT_Left = 0, //左开口 TriT_Right, //右开口 TriT_Top, //上开口 TriT_Bottom, //下开口 TriT_None }; //三条垂直边界线 class M_GUI_PLOT_EXPORT ZxObjBdyTri : public ZxObjBdyRect { Q_OBJECT ZX_DECLARE_DYNAMIC public: ZxObjBdyTri(); ZxObjBdyTri(const QString& sName, ZxSubAxisX* pAxisX, ZxSubAxisY* pAxisY); ~ZxObjBdyTri(); public: //设置类型 void setTriType(int eType); int getTriType(); // 封装 virtual void initTools(); void initObj(); // 具体击中实现的函数,单纯击中,不做选项的改变 // nOption用int是因为Rect类的击中选项不一致 // nOption为负值,表示未击中,此时返回false virtual bool _runHitTest(const QPointF& pt, int& nOption, int& nSubIndex); // pt1:鼠标Down点,pt2:鼠标Up点 virtual bool runMove(const QPointF& pt1, const QPointF& pt2); // void calBdyTriParam(eTriType eType, QVector& vecVals); //属性 virtual void fillPtyPano(IxPtyPano* sheet); virtual void paintBack(QPainter* painter, const ZxPaintParam& param); //移动后参数改变 virtual void resetBdyParam(); //设置参数后数据改变 virtual void calBdyRectParam(); void resetBdyTriParam(); //得到单边的参数指针 iBdyInfo* getSingleBdy(); //得到双边的上或者左指针 iBdyInfo* getBdyLineOneParam(); iBdyInfo* getBdyLineTwoParam(); //不同类型获得上左点 QPointF getLeftTopPos(); QPointF getRightTopPos(); QPointF getRightBottomPos(); QPointF getLeftBottomPos(); //数据点归位 void setLeftTopPt(QPointF pt, QVector& vec); void setRightTopPt(QPointF pt, QVector& vec); void setRightBottomPt(QPointF pt, QVector& vec); void setLeftBottomPt(QPointF pt, QVector& vec); //设置独立边界的距离 void setBdySingleDistance(double f); double getBdySingleDistance(); //设置边界的距离(One代表左边界和上边界) void setBdyLineOneDistance(double f); double getBdyLineOneDistance(); //设置边界的距离 void setBdyLineTwoDistance(double f); double getBdyLineTwoDistance(); protected: //平行类型 eTriType m_eType; };