------------------------------------------------------------------------------
| 49 | |
| 50 | //------------------------------------------------------------------------------ |
| 51 | void vtkHigherOrderTriangle::SetEdgeIdsAndPoints(int edgeId, |
| 52 | const std::function<void(const vtkIdType&)>& set_number_of_ids_and_points, |
| 53 | const std::function<void(const vtkIdType&, const vtkIdType&)>& set_ids_and_points) |
| 54 | { |
| 55 | vtkIdType order = this->GetOrder(); |
| 56 | |
| 57 | set_number_of_ids_and_points(order + 1); |
| 58 | |
| 59 | vtkIdType bindex[3] = { 0, 0, 0 }; |
| 60 | bindex[(edgeId + 2) % 3] = order; |
| 61 | |
| 62 | for (vtkIdType i = 0; i <= order; i++) |
| 63 | { |
| 64 | vtkIdType triangleIndex = this->ToIndex(bindex); |
| 65 | |
| 66 | // The ordering for points in vtkHigherOrderCurve are: first point, then last |
| 67 | // point, and then the remaining points in sequence. This loop iterates over |
| 68 | // the edge in sequence starting with the first point. The following value |
| 69 | // maps from this iteration loop to the edge's ordering. |
| 70 | // NOLINTNEXTLINE(readability-avoid-nested-conditional-operator) |
| 71 | vtkIdType edgeIndex = (i == 0 ? 0 : (i == order ? 1 : i + 1)); |
| 72 | |
| 73 | set_ids_and_points(edgeIndex, triangleIndex); |
| 74 | |
| 75 | bindex[(edgeId + 2) % 3]--; |
| 76 | bindex[edgeId]++; |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | //------------------------------------------------------------------------------ |
| 81 | void vtkHigherOrderTriangle::Initialize() |