#pragma once #include "ZxAxisHelperFloat.h" // 对数类 class I_PLOTBASE_EXPORT ZxAxisHelperFloatLog : public ZxAxisHelperFloat { Q_OBJECT public: static const int g_logScaleCount = 8; static const float g_logScaleRatios[g_logScaleCount]; public: explicit ZxAxisHelperFloatLog(ZxSubAxisBase* p); ~ZxAxisHelperFloatLog(); protected: // Plot网格线 virtual void drawGrids(QPainter* painter, QRectF& rtInner); // 绘制函数 virtual void drawTickAndTags(QPainter* painter, QRectF& rt); virtual void drawOneTickTag(QPainter* painter, float fPos, QString s); // 取得待显示的刻度文本标识 virtual QMap getTickInfos(); // 预估大小 virtual QRectF getPreferedTickSumRect(QPainter* painter); virtual void adjustPreferedSize(float& w, float& h); private: // 幂指数方式显示,10的多少次幂 void drawOneTickTagEx(QPainter* painter, float fPos, QString s); // 获取绘制的位置信息 virtual void locateOneTickTag(QPainter* painter, float fPos, QString s, \ QRectF& rt, int& flag); // 获取绘制的位置信息(Base) void locateOneTickBaseTag(QPainter* painter, float fPos, \ QString s, \ QRectF& rtBase, \ int& flag); // 获取绘制的位置信息(Index) void locateOneTickIndexTag(QPainter* painter, float fPos, \ QString s, \ QRectF& rtBase, QRectF& rtIndex, \ int& flag); // 进一步调整 void adjustTickLocation(QPainter* painter, \ QRectF& rtBase, QRectF& rtIndex); public slots: protected: };