|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Visvalingam-Whyatt polyline simplification. More...
#include <geom_algorithms.H>
Classes | |
| struct | VWEntry |
| Entry in the priority queue for vertex removal. More... | |
Public Member Functions | |
| Array< Point > | operator() (const Array< Point > &polyline, const Geom_Number &area_threshold) const |
| Simplify an open polyline. | |
| Array< Point > | operator() (const DynList< Point > &polyline, const Geom_Number &area_threshold) const |
| Overload accepting DynList. | |
Static Public Member Functions | |
| static Polygon | simplify_polygon (const Polygon &poly, const Geom_Number &area_threshold) |
| Simplify a closed polygon. | |
Static Private Member Functions | |
| static Geom_Number | effective_area (const Point &a, const Point &b, const Point &c) |
| static Array< Point > | simplify_open_array (const Array< Point > &polyline, const Geom_Number &area_threshold) |
Visvalingam-Whyatt polyline simplification.
Iteratively removes the vertex that forms the smallest effective area triangle with its two neighbors. Uses a min-heap for O(n log n) complexity.
Definition at line 12575 of file geom_algorithms.H.
|
inlinestaticprivate |
Definition at line 12592 of file geom_algorithms.H.
References Aleph::area_of_parallelogram(), and Aleph::divide_and_conquer_partition_dp().
Referenced by simplify_open_array(), and simplify_polygon().
|
inline |
Simplify an open polyline.
First and last vertices are always kept.
| polyline | Ordered sequence of vertices. |
| area_threshold | Minimum effective area to keep a vertex. |
polyline). Definition at line 12687 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), and simplify_open_array().
|
inline |
Overload accepting DynList.
Definition at line 12695 of file geom_algorithms.H.
References Aleph::Array< T >::append(), Aleph::divide_and_conquer_partition_dp(), Aleph::HTList::Iterator::has_curr(), and simplify_open_array().
|
inlinestaticprivate |
Definition at line 12600 of file geom_algorithms.H.
References Aleph::and, Aleph::Array< T >::append(), Aleph::divide_and_conquer_partition_dp(), effective_area(), Aleph::DynBinHeap< T, Compare >::get(), Aleph::GenBinHeap< NodeType, Key, Compare >::is_empty(), Aleph::next(), and Aleph::DynBinHeap< T, Compare >::put().
Referenced by operator()(), and operator()().
|
inlinestatic |
Simplify a closed polygon.
All vertices are candidates (cyclic neighbor links).
| poly | The closed polygon. |
| area_threshold | Minimum effective area to keep a vertex. |
Definition at line 12715 of file geom_algorithms.H.
References Aleph::Polygon::add_vertex(), Aleph::and, Aleph::Array< T >::append(), Aleph::divide_and_conquer_partition_dp(), effective_area(), Aleph::GeomPolygonUtils::extract_vertices(), Aleph::DynBinHeap< T, Compare >::get(), Aleph::GenBinHeap< NodeType, Key, Compare >::is_empty(), Aleph::next(), Aleph::DynBinHeap< T, Compare >::put(), and Aleph::Array< T >::size().
Referenced by TEST_F().