Bridges-C++  3.4.1
Bridges(C++API)
OSMEdge.h
Go to the documentation of this file.
1 #ifndef OSM_EDGE_H
2 
3 #define OSM_EDGE_H
4 
5 #include <string>
6 #include "./data_src/OSMVertex.h"
7 
8 
9 using namespace std;
10 
11 namespace bridges {
12  namespace dataset {
28  class OSMEdge {
29 
30  private:
31  // edge vertices
32  OSMVertex::OSMVertexID src_vertex = 0;
33  OSMVertex::OSMVertexID dest_vertex = 0;
34  // edge length
35  double length = 0.0;
36 
37  public:
45  double dist) : src_vertex(src), dest_vertex(dest),
46  length(dist) {
47  }
48 
53  OSMEdge(const OSMEdge *edge) : src_vertex(edge->src_vertex),
54  dest_vertex(edge->dest_vertex), length(edge->length) {
55  }
56 
63  return src_vertex;
64  }
71  src_vertex = src;
72  }
79  return dest_vertex;
80  }
87  this->dest_vertex = dest;
88  }
94  double getEdgeLength() const {
95  return length;
96  }
102  void setEdgeLength(double l) {
103  this->length = l;
104  }
105  };
106  }
107 } // namespace bridges
108 
109 #endif
OSMVertex::OSMVertexID getSourceVertex() const
Definition: OSMEdge.h:62
void setDestinationVertex(OSMVertex::OSMVertexID dest)
Definition: OSMEdge.h:86
OSMEdge(const OSMEdge *edge)
Definition: OSMEdge.h:53
void setEdgeLength(double l)
Definition: OSMEdge.h:102
long OSMVertexID
Definition: OSMVertex.h:36
Class that hold Open Street Map edges.
Definition: OSMEdge.h:28
OSMVertex::OSMVertexID getDestinationVertex() const
Definition: OSMEdge.h:78
these methods convert byte arrays in to base64 codes and are used in BRIDGES to represent the color a...
Definition: alltypes.h:4
OSMEdge(OSMVertex::OSMVertexID src, OSMVertex::OSMVertexID dest, double dist)
Definition: OSMEdge.h:44
void setSourceVertex(OSMVertex::OSMVertexID src)
Definition: OSMEdge.h:70
double getEdgeLength() const
Definition: OSMEdge.h:94