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

Method UpdateNeededVariables

Common/Misc/vtkFunctionParser.cxx:2281–2308  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2279
2280//------------------------------------------------------------------------------
2281void vtkFunctionParser::UpdateNeededVariables()
2282{
2283 this->ScalarVariableNeeded.clear();
2284 this->ScalarVariableNeeded.resize(this->ScalarVariableNames.size(), false);
2285
2286 this->VectorVariableNeeded.clear();
2287 this->VectorVariableNeeded.resize(this->VectorVariableNames.size(), false);
2288
2289 unsigned int numscalars = static_cast<unsigned int>(this->GetNumberOfScalarVariables());
2290
2291 for (int cc = 0; cc < this->ByteCodeSize; ++cc)
2292 {
2293 unsigned int code = this->ByteCode[cc];
2294 if (code < VTK_PARSER_BEGIN_VARIABLES)
2295 {
2296 continue;
2297 }
2298 code -= VTK_PARSER_BEGIN_VARIABLES;
2299 if (code >= numscalars)
2300 {
2301 this->VectorVariableNeeded[code - numscalars] = true;
2302 }
2303 else
2304 {
2305 this->ScalarVariableNeeded[code] = true;
2306 }
2307 }
2308}
2309
2310//------------------------------------------------------------------------------
2311int vtkFunctionParser::GetScalarVariableIndex(const char* inVariableName)

Callers 1

ParseMethod · 0.95

Calls 3

clearMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected