header_utils
Loading...
Searching...
No Matches
ghassanpl::geometry::immutable::tpolygon< T > Struct Template Reference

An immutable version of tpolygon that performs and caches its triangulation lazily upon request. More...

#include <polygon.h>

Public Types

using tvec
using value_type
using mutable_polygon

Public Member Functions

 tpolygon (tpolygon const &) noexcept=default
 tpolygon (tpolygon &&) noexcept=default
tpolygon & operator= (tpolygon const &) noexcept=default
tpolygon & operator= (tpolygon &&) noexcept=default
template<typename... ARGS>
 tpolygon (ARGS &&... args) noexcept
template<typename POLY_OR_ARR>
 tpolygon (POLY_OR_ARR &&poly, std::vector< indexed_triangle > triangles, std::vector< T > cached_triangle_areas, T cached_area)
 Deserialization constructor.
tvec const & operator[] (size_t index) const
auto cbegin () const noexcept
auto cend () const noexcept
auto begin () const noexcept
auto end () const noexcept
auto size () const noexcept
const auto * operator-> () const noexcept
const auto & polygon () const noexcept
T edge_length () const
tvec edge_point_alpha (T t) const
tvec edge_point (T t) const
trec2< T > bounding_box () const
tvec closest_point_to (glm::tvec2< T > pt) const
bool contains (glm::tvec2< T > pt) const
 area_shape concept
T calculate_area () const
tvec centroid () const
auto const & triangles () const
auto const & areas () const
bool has_triangle (size_t i) const
auto triangle (size_t i) const
T triangle_area (size_t i) const

Protected Member Functions

void triangulate () const

Protected Attributes

geometry::tpolygon< T > m_poly
std::vector< indexed_triangle > m_triangles
std::vector< T > m_cached_triangle_areas
T m_cached_area
tvec m_cached_centroid
polygon_classification m_cached_classification

Detailed Description

template<std::floating_point T>
struct ghassanpl::geometry::immutable::tpolygon< T >

An immutable version of tpolygon that performs and caches its triangulation lazily upon request.

Definition at line 501 of file polygon.h.

Member Typedef Documentation

◆ mutable_polygon

template<std::floating_point T>
using ghassanpl::geometry::immutable::tpolygon< T >::mutable_polygon

Definition at line 505 of file polygon.h.

◆ tvec

template<std::floating_point T>
using ghassanpl::geometry::immutable::tpolygon< T >::tvec

Definition at line 503 of file polygon.h.

◆ value_type

template<std::floating_point T>
using ghassanpl::geometry::immutable::tpolygon< T >::value_type

Definition at line 504 of file polygon.h.

Constructor & Destructor Documentation

◆ tpolygon() [1/2]

template<std::floating_point T>
template<typename... ARGS>
ghassanpl::geometry::immutable::tpolygon< T >::tpolygon ( ARGS &&... args)
inlinenoexcept

Definition at line 515 of file polygon.h.

◆ tpolygon() [2/2]

template<std::floating_point T>
template<typename POLY_OR_ARR>
ghassanpl::geometry::immutable::tpolygon< T >::tpolygon ( POLY_OR_ARR && poly,
std::vector< indexed_triangle > triangles,
std::vector< T > cached_triangle_areas,
T cached_area )
inline

Deserialization constructor.

Definition at line 522 of file polygon.h.

Member Function Documentation

◆ areas()

template<std::floating_point T>
auto const & ghassanpl::geometry::immutable::tpolygon< T >::areas ( ) const
inline

Definition at line 571 of file polygon.h.

◆ begin()

template<std::floating_point T>
auto ghassanpl::geometry::immutable::tpolygon< T >::begin ( ) const
inlinenoexcept

Definition at line 536 of file polygon.h.

◆ bounding_box()

template<std::floating_point T>
trec2< T > ghassanpl::geometry::immutable::tpolygon< T >::bounding_box ( ) const
inline

Definition at line 547 of file polygon.h.

◆ calculate_area()

template<std::floating_point T>
T ghassanpl::geometry::immutable::tpolygon< T >::calculate_area ( ) const
inline

Definition at line 553 of file polygon.h.

◆ cbegin()

template<std::floating_point T>
auto ghassanpl::geometry::immutable::tpolygon< T >::cbegin ( ) const
inlinenoexcept

Definition at line 534 of file polygon.h.

◆ cend()

template<std::floating_point T>
auto ghassanpl::geometry::immutable::tpolygon< T >::cend ( ) const
inlinenoexcept

Definition at line 535 of file polygon.h.

◆ centroid()

template<std::floating_point T>
tvec ghassanpl::geometry::immutable::tpolygon< T >::centroid ( ) const
inline

Definition at line 559 of file polygon.h.

◆ closest_point_to()

template<std::floating_point T>
tvec ghassanpl::geometry::immutable::tpolygon< T >::closest_point_to ( glm::tvec2< T > pt) const
inline

Definition at line 548 of file polygon.h.

◆ edge_length()

template<std::floating_point T>
T ghassanpl::geometry::immutable::tpolygon< T >::edge_length ( ) const
inline

Definition at line 544 of file polygon.h.

◆ edge_point()

template<std::floating_point T>
tvec ghassanpl::geometry::immutable::tpolygon< T >::edge_point ( T t) const
inline

Definition at line 546 of file polygon.h.

◆ edge_point_alpha()

template<std::floating_point T>
tvec ghassanpl::geometry::immutable::tpolygon< T >::edge_point_alpha ( T t) const
inline

Definition at line 545 of file polygon.h.

◆ end()

template<std::floating_point T>
auto ghassanpl::geometry::immutable::tpolygon< T >::end ( ) const
inlinenoexcept

Definition at line 537 of file polygon.h.

◆ has_triangle()

template<std::floating_point T>
bool ghassanpl::geometry::immutable::tpolygon< T >::has_triangle ( size_t i) const
inline

Definition at line 577 of file polygon.h.

◆ operator->()

template<std::floating_point T>
const auto * ghassanpl::geometry::immutable::tpolygon< T >::operator-> ( ) const
inlinenoexcept

Definition at line 540 of file polygon.h.

◆ operator[]()

template<std::floating_point T>
tvec const & ghassanpl::geometry::immutable::tpolygon< T >::operator[] ( size_t index) const
inline

Definition at line 532 of file polygon.h.

◆ polygon()

template<std::floating_point T>
const auto & ghassanpl::geometry::immutable::tpolygon< T >::polygon ( ) const
inlinenoexcept

Definition at line 542 of file polygon.h.

◆ size()

template<std::floating_point T>
auto ghassanpl::geometry::immutable::tpolygon< T >::size ( ) const
inlinenoexcept

Definition at line 538 of file polygon.h.

◆ triangle()

template<std::floating_point T>
auto ghassanpl::geometry::immutable::tpolygon< T >::triangle ( size_t i) const
inline

Definition at line 578 of file polygon.h.

◆ triangle_area()

template<std::floating_point T>
T ghassanpl::geometry::immutable::tpolygon< T >::triangle_area ( size_t i) const
inline

Definition at line 579 of file polygon.h.

◆ triangles()

template<std::floating_point T>
auto const & ghassanpl::geometry::immutable::tpolygon< T >::triangles ( ) const
inline

Definition at line 565 of file polygon.h.

◆ triangulate()

template<std::floating_point T>
void ghassanpl::geometry::immutable::tpolygon< T >::triangulate ( ) const
inlineprotected

Definition at line 590 of file polygon.h.

Member Data Documentation

◆ m_cached_area

template<std::floating_point T>
T ghassanpl::geometry::immutable::tpolygon< T >::m_cached_area
mutableprotected

Definition at line 586 of file polygon.h.

◆ m_cached_centroid

template<std::floating_point T>
tvec ghassanpl::geometry::immutable::tpolygon< T >::m_cached_centroid
mutableprotected

Definition at line 587 of file polygon.h.

◆ m_cached_classification

template<std::floating_point T>
polygon_classification ghassanpl::geometry::immutable::tpolygon< T >::m_cached_classification
mutableprotected

Definition at line 588 of file polygon.h.

◆ m_cached_triangle_areas

template<std::floating_point T>
std::vector<T> ghassanpl::geometry::immutable::tpolygon< T >::m_cached_triangle_areas
mutableprotected

Definition at line 585 of file polygon.h.

◆ m_poly

template<std::floating_point T>
geometry::tpolygon<T> ghassanpl::geometry::immutable::tpolygon< T >::m_poly
protected

Definition at line 583 of file polygon.h.

◆ m_triangles

template<std::floating_point T>
std::vector<indexed_triangle> ghassanpl::geometry::immutable::tpolygon< T >::m_triangles
mutableprotected

Definition at line 584 of file polygon.h.