header_utils
Loading...
Searching...
No Matches
ghassanpl::geometry::polygon_shape Concept Reference

A shape with vertices and edges. More...

#include <shape_concepts.h>

Concept definition

template<typename T, typename SHAPE>
concept polygon_shape = shape<T, SHAPE> && requires (SHAPE const& shape) {
{ shape.for_each_edge([](glm::tvec2<T> const& a, glm::tvec2<T> const& b) {}) };
{ shape.for_each_vertex([](glm::tvec2<T> const& vertex) {}) };
{ shape.vertex_count() } -> std::convertible_to<size_t>;
{ shape.edge_count() } -> std::convertible_to<size_t>;
{ shape.edge(size_t{}) } -> std::convertible_to<std::optional<std::pair<glm::tvec2<T>, glm::tvec2<T>>>>;
{ shape.vertex(size_t{}) } -> std::convertible_to<std::optional<glm::tvec2<T>>>;
}
A shape with vertices and edges.
Any contiguous non-empty set of 2D points.

Detailed Description

A shape with vertices and edges.

Not specified in terms of area_shape because those operations might be too costly for the specified type to handle

Definition at line 72 of file shape_concepts.h.