HighMap library (C++)
|
Represents a line segment in 2D space. More...
#include <edge.hpp>
Public Member Functions | |
Edge (Point p1, Point p2, float w) | |
Constructs an Edge object with specified start and end points and a weight. | |
Edge (Point p1, Point p2) | |
Constructs an Edge object with specified start and end points and a default weight of 0. | |
float | length () |
Computes the length of the edge. | |
Public Attributes | |
Point | p1 |
The start point of the edge. | |
Point | p2 |
The end point of the edge. | |
float | w |
A weight associated with the edge. | |
Represents a line segment in 2D space.
The Edge
class defines a line segment using two Point
objects to represent the start and end of the segment. Additionally, it has a weight associated with the edge, and provides functionality to compute the length of the segment.
Constructs an Edge
object with specified start and end points and a weight.
p1 | The start point of the edge. |
p2 | The end point of the edge. |
w | The weight associated with the edge. |
Constructs an Edge
object with specified start and end points and a default weight of 0.
p1 | The start point of the edge. |
p2 | The end point of the edge. |
|
inline |
Computes the length of the edge.
This function calculates the distance between the start and end points of the edge.
Point hmap::Edge::p1 |
The start point of the edge.
Point hmap::Edge::p2 |
The end point of the edge.
float hmap::Edge::w |
A weight associated with the edge.