1#ifndef IV_SRC_MATH_STRUCTS_HPP_
2#define IV_SRC_MATH_STRUCTS_HPP_
57 static constexpr std::string_view
x {
"x"};
58 static constexpr std::string_view
y {
"y"};
110 static constexpr std::string_view
x {
"x"};
111 static constexpr std::string_view
y {
"y"};
112 static constexpr std::string_view
z {
"z"};
137 requires std::is_same_v<T, iv::math::geometry::Point2d> || std::is_same_v<T, iv::math::geometry::Point3d>
140 auto *array =
static_cast<float *
>(calloc(v.size() *
sizeof(T) /
sizeof(
iv::types::coord),
sizeof(
float)));
142 for (
size_t i = 0; i < v.size(); ++i)
144 array[i *
sizeof(T) /
sizeof(
iv::types::coord)] =
static_cast<float>(v[i].x);
145 array[i *
sizeof(T) /
sizeof(
iv::types::coord) + 1] =
static_cast<float>(v[i].y);
147 if constexpr (std::is_same_v<T, iv::math::geometry::Point3d>)
149 array[i *
sizeof(T) /
sizeof(
iv::types::coord) + 2] =
static_cast<float>(v[i].z);
Definition xmlFile.hpp:15
float * toArrayOfFloats(const std::vector< T > &v)
Definition structs.hpp:138
double height
Definition types.hpp:14
double width
Definition types.hpp:23
double coord
Definition types.hpp:13
Definition structs.hpp:123
iv::types::width width
Definition structs.hpp:133
bool operator>(const Area &rhs) const
Definition structs.cpp:366
bool operator>=(const Area &rhs) const
Definition structs.cpp:376
Area & operator=(const Area &rhs)
Definition structs.cpp:340
bool operator<(const Area &rhs) const
Definition structs.cpp:361
bool operator==(const Area &rhs) const
Definition structs.cpp:351
bool operator!=(const Area &rhs) const
Definition structs.cpp:356
iv::types::height height
Definition structs.hpp:132
bool operator<=(const Area &rhs) const
Definition structs.cpp:371
Definition structs.hpp:61
static constexpr iv::types::coord y
Definition structs.hpp:63
static constexpr iv::types::coord x
Definition structs.hpp:62
Definition structs.hpp:56
static constexpr std::string_view x
Definition structs.hpp:57
static constexpr std::string_view y
Definition structs.hpp:58
Definition structs.hpp:16
Point2d operator*(const Point2d &rhs) const
Definition structs.cpp:27
Point2d & operator-=(const Point2d &rhs)
Definition structs.cpp:66
bool operator>=(const Point2d &rhs) const
Definition structs.cpp:124
Point2d & operator/=(const Point2d &rhs)
Definition structs.cpp:82
Point2d & operator=(const Point2d &rhs)
Definition structs.cpp:47
Point2d operator/(const Point2d &rhs) const
Definition structs.cpp:32
bool operator<(const Point2d &rhs) const
Definition structs.cpp:109
bool operator>(const Point2d &rhs) const
Definition structs.cpp:114
iv::types::coord y
Definition structs.hpp:52
Point2d & operator+=(const Point2d &rhs)
Definition structs.cpp:58
Point2d()
Definition structs.cpp:90
friend std::ostream & operator<<(std::ostream &os, const Point2d &point)
Definition structs.cpp:139
bool operator==(const Point2d &rhs) const
Definition structs.cpp:99
Point2d & operator*=(const Point2d &rhs)
Definition structs.cpp:74
Point2d operator+(const Point2d &rhs) const
Definition structs.cpp:17
Point2d operator-() const
Definition structs.cpp:12
iv::types::coord x
Definition structs.hpp:51
iv::types::coord distance() const
Definition structs.cpp:129
bool load(const iv::file::xml::node &nodePoint)
Definition structs.cpp:145
bool operator<=(const Point2d &rhs) const
Definition structs.cpp:119
bool operator!=(const Point2d &rhs) const
Definition structs.cpp:104
bool save(iv::file::xml::node &nodePoint) const
Definition structs.cpp:152
Definition structs.hpp:115
static constexpr iv::types::coord y
Definition structs.hpp:117
static constexpr iv::types::coord z
Definition structs.hpp:118
static constexpr iv::types::coord x
Definition structs.hpp:116
Definition structs.hpp:109
static constexpr std::string_view z
Definition structs.hpp:112
static constexpr std::string_view x
Definition structs.hpp:110
static constexpr std::string_view y
Definition structs.hpp:111
Definition structs.hpp:68
bool operator<=(const Point3d &rhs) const
Definition structs.cpp:281
Point3d()
Definition structs.cpp:170
Point3d operator/(const Point3d &rhs) const
Definition structs.cpp:198
bool operator>=(const Point3d &rhs) const
Definition structs.cpp:286
bool load(const iv::file::xml::node &nodePoint)
Definition structs.cpp:308
iv::types::coord x
Definition structs.hpp:103
Point3d & operator=(const Point3d &rhs)
Definition structs.cpp:213
bool operator>(const Point3d &rhs) const
Definition structs.cpp:276
bool operator<(const Point3d &rhs) const
Definition structs.cpp:271
iv::types::coord distance() const
Definition structs.cpp:291
Point3d operator-() const
Definition structs.cpp:178
Point3d operator*(const Point3d &rhs) const
Definition structs.cpp:193
Point3d & operator+=(const Point3d &rhs)
Definition structs.cpp:225
Point3d & operator/=(const Point3d &rhs)
Definition structs.cpp:252
friend std::ostream & operator<<(std::ostream &os, const Point3d &point)
Definition structs.cpp:301
iv::types::coord z
Definition structs.hpp:105
Point3d & operator-=(const Point3d &rhs)
Definition structs.cpp:234
bool save(iv::file::xml::node &nodePoint) const
Definition structs.cpp:317
Point3d operator+(const Point3d &rhs) const
Definition structs.cpp:183
iv::types::coord y
Definition structs.hpp:104
bool operator==(const Point3d &rhs) const
Definition structs.cpp:261
Point3d & operator*=(const Point3d &rhs)
Definition structs.cpp:243
bool operator!=(const Point3d &rhs) const
Definition structs.cpp:266