17 template <
class T,
int N>
24 for (
size_t i = 0; i < N; i++)
object[i] = 0.0;
28 for (
size_t i = 0; i < N; i++)
object[i] += o[i];
35 size_t N = poly.size();
37 std::vector<size_t> unused;
44 for (
size_t i = 1; i < N - 1; i++)
56 unused.push_back(N - 1);
59 for (
size_t i = 0; i < unused.size() - 1; i++)
61 size_t last = unused[i + 1];
62 for (
size_t j = unused[i] + 1 - diff; j < last - diff; j++)
63 poly[j] = poly[j + diff];
65 poly.resize(N + 1 - unused.size());
70 size_t N = poly.size();
72 std::vector<size_t> rep;
73 for (
size_t i = 0; i < N - 1; i++)
80 for (
size_t i = 0; i < rep.size() - 1; i++)
82 size_t last = rep[i + 1];
83 for (
size_t j = rep[i] + 1 - diff; j < last - diff; j++)
84 poly[j] = poly[j + diff];
86 poly.resize(N + 1 - rep.size());
Auxiliary functor class to compute polygon's center.
void removeRepVertices(T &poly)
This base provides a set of functions for maths stuff.
void removeUnusedVertices(T &poly)
double getEpsilon()
Gets the value of the geometric epsilon (default = 1e-5)
void operator()(const T &o)
double distance(const TPoint2D &p1, const TPoint2D &p2)
Gets the distance between two points in a 2D space.