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/ZxObjCurveBar.h

96 lines
2.3 KiB
C

#pragma once
#include "ZxObjCurve.h"
class I_PLOTCURVE_T_EXPORT ZxObjCurveBar : public ZxObjCurve
{
Q_OBJECT
ZX_DECLARE_DYNAMIC
public:
ZxObjCurveBar();
ZxObjCurveBar(const QString& sName, ZxSubAxisX* pAxisX, ZxSubAxisY* pAxisY);
~ZxObjCurveBar(void);
virtual void init(const QString& sName, ZxSubAxisX* pAxisX, ZxSubAxisY* pAxisY);
// 封装
virtual void initTools();
public:
void setBarWidth(double f);
double getBarWidth();
void setBarFill(bool b);
bool getBarFill();
void setBarFillClr(QColor clr);
QColor getBarFillClr();
void setPinValue(bool b);
bool getPinValue();
void setPinFont(QFont o);
QFont getPinFont();
void setPinClr(QColor clr);
QColor getPinClr();
void setShow3D(bool b);
bool getShow3D();
protected:
// 击中
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 QRectF getBounds4Update();
virtual void updateRect(QRectF);
public:
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);
virtual void paintBack(QPainter* painter, const ZxPaintParam& param);
protected:
virtual void drawSubBars(QPainter* painter, QVector<QPointF>& vec);
virtual void drawSubBarOne(QPainter* painter, QPointF pt, int index);
private:
QRectF _getBarRectOf(QPointF pt); //Pos而非Value
void _drawSubBarOne2D(QPainter* painter, QRectF rt, int index, bool calledBy3D = false);
void _drawSubBarOne3D(QPainter* painter, QRectF rt, int index);
void _drawPinnedValue(QPainter* painter, QRectF rtTag, int index);
protected:
double m_fBarWidth;
bool m_bBarFill;
QColor m_oBarFillClr;
bool m_bPinValue;
QFont m_oPinFont;
QColor m_oPinClr;
bool m_bShow3D; //3D显示
};