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.
48 lines
1.0 KiB
C++
48 lines
1.0 KiB
C++
//////////////////////////////////////////////////////////////////////////////
|
|
//文件: 刻度步长自动展示
|
|
//主要功能:
|
|
//
|
|
//程序编写: 2011-11-15
|
|
//
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
#include "TInterval.h"
|
|
|
|
// 为了获得标尺上的刻度分布方式,使显示效果更好
|
|
class AFX_EXT_CLASS CAxisLayout
|
|
{
|
|
public:
|
|
CAxisLayout();
|
|
|
|
// Init with explicit layout
|
|
CAxisLayout(double start_, double stop_, double step_);
|
|
CAxisLayout(TIntervalStep<double> is);
|
|
|
|
// Returns 'modulo' end with this sd and stop
|
|
double findEnd(double datastop) const;
|
|
|
|
// Have layout calculated
|
|
void setDataRange(const TIntervalStep<double>& dr);
|
|
void setDataRange(double start_, double stop_, double step_);
|
|
|
|
TIntervalStep<double> sd;
|
|
|
|
public:
|
|
class AFX_EXT_CLASS CLinScaler
|
|
{
|
|
public:
|
|
CLinScaler(double x0, double y0, double x1, double y1);
|
|
|
|
void setValue(double x0, double y0, double x1, double y1);
|
|
|
|
double scale(double) const;
|
|
double unScale(double) const;
|
|
|
|
double constant;
|
|
double factor;
|
|
};
|
|
};
|
|
|