35#include <NDEVR/Vertex.h>
36#include <NDEVR/LineSegment.h>
37#include <NDEVR/Bounds.h>
38#include <NDEVR/Triangle.h>
39#include <NDEVR/PolyLine.h>
42 template<
class t_type,
class t_vector, u
int01 t_dims, u
int01 t_row_dims, u
int01 t_col_dims>
45 return matrix * vertex;
47 template<
class t_type,
class t_vector, u
int01 t_row_dims, u
int01 t_col_dims>
51 trans = matrix * trans;
54 template<
class t_type,
class t_vector, u
int01 t_row_dims, u
int01 t_col_dims>
57 t_type bottom = right[0] * matrix[0][3] + right[1] * matrix[1][3] + matrix[2][3] + matrix[3][3];
59 (right[0] * matrix[0][0] + right[1] * matrix[1][0] + matrix[2][0] + matrix[3][0]) / bottom
60 , (right[0] * matrix[0][1] + right[1] * matrix[1][1] + matrix[2][1] + matrix[3][1]) / bottom);
62 template<
class t_type,
class t_vector>
65 t_type bottom = right[0] * matrix[0][3] + right[1] * matrix[1][3] + right[2] * matrix[2][3] + matrix[3][3];
67 (right[0] * matrix[0][0] + right[1] * matrix[1][0] + right[2] * matrix[2][0] + matrix[3][0]) / bottom
68 , (right[0] * matrix[0][1] + right[1] * matrix[1][1] + right[2] * matrix[2][1] + matrix[3][1]) / bottom
69 , (right[0] * matrix[0][2] + right[1] * matrix[1][2] + right[2] * matrix[2][2] + matrix[3][2]) / bottom);
71 template<
class t_type,
class t_vector>
75 (right[0] * matrix[0][0] + right[1] * matrix[1][0] + right[2] * matrix[2][0])
76 , (right[0] * matrix[0][1] + right[1] * matrix[1][1] + right[2] * matrix[2][1])
77 , (right[0] * matrix[0][2] + right[1] * matrix[1][2] + right[2] * matrix[2][2]));
79 template<
class t_type,
class t_vector>
83 right[0] * matrix[0][0] + right[1] * matrix[1][0] + right[2] * matrix[2][0] + right[3] * matrix[3][0]
84 , right[0] * matrix[0][1] + right[1] * matrix[1][1] + right[2] * matrix[2][1] + right[3] * matrix[3][1]
85 , right[0] * matrix[0][2] + right[1] * matrix[1][2] + right[2] * matrix[2][2] + right[3] * matrix[3][2]
86 , right[0] * matrix[0][3] + right[1] * matrix[1][3] + right[2] * matrix[2][3] + right[3] * matrix[3][3]);
89 template<
class t_type,
class t_vector, u
int01 t_dims, u
int01 t_row_dims, u
int01 t_col_dims>
92 return matrix * vertex;
94 template<
class t_type,
class t_vector, u
int01 t_row_dims, u
int01 t_col_dims>
99 template<
class t_type,
class t_vector, u
int01 t_row_dims, u
int01 t_col_dims>
103 (right[0] * matrix[0][0] + right[1] * matrix[1][0] + matrix[2][0])
104 , (right[0] * matrix[0][1] + right[1] * matrix[1][1] + matrix[2][1]));
106 template<
class t_type,
class t_vector>
110 (right[0] * matrix[0][0] + right[1] * matrix[1][0] + right[2] * matrix[2][0])
111 , (right[0] * matrix[0][1] + right[1] * matrix[1][1] + right[2] * matrix[2][1])
112 , (right[0] * matrix[0][2] + right[1] * matrix[1][2] + right[2] * matrix[2][2]));
114 template<
class t_type,
class t_vector>
118 (right[0] * matrix[0][0] + right[1] * matrix[1][0] + right[2] * matrix[2][0])
119 , (right[0] * matrix[0][1] + right[1] * matrix[1][1] + right[2] * matrix[2][1])
120 , (right[0] * matrix[0][2] + right[1] * matrix[1][2] + right[2] * matrix[2][2]));
122 template<
class t_type,
class t_vector>
126 right[0] * matrix[0][0] + right[1] * matrix[1][0] + right[2] * matrix[2][0] + right[3] * matrix[3][0]
127 , right[0] * matrix[0][1] + right[1] * matrix[1][1] + right[2] * matrix[2][1] + right[3] * matrix[3][1]
128 , right[0] * matrix[0][2] + right[1] * matrix[1][2] + right[2] * matrix[2][2] + right[3] * matrix[3][2]
129 , right[0] * matrix[0][3] + right[1] * matrix[1][3] + right[2] * matrix[2][3] + right[3] * matrix[3][3]);
131 template<
class t_type, u
int01 t_dims,
class t_vertex, u
int01 t_row_dims, u
int01 t_col_dims>
136 template<
class t_type, u
int01 t_dims,
class t_vertex, u
int01 t_row_dims, u
int01 t_col_dims>
142 template<
class t_type,
class t_vertex, u
int01 t_dims, u
int01 t_row_dims, u
int01 t_col_dims>
152 template<
class t_type,
class t_vertex, u
int01 t_row_dims, u
int01 t_col_dims>
157 for (
uint01 max_min = 0; max_min < 2; max_min++)
159 for (
uint01 n = 0; n < 3; n++)
160 upper_1[n] = matrix[0][n] * bounds[max_min][
X] + matrix[3][n];
161 t_type lower_1 = matrix[0][3] * bounds[max_min][
X] + matrix[3][3];
166 template<
class t_type,
class t_vertex, u
int01 t_row_dims, u
int01 t_col_dims>
173 for (
uint01 n = 0; n < 3; n++)
174 upper_1[n] = matrix[0][n] * bounds[i][
X] + matrix[3][n];
175 t_type lower_1 = matrix[0][3] * bounds[i][
X] + matrix[3][3];
179 for (
uint01 n = 0; n < 3; n++)
180 upper_2[n] = upper_1[n] + matrix[1][n] * bounds[j][
Y];
181 t_type lower_2 = lower_1 + matrix[1][3] * bounds[j][
Y];
187 template<
class t_type,
class t_vertex, u
int01 t_row_dims, u
int01 t_col_dims>
200 for (
uint01 n = 0; n < 3; n++)
201 upper_1[n] = matrix[0][n] * bounds[max_min][
X] + matrix[3][n];
202 t_type lower_1 = matrix[0][3] * bounds[max_min][
X] + matrix[3][3];
204 for (
uint01 max_min_2 =
MIN; max_min_2 <=
MAX; max_min_2++)
206 for (
uint01 n = 0; n < 3; n++)
207 upper_2[n] = upper_1[n] + matrix[1][n] * bounds[max_min_2][
Y];
208 t_type lower_2 = lower_1 + matrix[1][3] * bounds[max_min_2][
Y];
210 for (
uint01 max_min_3 =
MIN; max_min_3 <=
MAX; max_min_3++)
212 for (
uint01 n = 0; n < 3; n++)
213 upper_3[n] = upper_2[n] + matrix[2][n] * bounds[max_min_3][
Z];
214 t_type lower_3 = lower_2 + matrix[2][3] * bounds[max_min_3][
Z];
230 template<
class t_type, u
int01 t_row_dims, u
int01 t_col_dims>
233 for (
uint01 i = 0; i < t_row_dims; i++)
234 if (!
equals(a[i], b[i], epsilon))
239 template<
class t_type, u
int01 t_row_dims, u
int01 t_col_dims>
243 for (
uint01 i = 0; i < t_row_dims; i++)
244 multiplied_matrix[i] = mult * matrix[i];
245 return multiplied_matrix;
254 bool solve_offset_xy =
true;;
255 bool solve_offset_z =
true;
256 bool solve_heading =
true;
257 bool solve_rotation =
false;
258 bool solve_scale =
false;
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:52
constexpr void addToBounds(const t_vertex &vector)
Definition Bounds.hpp:390
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A line segment represented by two vertices, a start and end.
Definition Line.hpp:49
constexpr const t_vertex & vertex(uint01 index) const
Definition Line.hpp:152
Definition MatrixFunctions.h:248
static Matrix< fltp08 > SolveLeastSquaredAffine(const Buffer< Vertex< 3, fltp08 > > &a, const Buffer< Vertex< 3, fltp08 > > &b)
static Matrix< fltp08 > Solve2DAffine(const Buffer< Vertex< 2, fltp08 > > &a, const Buffer< Vertex< 2, fltp08 > > &b)
static Matrix< fltp08 > SolveBestFitTransform(const TransformSolveOptions &options)
Definition Matrix.hpp:176
A polyline which stores vertex information for many points along a given path.
Definition CoordinateProjectionManager.h:44
uint04 vertexCount() const
Definition PolyLine.hpp:191
void add(const t_vertex &vertex)
Definition PolyLine.hpp:241
const t_vertex & vertex(uint04 index) const
Definition PolyLine.hpp:143
Definition Vertex.hpp:317
A triangle is a polygon with three edges and three vertices. It is one of the basic shapes in geometr...
Definition Triangle.hpp:138
constexpr t_vertex & vertex(TriangleLocation triangle_node)
Vertices the given triangle node.
Definition Triangle.hpp:168
A vertex or point. A specific type of Vector used primarily for spacial location information.
Definition Vertex.hpp:48
constexpr bool IsInvalid(const t_type &value)
Query if 'value' is valid or invalid. Invalid values should return invalid if used for calculations o...
Definition BaseFunctions.hpp:170
constexpr std::enable_if< IsVecType< t_vector_type, Angle< fltp08 > >::value, t_vector_type >::type operator*(const t_vector_type &angle, const t_type &mult)
Multiplication operator for a Vector of Angles.
Definition AngleFunctions.h:326
@ MIN
Definition BaseValues.hpp:196
@ MAX
Definition BaseValues.hpp:197
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:375
constexpr bool equals(const LineSegment< t_dims, t_type, t_vertex > &left, const LineSegment< t_dims, t_type, t_vertex > &right, const t_type &epsilon=cast< t_type >(0))
Definition Line.hpp:757
@ B
Definition BaseValues.hpp:170
@ A
Definition BaseValues.hpp:168
@ Y
Definition BaseValues.hpp:169
@ X
Definition BaseValues.hpp:167
@ C
Definition BaseValues.hpp:172
@ Z
Definition BaseValues.hpp:171
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233