SUMO - Simulation of Urban MObility
RONode.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // Base class for nodes used by the router
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef RONode_h
22 #define RONode_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <vector>
36 #include <utils/common/Named.h>
37 #include <utils/geom/Position.h>
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class ROEdge;
43 
44 typedef std::vector<const ROEdge*> ConstROEdgeVector;
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
53 class RONode : public Named {
54 public:
58  RONode(const std::string& id);
59 
60 
62  ~RONode();
63 
64 
68  void setPosition(const Position& p);
69 
70 
74  const Position& getPosition() const {
75  return myPosition;
76  }
77 
78 
79  inline const ConstROEdgeVector& getIncoming() const {
80  return myIncoming;
81  }
82 
83  inline const ConstROEdgeVector& getOutgoing() const {
84  return myOutgoing;
85  }
86 
87  void addIncoming(ROEdge* edge) {
88  myIncoming.push_back(edge);
89  }
90 
91  void addOutgoing(ROEdge* edge) {
92  myOutgoing.push_back(edge);
93  }
94 
95 private:
98 
103 
104 
105 private:
107  RONode(const RONode& src);
108 
110  RONode& operator=(const RONode& src);
111 
112 };
113 
114 
115 #endif
116 
117 /****************************************************************************/
118 
void addOutgoing(ROEdge *edge)
Definition: RONode.h:91
const Position & getPosition() const
Returns the position of the node.
Definition: RONode.h:74
RONode(const std::string &id)
Constructor.
Definition: RONode.cpp:39
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:46
ConstROEdgeVector myIncoming
incoming edges
Definition: RONode.h:100
void setPosition(const Position &p)
Sets the position of the node.
Definition: RONode.cpp:47
const ConstROEdgeVector & getIncoming() const
Definition: RONode.h:79
void addIncoming(ROEdge *edge)
Definition: RONode.h:87
A basic edge for routing applications.
Definition: ROEdge.h:77
Base class for objects which have an id.
Definition: Named.h:46
const ConstROEdgeVector & getOutgoing() const
Definition: RONode.h:83
~RONode()
Destructor.
Definition: RONode.cpp:43
ConstROEdgeVector myOutgoing
outgoing edges
Definition: RONode.h:102
Base class for nodes used by the router.
Definition: RONode.h:53
Position myPosition
This node&#39;s position.
Definition: RONode.h:97
std::vector< const ROEdge * > ConstROEdgeVector
Definition: RONode.h:42