Return indexes of common edges of [to, from] triangles.
| 120 | |
| 121 | /// Return indexes of common edges of [to, from] triangles. |
| 122 | std::pair<int, int> CommonEdge(Triangle const & to, Triangle const & from) |
| 123 | { |
| 124 | for (int i = 0; i < 3; ++i) |
| 125 | { |
| 126 | for (int j = 0; j < 3; ++j) |
| 127 | if (to.m_p[i] == from.m_p[math::NextModN(j, 3)] && to.m_p[math::NextModN(i, 3)] == from.m_p[j]) |
| 128 | return std::make_pair(i, j); |
| 129 | } |
| 130 | |
| 131 | ASSERT(false, ("?WTF? Triangles not neighbors!")); |
| 132 | return std::make_pair(-1, -1); |
| 133 | } |
| 134 | |
| 135 | /// Get neighbors of 'trg' triangle, which was achieved from 'from' triangle. |
| 136 | /// @param[out] nb neighbors indexes of 'trg' if 0->1 is common edge with'from': |
no test coverage detected