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

Method EvaluateFunction

Common/DataModel/vtkImplicitSum.cxx:102–125  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Evaluate sum of implicit functions.

Source from the content-addressed store, hash-verified

100//------------------------------------------------------------------------------
101// Evaluate sum of implicit functions.
102double vtkImplicitSum::EvaluateFunction(double x[3])
103{
104 double sum = 0;
105 double c;
106 int i;
107 vtkImplicitFunction* f;
108 double* weights = this->Weights->GetPointer(0);
109
110 vtkCollectionSimpleIterator sit;
111 for (i = 0, this->FunctionList->InitTraversal(sit);
112 (f = this->FunctionList->GetNextImplicitFunction(sit)); i++)
113 {
114 c = weights[i];
115 if (c != 0.0)
116 {
117 sum += f->FunctionValue(x) * c;
118 }
119 }
120 if (this->NormalizeByWeight && this->TotalWeight != 0.0)
121 {
122 sum /= this->TotalWeight;
123 }
124 return sum;
125}
126
127//------------------------------------------------------------------------------
128// Evaluate gradient of sum of functions (valid only if linear)

Callers

nothing calls this directly

Calls 3

FunctionValueMethod · 0.80
GetPointerMethod · 0.45
InitTraversalMethod · 0.45

Tested by

no test coverage detected