SUMO - Simulation of Urban MObility
RONode.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // Base class for nodes used by the router
19 /****************************************************************************/
20 #ifndef RONode_h
21 #define RONode_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <string>
34 #include <vector>
35 #include <utils/common/Named.h>
36 #include <utils/geom/Position.h>
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class ROEdge;
42 
43 typedef std::vector<const ROEdge*> ConstROEdgeVector;
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
52 class RONode : public Named {
53 public:
57  RONode(const std::string& id);
58 
59 
61  ~RONode();
62 
63 
67  void setPosition(const Position& p);
68 
69 
73  const Position& getPosition() const {
74  return myPosition;
75  }
76 
77 
78  inline const ConstROEdgeVector& getIncoming() const {
79  return myIncoming;
80  }
81 
82  inline const ConstROEdgeVector& getOutgoing() const {
83  return myOutgoing;
84  }
85 
86  void addIncoming(ROEdge* edge) {
87  myIncoming.push_back(edge);
88  }
89 
90  void addOutgoing(ROEdge* edge) {
91  myOutgoing.push_back(edge);
92  }
93 
94 private:
97 
102 
103 
104 private:
106  RONode(const RONode& src);
107 
109  RONode& operator=(const RONode& src);
110 
111 };
112 
113 
114 #endif
115 
116 /****************************************************************************/
117 
void addOutgoing(ROEdge *edge)
Definition: RONode.h:90
const Position & getPosition() const
Returns the position of the node.
Definition: RONode.h:73
RONode(const std::string &id)
Constructor.
Definition: RONode.cpp:38
RONode & operator=(const RONode &src)
Invalidated assignment operator.
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:62
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
ConstROEdgeVector myIncoming
incoming edges
Definition: RONode.h:99
void setPosition(const Position &p)
Sets the position of the node.
Definition: RONode.cpp:46
const ConstROEdgeVector & getIncoming() const
Definition: RONode.h:78
void addIncoming(ROEdge *edge)
Definition: RONode.h:86
A basic edge for routing applications.
Definition: ROEdge.h:77
Base class for objects which have an id.
Definition: Named.h:45
const ConstROEdgeVector & getOutgoing() const
Definition: RONode.h:82
~RONode()
Destructor.
Definition: RONode.cpp:42
ConstROEdgeVector myOutgoing
outgoing edges
Definition: RONode.h:101
Base class for nodes used by the router.
Definition: RONode.h:52
Position myPosition
This node&#39;s position.
Definition: RONode.h:96
std::vector< const ROEdge * > ConstROEdgeVector
Definition: RONode.h:41