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

Any contiguous non-empty set of 2D points. More...

#include <shape_concepts.h>

Concept definition

template<typename T, typename SHAPE>
concept shape = requires (SHAPE const& shape, glm::tvec2<T> pt, T t)
{
Any contiguous non-empty set of 2D points.

edge_length() should return the total length of this shape's edge.

{ shape.edge_length() } -> std::convertible_to<T>;

edge_point_alpha(t) should return a point on the shape edge at percentage t from an arbitrary start point. t should be normalized between 0 and 1 where 0 is the beginning of the shape edge, and 1 is the end.

{ shape.edge_point_alpha(t) } -> std::convertible_to<glm::tvec2<T>>;

edge_point(t) should return a point on the shape edge at distance t from an arbitrary start point. t should be between 0 and L where L is the edge_length()

{ shape.edge_point(t) } -> std::convertible_to<glm::tvec2<T>>;

bounding_box() should return an axis-aligned minimum bounding rectangle of this shape.

{ shape.bounding_box() } -> std::convertible_to<trec2<T>>;

closest_point_to(pt) should return the point of the shape that is closest to pt.

{ shape.closest_point_to(pt) } -> std::convertible_to<glm::tvec2<T>>;
// interval<T> projected_on_axis(glm::tvec2<T> axis) const;
}

Detailed Description

Any contiguous non-empty set of 2D points.

Definition at line 18 of file shape_concepts.h.