43 for (
size_t i = 0; i <
res.trapezoids.size(); ++i)
44 if (
res.trapezoids(i).active) ++
count;
228 const Point center(0, 0);
239 auto loc =
res.locate(center);
314 for (
int x = 0; x <= 10; ++x)
315 for (
int y = 0;
y <= 10; ++
y)
321 winding_loc != PointInPolygonWinding::Location::Outside;
324 <<
"Mismatch at (" << x <<
", " <<
y <<
"): "
390 for (
size_t i = 0; i <
res.num_input_points; ++i)
392 auto loc =
res.locate(
res.points(i));
393 EXPECT_TRUE(loc.type == LT::ON_POINT
or loc.type == LT::ON_SEGMENT)
394 <<
"Point " << i <<
" not located as ON_POINT or ON_SEGMENT";
408 for (
int x = -1; x <= 5; ++x)
409 for (
int y = -1;
y <= 5; ++
y)
413 <<
"Non-deterministic result at (" << x <<
", " <<
y <<
")";
Simple dynamic array with automatic resizing and functional operations.
T & append(const T &data)
Append a copy of data
static Location locate(const Polygon &poly, const Point &p)
Classify point location with respect to a polygon.
Represents a point with rectangular coordinates in a 2D plane.
A general (irregular) 2D polygon defined by a sequence of vertices.
void add_vertex(const Point &point)
Add a vertex to the polygon.
void close()
Close the polygon.
Represents a line segment between two points.
O(log n) point location via trapezoidal map with DAG search.
LocationType
Classification of a point location query result.
static Polygon make_square_poly(Geom_Number cx, Geom_Number cy, Geom_Number half)
static size_t count_active_trapezoids(const TM::Result &res)
static Polygon make_hexagon()
static Polygon make_triangle_poly()
Main namespace for Aleph-w library functions.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
Itor::difference_type count(const Itor &beg, const Itor &end, const T &value)
Count elements equal to a value.
The trapezoidal map and DAG search structure.