|
| | Edge (Id id, std::pair< Id, Id > nodePair, geometry::PolyLine geometry={}) |
| | Construct a new Edge object.
|
|
| Edge (Edge &&)=default |
|
| Edge (const Edge &)=delete |
| void | setGeometry (geometry::PolyLine geometry) |
| | Set the edge's geometry.
|
| void | setAttribute (std::string const &name, std::variant< std::monostate, bool, std::int64_t, double, std::string > const &value) |
| | Set an attribute for the edge.
|
| auto | id () const |
| | Get the edge's id.
|
| auto | source () const |
| | Get the edge's source node id.
|
| auto | target () const |
| | Get the edge's target node id.
|
| auto const & | nodePair () const |
| | Get the edge's node pair.
|
| auto const & | geometry () const |
| | Get the edge's geometry.
|
| auto | angle () const |
| | Get the edge's angle, in radians, between the source and target nodes.
|
| auto const & | attributes () const |
| | Get the edge's attributes.
|
| template<typename T> |
| std::optional< T > | getAttribute (std::string const &name) const |
| | Get an attribute of the edge by name.
|
| virtual bool | isFull () const =0 |
| virtual bool | isActive () const |
|
double | deltaAngle (double const previousEdgeAngle) const |
|
|
geometry::PolyLine | m_geometry |
|
Id | m_id |
|
std::pair< Id, Id > | m_nodePair |
|
double | m_angle |
|
std::unordered_map< std::string, std::variant< std::monostate, bool, std::int64_t, double, std::string > > | m_attributes |
◆ Edge()
Construct a new Edge object.
- Parameters
-
| id | The edge's id |
| nodePair | The edge's node pair (u, v) with the edge u -> v |
| geometry | The edge's geometry, a vector of pairs of doubles representing the coordinates of the edge's geometry. Default is an empty vector. |
◆ angle()
| auto dsf::Edge::angle |
( |
| ) |
const |
|
inline |
Get the edge's angle, in radians, between the source and target nodes.
- Returns
- double The edge's angle, in radians
◆ attributes()
| auto const & dsf::Edge::attributes |
( |
| ) |
const |
|
inline |
Get the edge's attributes.
- Returns
- std::unordered_map<std::string, std::variant<std::monostate, bool, std::int64_t, double, std::string>> The edge's attributes, where the key is the attribute's name and the value is the attribute's value
◆ geometry()
| auto const & dsf::Edge::geometry |
( |
| ) |
const |
|
inline |
Get the edge's geometry.
- Returns
- dsf::geometry::PolyLine The edge's geometry, a vector of pairs of doubles representing the coordinates of the edge's geometry
◆ getAttribute()
template<typename T>
| std::optional< T > dsf::Edge::getAttribute |
( |
std::string const & | name | ) |
const |
|
inline |
Get an attribute of the edge by name.
- Template Parameters
-
| T | The expected type of the attribute's value |
- Parameters
-
- Returns
- std::optional<T> The attribute's value if it exists and can be cast to the expected type, std::nullopt otherwise
◆ id()
| auto dsf::Edge::id |
( |
| ) |
const |
|
inline |
Get the edge's id.
- Returns
- Id The edge's id
◆ isActive()
| virtual bool dsf::Edge::isActive |
( |
| ) |
const |
|
inlinevirtual |
◆ isFull()
| virtual bool dsf::Edge::isFull |
( |
| ) |
const |
|
pure virtual |
◆ nodePair()
| auto const & dsf::Edge::nodePair |
( |
| ) |
const |
|
inline |
Get the edge's node pair.
- Returns
- std::pair<Id, Id> The edge's node pair, where the first element is the source node id and the second element is the target node id. The pair is (u, v) with the edge u -> v.
◆ setAttribute()
| void dsf::Edge::setAttribute |
( |
std::string const & | name, |
|
|
std::variant< std::monostate, bool, std::int64_t, double, std::string > const & | value ) |
Set an attribute for the edge.
- Parameters
-
| name | The attribute's name |
| value | The attribute's value |
◆ setGeometry()
Set the edge's geometry.
- Parameters
-
◆ source()
| auto dsf::Edge::source |
( |
| ) |
const |
|
inline |
Get the edge's source node id.
- Returns
- Id The edge's source node id
◆ target()
| auto dsf::Edge::target |
( |
| ) |
const |
|
inline |
Get the edge's target node id.
- Returns
- Id The edge's target node id
The documentation for this class was generated from the following files:
- src/dsf/base/Edge.hpp
- src/dsf/base/Edge.cpp