point.hpp
1 #ifndef NOOS_OBJECT_POINT
2 #define NOOS_OBJECT_POINT
3 #include "includes.ihh"
4 /*
5  * LICENSE HERE
6  */
7 namespace noos {
8 namespace object {
16 template <class value_type>
17 struct point
18 {
20  value_type x = 0;
22  value_type y = 0;
24  value_type z = 0;
25 
27  point() = default;
28 
30  point(value_type x_data,
31  value_type y_data,
32  value_type z_data);
33 
35  point(const json::const_iterator & position);
36 
38  json::object_t to_json() const;
39 
41  bool operator==(const noos::object::point<value_type> & rhs) const;
42 };
43 
50 template <class value_type>
51 struct point2d
52 {
54  value_type x = 0;
56  value_type y = 0;
57 
59  point2d() = default;
60 
62  point2d(value_type x_data,
63  value_type y_data);
64 
66  point2d(const json::const_iterator & position);
67 
69  json::object_t to_json() const;
70 
72  bool operator==(const noos::object::point2d<value_type> & rhs) const;
73 };
74 
81 template <class value_type>
82 struct pose2d
83 {
85  value_type x = 0;
87  value_type y = 0;
89  value_type theta = 0;
90 
92  pose2d() = default;
93 
95  pose2d(value_type x_data,
96  value_type y_data,
97  value_type theta_data);
98 
100  pose2d(const json::const_iterator & position);
101 
103  json::object_t to_json() const;
104 
106  bool operator==(const noos::object::pose2d<value_type> & rhs) const;
107 };
108 #include "point.tpl"
109 }
110 }
111 #endif
point()=default
default constructor
value_type x
coordinate x
Definition: point.hpp:20
pose2d(value_type x_data, value_type y_data, value_type theta_data)
constructor taking parameters x, y and theta
Definition: point.hpp:92
Definition: asio_handler.hpp:14
encapsulate point of 2 dimensions (x, y)
Definition: point.hpp:51
value_type y
coordinate y
Definition: point.hpp:22
json::object_t to_json() const
Definition: point.hpp:36
bool operator==(const noos::object::point< value_type > &rhs) const
Equality operator.
Definition: point.hpp:43
encapsulate point of 2 dimensions (x, y) with an angle
Definition: point.hpp:82
encapsulate point position vector
Definition: point.hpp:17
value_type z
coordinate z
Definition: point.hpp:24
point2d(const json::const_iterator &position)
Construct using library "json for modern c++".
Definition: point.hpp:60