载入中...
搜索中...
未找到
UrbanGeometry.h
浏览该文件的文档.
45EVENGINE_API_DOMAINS Vec2 closestPointOnBoundary(const Polygon& poly, const Vec2& p, BoundaryPosition* pos);
72EVENGINE_API_DOMAINS double shapeIrregularity(const Polygon& approxRing, double gammaAngle = 0.75,
86bool validSplit(const Polygon& poly, const Polyline& split, double minHalfArea, Polygon* outA, Polygon* outB,
Definition UrbanCrossField.cpp:12
Polygon approximatePolygon(const Polygon &ring)
Simplify a ring to its approximate polygon: consecutive edges with included angle > 135° are merged i...
Definition UrbanGeometry.cpp:277
bool validSplit(const Polygon &poly, const Polyline &split, double minHalfArea, Polygon *outA, Polygon *outB, double *fracA)
Validity of a candidate split: both halves simple, positive area, inside the original.
Definition UrbanGeometry.cpp:425
std::vector< Vec2 > Polyline
Open polyline (e.g. a streamline candidate or a street centerline).
Definition UrbanTypes.h:57
double includedAngleDeg(const Vec2 &u, const Vec2 &v)
Included angle in degrees at the shared vertex between edge u (prev->shared) and v (shared->next),...
Definition UrbanGeometry.cpp:266
bool pointInPolygon(const Vec2 &p, const Polygon &poly)
Point-in-polygon test (ray casting; boundary counts as inside).
Definition UrbanGeometry.cpp:112
Vec2 pointAtBoundaryLength(const Polygon &poly, double s, BoundaryPosition *pos)
Interpolate the boundary point at arc length s in [0, perimeter).
Definition UrbanGeometry.cpp:219
bool splitPolygonByPolyline(const Polygon &poly, const Polyline &split, const BoundaryPosition &posA, const BoundaryPosition &posB, Polygon &outA, Polygon &outB)
Split a CCW simple polygon by a polyline whose endpoints lie on the boundary and whose interior point...
Definition UrbanGeometry.cpp:399
bool triangulatePolygon(const Polygon &poly, std::vector< int > &outTriangles)
Triangulate a simple polygon by ear clipping; returns CCW triangles (3*i..3*i+2).
Definition UrbanGeometry.cpp:462
bool polylineSelfIntersects(const Polyline &pl)
True if any two non-adjacent segments of the open polyline cross.
Definition UrbanGeometry.cpp:149
double closestPointOnSegment(const Vec2 &p, const Vec2 &a, const Vec2 &b, Vec2 *out)
Closest point on segment a-b; returns distance and writes out.
Definition UrbanGeometry.cpp:177
double distanceToSegment(const Vec2 &p, const Vec2 &a, const Vec2 &b)
Raster helper: does the pixel-center fall within eps of segment a-b?
Definition UrbanGeometry.cpp:513
std::vector< Vec2 > Polygon
Closed polygon ring, stored CCW, without repeating the first point.
Definition UrbanTypes.h:55
bool segmentsIntersect(const Vec2 &a, const Vec2 &b, const Vec2 &c, const Vec2 &d, Vec2 *out)
True if the open segments a-b and c-d properly cross; out receives the crossing.
Definition UrbanGeometry.cpp:127
double perimeter(const Polygon &poly)
Perimeter length of a closed ring.
Definition UrbanGeometry.cpp:72
std::vector< BoundarySample > sampleBoundary(const Polygon &poly, int count)
Uniformly sample the polygon boundary (approx. count samples, at least 8). Samples are ordered along ...
Definition UrbanGeometry.cpp:247
bool polygonIsSimple(const Polygon &poly)
Simple polygon test: no self intersections among non-adjacent ring edges.
Definition UrbanGeometry.cpp:159
double signedArea(const Polygon &poly)
Return the raw (possibly negative) signed area of a polygon ring.
Definition UrbanGeometry.cpp:34
bool pointOnSegment(const Vec2 &p, const Vec2 &a, const Vec2 &b, double eps)
True if p lies on segment a-b (within tolerance).
Definition UrbanGeometry.cpp:125
double shapeIrregularity(const Polygon &approxRing, double gammaAngle, double gammaSide)
Shape irregularity metric of Eq. (1) over the approximate polygon: I = γ1·(1/N)·Σ(θi−θ̄)² + γ2·(1/(N·...
Definition UrbanGeometry.cpp:314
void cleanupRing(Polygon &poly, double eps)
Remove consecutive duplicate points (within eps) and points that create zero spikes.
Definition UrbanGeometry.cpp:86
double polylineLength(const Polyline &pl)
Total length of an open polyline.
Definition UrbanGeometry.cpp:48
bool segmentIntersectsPolyline(const Vec2 &a, const Vec2 &b, const Polyline &pl)
True if a segment crosses any segment of an open polyline (excluding shared endpoints).
Definition UrbanGeometry.cpp:141
Vec2 closestPointOnBoundary(const Polygon &poly, const Vec2 &p, BoundaryPosition *pos)
Closest point on the polygon boundary; writes edge index + t in [0,1].
Definition UrbanGeometry.cpp:189
bool ensureCCW(Polygon &poly)
Ensure the ring is CCW (positive signed area); returns whether it was flipped.
Definition UrbanGeometry.cpp:78
bool isCollinear(const Vec2 &prev, const Vec2 &shared, const Vec2 &next)
True when two consecutive edges are considered collinear (included angle > 135°).
Definition UrbanGeometry.cpp:273