libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
line.h
Go to the documentation of this file.
1
8#pragma once
9
11#include <promeki/core/point.h>
12
14
25template <typename T, size_t N> class Line {
26 public:
28 using Pt = Point<T, N>;
29
31 Line() = default;
32
38 Line(const Pt &s, const Pt &e) : _start(s), _end(e) {};
39
45 Line(const Pt &&s, const Pt &&e) : _start(std::move(s)), _end(std::move(e)) {}
46
51 const Pt &start() const {
52 return _start;
53 }
54
59 const Pt &end() const {
60 return _end;
61 }
62
63 private:
64 Pt _start;
65 Pt _end;
66};
67
86
88
N-dimensional line segment defined by a start and end point.
Definition line.h:25
const Pt & end() const
Returns a const reference to the end point.
Definition line.h:59
const Pt & start() const
Returns a const reference to the start point.
Definition line.h:51
Line()=default
Default constructor. Both endpoints are default-constructed (zero).
Point< T, N > Pt
The Point type used for the endpoints of this Line.
Definition line.h:28
Line(const Pt &&s, const Pt &&e)
Move-constructs a Line from a start and end point.
Definition line.h:45
Line(const Pt &s, const Pt &e)
Constructs a Line from a start and end point.
Definition line.h:38
Dynamic array container wrapping std::vector.
Definition list.h:40
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19