Map Matching
pointroad.h
Go to the documentation of this file.
1 #ifndef POINTROAD_H
2 #define POINTROAD_H
3 
4 #include "point.h"
5 #include <iostream>
6 #include <vector>
7 
8 #define NO_ID -1
9 
10 class PointRoad : public Point {
11 public:
12  PointRoad() {} // should never be used !!
13 
20  PointRoad(double x, double y, bool isNode)
21  : Point(x, y)
22  , m_isNode(isNode)
23  , m_id(NO_ID)
24  {
25  }
26 
27  void updateBelongToRoad(long roadId);
28 
29  std::string infos() const { return Point::infos(); }
30  void outputInfos();
31 
32  // accessors
33  int id() const { return m_id; }
34  void setid(int id) { m_id = id; }
35  long isNode() const { return m_isNode; }
36  const std::vector<long>& vectorOfRoadId() const { return m_vectorOfRoadId; }
37 protected:
38  static long counter; // counter used to generate unique m_id (not used for Seattle data)
39  bool m_isNode; // true if this point is an extremity of a road
40  int m_id; // unique id of the point
41  std::vector<long> m_vectorOfRoadId; // list of roads sharing the point
42 };
43 
44 #endif // POINTROAD_H
static long counter
Definition: pointroad.h:38
void outputInfos()
Definition: pointroad.cpp:12
void setid(int id)
Definition: pointroad.h:34
Class Point.
void updateBelongToRoad(long roadId)
Definition: pointroad.cpp:7
#define NO_ID
Definition: pointroad.h:8
double y() const
Definition: point.cpp:52
double x() const
Definition: point.cpp:75
virtual std::string infos() const
Definition: point.cpp:45
const std::vector< long > & vectorOfRoadId() const
Definition: pointroad.h:36
std::vector< long > m_vectorOfRoadId
Definition: pointroad.h:41
bool m_isNode
Definition: pointroad.h:39
long isNode() const
Definition: pointroad.h:35
PointRoad()
Definition: pointroad.h:12
std::string infos() const
Definition: pointroad.h:29
int m_id
Definition: pointroad.h:40
The Point class.
Definition: point.h:20
PointRoad(double x, double y, bool isNode)
Constructor for Road points.
Definition: pointroad.h:20
int id() const
Definition: pointroad.h:33