int vtkCubeAxesActor::LabelExponent(double min, double max)
{
if (min == max)
{
return 0;
}
//
// Determine power of 10 to scale axis labels to.
//
double range = (fabs(min) > fabs(max) ? fabs(min) : fabs(max));
double pow10 = log10(range);
const double eformat_cut_min = -1.5;
const double eformat_cut_max = 5.0; // 原来是3.0 1000 现在为10000, 不想让xyz轴显值为科学计数
const/*expr*/ double cut_min = pow(10., eformat_cut_min);
const/*expr*/ double cut_max = pow(10., eformat_cut_max);
double ipow10;
if (range < cut_min || range > cut_max)
{
//
// We are going to use scientific notation and round the exponents to
// the nearest multiple of three.
//
ipow10 = (floor(floor(pow10)/3.))*3;
}
else
{
ipow10 = 0;
}
return static_cast<int>(ipow10);
}