bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
line_segment_link.h
Go to the documentation of this file.
1#ifndef BITSIM_TRAJECTORY_LINE_SEGMENT_LINK_H
2#define BITSIM_TRAJECTORY_LINE_SEGMENT_LINK_H
3
7
8namespace bitsim
9{
10namespace trajectory
11{
12
17template <int dim, typename NodeData, typename SegmentData>
19{
20 public:
21 static const int dimension = dim;
22 using node_data_type = NodeData;
23 using segment_data_type = SegmentData;
25
31
36
41 const segment_data_type &data);
42
47
55
59 const segment_data_type &get_data() const noexcept { return data_; }
60
64 bool is_active() const { return is_active_; }
65
69 void deactivate() { is_active_ = false; }
70
74 void make_active() { is_active_ = true; }
75
76 private:
79 std::vector<w_point_type> internal_points_;
80
83
85 bool is_active_;
86};
87
88template <int dim, typename NodeData, typename SegmentData>
91 bitsim::consts::INVALID_ID),
92 internal_points_(), data_(), is_active_(false)
93{
94}
95
96template <int dim, typename NodeData, typename SegmentData>
101 : bitsim::geometry::GenericLine<dim>(v1, v2, id), internal_points_(), data_(data),
102 is_active_(true)
103{
104}
105
106template <int dim, typename NodeData, typename SegmentData>
110 : LineSegmentLink<dim, NodeData, SegmentData>(
111 v1, v2, id, typename LineSegmentLink<dim, NodeData, SegmentData>::segment_data_type())
112{
113}
114
115} // namespace trajectory
116} // namespace bitsim
117
118#endif // BITSIM_TRAJECTORY_LINE_SEGMENT_LINK_H
class GenericLine. Represents a generic line with vertex VertexType The equation of a linein l=Ax + B...
Definition generic_line.h:24
bool has_valid_id() const noexcept
Returns true iff id_ != rlenvscpp::consts::INVALID_ID.
Definition generic_line.h:58
GenericLine()
Constructor.
Definition generic_line.h:103
uint_t get_id() const noexcept
Returns the id of the line.
Definition generic_line.h:63
real_t segment_distance(const vertex_type &n) const
The distance of the point from the segment between the two vertices.
void set_id(uint_t id) noexcept
Set the id of the line.
Definition generic_line.h:68
const vertex_type & get_vertex(uint_t v) const
Returns the v-th vertex of the segment.
Definition generic_line.h:120
real_t length() const
Calculate the length of the line.
Definition generic_line.h:94
A class that describes a point with spacedim spatial dimension space.
Definition geom_point.h:22
Helper class to represent a waypoint.
Definition waypoint.h:18
Definition bitsim_consts.cpp:10
Definition generic_line.h:16
Definition line_segment_link.h:11
Definition dc_motor_backend_base.h:9
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
double real_t
real_t
Definition bitsim_types.h:20