![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Spatial frame containing CRS and georeferenced coordinates. More...
#include <SpatialFrame.hpp>
Public Member Functions | |
| void | register_coupling_point (ICouplingPoint *point) |
| Append a borrowed coupling point without deduplication. | |
| bool | has_2d_coupling () const noexcept |
| Check whether the registration vector contains any entries. | |
| void | shrink_to_fit () |
| Request capacity reduction for coordinate and vertex arrays. | |
Public Attributes | |
| std::string | crs |
| CRS specification string. | |
| bool | is_geographic = false |
| True if the CRS represents geographic coordinates (lon/lat). | |
| double | map_x1 = 0.0 |
| Map extent minimum X (left). | |
| double | map_y1 = 0.0 |
| Map extent minimum Y (bottom). | |
| double | map_x2 = 0.0 |
| Map extent maximum X (right). | |
| double | map_y2 = 0.0 |
| Map extent maximum Y (top). | |
| std::string | map_units |
| Map units string from [MAP] UNITS keyword. | |
| std::vector< double > | node_x |
| Node X coordinates (easting or longitude). | |
| std::vector< double > | node_y |
| Node Y coordinates (northing or latitude). | |
| std::vector< uint8_t > | node_has_xy |
| G-X2 (2026-09-19): 1 when the node's coordinates were authored ([COORDINATES], the GeoPackage geometry, the spatial C API or a virtual-junction split). A node whose entry is 0 sits at the (0, 0) fill and must not be located on a mesh by it. Sized with node_x. | |
| std::vector< double > | link_x |
| Link centroid X coordinates. | |
| std::vector< double > | link_y |
| Link centroid Y coordinates. | |
| std::vector< double > | subcatch_x |
| Subcatchment centroid X. | |
| std::vector< double > | subcatch_y |
| Subcatchment centroid Y. | |
| std::vector< std::vector< double > > | link_vertices_x |
| Per-link X vertices. link_vertices_x[link_idx] is a vector of X coords. | |
| std::vector< std::vector< double > > | link_vertices_y |
| Per-link Y vertices. link_vertices_y[link_idx] is a vector of Y coords. | |
| std::vector< std::vector< double > > | subcatch_polygon_x |
| Per-subcatchment X vertices. Multiple rings are concatenated with explicit closures; the final ring may be open. | |
| std::vector< std::vector< double > > | subcatch_polygon_y |
| Per-subcatchment polygon Y vertices. | |
| std::vector< double > | gage_x |
| Gage X coordinates. | |
| std::vector< double > | gage_y |
| Gage Y coordinates. | |
| std::vector< ICouplingPoint * > | coupling_points |
| Registered 2D coupling points. | |
Spatial frame containing CRS and georeferenced coordinates.
Coordinates are stored in the CRS specified by the crs field. If crs is empty, coordinates are in model units (as in legacy SWMM).
Arrays are indexed identically to the corresponding SoA data stores (NodeData, LinkData, SubcatchData). Index i in node_x corresponds to node i in NodeData.
|
inlinenoexcept |
Check whether the registration vector contains any entries.
|
inline |
Append a borrowed coupling point without deduplication.
Does not invoke exchange methods, locate the object on a mesh or take ownership. Caller serializes vector mutation and traversal.
| [in] | point | Non-owning pointer that must outlive all uses of the frame entry; NULL is ignored. |
|
inline |
Request capacity reduction for coordinate and vertex arrays.
Preserves values but can invalidate references, pointers and iterators if a vector reallocates. Visits outer and inner geometry vectors; node_has_xy and coupling_points are not compacted. Standard vector capacity requests need not reduce allocation.
| std::vector<ICouplingPoint*> openswmm::SpatialFrame::coupling_points |
Registered 2D coupling points.
2D components register ICouplingPoint objects here to establish exchange at specific 1D objects. Registration stores the pointers only; a driver integrating this interface must invoke exchange_to_2d()/receive_from_2d() explicitly. The concrete SurfaceRouter2D uses its own coupling data structures.
Not owned — the 2D component manages the lifetime of these objects.
| std::string openswmm::SpatialFrame::crs |
CRS specification string.
EPSG code (e.g., "EPSG:4326") or PROJ string (e.g., "+proj=utm +zone=33 +datum=WGS84"). Empty string means no CRS is specified (legacy behavior).
Set from the CRS key in [OPTIONS]:
| std::vector<double> openswmm::SpatialFrame::gage_x |
Gage X coordinates.
| std::vector<double> openswmm::SpatialFrame::gage_y |
Gage Y coordinates.
| bool openswmm::SpatialFrame::is_geographic = false |
True if the CRS represents geographic coordinates (lon/lat).
Used for distance calculations and 2D coupling.
| std::vector<std::vector<double> > openswmm::SpatialFrame::link_vertices_x |
Per-link X vertices. link_vertices_x[link_idx] is a vector of X coords.
| std::vector<std::vector<double> > openswmm::SpatialFrame::link_vertices_y |
Per-link Y vertices. link_vertices_y[link_idx] is a vector of Y coords.
| std::vector<double> openswmm::SpatialFrame::link_x |
Link centroid X coordinates.
| std::vector<double> openswmm::SpatialFrame::link_y |
Link centroid Y coordinates.
| std::string openswmm::SpatialFrame::map_units |
Map units string from [MAP] UNITS keyword.
Typically NONE, FEET, METERS, or DEGREES.
| double openswmm::SpatialFrame::map_x1 = 0.0 |
Map extent minimum X (left).
| double openswmm::SpatialFrame::map_x2 = 0.0 |
Map extent maximum X (right).
| double openswmm::SpatialFrame::map_y1 = 0.0 |
Map extent minimum Y (bottom).
| double openswmm::SpatialFrame::map_y2 = 0.0 |
Map extent maximum Y (top).
| std::vector<uint8_t> openswmm::SpatialFrame::node_has_xy |
G-X2 (2026-09-19): 1 when the node's coordinates were authored ([COORDINATES], the GeoPackage geometry, the spatial C API or a virtual-junction split). A node whose entry is 0 sits at the (0, 0) fill and must not be located on a mesh by it. Sized with node_x.
| std::vector<double> openswmm::SpatialFrame::node_x |
Node X coordinates (easting or longitude).
| std::vector<double> openswmm::SpatialFrame::node_y |
Node Y coordinates (northing or latitude).
| std::vector<std::vector<double> > openswmm::SpatialFrame::subcatch_polygon_x |
Per-subcatchment X vertices. Multiple rings are concatenated with explicit closures; the final ring may be open.
| std::vector<std::vector<double> > openswmm::SpatialFrame::subcatch_polygon_y |
Per-subcatchment polygon Y vertices.
| std::vector<double> openswmm::SpatialFrame::subcatch_x |
Subcatchment centroid X.
| std::vector<double> openswmm::SpatialFrame::subcatch_y |
Subcatchment centroid Y.