API Documentation
|
A specification of upper and lower bounds in N-dimensions. More...
#include <Bounds.hpp>
Public Member Functions | |
constexpr | Bounds () |
constexpr | Bounds (const t_vertex &vertex) |
Given the vector, creates bounds of size 0 where max and min are both equal to the vertex. | |
constexpr | Bounds (const t_vertex ¢er, t_type size) |
Given the center, creates bounds of size where max and min are both equal to the vertex + size and. | |
constexpr | Bounds (const t_vertex &min, const t_vertex &max) |
constexpr | Bounds (const t_type &min_scaler, const t_type &max_scaler) |
constexpr | Bounds (const Vector< 2, t_vertex > &bounds) |
constexpr | Bounds (const Bounds &bounds_a, const Bounds &bounds_b) |
constexpr | Bounds (const Bounds &bounds, const t_vertex &vector) |
constexpr | Bounds (const LineSegment< t_dims, t_type, t_vertex > &line) |
constexpr | Bounds (const Triangle< t_dims, t_type, t_vertex > &tri) |
constexpr | Bounds (const RadialObject< t_dims, t_type, t_vertex > &radial) |
constexpr Ray< t_dims, t_type > | span () const |
The side lengths of these bounds. For each dimension, the span is max - min. | |
constexpr t_vertex | center () const |
Returns the center of the bounds. | |
constexpr t_type | volume () const |
Returns the volume of the bounds. This is defined as length in 1 dimension, area in 2 dimensions. | |
constexpr t_type | surfaceArea () const |
The surface area of the shape. This is defined as the area between internal space and non-internal space. | |
constexpr void | expand (const t_type &expansion_scaler) |
Expands the given expansion scaler. such that max and min are both expanded outward from the center by the given expansion scaler. | |
constexpr void | expand (const t_vertex &expansion_vector) |
Expands the given expansion scaler. such that max and min are both expanded outward from the center by the given expansion vector. That is that each dimension may be scaled out differently. | |
constexpr Bounds< t_dims, t_type > | scale (const Vector< t_dims, t_type > &scale, const Vector< t_dims, t_type > ¢er) const |
Scales this geometry about a center point. | |
constexpr Bounds< t_dims, t_type > | scale (const Vector< t_dims, t_type > ¢er_scale) const |
constexpr Bounds< t_dims, t_type > | scale (const t_type &scale, const Vector< t_dims, t_type > ¢er) const |
constexpr Bounds< t_dims, t_type > | scale (const t_type ¢er_scale) const |
template<uint01 t_new_dims, class t_new_type , class t_new_vertex = Vertex<t_new_dims, t_new_type>> | |
constexpr Bounds< t_new_dims, t_new_type, t_new_vertex > | as (t_new_type extra_fill_value=t_new_type(0)) const |
Casts this object into an object of different dimension or precision. | |
template<bool t_allow_bounds = true, uint01 tdims = t_dims, typename = typename std::enable_if<tdims == 1>::type> | |
constexpr bool | contains (const t_type &value) const |
Query if this object contains the given value. | |
template<bool t_allow_bounds = true> | |
constexpr bool | contains (const t_vertex &vector) const |
Query if this object contains the given vector. | |
template<bool t_allow_bounds = true> | |
constexpr bool | contains (const Bounds &bounds) const |
Query if this object contains the given bounds. | |
template<bool t_allow_bounds = true> | |
constexpr bool | contains (const LineSegment< t_dims, t_type, t_vertex > &line) const |
Author: Tyler Parke. | |
template<bool t_allow_bounds = true> | |
constexpr bool | contains (const Triangle< t_dims, t_type, t_vertex > &tri) const |
Fully contains. | |
constexpr void | addToBounds (const t_vertex &vector) |
Adds to the bounds such that the new bounds fully encompasses the argument. | |
template<uint01 tdims = t_dims> | |
constexpr void | addToBounds (typename std::enable_if< tdims==1, const t_type & >::type scaler) |
constexpr void | addToBounds (const Bounds &bounds) |
Adds to the bounds such that the new bounds fully encompasses the argument. | |
constexpr void | addToBounds (const LineSegment< t_dims, t_type, t_vertex > &line_segment) |
Adds to the bounds such that the new bounds fully encompasses the argument. | |
constexpr void | addToBounds (const Triangle< t_dims, t_type, t_vertex > &triangle) |
Adds to the bounds such that the new bounds fully encompesses the argument. | |
template<bool t_allow_bounds = true> | |
constexpr bool | contains (const RadialObject< t_dims, t_type > &radial_object) const |
Query if this object contains the given radial_object. | |
constexpr t_vertex | closestEdge (const t_vertex &vertex) const |
Closest edge. | |
constexpr t_vertex | closestValue (const t_vertex &vertex) const |
Closest value. | |
constexpr t_vertex | furthestValue (const t_vertex &vertex) const |
Furthest value. | |
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. | |
template<class t_other_vertex_type > | |
constexpr bool | intersects (const Bounds< t_dims, t_type, t_other_vertex_type > &bounds) const |
Query if this object intersects the given pair. | |
template<class t_other_vertex_type > | |
constexpr bool | intersects (const LineSegment< t_dims, t_type, t_other_vertex_type > &seg) const |
template<bool t_allow_bounds = true> | |
constexpr bool | intersects (const RadialObject< t_dims, t_type > &circle) const |
Query if this object contains the given circle. | |
constexpr bool | validate () const |
void | ensureValid () |
Ensures that this is a valid bounds object. Values are swapped within the structure to ensure that MAX >= MIN. | |
Bounds< t_dims, t_type > & | operator-= (const t_type ¢er_scale) |
Public Member Functions inherited from Vector< t_dims, t_type > | |
constexpr | Vector () noexcept |
template<class t_vec_type > | |
constexpr | Vector (const Vector< t_dims, t_vec_type > &vector) noexcept |
constexpr | Vector (const t_type &scaler) noexcept |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &x, typename std::enable_if< tdims==2, const t_type & >::type y) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &x, const t_type &y, const typename std::enable_if< tdims==3, const t_type & >::type z) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &x, const t_type &y, const t_type &z, typename std::enable_if< tdims==4, const t_type & >::type w) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &x, const t_type &y, const t_type &z, const t_type &w, typename std::enable_if< tdims==5, const t_type & >::type v) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &x, const t_type &y, const t_type &z, const t_type &w, const t_type &v, typename std::enable_if< tdims==6, const t_type & >::type u) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &x, const t_type &y, const t_type &z, const t_type &w, const t_type &v, const t_type &u, const t_type &t, const t_type &s, typename std::enable_if< tdims==9, const t_type & >::type r) |
constexpr | Vector (const t_type(&vector)[t_dims]) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const Vector< tdims - 1, t_type > &vector, typename std::enable_if< tdims >=2, const t_type & >::type suffix) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const Vector< getMax(tdims - 2, 0), t_type > &vector, const t_type &suffix_a, typename std::enable_if< tdims >=3, const t_type & >::type suffix_b) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &prefix, typename std::enable_if< tdims >=2, const Vector< t_dims - 1, t_type > & >::type vector) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &prefix_a, const t_type &prefix_b, typename std::enable_if< tdims >=3, const Vector< tdims - 1, t_type > & >::type vector) |
template<class t_new_type > | |
constexpr Vector< t_dims, t_new_type > | as () const |
template<uint01 t_new_dim, class t_new_type > | |
constexpr Vector< t_new_dim, t_new_type > | as () const |
template<uint01 t_new_dim, class t_new_type > | |
constexpr Vector< t_new_dim, t_new_type > | as (t_new_type extra_fill_value) const |
template<LocationValues t_max_min> | |
constexpr t_type | dimensionalValue () const |
template<LocationValues t_max_min> | |
constexpr uint01 | dimensionalIndex () const |
template<uint01 tdims = t_dims, typename = typename std::enable_if<tdims == 1>::type> | |
constexpr | operator t_type & () |
template<uint01 tdims = t_dims, typename = typename std::enable_if<tdims == 1>::type> | |
constexpr | operator const t_type & () const |
constexpr t_type | magnitudeSquared () const |
template<class t_magnitude_type = t_type> | |
constexpr t_magnitude_type | magnitude () const |
template<class t_norm_type = t_type> | |
constexpr Vector< t_dims, t_norm_type > | normalized (Vector< t_dims, t_norm_type > value_if_nan=Constant< Vector< t_dims, t_norm_type > >::NaN) const |
constexpr t_type | product () const |
constexpr t_type | sum () const |
constexpr t_type & | operator[] (uint01 dimension_index) |
constexpr const t_type & | operator[] (const uint01 dimension_index) const |
constexpr Vector< t_dims, t_type > | operator- () const |
constexpr Vector< t_dims, t_type > & | operator= (const t_type &scaler) |
Additional Inherited Members | |
Static Public Member Functions inherited from Vector< t_dims, t_type > | |
static constexpr uint01 | NumberOfDimensions () |
static constexpr t_type | Type () |
Protected Attributes inherited from Vector< t_dims, t_type > | |
t_type | m_values [t_dims] |
A specification of upper and lower bounds in N-dimensions.
Class: Bounds
Author: Tyler Parke
|
inlineconstexpr |
|
inlineconstexpr |
Given the vector, creates bounds of size 0 where max and min are both equal to the vertex.
Fn: constexpr Bounds::Bounds(const t_vertex& vector) : Vector<2, t_vertex>(vector, vector)
Author: Tyler Parke
Date: 2017-11-17
Parameters:
|
inlineconstexpr |
Given the center, creates bounds of size where max and min are both equal to the vertex + size and.
Fn: constexpr Bounds::Bounds(const t_vertex& center, t_type size) : Vector<2, t_vertex>(center - size, center + size)
Author: Tyler Parke
Date: 2017-11-17
Parameters: center - The center of the bounds.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Adds to the bounds such that the new bounds fully encompasses the argument.
Fn: constexpr void Bounds::addToBounds(const Bounds& bounds)
Author: Tyler Parke.
Date: 2017-11-17.
Parameters:
|
inlineconstexpr |
Adds to the bounds such that the new bounds fully encompasses the argument.
Fn: constexpr void Bounds::addToBounds(const LineSegment<t_dims, t_type, t_vertex>& line_segment)
Author: Tyler Parke.
Date: 2017-11-17.
Parameters:
|
inlineconstexpr |
Adds to the bounds such that the new bounds fully encompasses the argument.
Fn: constexpr void Bounds::addToBounds(const t_vertex& vector)
Author: Tyler Parke.
Date: 2017 - 11-17.
Parameters:
|
inlineconstexpr |
Adds to the bounds such that the new bounds fully encompesses the argument.
Fn: constexpr void Bounds::addToBounds(const Triangle<t_dims, t_type, t_vertex>& triangle)
Author: Tyler Parke.
Date: 2017-11-17.
Parameters:
|
inlineconstexpr |
|
inlineconstexpr |
Casts this object into an object of different dimension or precision.
Fn: constexpr Bounds<t_new_dims, t_new_type> Bounds::as() const
Author: Tyler Parke
Date: 2017-11-13
Parameters: extra_fill_value - (Optional) The extra fill value, or value to set dimensions extra that may be
|
inlineconstexpr |
Returns the center of the bounds.
Fn: constexpr t_vertex Bounds::center() const
Author: Tyler Parke
Date: 2017-11-17
|
inlineconstexpr |
Closest edge.
Fn: constexpr t_vertex Bounds::closestEdge(const t_vertex& vertex) const
Author: Tyler Parke.
Date: 2017 - 11-17.
Parameters: vertex - The first t_vertex.
|
inlineconstexpr |
Closest value.
Fn: constexpr t_vertex Bounds::closestValue(const t_vertex& vertex) const
Author: Tyler Parke.
Date: 2017 - 11-17.
Parameters: vertex - The first t_vertex.
|
inlineconstexpr |
Query if this object contains the given bounds.
Fn: constexpr bool Bounds::fullyContains(const Bounds<t_dims, t_type>& bounds) const
Author: Tyler Parke
Date: 2017-11-17
Parameters: t_allow_bounds - whether or not to allow boundary cases to be considered valid.
bounds - The bounds to check if it is inside object.
|
inlineconstexpr |
|
inlineconstexpr |
Query if this object contains the given radial_object.
Fn: constexpr bool Bounds::contains(const RadialObject<t_dims, t_type>& radial_object) const
Author: Tyler Parke
Date: 2017-11-18
Parameters: radial_object - The const RadialObject<t_dims,t_type>& to test for containment.
|
inlineconstexpr |
Query if this object contains the given value.
Fn: constexpr bool Bounds::contains(const t_type& vector) const
Author: Tyler Parke
Date: 2017-11-17
Parameters: t_allow_bounds - whether or not to allow boundary cases to be considered valid.
vector - The const t_vertex& to test for containment.
|
inlineconstexpr |
Query if this object contains the given vector.
Fn: constexpr bool Bounds::contains(const t_vertex& vector) const
Author: Tyler Parke
Date: 2017-11-17
Parameters: t_allow_bounds - whether or not to allow boundary cases to be considered valid.
vector - The const t_vertex& to test for containment.
|
inlineconstexpr |
Checks for intersection of the ray from a given distance, excluding one axis.
Fn: constexpr bool Bounds::doesIntersect(t_type distance_a, t_type distance_b, const t_vertex& origin, const t_vertex& ray, uint01 exclusion_axis) const
Author: Tyler Parke
Date: 2017-11-18
Parameters: distance_a - The distance a. distance_b - The distance b. origin - The origin. ray - The ray. exclusion_axis - The exclusion axis.
< for NaN
|
inline |
|
inlineconstexpr |
Expands the given expansion scaler. such that max and min are both expanded outward from the center by the given expansion scaler.
Fn: constexpr void Bounds::expand(const t_type& expansion_scaler)
Author: Tyler Parke
Date: 2017-11-17
Parameters:
|
inlineconstexpr |
Expands the given expansion scaler. such that max and min are both expanded outward from the center by the given expansion vector. That is that each dimension may be scaled out differently.
Fn: constexpr void Bounds::expand(const t_vertex& expansion_vector)
Author: Tyler Parke
Date: 2017-11-17
Parameters:
|
inlineconstexpr |
Furthest value.
Fn: constexpr t_vertex Bounds::furthestValue(const t_vertex& vertex) const
Author: Tyler Parke.
Date: 2017 - 11-17.
Parameters: vertex - The first t_vertex.
|
inlineconstexpr |
|
inlineconstexpr |
Query if this object contains the given circle.
Fn: constexpr bool Bounds::contains(const RadialObject<t_rad_dims, t_rad_type>& circle) const
Author: Tyler Parke
Date: 2017-11-17
Parameters: circle - The const RadialObject<t_rad_dims,t_rad_type>& to test for containment.
|
inline |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Scales this geometry about a center point.
Fn: constexpr Bounds<t_dims, t_type> Bounds::scale(const Vector<t_dims, t_type>& scale , const Vector<t_dims, t_type>& center) const
Author: Tyler Parke
Date: 2017-11-17
Parameters: scale - The scale. center - The center.
|
inlineconstexpr |
The side lengths of these bounds. For each dimension, the span is max - min.
Fn: constexpr t_vertex Bounds::span() const
Author: Tyler Parke
Date: 2017-11-17
|
inlineconstexpr |
The surface area of the shape. This is defined as the area between internal space and non-internal space.
Fn: constexpr t_type Bounds::surfaceArea() const
Author: Tyler Parke
Date: 2017-11-17
|
inlinenodiscardconstexpr |
Fn: constexpr bool Bounds::validate() const
Validates this object. Returns true if the value at MIN is less than or equal the value at MAX in all dimensions.
Author: Tyler Parke
Date: 2017-11-17
|
inlineconstexpr |
Returns the volume of the bounds. This is defined as length in 1 dimension, area in 2 dimensions.
Fn: constexpr t_type Bounds::volume() const
Author: Tyler Parke
Date: 2017-11-17