////////////////////////////////////////////////////////////////////////////// //文件: 刻度步长自动展示 //主要功能: // //程序编写: 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 is); // Returns 'modulo' end with this sd and stop double findEnd(double datastop) const; // Have layout calculated void setDataRange(const TIntervalStep& dr); void setDataRange(double start_, double stop_, double step_); TIntervalStep 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; }; };