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

Method GetElementaryOperatorNumber

Common/Misc/vtkFunctionParser.cxx:1733–1771  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1731
1732//------------------------------------------------------------------------------
1733unsigned char vtkFunctionParser::GetElementaryOperatorNumber(char op)
1734{
1735 static const char* const operators = "+-*/^";
1736
1737 if (op == '<')
1738 {
1739 return VTK_PARSER_LESS_THAN;
1740 }
1741 if (op == '>')
1742 {
1743 return VTK_PARSER_GREATER_THAN;
1744 }
1745 if (op == '=')
1746 {
1747 return VTK_PARSER_EQUAL_TO;
1748 }
1749 if (op == '&')
1750 {
1751 return VTK_PARSER_AND;
1752 }
1753 if (op == '|')
1754 {
1755 return VTK_PARSER_OR;
1756 }
1757
1758 for (unsigned char i = 0; i < 5; i++)
1759 {
1760 if (operators[i] == op)
1761 {
1762 return (i + VTK_PARSER_ADD);
1763 }
1764 }
1765 if (op == '.')
1766 {
1767 return VTK_PARSER_DOT_PRODUCT;
1768 }
1769
1770 return 0;
1771}
1772
1773//------------------------------------------------------------------------------
1774unsigned int vtkFunctionParser::GetOperandNumber(int currentIndex)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected