Bridges-C++  3.2.0
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 {
21  class OSMEdge {
22 
23  private:
24  // edge vertices
25  OSMVertex::OSMVertexID src_vertex = 0;
26  OSMVertex::OSMVertexID dest_vertex = 0;
27  // edge length
28  double length = 0.0;
29 
30  public:
38  double dist) : src_vertex(src), dest_vertex(dest),
39  length(dist) {
40  }
41 
46  OSMEdge(const OSMEdge *edge) : src_vertex(edge->src_vertex),
47  dest_vertex(edge->dest_vertex), length(edge->length) {
48  }
49 
56  return src_vertex;
57  }
64  src_vertex = src;
65  }
72  return dest_vertex;
73  }
80  this->dest_vertex = dest;
81  }
87  double getEdgeLength() const {
88  return length;
89  }
95  void setEdgeLength(double l) {
96  this->length = l;
97  }
98  };
99  }
100 } // namespace bridges
101 
102 #endif
OSMVertex::OSMVertexID getSourceVertex() const
Definition: OSMEdge.h:55
void setDestinationVertex(OSMVertex::OSMVertexID dest)
Definition: OSMEdge.h:79
OSMEdge(const OSMEdge *edge)
Definition: OSMEdge.h:46
STL namespace.
void setEdgeLength(double l)
Definition: OSMEdge.h:95
long OSMVertexID
Definition: OSMVertex.h:30
Class that hold Open Street Map edges.
Definition: OSMEdge.h:21
OSMVertex::OSMVertexID getDestinationVertex() const
Definition: OSMEdge.h:71
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:37
void setSourceVertex(OSMVertex::OSMVertexID src)
Definition: OSMEdge.h:63
double getEdgeLength() const
Definition: OSMEdge.h:87