MCPcopy Create free account
hub / github.com/Kitware/VTK / GetMathFunctionNumber

Method GetMathFunctionNumber

Common/Misc/vtkFunctionParser.cxx:1465–1570  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1463
1464//------------------------------------------------------------------------------
1465int vtkFunctionParser::GetMathFunctionNumber(int currentIndex)
1466{
1467 // For addition of any new math function, please update
1468 // function GetMathFunctionNumberByCheckingParenthesis()
1469
1470 if (strncmp(&this->Function[currentIndex], "abs", 3) == 0)
1471 {
1472 return VTK_PARSER_ABSOLUTE_VALUE;
1473 }
1474 if (strncmp(&this->Function[currentIndex], "exp", 3) == 0)
1475 {
1476 return VTK_PARSER_EXPONENT;
1477 }
1478 if (strncmp(&this->Function[currentIndex], "ceil", 4) == 0)
1479 {
1480 return VTK_PARSER_CEILING;
1481 }
1482 if (strncmp(&this->Function[currentIndex], "floor", 5) == 0)
1483 {
1484 return VTK_PARSER_FLOOR;
1485 }
1486 if (strncmp(&this->Function[currentIndex], "ln", 2) == 0)
1487 {
1488 return VTK_PARSER_LOGARITHME;
1489 }
1490 if (strncmp(&this->Function[currentIndex], "log10", 5) == 0)
1491 {
1492 return VTK_PARSER_LOGARITHM10;
1493 }
1494 if (strncmp(&this->Function[currentIndex], "log", 3) == 0)
1495 {
1496 vtkErrorMacro("The use of log function is being deprecated. "
1497 "Please use log10 or ln instead");
1498 return VTK_PARSER_LOGARITHM;
1499 }
1500 if (strncmp(&this->Function[currentIndex], "sqrt", 4) == 0)
1501 {
1502 return VTK_PARSER_SQUARE_ROOT;
1503 }
1504 if (strncmp(&this->Function[currentIndex], "sin", 3) == 0)
1505 {
1506 if (strncmp(&this->Function[currentIndex], "sinh", 4) == 0)
1507 {
1508 return VTK_PARSER_HYPERBOLIC_SINE;
1509 }
1510 return VTK_PARSER_SINE;
1511 }
1512 if (strncmp(&this->Function[currentIndex], "cos", 3) == 0)
1513 {
1514 if (strncmp(&this->Function[currentIndex], "cosh", 4) == 0)
1515 {
1516 return VTK_PARSER_HYPERBOLIC_COSINE;
1517 }
1518 return VTK_PARSER_COSINE;
1519 }
1520 if (strncmp(&this->Function[currentIndex], "tan", 3) == 0)
1521 {
1522 if (strncmp(&this->Function[currentIndex], "tanh", 4) == 0)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected