------------------------------------------------------------------------------
| 97 | |
| 98 | //------------------------------------------------------------------------------ |
| 99 | int vtkGeometricErrorMetric::RequiresEdgeSubdivision( |
| 100 | double* leftPoint, double* midPoint, double* rightPoint, |
| 101 | #ifdef VTK_DISTANCE_LINE_POINT |
| 102 | double vtkNotUsed(alpha) |
| 103 | #else |
| 104 | double alpha |
| 105 | #endif |
| 106 | ) |
| 107 | { |
| 108 | assert("pre: leftPoint_exists" && leftPoint != nullptr); |
| 109 | assert("pre: midPoint_exists" && midPoint != nullptr); |
| 110 | assert("pre: rightPoint_exists" && rightPoint != nullptr); |
| 111 | // assert("pre: clamped_alpha" && alpha>0 && alpha<1); // or else true |
| 112 | if (this->GenericCell->IsGeometryLinear()) |
| 113 | { |
| 114 | // don't need to do anything: |
| 115 | return 0; |
| 116 | } |
| 117 | // distance between the line (leftPoint,rightPoint) and the point midPoint. |
| 118 | #ifdef VTK_DISTANCE_LINE_POINT |
| 119 | return this->Distance2LinePoint(leftPoint, rightPoint, midPoint) > |
| 120 | this->AbsoluteGeometricTolerance; |
| 121 | #else |
| 122 | // Interpolated point |
| 123 | double interpolatedPoint[3]; |
| 124 | int i = 0; |
| 125 | while (i < 3) |
| 126 | { |
| 127 | interpolatedPoint[i] = leftPoint[i] + alpha * (rightPoint[i] - leftPoint[i]); |
| 128 | ++i; |
| 129 | } |
| 130 | return vtkMath::Distance2BetweenPoints(midPoint, interpolatedPoint) > |
| 131 | this->AbsoluteGeometricTolerance; |
| 132 | #endif |
| 133 | } |
| 134 | |
| 135 | //------------------------------------------------------------------------------ |
| 136 | // Description: |
nothing calls this directly
no test coverage detected