|
| QVector< QPolygonF > | chainIsoSegments (const QVector< QLineF > &segs, double quantum) |
| | Chain unordered iso-line segments into polylines.
|
| |
| QColor | viridisAt (double t) |
| | Sample a 5-stop Viridis-inspired colour ramp at t in [0, 1].
|
| |
| template<typename TriRange , typename Extract > |
| std::vector< IsoLineSegment > | marchingTriangles (const TriRange &tris, const std::vector< double > &levels, Extract extract) |
| | Generate iso-line segments for every (triangle, level) pair where the level crosses the triangle's value range.
|
| |
| std::vector< double > | evenlySpacedLevels (double vMin, double vMax, int count) |
| | Convenience helper that generates N evenly-spaced contour levels between vMin and vMax (exclusive of the endpoints).
|
| |
| std::vector< double > | evenlySpacedLevelsInclusive (double vMin, double vMax, int levelCount) |
| | Convenience helper that returns levelCount evenly-spaced break levels INCLUSIVE of both endpoints (vMin and vMax).
|
| |
| template<typename TriRange , typename Extract > |
| std::vector< IsoBandPolygon > | marchingTrianglesIsobands (const TriRange &tris, const std::vector< double > &levels, Extract extract, bool clampUniformOutsideRange=true) |
| | Generate filled iso-band polygons for every (triangle, band) pair.
|
| |
template<typename TriRange , typename Extract >
| std::vector< IsoLineSegment > OpenSWMM::Contour::marchingTriangles |
( |
const TriRange & |
tris, |
|
|
const std::vector< double > & |
levels, |
|
|
Extract |
extract |
|
) |
| |
Generate iso-line segments for every (triangle, level) pair where the level crosses the triangle's value range.
- Template Parameters
-
| TriRange | Forward-iterable range of opaque "triangle handles". The caller's Extract functor turns each handle into vertex positions + per-vertex scalar values. |
| Extract | Callable with signature void(const TriHandle &h,
QPointF &p0, QPointF &p1, QPointF &p2,
double &v0, double &v1, double &v2) |
- Parameters
-
| tris | forward range of triangles (anything with begin()/end()) |
| levels | iso-levels (sorted ascending is convenient for the caller but not required by the algorithm) |
| extract | per-triangle vertex/value extractor |
Complexity O(|tris| * |levels|) with an early-out per triangle when the level lies outside [min(v0,v1,v2), max(v0,v1,v2)]. Typical fill rate on real meshes is well under 30% so the constant factor stays small.
template<typename TriRange , typename Extract >
| std::vector< IsoBandPolygon > OpenSWMM::Contour::marchingTrianglesIsobands |
( |
const TriRange & |
tris, |
|
|
const std::vector< double > & |
levels, |
|
|
Extract |
extract, |
|
|
bool |
clampUniformOutsideRange = true |
|
) |
| |
Generate filled iso-band polygons for every (triangle, band) pair.
levels is interpreted as N break levels defining N-1 bands; consecutive pairs [levels[k], levels[k+1]] define band k. For best results pass an inclusive level vector (see evenlySpacedLevelsInclusive) so boundary triangles aren't clipped away.
Implementation: each triangle is clipped twice per band via two Sutherland-Hodgman passes (one for value >= L1, one for value <= L2). The output convex polygon has up to 5 vertices and is suitable for fan triangulation by the caller.
Complexity O(|tris| * |bands|) with an early-out per (triangle, band) when the band lies entirely outside the triangle's value range.