12#include "detray/definitions/algebra.hpp"
13#include "detray/tracks/ray.hpp"
16#include "detray/plugins/svgtools/meta/proto/trajectory.hpp"
17#include "detray/plugins/svgtools/styling/styling.hpp"
22namespace detray::svgtools::conversion {
25template <concepts::po
int3D po
int3_t>
26inline auto trajectory(
const std::vector<point3_t>& points,
27 const styling::trajectory_style& style =
29 using p_trajectory_t = svgtools::meta::proto::trajectory<point3_t>;
30 p_trajectory_t p_trajectory;
32 p_trajectory._points = points;
34 svgtools::styling::apply_style(p_trajectory, style);
45template <
template <
typename>
class trajectory_t, concepts::algebra algebra_t>
46inline auto trajectory(
const trajectory_t<algebra_t>& traj,
47 const styling::trajectory_style& style =
52 std::vector<dpoint3D<algebra_t>> points;
53 for (
auto s = S0;
s < path_length;
s += step_size) {
54 points.push_back(traj.pos(s));
57 return trajectory(points, style);
65template <concepts::algebra algebra_t>
66inline auto trajectory(
const detray::detail::ray<algebra_t>& traj,
67 const styling::trajectory_style& style =
71 std::vector<dpoint3D<algebra_t>> points = {traj.
pos(S0),
72 traj.
pos(path_length)};
74 return trajectory(points, style);
const point3_type & pos() const
Return the ray origin.
Definition ray.hpp:63
constexpr double s
Definition Units.hpp:120
get_scalar_t< A, T > dscalar
Scalar type for algebra A and value type T.
Definition algebra.hpp:64