------------------------------------------------------------------------------ Evaluate plane equations. Return the largest value.
| 75 | //------------------------------------------------------------------------------ |
| 76 | // Evaluate plane equations. Return the largest value. |
| 77 | double 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. |
nothing calls this directly
no test coverage detected