|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "ZxAxisHelperFloat.h"
|
|
|
|
|
|
|
|
|
|
// 对数类
|
|
|
|
|
class I_PLOTBASE_EXPORT ZxAxisHelperFloatLog : public ZxAxisHelperFloat
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
static const int g_logScaleCount = 8;
|
|
|
|
|
static const double 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, double fPos, QString s);
|
|
|
|
|
|
|
|
|
|
// 取得待显示的刻度文本标识
|
|
|
|
|
virtual QMap<double, QString> getTickInfos();
|
|
|
|
|
|
|
|
|
|
// 预估大小
|
|
|
|
|
virtual QRectF getPreferedTickSumRect(QPainter* painter);
|
|
|
|
|
virtual void adjustPreferedSize(double& w, double& h);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
// 幂指数方式显示,10的多少次幂
|
|
|
|
|
void drawOneTickTagEx(QPainter* painter, double fPos, QString s);
|
|
|
|
|
|
|
|
|
|
// 获取绘制的位置信息
|
|
|
|
|
virtual void locateOneTickTag(QPainter* painter, double fPos, QString s, \
|
|
|
|
|
QRectF& rt, int& flag);
|
|
|
|
|
// 获取绘制的位置信息(Base)
|
|
|
|
|
void locateOneTickBaseTag(QPainter* painter, double fPos, \
|
|
|
|
|
QString s, \
|
|
|
|
|
QRectF& rtBase, \
|
|
|
|
|
int& flag);
|
|
|
|
|
// 获取绘制的位置信息(Index)
|
|
|
|
|
void locateOneTickIndexTag(QPainter* painter, double fPos, \
|
|
|
|
|
QString s, \
|
|
|
|
|
QRectF& rtBase, QRectF& rtIndex, \
|
|
|
|
|
int& flag);
|
|
|
|
|
// 进一步调整
|
|
|
|
|
void adjustTickLocation(QPainter* painter, \
|
|
|
|
|
QRectF& rtBase, QRectF& rtIndex);
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
};
|