|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Andrew's monotonic chain convex hull algorithm. More...
#include <geom_algorithms.H>
Classes | |
| struct | LexicographicCmp |
| Lexicographical comparison for points (x primary, y secondary). More... | |
Public Member Functions | |
| Polygon | operator() (const DynList< Point > &point_set) const |
| Compute the convex hull of a point set. | |
Static Private Member Functions | |
| static Array< Point > | sorted_unique_points (const DynList< Point > &point_set) |
| Extracts points from a list, sorts them and removes duplicates. | |
| static Geom_Number | turn (const Point &a, const Point &b, const Point &c) |
| Computes the turn orientation of triple (a, b, c). | |
Andrew's monotonic chain convex hull algorithm.
Computes the convex hull by sorting points lexicographically and building the lower and upper chains with a stack-like process.
Definition at line 4741 of file geom_algorithms.H.
|
inline |
Compute the convex hull of a point set.
| point_set | The input points. |
Definition at line 4799 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Array< T >::reserve(), Aleph::Array< T >::size(), sorted_unique_points(), and turn().
|
inlinestaticprivate |
Extracts points from a list, sorts them and removes duplicates.
Definition at line 4763 of file geom_algorithms.H.
References Aleph::Array< T >::append(), Aleph::divide_and_conquer_partition_dp(), Aleph::Array< T >::get_last(), Aleph::HTList::Iterator::has_curr(), Aleph::quicksort_op(), Aleph::Array< T >::reserve(), Aleph::Array< T >::size(), and Aleph::unique().
Referenced by operator()().
|
inlinestaticprivate |
Computes the turn orientation of triple (a, b, c).
Definition at line 4787 of file geom_algorithms.H.
References Aleph::area_of_parallelogram().
Referenced by operator()().