27#ifndef OPENSWMM_ENGINE_SPATIAL_FRAME_HPP
28#define OPENSWMM_ENGINE_SPATIAL_FRAME_HPP
106 bool is_geographic =
false;
211 if (point) coupling_points.push_back(point);
218 return !coupling_points.empty();
225 node_x.shrink_to_fit();
226 node_y.shrink_to_fit();
227 link_x.shrink_to_fit();
228 link_y.shrink_to_fit();
229 subcatch_x.shrink_to_fit();
230 subcatch_y.shrink_to_fit();
231 gage_x.shrink_to_fit();
232 gage_y.shrink_to_fit();
234 link_vertices_x.shrink_to_fit();
235 for (
auto& v : link_vertices_x) v.shrink_to_fit();
236 link_vertices_y.shrink_to_fit();
237 for (
auto& v : link_vertices_y) v.shrink_to_fit();
239 subcatch_polygon_x.shrink_to_fit();
240 for (
auto& v : subcatch_polygon_x) v.shrink_to_fit();
241 subcatch_polygon_y.shrink_to_fit();
242 for (
auto& v : subcatch_polygon_y) v.shrink_to_fit();
Abstract coupling point between a 1D SWMM object and a 2D mesh cell.
Definition SpatialFrame.hpp:49
virtual ~ICouplingPoint()=default
virtual void exchange_to_2d(double value)=0
Exchange 1D state to the 2D component at this point.
virtual int object_index() const noexcept=0
Index of the 1D SWMM object (node, link, or subcatch index).
virtual double receive_from_2d() const =0
Receive 2D state from the 2D component at this point.
virtual const char * object_type() const noexcept=0
Type: "NODE", "LINK", or "SUBCATCH".
Definition NodeCoupling.cpp:15
Spatial frame containing CRS and georeferenced coordinates.
Definition SpatialFrame.hpp:82
std::vector< double > link_x
Link centroid X coordinates.
Definition SpatialFrame.hpp:145
void shrink_to_fit()
Release excess vector capacity accumulated during parsing.
Definition SpatialFrame.hpp:224
void register_coupling_point(ICouplingPoint *point)
Register a 2D coupling point.
Definition SpatialFrame.hpp:210
std::vector< double > subcatch_x
Subcatchment centroid X.
Definition SpatialFrame.hpp:155
std::vector< double > node_x
Node X coordinates (easting or longitude).
Definition SpatialFrame.hpp:135
std::vector< double > gage_x
Gage X coordinates.
Definition SpatialFrame.hpp:185
std::vector< double > gage_y
Gage Y coordinates.
Definition SpatialFrame.hpp:188
std::string crs
CRS specification string.
Definition SpatialFrame.hpp:100
std::vector< std::vector< double > > subcatch_polygon_y
Per-subcatchment polygon Y vertices.
Definition SpatialFrame.hpp:178
bool has_2d_coupling() const noexcept
Returns true if any 2D coupling points are registered.
Definition SpatialFrame.hpp:217
std::vector< std::vector< double > > link_vertices_x
Per-link X vertices. link_vertices_x[link_idx] is a vector of X coords.
Definition SpatialFrame.hpp:165
std::vector< double > link_y
Link centroid Y coordinates.
Definition SpatialFrame.hpp:148
std::vector< std::vector< double > > subcatch_polygon_x
Per-subcatchment polygon X vertices.
Definition SpatialFrame.hpp:175
std::vector< double > node_y
Node Y coordinates (northing or latitude).
Definition SpatialFrame.hpp:138
std::string map_units
Map units string from [MAP] UNITS keyword.
Definition SpatialFrame.hpp:128
std::vector< double > subcatch_y
Subcatchment centroid Y.
Definition SpatialFrame.hpp:158
std::vector< std::vector< double > > link_vertices_y
Per-link Y vertices. link_vertices_y[link_idx] is a vector of Y coords.
Definition SpatialFrame.hpp:168
std::vector< ICouplingPoint * > coupling_points
Registered 2D coupling points.
Definition SpatialFrame.hpp:204