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

Method EvaluateGradient

Common/DataModel/vtkPlanes.cxx:108–140  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Evaluate planes gradient.

Source from the content-addressed store, hash-verified

106//------------------------------------------------------------------------------
107// Evaluate planes gradient.
108void 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//------------------------------------------------------------------------------
143void vtkPlanes::SetFrustumPlanes(double planes[24])

Callers

nothing calls this directly

Calls 5

GetNumberOfPointsMethod · 0.45
GetNumberOfTuplesMethod · 0.45
GetTupleMethod · 0.45
GetPointMethod · 0.45
EvaluateMethod · 0.45

Tested by

no test coverage detected