|
Plugins
|
Represents a network of segments, like, e.g. a low dimensional river network. More...
#include <segment_network.h>
Public Types | |
| typedef Grid::VertexAttachmentAccessor< gauge_attachment_t > | gauge_accessor_t |
| typedef Attachment< gauge_t > | gauge_attachment_t |
| typedef number | gauge_t |
| typedef Grid::VertexAttachmentAccessor< position_attachment_t > | position_accessor_t |
| typedef Attachment< vector_t > | position_attachment_t |
| typedef vector2 | vector_t |
Public Member Functions | |
| size_t | find_vertices (std::vector< Vertex * > &vrtsOut, const vector_t ¢er, number radius) const |
| finds the vertices in the specified sphere to vrtsOut | |
| gauge_accessor_t | gauge_accessor () |
| gauge_attachment_t | gauge_attachment () |
| Grid & | grid () |
| void | load_from_file (const char *name, number maxEdgeLen) |
| loads a segment network from a grid file | |
| position_accessor_t | position_accessor () |
| position_attachment_t | position_attachment () |
| void | save_to_file (const char *name) |
| saves the segment network into a file (mainly for plotting) | |
| void | save_to_file_with_ (gauge_accessor_t &z_acc, const char *name) |
| saves the segment network into a file (mainly for plotting) using the given gauge values | |
| SegmentNetwork () | |
| Constructor: | |
| void | set_gauge_values (SmartPtr< UserData< number, dim > > h) |
| sets the gauge values from a UserData object | |
| GridSubsetHandler & | subset_handler () |
| ~SegmentNetwork () | |
| Destructor: | |
Static Public Attributes | |
| static const int | dim = 3 |
Private Attributes | |
| gauge_accessor_t | m_aaGauge |
| position_accessor_t | m_aaPos |
| gauge_attachment_t | m_aGauge |
| position_attachment_t | m_aPos |
| Grid | m_grid |
| GridSubsetHandler | m_SH |
Represents a network of segments, like, e.g. a low dimensional river network.
The class gives access to the two-dimensional coordinate of each vertex of the river and to the gauge at that vertex.
Note that this implementation should be used with 3d objects only!
| typedef Grid::VertexAttachmentAccessor<gauge_attachment_t> ug::d3f::SegmentNetwork::gauge_accessor_t |
| typedef Grid::VertexAttachmentAccessor<position_attachment_t> ug::d3f::SegmentNetwork::position_accessor_t |
|
inline |
Constructor:
References ug::Grid::AttachmentAccessor< class TElem, class TAttachment >::access(), ug::GridSubsetHandler::assign_grid(), ug::Grid::attach_to_vertices(), m_aaGauge, m_aaPos, m_aGauge, m_aPos, m_grid, and m_SH.
|
inline |
Destructor:
| size_t ug::d3f::SegmentNetwork::find_vertices | ( | std::vector< Vertex * > & | vrtsOut, |
| const vector_t & | center, | ||
| number | radius | ||
| ) | const |
finds the vertices in the specified sphere to vrtsOut
Finds the vertices in the specified sphere to vrtsOut
References lg_end_for, lg_for_each_const, m_aaPos, m_grid, ug::sq(), and ug::VecDistanceSq().
|
inline |
References m_aaGauge.
|
inline |
References m_aGauge.
| void ug::d3f::SegmentNetwork::load_from_file | ( | const char * | name, |
| number | maxEdgeLen | ||
| ) |
loads a segment network from a grid file
The last vertex coordinate is interpreted as gauge at each vertex. Upon load, the network is refined until all edges are shorter than maxEdgeLen. Note that the grid 3d coordinates are converted to the 2d (x,y)-coordinates and the gauge.
| name | file name to read from |
| maxEdgeLen | max. length of the edges to refine to |
References ug::aPosition, ug::Grid::attach_to_edges(), ug::Grid::attach_to_vertices(), ug::Selector::clear(), ug::Grid::detach_from_edges(), ug::Grid::detach_from_vertices(), ug::EdgeLengthSq(), ug::Selector::empty(), lg_end_for, lg_for_each, ug::LoadGridFromFile(), m_aaGauge, m_aaPos, m_grid, m_SH, ug::Refine(), ug::ISelector::select(), ug::sq(), and UG_THROW.
Referenced by ug::d3f::RiverFunctionality3d::Independent().
|
inline |
References m_aaPos.
|
inline |
References m_aPos.
|
inline |
saves the segment network into a file (mainly for plotting)
| name | file name to write to |
References m_aaGauge, and save_to_file_with_().
Referenced by ug::d3f::RiverFunctionality3d::Independent().
| void ug::d3f::SegmentNetwork::save_to_file_with_ | ( | gauge_accessor_t & | z_acc, |
| const char * | name | ||
| ) |
saves the segment network into a file (mainly for plotting) using the given gauge values
Saves the segment grid to a file. The coordinates of the vertices are converted to (x,y,gauge) 3d coordinates.
| z_acc | to save in the z-coordinate |
| name | file name to write to |
References ug::aPosition, ug::Grid::attach_to_vertices(), ug::Grid::detach_from_vertices(), lg_end_for, lg_for_each, m_aaPos, m_grid, and ug::SaveGridToFile().
Referenced by save_to_file().
sets the gauge values from a UserData object
Sets the gauge values from a UserData object to the vertices of the segment grid. Note that the userdata object gets the old gauge value as the z coordinate and the subset id of the vertex.
| h | the data to write to the gauge at the vertices |
References ug::ISubsetHandler::get_subset_index(), lg_end_for, lg_for_each, m_aaGauge, m_aaPos, m_grid, and m_SH.
Referenced by ug::d3f::RiverFunctionality3d::Independent().
|
inline |
References m_SH.
|
static |
|
private |
Referenced by gauge_accessor(), load_from_file(), save_to_file(), SegmentNetwork(), and set_gauge_values().
|
private |
Referenced by find_vertices(), load_from_file(), position_accessor(), save_to_file_with_(), SegmentNetwork(), and set_gauge_values().
|
private |
Referenced by gauge_attachment(), and SegmentNetwork().
|
private |
Referenced by position_attachment(), and SegmentNetwork().
|
private |
Referenced by find_vertices(), grid(), load_from_file(), save_to_file_with_(), SegmentNetwork(), and set_gauge_values().
|
private |
Referenced by load_from_file(), SegmentNetwork(), set_gauge_values(), and subset_handler().