Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::GeomPolygonUtils Class Reference

Shared polygon helpers used across multiple geometry algorithms. More...

#include <geom_algorithms.H>

Static Public Member Functions

static Array< Pointextract_vertices (const Polygon &poly)
 Extract vertices from a polygon into an array for indexed access.
 
static Geom_Number signed_double_area (const Array< Point > &verts)
 Compute twice the signed area (shoelace formula without division).
 
static Geom_Number signed_double_area (const Polygon &poly)
 Compute twice the signed area of a polygon.
 
static Geom_Number signed_area (const Array< Point > &verts)
 Compute the actual signed area of a vertex array.
 
static Geom_Number signed_area (const Polygon &poly)
 Compute the actual signed area of a polygon.
 
static Geom_Number area (const Array< Point > &verts)
 Compute the absolute area of a vertex array.
 
static Geom_Number area (const Polygon &poly)
 Compute the absolute area of a polygon.
 
static bool is_convex (const Array< Point > &verts)
 Check if a vertex array forms a convex polygon.
 
static void ensure_ccw (Array< Point > &verts)
 

Detailed Description

Shared polygon helpers used across multiple geometry algorithms.

Provides utilities for working with polygons represented as Array<Point>. Many internal algorithms extract vertices into arrays for efficient indexed access. These helpers centralize common operations.

Note
For direct operations on Polygon objects, prefer the convenience methods Polygon::area(), Polygon::is_convex(), etc. Use this class when working with extracted vertex arrays.
signed_double_area() returns twice the signed area (avoids division). Use area() for the actual area value.

Definition at line 231 of file geom_algorithms.H.

Member Function Documentation

◆ area() [1/2]

static Geom_Number Aleph::GeomPolygonUtils::area ( const Array< Point > &  verts)
inlinestatic

Compute the absolute area of a vertex array.

Definition at line 280 of file geom_algorithms.H.

References Aleph::divide_and_conquer_partition_dp(), and signed_area().

◆ area() [2/2]

static Geom_Number Aleph::GeomPolygonUtils::area ( const Polygon poly)
inlinestatic

Compute the absolute area of a polygon.

Definition at line 287 of file geom_algorithms.H.

References signed_area().

◆ ensure_ccw()

◆ extract_vertices()

◆ is_convex()

◆ signed_area() [1/2]

static Geom_Number Aleph::GeomPolygonUtils::signed_area ( const Array< Point > &  verts)
inlinestatic

Compute the actual signed area of a vertex array.

Definition at line 268 of file geom_algorithms.H.

References Aleph::divide_and_conquer_partition_dp(), and signed_double_area().

Referenced by area(), and area().

◆ signed_area() [2/2]

static Geom_Number Aleph::GeomPolygonUtils::signed_area ( const Polygon poly)
inlinestatic

Compute the actual signed area of a polygon.

Definition at line 274 of file geom_algorithms.H.

References signed_double_area().

◆ signed_double_area() [1/2]

◆ signed_double_area() [2/2]

static Geom_Number Aleph::GeomPolygonUtils::signed_double_area ( const Polygon poly)
inlinestatic

Compute twice the signed area of a polygon.

Definition at line 262 of file geom_algorithms.H.

References extract_vertices(), and signed_double_area().


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