本文整理汇总了C++中FunctionDefinition::setDisplayName方法的典型用法代码示例。如果您正苦于以下问题:C++ FunctionDefinition::setDisplayName方法的具体用法?C++ FunctionDefinition::setDisplayName怎么用?C++ FunctionDefinition::setDisplayName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionDefinition
的用法示例。
在下文中一共展示了FunctionDefinition::setDisplayName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: registerDefaultFunctions
void PlotFunctionRegister::registerDefaultFunctions()
{
FunctionDefinition *def = nullptr;
QString category;
// Core fundamentals
category = "general";
add(static_cast<double (*)(double)>(&std::abs), category, "abs", "Absolute value of x.");
add(new FunctionClean(category));
def = add(&clipFunc, category, "clip", "Clip x to to the range [min,max]. All values are clipped to this range.", 3);
def->setDisplayName("clip(x,min,max)");
def = add(&clipmaxFunc, category, "clipmax", "Clip x to a maximum value. Any value above max is displayed as min.", 2);
def->setDisplayName("clipmax(x,max)");
def = add(&clipminFunc, category, "clipmin", "Clip x to a minimum value. Any value below min is displayed as min.", 2);
def->setDisplayName("clipmin(x,min)");
add(&deltaFunc, category, "delta", "Delta from the last value of x.", 1);
add(static_cast<double (*)(double)>(&std::exp), category, "exp", "Calculate e (2.718...) to the power of x.");
add(&isNanFunc, category, "isnan", "Test if the input value is NaN. 1 if so, zero otherwise.", 1);
add(&isInfFunc, category, "isinf", "Test if the input value is +/- infinity. 1 if so, zero otherwise.", 1);
add(static_cast<double(*)(double)>(&std::log), category, "log", "Natural logarithm of x.");
add(static_cast<double(*)(double)>(&std::log10), category, "log10", "Base 10 logarithm of x.");
add(&maxFunc, category, "max", "Most recent maximum value of x.", 1);
add(&minFunc, category, "min", "Most recent minimum value of x.", 1);
add(static_cast<double (*)(double)>(&std::sqrt), category, "sqrt", "Sqrt of the value of x.");
add(&nowFunc, category, "now", "Returns the current sample time.", 0);
add(new FunctionUnwrap(category));
category = "rounding";
add(static_cast<double(*)(double)>(&std::ceil), category, "ceil", "Nearest integer not less than x.");
add(static_cast<double(*)(double)>(&std::floor), category, "floor", "Nearest integer not greater than x.");
add(static_cast<double(*)(double)>(&std::trunc), category, "trunc", "Nearest integer not greater in magnitude than x.");
add(static_cast<double(*)(double)>(&std::round), category, "round", "Nearest integer rounding up (in magnitude) from halfway cases.");
add(&fmodFunc, category, "fmod", "Floating point remainder of the division x/y.", 2);
add(&remainderFunc, category, "remainder", "Integer remainder (closest) of the division x/y. Sign may differ from fmod.", 2);
add(&signFunc, category, "sign", "Return the sign of x. -1 if negative, 1 otherwise.", 1);
// Statistics
category = "statistics";
add(&abserrFunc, category, "abserr", "Absolute error between x and y.", 2);
add(&avgFunc, category, "avg", "Running average value of x.", 1);
add(new FunctionMAvg(category));
add(&maxofFunc, category, "maxof", "Maximum value of any number of graphs.", 1, true);
add(&minofFunc, category, "minof", "Minimum value of any number of graphs.", 1, true);
add(&relerrFunc, category, "relerr", "Relative error between x and y.", 2);
add(&totalFunc, category, "total", "Running sum of x.", 1);
// Trigonometry
category = "trigonometry";
add(static_cast<double(*)(double)>(&std::acos), category, "acos", "Trigonometric arccos function of x");
add(static_cast<double(*)(double)>(&std::asin), category, "asin", "Trigonometric arcsin function of x");
add(static_cast<double(*)(double)>(&std::atan), category, "atan", "Trigonometric arctan function of x");
def = add(&atan2Func, category, "atan2", "Trigonometric arctan of y/x with quadrant selection.", 2);
if (def)
{
def->setDisplayName("atan2(y,x)");
}
add(static_cast<double(*)(double)>(&std::cos), category, "cos", "Trigonometric cos function of x");
add(static_cast<double(*)(double)>(&std::sin), category, "sin", "Trigonometric sin function of x");
add(static_cast<double(*)(double)>(&std::tan), category, "tan", "Trigonometric tan function of x");
add(static_cast<double(*)(double)>(&std::cosh), category, "cosh", "Hyperbolic cos function of x");
add(static_cast<double(*)(double)>(&std::sinh), category, "sinh", "Hyperbolic sin function of x");
add(static_cast<double(*)(double)>(&std::tanh), category, "tanh", "Hyperbolic tan function of x");
add(static_cast<double(*)(double)>(&std::acosh), category, "acosh", "Hyperbolic arccos function of x");
add(static_cast<double(*)(double)>(&std::asinh), category, "asinh", "Hyperbolic arcsin function of x");
add(static_cast<double(*)(double)>(&std::atanh), category, "atanh", "Hyperbolic arctan function of x");
add(&piFunc, category, "pi", "Pi constant (3.141...).", 0);
}