API Documentation
Loading...
Searching...
No Matches
Triangle< t_dims, t_type, t_vertex > Class Template Reference

A triangle is a polygon with three edges and three vertices. It is one of the basic shapes in geometry. This triangle with vertices A, B, and C is which can be accessed using vertex(...) More...

#include <Triangle.hpp>

Inheritance diagram for Triangle< t_dims, t_type, t_vertex >:
[legend]
Collaboration diagram for Triangle< t_dims, t_type, t_vertex >:
[legend]

Public Member Functions

template<class t_angle_type >
constexpr Angle< t_angle_type > angle (TriangleLocation location) const
 
template<class t_angle_type >
constexpr Angle< t_angle_type > angle (uint01 triangle_node) const
 
template<class t_area_type >
constexpr t_area_type area () const
 
template<uint01 t_new_dims, class t_new_type >
constexpr Triangle< t_new_dims, t_new_type > as () const
 
constexpr t_vertex center () const
 
constexpr t_vertex centroid () const
 
constexpr bool contains (const t_vertex &vertex_point, t_type epsilon=t_type(0.0001)) const
 
constexpr bool contains (const Vector< t_dims - 1, t_type > &p) const
 
constexpr LineSegment< t_dims, t_type, t_vertex > edge (TriangleLocation location) const
 Edges the given location.
 
constexpr LineSegment< t_dims, t_type, t_vertex > edge (uint01 triangle_node_a, uint01 triangle_node_b) const
 
constexpr TriangleLocation getIdentityOf (const LineSegment< t_dims, t_type, t_vertex > &line) const
 
constexpr TriangleLocation getIdentityOf (const LineSegment< t_dims, t_type, t_vertex > &line, t_type epsilon) const
 
constexpr TriangleLocation getIdentityOf (const t_vertex &p) const
 
constexpr TriangleLocation getIdentityOf (const t_vertex &p, t_type epsilon) const
 
constexpr TriangleLocation getLocation (const LineSegment< t_dims, t_type, t_vertex > &line, t_type epsilon=cast< t_type >(0)) const
 
constexpr TriangleLocation getLocation (const t_vertex &p, t_type epsilon=cast< t_type >(0)) const
 
bool hasVertex (const t_vertex &point) const
 
constexpr void invert ()
 
constexpr const t_vertex & nextVertexCCW (const t_vertex &point) const
 
constexpr const t_vertex & nextVertexCW (const t_vertex &point) const
 
template<bool is_normalized, class t_normal_type = t_type>
constexpr Vector< t_dims, t_normal_type > normal () const
 
constexpr TriangleLocation sharesObject (TriangleLocation object_to_check, const Triangle< t_dims, t_type, t_vertex > &tri, t_type epsilon=0) const
 
constexpr fltp08 tan (uint01 triangle_node) const
 
constexpr Triangle ()
 
constexpr Triangle (const t_type &a)
 
constexpr Triangle (const t_type &a, const t_type &b, const t_type &c)
 
constexpr Triangle (const t_vertex &a, const t_vertex &b, const t_vertex &c)
 
constexpr Triangle (const t_vertex &vector)
 
constexpr t_vertex & vertex (TriangleLocation triangle_node)
 Vertices the given triangle node.
 
constexpr const t_vertex & vertex (TriangleLocation triangle_node) const
 Vertices the given triangle node.
 
constexpr t_vertex & vertex (uint01 triangle_node)
 
constexpr const t_vertex & vertex (uint01 triangle_node) const
 
constexpr uint01 vertexIndex (const t_vertex &p) const
 
- Public Member Functions inherited from Vector< t_dims, t_type >
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 uint01 dimensionalIndex () const
 
template<LocationValues t_max_min>
constexpr t_type dimensionalValue () const
 
template<class t_magnitude_type = t_type>
constexpr t_magnitude_type magnitude () const
 
constexpr t_type magnitudeSquared () 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 > >::Invalid) const
 
template<uint01 tdims = t_dims, typename = typename std::enable_if<tdims == 1>::type>
constexpr operator const t_type & () const
 
template<uint01 tdims = t_dims, typename = typename std::enable_if<tdims == 1>::type>
constexpr operator t_type & ()
 
constexpr Vector< t_dims, t_type > operator- () const
 
constexpr Vector< t_dims, t_type > & operator= (const t_type &scaler)
 
constexpr const t_type & operator[] (const uint01 dimension_index) const
 
constexpr t_type & operator[] (uint01 dimension_index)
 
constexpr t_type product () const
 
constexpr t_type sum () const
 
constexpr Vector () noexcept
 
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)
 
constexpr Vector (const t_type &scaler) noexcept
 
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)
 
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, 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, 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 typename std::enable_if< tdims==3, const t_type & >::type z)
 
template<uint01 tdims = t_dims>
constexpr Vector (const t_type &x, typename std::enable_if< tdims==2, const t_type & >::type y)
 
constexpr Vector (const t_type(&vector)[t_dims])
 
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<class t_vec_type >
constexpr Vector (const Vector< t_dims, t_vec_type > &vector) noexcept
 
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)
 

Additional Inherited Members

- Static Public Member Functions inherited from Vector< t_dims, t_type >
static constexpr uint01 NumberOfDimensions ()
 
static constexpr t_type Type ()
 
- Static Public Member Functions inherited from TriangleBase
static constexpr TriangleLocation NextVertexCCW (TriangleLocation location)
 Returns the point location counter-clockwise to given point location.
 
static constexpr TriangleLocation NextVertexCW (TriangleLocation location)
 Returns the point location clockwise to given point location.
 
static constexpr TriangleLocation oppositeLocation (TriangleLocation location)
 
- Protected Attributes inherited from Vector< t_dims, t_type >
t_type m_values [t_dims]
 

Detailed Description

template<uint01 t_dims, class t_type, class t_vertex = Vertex<t_dims, t_type>>
class NDEVR::Triangle< t_dims, t_type, t_vertex >

A triangle is a polygon with three edges and three vertices. It is one of the basic shapes in geometry. This triangle with vertices A, B, and C is which can be accessed using vertex(...)


Class: Triangle

Author: Tyler Parke

Date: 2017-11-17

Constructor & Destructor Documentation

◆ Triangle() [1/5]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
Triangle ( )
inlineconstexpr

◆ Triangle() [2/5]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
Triangle ( const t_type & a)
inlineexplicitconstexpr

◆ Triangle() [3/5]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
Triangle ( const t_type & a,
const t_type & b,
const t_type & c )
inlineconstexpr

◆ Triangle() [4/5]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
Triangle ( const t_vertex & vector)
inlineexplicitconstexpr

◆ Triangle() [5/5]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
Triangle ( const t_vertex & a,
const t_vertex & b,
const t_vertex & c )
inlineconstexpr

Member Function Documentation

◆ angle() [1/2]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
template<class t_angle_type >
Angle< t_angle_type > angle ( TriangleLocation location) const
inlinenodiscardconstexpr

Angles the given location.

Author: Tyler Parke

Date: 2017-11-17

Parameters: location - The location.

Returns: An Angle.

◆ angle() [2/2]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
template<class t_angle_type >
Angle< t_angle_type > angle ( uint01 triangle_node) const
inlinenodiscardconstexpr

Angles the given triangle node.

Author: Tyler Parke

Date: 2018-11-24

Parameters: triangle_node - The triangle node.

Returns: An Angle.

◆ area()

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
template<class t_area_type >
t_area_type area ( ) const
inlinenodiscardconstexpr

Gets the area.

Author: Tyler Parke

Date: 2017-11-17

Returns: A t_area_type.

◆ as()

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
template<uint01 t_new_dims, class t_new_type >
Triangle< t_new_dims, t_new_type > as ( ) const
inlinenodiscardconstexpr

Gets as.

Author: Tyler Parke

Date: 2017-11-17

Returns: as.

◆ center()

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
t_vertex center ( ) const
inlinenodiscardconstexpr

Gets the center.

Author: Tyler Parke

Date: 2017-11-17

Returns: A t_vertex.

◆ centroid()

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
t_vertex centroid ( ) const
inlinenodiscardconstexpr

Gets the centroid.

Author: Tyler Parke

Date: 2017-11-17

Returns: A t_vertex.

◆ contains() [1/2]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
bool contains ( const t_vertex & vertex_point,
t_type epsilon = t_type(0.0001) ) const
inlinenodiscardconstexpr

Query if this object contains the given vertex.

Author: Tyler Parke

Date: 2017-11-17

Parameters: vertex_point - The const t_vertex& to test for containment.

Returns: True if the object is in this collection, false if not.

◆ contains() [2/2]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
bool contains ( const Vector< t_dims - 1, t_type > & p) const
inlinenodiscardconstexpr

Query if this object contains the given p.

Author: Tyler Parke

Date: 2017-11-17

Parameters: p - The const Vector<t_dims-1,t_type>& to test for containment.

Returns: True if the object is in this collection, false if not.

◆ edge() [1/2]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
LineSegment< t_dims, t_type, t_vertex > edge ( TriangleLocation location) const
inlinenodiscardconstexpr

Edges the given location.


Author: Tyler Parke

Date: 2017-11-17

Parameters: location - The location.

Returns: A LineSegment<t_dims,t_type,t_vertex>

◆ edge() [2/2]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
LineSegment< t_dims, t_type, t_vertex > edge ( uint01 triangle_node_a,
uint01 triangle_node_b ) const
inlinenodiscardconstexpr

Edges.

Author: Tyler Parke

Date: 2017-11-17

Parameters: triangle_node_a - The triangle node a. triangle_node_b - The triangle node b.

Returns: A LineSegment<t_dims,t_type,t_vertex>

◆ getIdentityOf() [1/4]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
TriangleLocation getIdentityOf ( const LineSegment< t_dims, t_type, t_vertex > & line) const
inlinenodiscardconstexpr

◆ getIdentityOf() [2/4]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
TriangleLocation getIdentityOf ( const LineSegment< t_dims, t_type, t_vertex > & line,
t_type epsilon ) const
inlinenodiscardconstexpr

◆ getIdentityOf() [3/4]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
TriangleLocation getIdentityOf ( const t_vertex & p) const
inlinenodiscardconstexpr

◆ getIdentityOf() [4/4]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
TriangleLocation getIdentityOf ( const t_vertex & p,
t_type epsilon ) const
inlinenodiscardconstexpr

◆ getLocation() [1/2]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
TriangleLocation getLocation ( const LineSegment< t_dims, t_type, t_vertex > & line,
t_type epsilon = cast<t_type>(0) ) const
inlinenodiscardconstexpr

◆ getLocation() [2/2]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
TriangleLocation getLocation ( const t_vertex & p,
t_type epsilon = cast<t_type>(0) ) const
inlinenodiscardconstexpr

◆ hasVertex()

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
bool hasVertex ( const t_vertex & point) const
inline

◆ invert()

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
void invert ( )
inlineconstexpr

Inverts this object.

Author: Tyler Parke

Date: 2017-11-17

◆ nextVertexCCW()

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
const t_vertex & nextVertexCCW ( const t_vertex & point) const
inlineconstexpr

Returns the point counter-clockwise to given point. Note the given point must be a vertex of the triangle

Author: Tyler Parke

Date: 2017-05-15

◆ nextVertexCW()

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
const t_vertex & nextVertexCW ( const t_vertex & point) const
inlineconstexpr

Returns the point clockwise to given point. Note the given point must be a vertex of the triangle

Author: Tyler Parke

Date: 2017-05-15

◆ normal()

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
template<bool is_normalized, class t_normal_type = t_type>
Vector< t_dims, t_normal_type > normal ( ) const
inlinenodiscardconstexpr

Gets the normal.

Author: Tyler Parke

Date: 2017-11-17

Returns: A Vector<t_dims,t_normal_type>

◆ sharesObject()

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
TriangleLocation sharesObject ( TriangleLocation object_to_check,
const Triangle< t_dims, t_type, t_vertex > & tri,
t_type epsilon = 0 ) const
inlinenodiscardconstexpr

Shares object.

Author: Tyler Parke

Date: 2017-11-17

Parameters: object_to_check - The object to check. tri - The triangle. epsilon - (Optional) The epsilon.

Returns: A TriangleLocation.

◆ tan()

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
fltp08 tan ( uint01 triangle_node) const
inlinenodiscardconstexpr

◆ vertex() [1/4]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
t_vertex & vertex ( TriangleLocation triangle_node)
inlinenodiscardconstexpr

Vertices the given triangle node.


Author: Tyler Parke

Date: 2017-11-17

Parameters: triangle_node - The triangle node.

Returns: A reference to a t_vertex.

◆ vertex() [2/4]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
const t_vertex & vertex ( TriangleLocation triangle_node) const
inlinenodiscardconstexpr

Vertices the given triangle node.


Author: Tyler Parke

Date: 2017-11-17

Parameters: triangle_node - The triangle node.

Returns: A reference to a const t_vertex.

◆ vertex() [3/4]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
t_vertex & vertex ( uint01 triangle_node)
inlinenodiscardconstexpr

Vertices the given triangle node.

Author: Tyler Parke

Date: 2017-11-17

Parameters: triangle_node - The triangle node.

Returns: A reference to a t_vertex.

◆ vertex() [4/4]

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
const t_vertex & vertex ( uint01 triangle_node) const
inlinenodiscardconstexpr

Vertices the given triangle node.

Author: Tyler Parke

Date: 2017-11-17

Parameters: triangle_node - The triangle node.

Returns: A reference to a const t_vertex.

◆ vertexIndex()

template<uint01 t_dims, class t_type , class t_vertex = Vertex<t_dims, t_type>>
uint01 vertexIndex ( const t_vertex & p) const
inlinenodiscardconstexpr

Gets a location.

Author: Tyler Parke

Date: 2017-11-17

Parameters: p - A Vector<t_dims,t_type> to process. epsilon - (Optional) The epsilon.

Returns: The location.


The documentation for this class was generated from the following file: