22 namespace VerticesHelper {
34 const std::vector<ActsScalar>& phiRefs = {},
51 template <
typename vertex_t,
typename transform_t>
53 std::pair<ActsScalar, ActsScalar> rxy,
ActsScalar phi1,
54 ActsScalar phi2,
unsigned int lseg,
int addon = 0,
55 const vertex_t&
offset = vertex_t::Zero(),
56 const transform_t&
transform = transform_t::Identity()) {
59 static_cast<unsigned int>(std::abs(phi2 - phi1) / (2 * M_PI) * lseg);
60 segs = segs > 0 ? segs : 1;
63 for (
unsigned int iphi = 0; iphi < segs + addon; ++iphi) {
65 vertex_t
vertex = vertex_t::Zero();
66 vertex(0) = rxy.first * std::cos(phi);
67 vertex(1) = rxy.second * std::sin(phi);
88 unsigned int lseg = 1);
101 unsigned int lseg = 1);
112 template <
typename vertex_t,
typename vertex_container_t>
114 const vertex_container_t& vertices) {
122 auto lineSide = [&](
auto&& ll0,
auto&& ll1) {
123 auto normal = ll1 - ll0;
124 auto delta = point - ll0;
125 return std::signbit((normal[0] *
delta[1]) - (normal[1] * delta[0]));
132 auto reference = lineSide(l0,
l1);
133 for (++iv; iv !=
std::end(vertices); ++iv) {
136 if (lineSide(l0,
l1) != reference) {
158 template <
typename vertex_t>
160 const vertex_t& upperRight) {
161 return (lowerLeft[0] <= point[0]) && (point[0] < upperRight[0]) &&
162 (lowerLeft[1] <= point[1]) && (point[1] < upperRight[1]);