------------------------------------------------------------------------------ Evaluate spheres gradient.
| 95 | //------------------------------------------------------------------------------ |
| 96 | // Evaluate spheres gradient. |
| 97 | void vtkSpheres::EvaluateGradient(double x[3], double n[3]) |
| 98 | { |
| 99 | int numSpheres, i; |
| 100 | double val, minVal; |
| 101 | double rTemp[1]; |
| 102 | double cTemp[3]; |
| 103 | |
| 104 | if (!this->Centers || !this->Radii) |
| 105 | { |
| 106 | vtkErrorMacro(<< "Please define centers and radii!"); |
| 107 | return; |
| 108 | } |
| 109 | |
| 110 | if ((numSpheres = this->Centers->GetNumberOfPoints()) != this->Radii->GetNumberOfTuples()) |
| 111 | { |
| 112 | vtkErrorMacro(<< "Number of radii/centersinconsistent!"); |
| 113 | return; |
| 114 | } |
| 115 | |
| 116 | for (minVal = VTK_DOUBLE_MAX, i = 0; i < numSpheres; i++) |
| 117 | { |
| 118 | this->Radii->GetTuple(i, rTemp); |
| 119 | this->Centers->GetPoint(i, cTemp); |
| 120 | val = vtkSphere::Evaluate(cTemp, rTemp[0], x); |
| 121 | if (val < minVal) |
| 122 | { |
| 123 | minVal = val; |
| 124 | n[0] = x[0] - cTemp[0]; |
| 125 | n[1] = x[1] - cTemp[1]; |
| 126 | n[2] = x[2] - cTemp[2]; |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | //------------------------------------------------------------------------------ |
| 132 | int vtkSpheres::GetNumberOfSpheres() |
nothing calls this directly
no test coverage detected