MCPcopy Create free account
hub / github.com/comaps/comaps / ApplyPointOnSurfaceCalculator

Function ApplyPointOnSurfaceCalculator

libs/geometry/algorithm.hpp:70–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68{
69template <typename TCalculator, typename TIterator>
70m2::PointD ApplyPointOnSurfaceCalculator(TIterator begin, TIterator end, TCalculator && calc)
71{
72 std::array<m2::PointD, 3> triangle;
73 while (begin != end)
74 {
75 for (auto i = 0; i < 3; ++i)
76 {
77 // Cannot use ASSERT_NOT_EQUAL, due to absence of an approbriate DebugPrint.
78 ASSERT(begin != end, ("Not enough points to calculate point on surface"));
79 triangle[i] = *begin++;
80 }
81 calc(triangle[0], triangle[1], triangle[2]);
82 }
83 return calc.GetResult();
84}
85
86template <typename TCalculator, typename TIterator>
87auto ApplyCalculator(TIterator begin, TIterator end, TCalculator && calc) -> decltype(calc.GetResult())

Callers 1

SelectImplementationFunction · 0.85

Calls 2

ASSERTFunction · 0.85
GetResultMethod · 0.45

Tested by

no test coverage detected