Fawkes API
Fawkes Development Version
|
#include <>>
Public Member Functions | |
NavGraphEdge () | |
Constructor for an invalid edge. More... | |
NavGraphEdge (const std::string &from, const std::string &to, std::map< std::string, std::string > properties, bool directed=false) | |
Constructor. More... | |
NavGraphEdge (const std::string &from, const std::string &to, bool directed=false) | |
Constructor. More... | |
const std::string & | from () const |
Get edge originating node name. More... | |
const std::string & | to () const |
Get edge target node name. More... | |
const NavGraphNode & | from_node () const |
Get edge originating node. More... | |
const NavGraphNode & | to_node () const |
Get edge target node. More... | |
fawkes::cart_coord_2d_t | closest_point_on_edge (float x, float y) const |
Get the point on edge closest to a given point. More... | |
float | distance (float x, float y) const |
Get distance of point to closest point on edge. More... | |
bool | intersects (float x1, float y1, float x2, float y2) const |
Check if the edge intersects with another line segment. More... | |
bool | intersection (float x1, float y1, float x2, float y2, fawkes::cart_coord_2d_t &ip) const |
Check if the edge intersects with another line segment. More... | |
void | set_from (const std::string &from) |
Set originating node name. More... | |
void | set_to (const std::string &to) |
Set target node name. More... | |
void | set_directed (bool directed) |
Set directed state. More... | |
const std::map< std::string, std::string > & | properties () const |
Get all properties. More... | |
bool | has_property (const std::string &property) const |
Check if node has specified property. More... | |
void | set_properties (const std::map< std::string, std::string > &properties) |
Overwrite properties with given ones. More... | |
void | set_property (const std::string &property, const std::string &value) |
Set property. More... | |
void | set_property (const std::string &property, const char *value) |
Set property. More... | |
void | set_property (const std::string &property, float value) |
Set property. More... | |
void | set_property (const std::string &property, int value) |
Set property. More... | |
void | set_property (const std::string &property, bool value) |
Set property. More... | |
float | property_as_float (const std::string &prop) const |
Get property converted to float. More... | |
int | property_as_int (const std::string &prop) const |
Get property converted to int. More... | |
bool | property_as_bool (const std::string &prop) const |
Get property converted to bol. More... | |
bool | is_valid () const |
Check if edge is valid. More... | |
bool | is_directed () const |
Check if edge is directed. More... | |
std::string | property (const std::string &prop) const |
Get specified property as string. More... | |
float | property_as_float (const std::string &prop) |
Get property converted to float. More... | |
int | property_as_int (const std::string &prop) |
Get property converted to int. More... | |
bool | property_as_bool (const std::string &prop) |
Get property converted to bol. More... | |
bool | operator== (const NavGraphEdge &e) const |
Check edges for equality. More... | |
bool | operator< (const NavGraphEdge &e) const |
Less than operator based on node from and to names. More... | |
operator bool () const | |
Check of edge is valid. More... | |
void | set_nodes (const NavGraphNode &from_node, const NavGraphNode &to_node) |
Set nodes. More... | |
Topological graph edge.
Definition at line 40 of file navgraph_edge.h.
fawkes::NavGraphEdge::NavGraphEdge | ( | ) |
Constructor for an invalid edge.
Definition at line 52 of file navgraph_edge.cpp.
fawkes::NavGraphEdge::NavGraphEdge | ( | const std::string & | from, |
const std::string & | to, | ||
std::map< std::string, std::string > | properties, | ||
bool | directed = false |
||
) |
Constructor.
from | originating node name |
to | target node name |
properties | properties of the new node |
directed | true if the edge is directed, false for bidirectional edges |
Definition at line 63 of file navgraph_edge.cpp.
References from(), properties(), and to().
fawkes::NavGraphEdge::NavGraphEdge | ( | const std::string & | from, |
const std::string & | to, | ||
bool | directed = false |
||
) |
Constructor.
from | originating node name |
to | target node name |
directed | true if the edge is directed, false for bidirectional edges |
Definition at line 79 of file navgraph_edge.cpp.
cart_coord_2d_t fawkes::NavGraphEdge::closest_point_on_edge | ( | float | x, |
float | y | ||
) | const |
Get the point on edge closest to a given point.
The method determines a line perpendicular to the edge which goes through the given point, i.e. the point must be within the imaginary line segment. Then the point on the edge which crosses with that perpendicular line is returned.
x | X coordinate of point to get point on edge for |
y | Y coordinate of point to get point on edge for |
Exception | thrown if the point is out of the line segment and no line perpendicular to the edge going through the given point can be found. |
Definition at line 222 of file navgraph_edge.cpp.
float fawkes::NavGraphEdge::distance | ( | float | x, |
float | y | ||
) | const |
Get distance of point to closest point on edge.
x | X coordinate of point to get distance to closest point on edge for |
y | Y coordinate of point to get distance to closest point on edge for |
Definition at line 247 of file navgraph_edge.cpp.
|
inline |
Get edge originating node name.
Definition at line 57 of file navgraph_edge.h.
Referenced by fawkes::NavGraph::edge(), NavGraphEdge(), fawkes::NavGraph::remove_edge(), and fawkes::NavGraph::remove_node().
|
inline |
Get edge originating node.
Definition at line 73 of file navgraph_edge.h.
|
inline |
Check if node has specified property.
property | property key |
Definition at line 109 of file navgraph_edge.h.
bool fawkes::NavGraphEdge::intersection | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2, | ||
fawkes::cart_coord_2d_t & | ip | ||
) | const |
Check if the edge intersects with another line segment.
x1 | X coordinate of first point of line segment to test |
y1 | Y coordinate of first point of line segment to test |
x2 | X coordinate of first point of line segment to test |
y2 | Y coordinate of first point of line segment to test |
ip | upon returning true contains intersection point, not modified is return value is false |
Definition at line 269 of file navgraph_edge.cpp.
bool fawkes::NavGraphEdge::intersects | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2 | ||
) | const |
Check if the edge intersects with another line segment.
x1 | X coordinate of first point of line segment to test |
y1 | Y coordinate of first point of line segment to test |
x2 | X coordinate of first point of line segment to test |
y2 | Y coordinate of first point of line segment to test |
Definition at line 298 of file navgraph_edge.cpp.
|
inline |
Check if edge is directed.
Definition at line 165 of file navgraph_edge.h.
Referenced by fawkes::NavGraph::edge(), and fawkes::NavGraph::remove_edge().
|
inline |
Check if edge is valid.
An edge is valid iff it has originating and target node name values.
Definition at line 156 of file navgraph_edge.h.
|
inline |
Check of edge is valid.
An edge is valid if both the originating and the target node name is set to a non-empty string.
Definition at line 230 of file navgraph_edge.h.
|
inline |
Less than operator based on node from and to names.
One edge is less than another if this is true for their respective names.
e | edge to compare with |
Definition at line 220 of file navgraph_edge.h.
|
inline |
Check edges for equality.
Edges are equal if they have the same origination and destination nodes and the same directed status.
e | edge to compare with |
Definition at line 209 of file navgraph_edge.h.
|
inline |
Get all properties.
Definition at line 99 of file navgraph_edge.h.
Referenced by NavGraphEdge().
std::string fawkes::NavGraphEdge::property | ( | const std::string & | prop | ) | const |
Get specified property as string.
prop | property key |
Definition at line 140 of file navgraph_edge.cpp.
|
inline |
Get property converted to bol.
prop | property key |
Definition at line 197 of file navgraph_edge.h.
|
inline |
Get property converted to bol.
prop | property key |
Definition at line 146 of file navgraph_edge.h.
|
inline |
Get property converted to float.
prop | property key |
Definition at line 177 of file navgraph_edge.h.
|
inline |
Get property converted to float.
prop | property key |
Definition at line 126 of file navgraph_edge.h.
|
inline |
Get property converted to int.
prop | property key |
Definition at line 187 of file navgraph_edge.h.
|
inline |
Get property converted to int.
prop | property key |
Definition at line 136 of file navgraph_edge.h.
void fawkes::NavGraphEdge::set_directed | ( | bool | directed | ) |
Set directed state.
directed | true if the edge is directed, false for bidirectional edges |
Definition at line 130 of file navgraph_edge.cpp.
Referenced by fawkes::operator>>().
void fawkes::NavGraphEdge::set_from | ( | const std::string & | from | ) |
Set originating node name.
from | originating node name |
Definition at line 90 of file navgraph_edge.cpp.
Referenced by fawkes::operator>>().
void fawkes::NavGraphEdge::set_nodes | ( | const NavGraphNode & | from_node, |
const NavGraphNode & | to_node | ||
) |
Set nodes.
from_node | originating node |
to_node | target node |
Definition at line 109 of file navgraph_edge.cpp.
void fawkes::NavGraphEdge::set_properties | ( | const std::map< std::string, std::string > & | properties | ) |
Overwrite properties with given ones.
properties | map of properties to set |
Definition at line 154 of file navgraph_edge.cpp.
void fawkes::NavGraphEdge::set_property | ( | const std::string & | property, |
bool | value | ||
) |
Set property.
property | property key |
value | property value |
Definition at line 204 of file navgraph_edge.cpp.
void fawkes::NavGraphEdge::set_property | ( | const std::string & | property, |
const char * | value | ||
) |
Set property.
property | property key |
value | property value |
Definition at line 174 of file navgraph_edge.cpp.
void fawkes::NavGraphEdge::set_property | ( | const std::string & | property, |
const std::string & | value | ||
) |
Set property.
property | property key |
value | property value |
Definition at line 164 of file navgraph_edge.cpp.
Referenced by fawkes::operator>>().
void fawkes::NavGraphEdge::set_property | ( | const std::string & | property, |
float | value | ||
) |
Set property.
property | property key |
value | property value |
Definition at line 184 of file navgraph_edge.cpp.
void fawkes::NavGraphEdge::set_property | ( | const std::string & | property, |
int | value | ||
) |
Set property.
property | property key |
value | property value |
Definition at line 194 of file navgraph_edge.cpp.
void fawkes::NavGraphEdge::set_to | ( | const std::string & | to | ) |
Set target node name.
to | target node name |
Definition at line 99 of file navgraph_edge.cpp.
Referenced by fawkes::operator>>().
|
inline |
Get edge target node name.
Definition at line 65 of file navgraph_edge.h.
Referenced by fawkes::NavGraph::edge(), NavGraphEdge(), fawkes::NavGraph::remove_edge(), and fawkes::NavGraph::remove_node().
|
inline |