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

Method SetEdgeIdsAndPoints

Common/DataModel/vtkHigherOrderTriangle.cxx:51–78  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

49
50//------------------------------------------------------------------------------
51void 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//------------------------------------------------------------------------------
81void vtkHigherOrderTriangle::Initialize()

Callers

nothing calls this directly

Calls 2

ToIndexMethod · 0.95
GetOrderMethod · 0.45

Tested by

no test coverage detected