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

Method EvaluateFunction

Common/DataModel/vtkPlanes.cxx:77–104  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Evaluate plane equations. Return the largest value.

Source from the content-addressed store, hash-verified

75//------------------------------------------------------------------------------
76// Evaluate plane equations. Return the largest value.
77double vtkPlanes::EvaluateFunction(double x[3])
78{
79 int numPlanes, i;
80 double val, maxVal;
81 double normal[3], point[3];
82
83 if (!this->Points || !this->Normals)
84 {
85 vtkErrorMacro(<< "Please define points and/or normals!");
86 return VTK_DOUBLE_MAX;
87 }
88
89 if ((numPlanes = this->Points->GetNumberOfPoints()) != this->Normals->GetNumberOfTuples())
90 {
91 vtkErrorMacro(<< "Number of normals/points inconsistent!");
92 return VTK_DOUBLE_MAX;
93 }
94
95 for (maxVal = -VTK_DOUBLE_MAX, i = 0; i < numPlanes; i++)
96 {
97 this->Normals->GetTuple(i, normal);
98 this->Points->GetPoint(i, point);
99 val = this->Plane->Evaluate(normal, point, x);
100 maxVal = std::max(val, maxVal);
101 }
102
103 return maxVal;
104}
105
106//------------------------------------------------------------------------------
107// Evaluate planes gradient.

Callers

nothing calls this directly

Calls 6

maxFunction · 0.50
GetNumberOfPointsMethod · 0.45
GetNumberOfTuplesMethod · 0.45
GetTupleMethod · 0.45
GetPointMethod · 0.45
EvaluateMethod · 0.45

Tested by

no test coverage detected