PGROUTING  2.5
 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 
28 #ifndef INCLUDE_VRP_NODE_H_
29 #define INCLUDE_VRP_NODE_H_
30 #pragma once
31 
32 #include <string>
33 #include <iosfwd>
34 #include "vrp/base_node.h"
35 #include "cpp_common/xy_vertex.h"
36 #include "vrp/pd_problem.h"
37 
38 namespace pgrouting {
39 namespace vrp {
40 
50 class Node : public Base_node {
51  public:
52  Node() = default;
53  Node(size_t id, int64_t original_id, double _x, double _y);
54 
55 
58  bool operator ==(const Node &rhs) const;
62  double distance(const Base_node *) const;
63 
64  friend std::ostream& operator << (std::ostream &log, const Node &node);
65 
66  private:
67  double distance(const Node &) const;
68  void print(std::ostream& os) const;
69 
70  private:
72 };
73 
74 } // namespace vrp
75 } // namespace pgrouting
76 
77 #endif // INCLUDE_VRP_NODE_H_
friend std::ostream & operator<<(std::ostream &log, const Node &node)
Definition: node.cpp:33
The Node class defines a point in 2D space with an id.
Definition: node.h:50
bool operator==(const Node &rhs) const
Definition: node.cpp:74
The Base_node class defines the operations that can be performed in a 2D node.
Definition: base_node.h:47
Simple_cartasian::Point_2 Point
Definition: xy_vertex.h:48
double distance(const Base_node *) const
Calculates distance between two Node.
Definition: node.cpp:58
pgrouting::Point m_point
Definition: node.h:71
void print(std::ostream &os) const
Definition: node.cpp:39