26 #ifndef __POLY_GRID_PARTITION_H 27 #define __POLY_GRID_PARTITION_H 33 #include <unordered_map> 92 seed ^= hasher( v ) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
99 return (a.
A == b.
A && a.
B == b.
B) || (a.
A == b.
B && a.
B == b.
A);
107 return a.
A.
x + a.
B.
x + a.
A.
y + a.
B.
y;
115 int rescale_trunc(
int aNumerator,
int aValue,
int aDenominator )
const;
132 bool inRange(
int v1,
int v2,
int x )
const;
const VECTOR2I poly2grid(const VECTOR2I &p) const
void build(const SHAPE_LINE_CHAIN &aPolyOutline, int gridSize)
void scanCell(SCAN_STATE &state, const EDGE_LIST &cell, const VECTOR2I &aP, int cx, int cy) const
VECTOR2I v2(1, 0)
Test suite for KiCad math code.
SHAPE_LINE_CHAIN m_outline
int ContainsPoint(const VECTOR2I &aP, int aClearance=0)
std::size_t operator()(const SEG &a) const
bool inRange(int v1, int v2, int x) const
int grid2polyY(int y) const
std::vector< int > m_flags
int poly2gridX(int x) const
std::vector< EDGE_LIST > m_grid
const BOX2I & BBox() const
POLY_GRID_PARTITION(const SHAPE_LINE_CHAIN &aPolyOutline, int gridSize)
int containsPoint(const VECTOR2I &aP, bool debug=false) const
bool operator()(const SEG &a, const SEG &b) const
std::vector< int > EDGE_LIST
int grid2polyX(int x) const
void hash_combine(std::size_t &seed, const T &v)
const VECTOR2I grid2poly(const VECTOR2I &p) const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int poly2gridY(int y) const
Provide a fast test for point inside polygon.
int rescale_trunc(int aNumerator, int aValue, int aDenominator) const
bool checkClearance(const VECTOR2I &aP, int aClearance)