------------------------------------------------------------------------------
| 1253 | |
| 1254 | //------------------------------------------------------------------------------ |
| 1255 | void vtkExprTkFunctionParser::UpdateNeededVariables() |
| 1256 | { |
| 1257 | this->ScalarVariableNeeded.clear(); |
| 1258 | this->ScalarVariableNeeded.resize(this->UsedScalarVariableNames.size(), false); |
| 1259 | |
| 1260 | this->VectorVariableNeeded.clear(); |
| 1261 | this->VectorVariableNeeded.resize(this->UsedVectorVariableNames.size(), false); |
| 1262 | |
| 1263 | // store variables after parsing |
| 1264 | std::deque<exprtk::parser<double>::dependent_entity_collector::symbol_t> symbolList; |
| 1265 | this->ExprTkTools->Parser.dec().symbols(symbolList); |
| 1266 | // convert them to a set to remove duplicates |
| 1267 | std::set<std::string> variables; |
| 1268 | for (const auto& symbol : symbolList) |
| 1269 | { |
| 1270 | variables.insert(symbol.first); |
| 1271 | } |
| 1272 | |
| 1273 | for (auto& variable : variables) |
| 1274 | { |
| 1275 | // check if variable exists in scalars |
| 1276 | for (size_t j = 0; j < this->UsedScalarVariableNames.size(); ++j) |
| 1277 | { |
| 1278 | if (variable == this->UsedScalarVariableNames[j]) |
| 1279 | { |
| 1280 | this->ScalarVariableNeeded[j] = true; |
| 1281 | break; |
| 1282 | } |
| 1283 | } |
| 1284 | |
| 1285 | // check if variable exists in vectors |
| 1286 | for (size_t j = 0; j < this->UsedVectorVariableNames.size(); ++j) |
| 1287 | { |
| 1288 | if (variable == this->UsedVectorVariableNames[j]) |
| 1289 | { |
| 1290 | this->VectorVariableNeeded[j] = true; |
| 1291 | break; |
| 1292 | } |
| 1293 | } |
| 1294 | } |
| 1295 | } |
| 1296 | |
| 1297 | //------------------------------------------------------------------------------ |
| 1298 | std::string vtkExprTkFunctionParser::SanitizeName(const char* name) |