Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Polygon_With_Points Struct Reference

#include <eepicgeom.H>

Inheritance diagram for Polygon_With_Points:
[legend]
Collaboration diagram for Polygon_With_Points:
[legend]

Public Member Functions

 Polygon_With_Points ()
 
 Polygon_With_Points (const Polygon &p)
 
- Public Member Functions inherited from Aleph::Polygon
 Polygon ()
 Default constructor. Creates an empty, open polygon.
 
 ~Polygon ()
 Destructor. Frees all vertices.
 
 Polygon (const Polygon &poly)
 Copy constructor.
 
 Polygon (Polygon &&poly) noexcept
 Move constructor.
 
 Polygon (const Regular_Polygon &poly)
 Construct from a Regular_Polygon.
 
Polygon & operator= (const Polygon &poly)
 Copy assignment operator.
 
Polygon & operator= (Polygon &&poly) noexcept
 Move assignment operator.
 
Polygon & operator= (const Regular_Polygon &poly)
 Assignment from a Regular_Polygon.
 
const Point & lowest_point () const
 Get the vertex with the minimum y-coordinate.
 
const Point & highest_point () const
 Get the vertex with the maximum y-coordinate.
 
const Point & leftmost_point () const
 Get the vertex with the minimum x-coordinate.
 
const Point & rightmost_point () const
 Get the vertex with the maximum x-coordinate.
 
const bool & is_closed () const
 Check if the polygon is closed.
 
const size_t & size () const
 Get the number of vertices.
 
bool vertex_belong_polygon (const Vertex &v) const
 Check if a vertex belongs to this polygon.
 
const Vertex & get_first_vertex () const
 Get the first vertex of the polygon.
 
const Vertex & get_last_vertex () const
 Get the last vertex of the polygon.
 
const Vertex & get_next_vertex (const Vertex &v) const
 Get the vertex following v in the polygon.
 
const Vertex & get_prev_vertex (const Vertex &v) const
 Get the vertex preceding v in the polygon.
 
Segment get_first_segment () const
 Get the first edge (segment) of the polygon.
 
Segment get_last_segment () const
 Get the last edge (segment) of the polygon.
 
bool intersects_with (const Segment &sg) const
 Check if a segment intersects with any edge of the polygon.
 
void add_vertex (const Point &point)
 Add a vertex to the polygon.
 
void add_vertex (const Geom_Number &x, const Geom_Number &y)
 Add a vertex using coordinates.
 
void append (const Point &point)
 Append a vertex (Aleph container protocol).
 
template<template< typename > class List>
 Polygon (const List< Point > &l)
 
template<class It >
requires (not std::is_arithmetic_v<It> and requires (It it) { *it; ++it; it != it; })
 Polygon (It b, It e)
 
 Polygon (std::initializer_list< Point > l)
 
void remove_vertex (const Vertex &v)
 Remove a vertex from the polygon.
 
void close ()
 Close the polygon.
 
PointLocation locate_point (const Point &p) const
 Classify a point against this closed polygon.
 
bool contains (const Point &p) const
 Check if a point is inside the polygon (or on its boundary).
 
bool contains_to (const Point &p) const
 
Geom_Number signed_area () const
 Compute the signed area of the polygon using the shoelace formula.
 
Geom_Number area () const
 Compute the absolute area of the polygon.
 
Geom_Number perimeter () const
 Compute the perimeter of the polygon.
 
Point centroid () const
 Compute the centroid (center of mass) of the polygon.
 
bool is_convex () const
 Check if the polygon is convex.
 
 Polygon (const Triangle &tr)
 Construct a polygon from a Triangle.
 
- Public Member Functions inherited from Aleph::Geom_Object
 Geom_Object ()=default
 
virtual ~Geom_Object ()=default
 
- Public Member Functions inherited from GenericTraverse< Polygon >
bool traverse (Operation &operation) noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_arg< Polygon, Operation >::type, Polygon & >())
 Traverse the container via its iterator and performs a conditioned operation on each item.
 
bool traverse (Operation &operation) const noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_carg< Polygon, Operation >::type, const_source_t< Operation > >())
 Traverse a constant container; each item is handed out as a constant reference.
 
bool traverse (Operation &&operation) const noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_carg< Polygon, Operation >::type, const_source_t< Operation > >())
 Overload of traverse(Operation &) const that accepts rvalues.
 
bool traverse (Operation &&operation) noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_arg< Polygon, Operation >::type, Polygon & >())
 Overload of traverse(Operation &) that accepts rvalues.
 
- Public Member Functions inherited from FunctionalMethods< Polygon, Point >
void emplace (Args &&... args)
 Appends a new element into the container by constructing it from the given args.
 
void emplace_end (Args &&... args)
 See emplace(Args && ... args).
 
void emplace_ins (Args &&... args)
 
size_t ninsert (Args &&... args)
 Insert n variadic items.
 
size_t nappend (Args &&... args)
 Append n variadic items.
 
void for_each (Operation &operation) const
 Traverse all the container and performs an operation on each element.
 
void for_each (Operation &&operation) const
 Overload of for_each() that accepts rvalues.
 
void each (Operation &operation) const
 Alias of for_each().
 
void each (Operation &&operation) const
 Alias of for_each() that accepts rvalues.
 
void each (const size_t pos, const size_t slice, Operation &operation) const
 Traverse the container starting at pos taking one item every slice, performing an operation on each visited element.
 
void each (const size_t pos, const size_t slice, Operation &&operation) const
 See each(size_t pos, size_t slice, Operation & operation) const.
 
and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Polygon, Operation >::type, Point > void each (const size_t pos, const size_t slice, Operation &operation)
 Traverse the container starting at pos taking one item every slice, performing an operation that may modify each visited item.
 
and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Polygon, Operation >::type, Point > void each (const size_t pos, const size_t slice, Operation &&operation)
 See each(size_t pos, size_t slice, Operation & operation).
 
and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Polygon, Operation >::type, Point > void mutable_for_each (Operation &operation)
 Apply a mutable operation to each element of the container.
 
and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Polygon, Operation >::type, Point > void mutable_for_each (Operation &&operation)
 See mutable_for_each(Operation & operation).
 
bool all (Operation &operation) const
 Check if all the elements of the container satisfy a condition.
 
bool all (Operation &&operation) const
 Overload of all() that accepts rvalues.
 
bool exists (Operation &op) const
 Test for existence in the container of an element satisfying a criterion.
 
bool exists (Operation &&op) const
 Overload of exists() that accepts rvalues.
 
bool none (Operation &op) const
 Test that no element satisfies a criterion.
 
bool none (Operation &&op) const
 Overload of none() that accepts rvalues.
 
size_t count_if (Operation &op) const
 Count the elements that satisfy a criterion.
 
size_t count_if (Operation &&op) const
 Overload of count_if() that accepts rvalues.
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, Point > > maps (Operation &op) const
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, Point > > maps (Operation &&op) const
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, Point > > maps_if (Prop prop, Operation &op) const
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, Point > > maps_if (Prop prop, Operation &&op) const
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, Point > > map (Operation &op) const
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, Point > > map (Operation &&op) const
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, Point > > map_if (Prop prop, Operation &op) const
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, Point > > map_if (Prop prop, Operation &&op) const
 
auto flat_map (Operation &op) const
 Map each element to a container and concatenate the results.
 
auto flat_map (Operation &&op) const
 Overload of flat_map() that accepts rvalues.
 
Aleph::DynList< Point > to_dynlist () const
 Convert container to DynList.
 
std::vector< Point > to_vector () const
 Convert container to std::vector.
 
Acc foldl (const Acc &init, Op &op) const
 Fold the elements of the container to a specific result.
 
Acc foldl (const Acc &init, Op &&op) const
 Overload of foldl() that accepts rvalues.
 
Acc fold_left (const Acc &init, Op &op) const
 Alias for foldl().
 
Acc fold_left (const Acc &init, Op &&op) const
 Overload of fold_left() that accepts rvalues.
 
Point fold (const Point &init, Operation &operation) const
 Simplified version of foldl() where the folded type is the same type of elements stored in the container.
 
Point fold (const Point &init, Operation &&operation) const
 Overload of fold() that accepts rvalues.
 
Acc foldr (const Acc &init, Op &op) const
 Fold the elements from the last to the first.
 
Acc foldr (const Acc &init, Op &&op) const
 Overload of foldr() that accepts rvalues.
 
and std::copy_constructible< U > std::optional< Point > reduce (Op &op) const
 Fold the elements with no initial value.
 
and std::copy_constructible< U > std::optional< Point > reduce (Op &&op) const
 Overload of reduce() that accepts rvalues.
 
Aleph::DynList< Point > filter (Operation &operation) const
 Filter the elements of a container according to a matching criterion.
 
Aleph::DynList< Point > filter (Operation &&operation) const
 Overload of filter() that accepts rvalues.
 
Aleph::DynList< const Point * > ptr_filter (Operation &operation) const
 Filter the elements of a container according to a matching criterion and return a pointer to the matched items in the container.
 
Aleph::DynList< const Point * > ptr_filter (Operation &&operation) const
 Overload of ptr_filter() that accepts rvalues.
 
Aleph::DynList< std::tuple< Point, size_t > > pfilter (Operation &operation) const
 Filter the elements of a container according to a matching criterion and determine its positions respect to the traversal of container.
 
Aleph::DynList< std::tuple< Point, size_t > > pfilter (Operation &&operation) const
 Overload of pfilter() that accepts rvalues.
 
std::pair< Aleph::DynList< Point >, Aleph::DynList< Point > > partition (Operation &op) const
 Exclusive partition of container according to a filter criterion.
 
std::pair< Aleph::DynList< Point >, Aleph::DynList< Point > > partition (Operation &&op) const
 Overload of partition() that accepts rvalues.
 
std::pair< Aleph::DynList< Point >, Aleph::DynList< Point > > partition (size_t n) const
 Exclusive partition of container in the nth item.
 
std::pair< Aleph::DynList< Point >, Aleph::DynList< Point > > split_half () const
 Split the container into two halves by alternating elements.
 
std::tuple< Aleph::DynList< Point >, Aleph::DynList< Point > > tpartition (Operation &op) const
 Exclusive partition of container according to a filter criterion.
 
std::tuple< Aleph::DynList< Point >, Aleph::DynList< Point > > tpartition (Operation &&op) const
 Overload of tpartition() that accepts rvalues.
 
size_t length () const noexcept(Aleph::dry_detail::const_traversal_is_noexcept< Polygon, Point >)
 Count the number of elements of a container.
 
Aleph::DynList< Point > rev () const
 Return a list with the elements of container in reverse order respect to its traversal order.
 
Aleph::DynList< Point > take (const size_t n) const
 Return a list with the first n elements seen in the container during its traversal.
 
Aleph::DynList< Point > take (size_t i, const size_t j, const size_t step=1) const
 Return a list with the elements at positions i, i + step, i + 2 step, ... that are not greater than j, respect to the traversal order.
 
Aleph::DynList< Point > drop (const size_t n) const
 Drop the first n elements seen in the container during its traversal.
 
Aleph::DynList< Point > take_while (Operation &op) const
 The longest prefix of elements that satisfy a criterion.
 
Aleph::DynList< Point > take_while (Operation &&op) const
 Overload of take_while() that accepts rvalues.
 
Aleph::DynList< Point > drop_while (Operation &op) const
 The elements after the longest prefix that satisfies a criterion.
 
Aleph::DynList< Point > drop_while (Operation &&op) const
 Overload of drop_while() that accepts rvalues.
 
void mutable_drop (const size_t n)
 Drop the first n elements seen from container.
 
- Public Member Functions inherited from LocateFunctions< Polygon, Point >
auto get_it ()
 Return a properly initialized iterator positioned at the first item on the container.
 
auto get_it () const
 Read-only iterator positioned at the first item.
 
auto get_it (const size_t pos)
 Return a properly initialized iterator positioned at the pos item on the container.
 
auto get_it (const size_t pos) const
 Read-only iterator positioned at the pos item.
 
auto get_itor ()
 Alias of get_it().
 
auto get_itor () const
 See get_itor().
 
Point & nth_ne (const size_t n) noexcept(Aleph::dry_detail::mutable_traversal_is_noexcept< C, Point >)
 Return the n‑th element without bounds checking.
 
const Point & nth_ne (const size_t n) const noexcept(Aleph::dry_detail::const_traversal_is_noexcept< Polygon, Point >)
 Constant overload of nth_ne(size_t).
 
Point & nth (const size_t n)
 Return the n-th item of the container.
 
const Point & nth (const size_t n) const
 Const overload of nth(size_t).
 
and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Polygon, Operation >::type, Point > Point * find_ptr (Operation &operation) noexcept(mutable_search_is_noexcept< Operation >())
 Find a pointer to an item in the container according to a searching criterion.
 
const Point * find_ptr (Operation &operation) const noexcept(const_search_is_noexcept< Operation >())
 Const overload of find_ptr(Operation&).
 
const Point * find_ptr (Operation &&operation) const noexcept(const_search_is_noexcept< Operation >())
 Overload of find_ptr() const that accepts rvalues.
 
and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Polygon, Operation >::type, Point > Point * find_ptr (Operation &&operation) noexcept(mutable_search_is_noexcept< Operation >())
 Overload of find_ptr() that accepts rvalues.
 
size_t find_index (Operation &operation) const noexcept(const_search_is_noexcept< Operation >())
 Find the position of an item in the container according to a searching criterion.
 
size_t find_index (Operation &&operation) const noexcept(const_search_is_noexcept< Operation >())
 Overload of find_index() that accepts rvalues.
 
and std::default_initializable< T > and std::copy_constructible< T > std::tuple< bool, Point > find_item (Operation &operation) const noexcept(find_item_is_noexcept< Operation >())
 Safe sequential searching of an item matching a criterion.
 
and std::default_initializable< T > and std::copy_constructible< T > std::tuple< bool, Point > find_item (Operation &&operation) const noexcept(find_item_is_noexcept< Operation >())
 Overload of find_item() that accepts rvalues.
 
and std::copy_constructible< T > std::optional< Point > find_opt (Operation &operation) const
 Copy of the first item satisfying a criterion, if any.
 
and std::copy_constructible< T > std::optional< Point > find_opt (Operation &&operation) const
 Overload of find_opt() that accepts rvalues.
 
bool contains_if (Operation &&operation) const noexcept(const_search_is_noexcept< Operation >())
 Test if an item satisfying a criterion is present in the container.
 
bool contains (const Point &item) const
 Test if an item is present in the container using equality.
 
- Public Member Functions inherited from StlAlephIterator< Polygon >
iterator begin () noexcept
 Return an STL-compatible iterator to the first element.
 
const_iterator begin () const noexcept
 Return a const iterator to the first element.
 
iterator end () noexcept
 Return an STL-compatible end iterator.
 
const_iterator end () const noexcept
 Return a const end iterator.
 
const_iterator cbegin () const noexcept
 Return a const iterator to the first element.
 
const_iterator cend () const noexcept
 Return a const end iterator.
 

Additional Inherited Members

- Public Types inherited from Aleph::Polygon
enum class  PointLocation { Outside , Boundary , Inside }
 
using Item_Type = Point
 The type of elements iterated over.
 
using Key_Type = Point
 Alias for Item_Type.
 
- Public Types inherited from StlAlephIterator< Polygon >
using iterator = StlIterator< Polygon >
 
using const_iterator = StlConstIterator< Polygon >
 
- Static Public Member Functions inherited from FunctionalMethods< Polygon, Point >
static Polygon build (Items &&... items)
 Build a container that holds the given items.
 
static D build_as (Items &&... items)
 Build a D, a class derived from the container, holding the given items.
 
- Public Attributes inherited from FunctionalMethods< Polygon, Point >
 and
 Insert a new element into the container by constructing it from the given args.
 
and Aleph::InvocableWith< Operation &, const Point & > and
 Conditional mapping of the elements of the container.
 

Detailed Description

Definition at line 1337 of file eepicgeom.H.

Constructor & Destructor Documentation

◆ Polygon_With_Points() [1/2]

Polygon_With_Points::Polygon_With_Points ( )
inline

Definition at line 1337 of file eepicgeom.H.

◆ Polygon_With_Points() [2/2]

Polygon_With_Points::Polygon_With_Points ( const Polygon &  p)
inline

Definition at line 1337 of file eepicgeom.H.


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