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

Method EvaluateFunction

Common/DataModel/vtkSpheres.cxx:66–93  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Evaluate sphere equations. Return smallest absolute value.

Source from the content-addressed store, hash-verified

64//------------------------------------------------------------------------------
65// Evaluate sphere equations. Return smallest absolute value.
66double vtkSpheres::EvaluateFunction(double x[3])
67{
68 int numSpheres, i;
69 double val, minVal;
70 double radius[1], center[3];
71
72 if (!this->Centers || !this->Radii)
73 {
74 vtkErrorMacro(<< "Please define points and/or radii!");
75 return VTK_DOUBLE_MAX;
76 }
77
78 if ((numSpheres = this->Centers->GetNumberOfPoints()) != this->Radii->GetNumberOfTuples())
79 {
80 vtkErrorMacro(<< "Number of radii/points inconsistent!");
81 return VTK_DOUBLE_MAX;
82 }
83
84 for (minVal = VTK_DOUBLE_MAX, i = 0; i < numSpheres; i++)
85 {
86 this->Radii->GetTuple(i, radius);
87 this->Centers->GetPoint(i, center);
88 val = vtkSphere::Evaluate(center, radius[0], x);
89 minVal = std::min(val, minVal);
90 }
91
92 return minVal;
93}
94
95//------------------------------------------------------------------------------
96// Evaluate spheres gradient.

Callers

nothing calls this directly

Calls 6

EvaluateFunction · 0.70
minFunction · 0.50
GetNumberOfPointsMethod · 0.45
GetNumberOfTuplesMethod · 0.45
GetTupleMethod · 0.45
GetPointMethod · 0.45

Tested by

no test coverage detected