9 #include <boost/unordered_map.hpp> 12 # define CGAL_HEADER_ONLY 1 13 # define CGAL_NO_GMP 1 17 #include <CGAL/Polygon_2.h> 18 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> 19 #include <CGAL/partition_2.h> 21 namespace frechet {
namespace poly {
25 typedef CGAL::Exact_predicates_inexact_constructions_kernel
Kernel;
46 typedef CGAL::Point_2<Kernel>
super;
82 operator QPointF()
const;
260 static bool is_reflex_vertex(
const CgalPolygon::Vertex_circulator& p,
double precision=0.0);
CgalPolygon cgp
the polygon under examination
Greene's approximation algorithm.
int decompose(DecompositionAlgorithm algo, bool verify)
compute a convex decomposition of the polygon. Store results in the member variable 'convex'.
int partition(Partition &partition) const
compute a list of sub-polygons, one for each convex part. This is mainly copying data to a more conve...
frechet::poly::CgalPoint Point_2
replace Point_2 with our custom type
static bool create1Diagonal(int u, int v, int n, Partition &partition)
create a diagonal in a convex partition
void findReflexVertices(Polygon &poly, double tolerance=0.0)
find all reflex (concave) vertices.
global definitions for all algorithms.
PolygonUtilities()
empty constructor
frechet::poly::CgalPoint Point_2
replace Point_2 with our custom type
bool assertStrictlySorted(const CgalPolygon &)
debug assertion
bool is_counter_clockwise()
bool erase
used by PolgonUtilities::simplify to mark vertexes for deletion
Hertel and Mehlhorn's approximation algorithm.
CgalPolygonList convex
list of convex parts. created by decompose().
int i
index of polygon vertex (-1 if not available)
int simplify()
Contract polygon chains to a single edge. Kepp only c-diagonal and contracted edges....
Greene's optimal algorithm.
std::list< CgalPolygon > CgalPolygonList
a list of CgalPolygons
CGAL::Exact_predicates_inexact_constructions_kernel Kernel
CGAL::Point_2< Kernel > super
QPolygonF Curve
a polygonal curve in the plane; with double floating point precision. This type is heavily used throu...
std::list< Polygon > Partition
a partitioning of a polygon, that is a list of sub-sets
void fanTriangulate(Triangulation &tri) const
compute a fan-triangulation from a list of convex parts. Each convex sub-polygon is triangulated usin...
CgalPoint & operator=(const QPointF &p)
assignment operator from QPointF
CGAL::Polygon_2< PolygonTraits > CgalPolygon
CGAL::Polygon_2 built upon custom type.
static bool is_reflex_vertex(const CgalPolygon::Vertex_circulator &p, double precision=0.0)
test whether a vertex is a reflex (concave) vertex
CgalPoint()
empty constructor
DecompositionAlgorithm
choice of decomposition algorithm
std::vector< int > Polygon
Polygon a sub-set of vertex indexes.
Wrapper for CGAL::Triangulation_Data_Structure https://doc.cgal.org/latest/TDS_2/index....
a helper class for polygon analysis.
type traits for CgalPolygon. Defines the type for Points.
frechet::poly::CgalPolygon Polygon_2
replace Polygon_2 with our custom type
a polygon vertex to be used with CGAL::Polygon_2. Derives from CGAL::Point_2 but is convertible to an...
type traits for a polygon partition Defines the type for Points and Polygons
std::ostream & operator<<(std::ostream &out, const frechet::poly::CgalPolygon &poly)
print operator (for debugging)