33#include <NDEVR/Vector.h>
46 template<u
int01 t_dims,
class t_type,
class t_vector_type = Vector<t_dims, t_type>>
53 constexpr explicit Vertex(
const t_type& scaler)
54 : t_vector_type(scaler)
56 constexpr Vertex(
const t_vector_type& vector)
57 : t_vector_type(vector)
60 : t_vector_type(vector)
62 constexpr Vertex(
const t_type x,
const t_type y)
65 constexpr Vertex(t_type x, t_type y, t_type z)
66 : t_vector_type(x, y, z)
68 constexpr Vertex(
const t_type x,
const t_type y,
const t_type z,
const t_type w)
69 : t_vector_type(x, y, z, w)
71 constexpr explicit Vertex(
const t_type(&vector)[t_dims])
72 : t_vector_type(vector)
75 : t_vector_type(vector, postfix)
77 constexpr Vertex(
const Vector<
getMax(t_dims - 2, 0), t_type>& vector,
const t_type postfix_a,
const t_type postfix_b)
78 : t_vector_type(vector, postfix_a, postfix_b)
81 : t_vector_type(prefix, vector)
97 template<u
int01 t_new_dim,
class t_new_type,
class t_new_vector = Vector<t_new_dim, t_new_type>>
102 template<
class t_new_type,
class t_new_vector = Vector<t_dims, t_new_type>>
107 template<u
int01 t_new_dim,
class t_new_type,
class t_new_vector = Vector<t_new_dim, t_new_type>>
182 t_vector_type::operator=(scaler);
201 t_vector_type::operator=(vector);
206 t_vector_type::operator=(vector);
225 template<u
int01 t_dims,
class t_type,
class t_base>
229 for (
uint01 dim = 0; dim < t_dims; dim++)
231 vec[dim] =
getMax(v1[dim], v2[dim]);
250 template<u
int01 t_dims,
class t_type,
class t_base>
254 for (
uint01 dim = 0; dim < t_dims; dim++)
256 vec[dim] =
getMin(v1[dim], v2[dim]);
270 template<u
int01 t_dims,
class t_type,
class t_vector_type>
271 struct Constant<Vertex<t_dims, t_type, t_vector_type>>
295 template<u
int01 t_dims,
class t_type,
class t_vector_type>
296 static constexpr bool IsInvalid(
const Vertex<t_dims, t_type, t_vector_type>& value)
298 for (
uint01 dim = 0; dim < t_dims; ++dim)
315 template<u
int01 t_dims,
class t_type,
class t_vector_type = Vector<t_dims, t_type>>
316 class Ray :
public t_vector_type
322 constexpr explicit Ray(
const t_type& scaler)
323 : t_vector_type(scaler)
325 constexpr Ray(
const t_vector_type& vector)
326 : t_vector_type(vector)
329 : t_vector_type(vector)
331 constexpr Ray(
const t_type x,
const t_type y)
332 : t_vector_type(x, y)
334 constexpr Ray(t_type x, t_type y, t_type z)
335 : t_vector_type(x, y, z)
337 constexpr Ray(
const t_type x,
const t_type y,
const t_type z,
const t_type w)
338 : t_vector_type(x, y, z, w)
340 constexpr explicit Ray(
const t_type(&vector)[t_dims])
341 : t_vector_type(vector)
343 constexpr Ray(
const Vector<
getMax(t_dims - 1, 0), t_type>& vector,
const t_type postfix)
344 : t_vector_type(vector, postfix)
346 constexpr Ray(
const Vector<
getMax(t_dims - 2, 0), t_type>& vector,
const t_type postfix_a,
const t_type postfix_b)
347 : t_vector_type(vector, postfix_a, postfix_b)
350 : t_vector_type(prefix, vector)
366 template<u
int01 t_new_dim,
class t_new_type,
class t_new_vector = Vector<t_new_dim, t_new_type>>
371 template<
class t_new_type,
class t_new_vector = Vector<t_dims, t_new_type>>
394 return (*
this *
scale);
413 return (*
this *
scale);
432 t_vector_type::operator=(scaler);
451 t_vector_type::operator=(vector);
456 t_vector_type::operator=(vector);
475 template<u
int01 t_dims,
class t_type,
class t_base>
479 for (
uint01 dim = 0; dim < t_dims; dim++)
500 template<u
int01 t_dims,
class t_type,
class t_base>
504 for (
uint01 dim = 0; dim < t_dims; dim++)
520 template<u
int01 t_dims,
class t_type,
class t_vector_type>
521 struct Constant<Ray<t_dims, t_type, t_vector_type>>
524 constexpr const static Ray<t_dims, t_type, t_vector_type>
Min{ 0 };
545 template<u
int01 t_dims,
class t_type,
class t_vector_type>
546 static constexpr bool IsInvalid(
const Ray<t_dims, t_type, t_vector_type>& value)
548 for (
uint01 dim = 0; dim < t_dims; ++dim)
559 struct hash<
NDEVR::Vertex<3, NDEVR::fltp08>>
563 std::size_t h = 0, g = 0;
567 h = (h << 4) + bytes[i];
577 struct hash<
NDEVR::Vertex<3, NDEVR::fltp04>>
581 std::size_t h = 0, g = 0;
585 h = (h << 4) + bytes[i];
Definition Vertex.hpp:317
constexpr Ray(const t_type(&vector)[t_dims])
Definition Vertex.hpp:340
constexpr Ray(t_type x, t_type y, t_type z)
Definition Vertex.hpp:334
constexpr Ray(const Vector< getMax(t_dims - 1, 0), t_type > &vector, const t_type postfix)
Definition Vertex.hpp:343
constexpr Ray< t_dims, t_type, t_vector_type > & operator=(const t_vector_type &vector)
Definition Vertex.hpp:449
constexpr Ray(const t_type &scaler)
Definition Vertex.hpp:322
constexpr Ray(const Ray< t_dims, t_type, t_vector_type > &vector)
Definition Vertex.hpp:328
constexpr Ray(const t_type x, const t_type y, const t_type z, const t_type w)
Definition Vertex.hpp:337
constexpr Ray(const t_vector_type &vector)
Definition Vertex.hpp:325
constexpr Ray scale(const t_vector_type &scale) const
Definition Vertex.hpp:392
constexpr Ray< t_dims, t_type, t_vector_type > & operator=(const Ray< t_dims, t_type, t_vector_type > &vector)
Definition Vertex.hpp:454
constexpr Ray scale(const t_type scale) const
Definition Vertex.hpp:411
constexpr Ray< t_new_dim, t_new_type, t_new_vector > as(t_new_type extra_fill_value=0) const
Definition Vertex.hpp:367
constexpr Ray(const Vector< getMax(t_dims - 2, 0), t_type > &vector, const t_type postfix_a, const t_type postfix_b)
Definition Vertex.hpp:346
constexpr Ray(const t_type x, const t_type y)
Definition Vertex.hpp:331
constexpr Ray< t_dims, t_new_type, t_new_vector > as() const
Definition Vertex.hpp:372
constexpr Ray< t_dims, t_type, t_vector_type > & operator=(const t_type &scaler)
Definition Vertex.hpp:430
constexpr Ray()
Definition Vertex.hpp:319
constexpr Ray(const t_type prefix, const Vector< t_dims - 1, t_type > &vector)
Definition Vertex.hpp:349
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
A vertex or point. A specific type of Vector used primarily for spacial location information.
Definition Vertex.hpp:48
constexpr Vertex(const t_type(&vector)[t_dims])
Definition Vertex.hpp:71
constexpr Vertex< t_new_dim, t_new_type, t_new_vector > as() const
Definition Vertex.hpp:98
constexpr Vertex scale(const t_vector_type &scale, const Vertex< t_dims, t_type > ¢er) const
Definition Vertex.hpp:128
constexpr Vertex(const t_type &scaler)
Definition Vertex.hpp:53
constexpr Vertex(const t_type x, const t_type y)
Definition Vertex.hpp:62
constexpr Vertex< t_new_dim, t_new_type, t_new_vector > as(t_new_type extra_fill_value) const
Definition Vertex.hpp:108
constexpr Vertex scale(const t_type scale, const Vertex< t_dims, t_type > ¢er) const
Definition Vertex.hpp:147
constexpr const Vertex & center() const
Definition Vertex.hpp:162
constexpr Vertex< t_dims, t_new_type, t_new_vector > as() const
Definition Vertex.hpp:103
constexpr Vertex(const Vector< getMax(t_dims - 1, 0), t_type > &vector, const t_type postfix)
Definition Vertex.hpp:74
constexpr Vertex(const t_type prefix, const Vector< t_dims - 1, t_type > &vector)
Definition Vertex.hpp:80
constexpr Vertex< t_dims, t_type, t_vector_type > & operator=(const t_vector_type &vector)
Definition Vertex.hpp:199
constexpr Vertex< t_dims, t_type, t_vector_type > & operator=(const Vertex< t_dims, t_type, t_vector_type > &vector)
Definition Vertex.hpp:204
constexpr Vertex()
Definition Vertex.hpp:50
constexpr Vertex< t_dims, t_type, t_vector_type > & operator=(const t_type &scaler)
Definition Vertex.hpp:180
constexpr Vertex(t_type x, t_type y, t_type z)
Definition Vertex.hpp:65
constexpr Vertex(const Vertex< t_dims, t_type, t_vector_type > &vector)
Definition Vertex.hpp:59
constexpr Vertex(const t_vector_type &vector)
Definition Vertex.hpp:56
constexpr Vertex(const Vector< getMax(t_dims - 2, 0), t_type > &vector, const t_type postfix_a, const t_type postfix_b)
Definition Vertex.hpp:77
constexpr Vertex(const t_type x, const t_type y, const t_type z, const t_type w)
Definition Vertex.hpp:68
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 t_type getMax(const t_type &left, const t_type &right)
Finds the max of the given arguments using the > operator The only requirement is that t_type have > ...
Definition BaseFunctions.hpp:94
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
constexpr Angle< t_angle_type > abs(const Angle< t_angle_type > &value)
Changes an input with a negative sign, to a positive sign.
Definition AngleFunctions.h:645
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
constexpr t_type getMin(const t_type &left, const t_type &right)
Finds the minimum of the given arguments based on the < operator Author: Tyler Parke Date: 2017-11-05...
Definition BaseFunctions.hpp:56
static const t_type Invalid
Definition BaseValues.hpp:234
static const t_type Min
Definition BaseValues.hpp:235
static const t_type Max
Definition BaseValues.hpp:236