------------------------------------------------------------------------------ Evaluate planes gradient.
| 106 | //------------------------------------------------------------------------------ |
| 107 | // Evaluate planes gradient. |
| 108 | void vtkPlanes::EvaluateGradient(double x[3], double n[3]) |
| 109 | { |
| 110 | int numPlanes, i; |
| 111 | double val, maxVal; |
| 112 | double nTemp[3]; |
| 113 | double pTemp[3]; |
| 114 | |
| 115 | if (!this->Points || !this->Normals) |
| 116 | { |
| 117 | vtkErrorMacro(<< "Please define points and/or normals!"); |
| 118 | return; |
| 119 | } |
| 120 | |
| 121 | if ((numPlanes = this->Points->GetNumberOfPoints()) != this->Normals->GetNumberOfTuples()) |
| 122 | { |
| 123 | vtkErrorMacro(<< "Number of normals/points inconsistent!"); |
| 124 | return; |
| 125 | } |
| 126 | |
| 127 | for (maxVal = -VTK_DOUBLE_MAX, i = 0; i < numPlanes; i++) |
| 128 | { |
| 129 | this->Normals->GetTuple(i, nTemp); |
| 130 | this->Points->GetPoint(i, pTemp); |
| 131 | val = this->Plane->Evaluate(nTemp, pTemp, x); |
| 132 | if (val > maxVal) |
| 133 | { |
| 134 | maxVal = val; |
| 135 | n[0] = nTemp[0]; |
| 136 | n[1] = nTemp[1]; |
| 137 | n[2] = nTemp[2]; |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | //------------------------------------------------------------------------------ |
| 143 | void vtkPlanes::SetFrustumPlanes(double planes[24]) |
nothing calls this directly
no test coverage detected