33#include <NDEVR/Polygon.h>
34#include <NDEVR/PolyLine.h>
35#include <NDEVR/Plane.h>
36#include <NDEVR/Intersection.h>
41 template<u
int01 t_dims,
class t_type,
class t_vertex>
45 for (
uint01 dim = 0; dim < t_dims; ++dim)
47 if (vertex[dim] < bounds[
MIN][dim])
49 t_type val = bounds[
MIN][dim] - vertex[dim];
52 else if (vertex[dim] > bounds[
MAX][dim] )
54 t_type val = vertex[dim] - bounds[
MAX][dim];
60 template<u
int01 t_dims,
class t_type,
class t_vertex>
67 template<u
int01 t_dims,
class t_type,
class t_vertex_a,
class t_vertex_b>
74 for (
uint01 i = 0; i < t_dims; ++i)
83 t_type p1 =
getMax(t_type(0), t1.template dimensionalValue<MIN>(), t2.template dimensionalValue<MIN>());
84 t_type p2 =
getMax(t_type(0),
getMin(t1.template dimensionalValue<MAX>(), t2.template dimensionalValue<MAX>()));
87 val = p + v * t - val;
91 template<u
int01 t_dims,
class t_type,
class t_vertex_a,
class t_vertex_b>
97 template<u
int01 t_dims,
class t_type,
class t_vertex>
101 for (
uint01 dim = 0; dim < t_dims; ++dim)
103 if (a[
MAX][dim] < b[
MIN][dim])
105 t_type val = b[
MIN][dim] - a[
MAX][dim];
108 else if(a[
MIN][dim] < b[
MAX][dim])
110 t_type val = a[
MIN][dim] - b[
MAX][dim];
133 template<u
int01 t_dims,
class t_type,
class t_vertex>
136 return left.template closestPoints<t_type>(right, epsilon).
lengthSquared();
155 template<u
int01 t_dims,
class t_type,
class t_vertex>
177 template<u
int01 t_dims,
class t_type,
class t_vertex>
199 template<u
int01 t_dims,
class t_type,
class t_vertex>
209 return getMin(dist_a, dist_b, dist_c);
211 template<u
int01 t_dims,
class t_type,
class t_vertex>
218 template<u
int01 t_dims,
class t_type,
class t_vertex>
224 template<u
int01 t_dims,
class t_type,
class t_vertex>
249 template<
class epsilon_type, u
int01 t_dims,
class t_type,
class t_vertex>
254 template<
class t_type,
class t_other_type>
257 auto object = original_object.template as<2, t_type>();
276 template<
class t_type,
class t_other_type>
282 template<u
int01 t_dims,
class t_type,
class t_other_type>
300 template<u
int01 t_dims,
class t_type,
class t_other_type>
323 template<
class t_precision, u
int01 t_dims,
class t_type,
class t_vertex>
329 template<u
int01 t_dims,
class t_type,
class t_vertex>
358 template<
class t_precision, u
int01 t_dims,
class t_type,
class t_vertex>
#define lib_assert(expression, message)
Asserts some logic in the code. Disabled in non debug mode by default. Can be re-enabled in release u...
Definition LibAssert.h:70
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:57
constexpr bool contains(const t_type &value) const
Query if this object contains the given value.
Definition Bounds.hpp:329
constexpr bool doesIntersect(t_type distance_a, t_type distance_b, const t_vertex &origin, const Vector< t_dims, t_type > &ray, uint01 exclusion_axis) const
Checks for intersection of the ray from a given distance, excluding one axis.
Definition Bounds.hpp:701
Definition Distance.hpp:40
A line segment represented by two vertices, a start and end.
Definition Line.hpp:55
constexpr t_vertex ray() const
Definition Line.hpp:134
constexpr const t_vertex & vertex(uint01 index) const
Definition Line.hpp:171
constexpr t_type lengthSquared() const
Definition Line.hpp:505
t_type d
Definition Plane.hpp:216
Ray< t_dims, t_type > normal
Definition Plane.hpp:215
An N-sided polygon.
Definition Polygon.hpp:58
LineSegment< 2, t_type, t_vertex > edge(uint04 index) const
Definition Polygon.hpp:185
uint04 vertexCount() const
Definition Polygon.hpp:219
A polyline which stores vertex information for many points along a given path.
Definition CoordinateProjectionManager.h:44
uint04 vertexCount() const
Definition PolyLine.hpp:209
LineSegment< t_dims, t_type, t_vertex > segment(uint04 index) const
Definition PolyLine.hpp:175
const t_vertex & vertex(uint04 index) const
Definition PolyLine.hpp:155
Definition Triangle.hpp:143
constexpr LineSegment< t_dims, t_type, t_vertex > edge(uint01 triangle_node_a, uint01 triangle_node_b) const
Definition Triangle.hpp:276
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
constexpr t_type magnitudeSquared() const
Definition Vector.hpp:458
A vertex.
Definition Vertex.hpp:54
constexpr t_type getMax(const t_type &left, const t_type &right)
Finds the max of the given arguments using the > operator.
Definition BaseFunctions.hpp:116
t_type dot(const Vector< t_dims, t_type > &v1, const Vector< t_dims, t_type > &v2)
Definition VectorFunctions.hpp:1096
@ MIN
Definition BaseValues.hpp:226
@ MAX
Definition BaseValues.hpp:227
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
t_type distanceSquared(const Bounds< t_dims, t_type, t_vertex > &bounds, const Vector< t_dims, t_type > &vertex)
Definition Distance.hpp:42
@ outside
Definition BaseValues.hpp:242
constexpr Vector< t_dims, t_type > closestPoint(const Triangle< t_dims, t_type, t_vertex > &tri, const t_vertex &point)
Definition Triangle.hpp:909
IntersectionTypes classify(const Vector< t_dims, t_type > &v1, const Vector< t_dims, t_type > &v2)
Definition Intersection.hpp:338
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
t_type sqrt(const t_type &value)
Definition VectorFunctions.hpp:1309
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:514
constexpr t_type distance(const t_vertex &vertex, const LineSegment< t_dims, t_type, t_vertex > &line)
Definition Distance.hpp:250
constexpr Angle< t_angle_type > abs(const Angle< t_angle_type > &value)
Definition AngleFunctions.h:750
@ B
Definition BaseValues.hpp:203
@ A
Definition BaseValues.hpp:201
@ C
Definition BaseValues.hpp:205
constexpr t_type getMin(const t_type &left, const t_type &right)
Finds the minimum of the given arguments based on the < operator.
Definition BaseFunctions.hpp:67
Definition BaseValues.hpp:272