------------------------------------------------------------------------------ Evaluate sphere equations. Return smallest absolute value.
| 64 | //------------------------------------------------------------------------------ |
| 65 | // Evaluate sphere equations. Return smallest absolute value. |
| 66 | double 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. |
nothing calls this directly
no test coverage detected