![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Classes | |
| struct | Stats |
Functions | |
| bool | reprojectModel (SWMM_Engine engine, const SpatialReferenceSystem &oldSRS, const SpatialReferenceSystem &newSRS, Stats *stats=nullptr, QString *errorOut=nullptr) |
Transform every coordinate in the model from oldSRS to newSRS. | |
| void | transformPointsInPlace (OGRCoordinateTransformation *ct, double *xs, double *ys, int n) |
Transform n interleaved scene points in place, in chunks. | |
Variables | |
| constexpr int | kTransformChunk = 65536 |
| Number of points pushed through OGR per batched call. | |
| bool CRSReproject::reprojectModel | ( | SWMM_Engine | engine, |
| const SpatialReferenceSystem & | oldSRS, | ||
| const SpatialReferenceSystem & | newSRS, | ||
| Stats * | stats = nullptr, |
||
| QString * | errorOut = nullptr |
||
| ) |
Transform every coordinate in the model from oldSRS to newSRS.
Uses the bulk node API for performance; loops per-link and per-subcatch for variable-length chains. Best-effort: a per-object failure logs and continues so a partially-projectable model still gets the rest done.
| engine | Open SWMM engine handle (must outlive the call). |
| oldSRS | Source CRS (e.g. layer's stored CRS). |
| newSRS | Target CRS (also written to the engine via swmm_spatial_set_crs). |
| stats | Optional out-param with counts of objects touched. |
| errorOut | Optional human-readable error if the transform itself fails. |
| void CRSReproject::transformPointsInPlace | ( | OGRCoordinateTransformation * | ct, |
| double * | xs, | ||
| double * | ys, | ||
| int | n | ||
| ) |
Transform n interleaved scene points in place, in chunks.
Replaces the Transform(1, &x, &y)-per-point pattern that made the geometry cache do ~1.5M individual PROJ calls on a 100k-node model. One call per kTransformChunk points instead.
| ct | Transform to apply. Null is a valid no-op — a layer whose CRS already matches the canvas has no transform, and every caller relied on that. |
| xs,ys | Parallel arrays of n coordinates, rewritten in place. |
pabSuccess array and restores the original value for any point OGR rejects, rather than keeping whatever OGR wrote.
|
inlineconstexpr |
Number of points pushed through OGR per batched call.
Big enough that PROJ's per-call overhead is amortised, small enough that the scratch buffers stay cache-resident and the peak allocation is bounded regardless of model size.