PGROUTING  2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
node.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 
3 FILE: node.h
4 
5 Copyright (c) 2015 pgRouting developers
6 Mail: project@pgrouting.org
7 
8 ------
9 
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14 
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 
24  ********************************************************************PGR-GNU*/
25 
26 #pragma once
27 
28 #include <string>
29 // #include "./point.h"
30 #include "../../common/src/xy_vertex.h"
31 
32 namespace pgrouting {
33 namespace vrp {
34 
45 // class Node : public Point {
46 class Node {
47  public:
49 
51  inline size_t id() const {return m_id;}
52  inline int64_t original_id() const {return m_original_id;}
53 
55 
56  Node(size_t id, int64_t original_id, double _x, double _y);
57 
58 
60 
62  bool isSamePos(const Node &other) const;
63 #if 0
64  double travel_time_to(const Node &node2) const;
65 #endif
66  friend std::ostream& operator << (std::ostream &log, const Node &node);
67  bool operator ==(const Node &rhs) const;
68 
69  double distance(const Node &other) const;
70  double comparable_distance(const Node &other) const;
71 
72 
73  private:
75  size_t m_id;
76  int64_t m_original_id; // /< user supplied node number
77 };
78 
79 } // namespace vrp
80 } // namespace pgrouting
friend std::ostream & operator<<(std::ostream &log, const Node &node)
Definition: node.cpp:41
Node(size_t id, int64_t original_id, double _x, double _y)
Definition: node.cpp:63
double comparable_distance(const Node &other) const
Definition: node.cpp:56
size_t m_id
internal node number
Definition: node.h:75
The Node class defines a point in 2D space with an id.
Definition: node.h:46
bool operator==(const Node &rhs) const
Definition: node.cpp:70
int64_t original_id() const
Definition: node.h:52
double distance(const Node &other) const
Definition: node.cpp:49
int64_t m_original_id
Definition: node.h:76
Simple_cartasian::Point_2 Point
Definition: xy_vertex.h:46
PGDLLEXPORT Datum vrp(PG_FUNCTION_ARGS)
Definition: VRP.c:732
pgrouting::Point m_point
Definition: node.h:74
bool isSamePos(const Node &other) const
@ {
Definition: node.cpp:31
size_t id() const
@ {
Definition: node.h:51