Eclipse SUMO - Simulation of Urban MObility
NIXMLNodesHandler.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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Importer for network nodes stored in XML
18 /****************************************************************************/
19 #ifndef NIXMLNodesHandler_h
20 #define NIXMLNodesHandler_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
29 #include <utils/geom/Position.h>
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class OptionsCont;
36 class GeoConvHelper;
37 class NBNode;
38 class NBNodeCont;
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
54 
55 public:
65  OptionsCont& options);
66 
67 
70 
73  static NBNode* processNodeType(const SUMOSAXAttributes& attrs, NBNode* node, const std::string& nodeID, const Position& position,
74  bool updateEdgeGeometries,
75  NBNodeCont& nc, NBEdgeCont& ec,
77 
78 protected:
80 
81 
92  void myStartElement(int element,
93  const SUMOSAXAttributes& attrs);
100  void myEndElement(int element);
102 
103 
104 private:
105  /*
106  * @brief Parses node information
107  * Tries to parse a node. If the node can be parsed, it is stored within
108  * "myNodeCont". Otherwise an error is generated. Then, if given
109  * the tls information is parsed and inserted into "myTLLogicCont".
110  */
111  void addNode(const SUMOSAXAttributes& attrs);
112 
113  /*
114  * @brief Parses node deletion information
115  */
116  void deleteNode(const SUMOSAXAttributes& attrs);
117 
118  /*
119  * @brief Parses a cluster of nodes to be joined
120  */
121  void addJoinCluster(const SUMOSAXAttributes& attrs);
122 
123  /*
124  * @brief Parses a list of nodes to be excluded from joining
125  */
126  void addJoinExclusion(const SUMOSAXAttributes& attrs);
127 
128 
134  static void processTrafficLightDefinitions(const SUMOSAXAttributes& attrs,
135  NBNode* currentNode, NBTrafficLightLogicCont& tlc);
136 
137 
138 private:
141 
143  std::string myID;
144 
147 
150 
153 
156 
159 
162 
163 private:
166 
169 
170 };
171 
172 
173 #endif
174 
175 /****************************************************************************/
176 
GeoConvHelper * myLocation
The coordinate transformation which was used compute the node coordinates.
std::string myID
The id of the currently parsed node.
A container for traffic light definitions and built programs.
~NIXMLNodesHandler()
Destructor.
Position myPosition
The position of the currently parsed node.
NBTrafficLightLogicCont & myTLLogicCont
The traffic lights container to add built tls to.
SAX-handler base for SUMO-files.
NBNodeCont & myNodeCont
The node container to add built nodes to.
Importer for network nodes stored in XML.
static methods for processing the coordinates conversion for the current net
Definition: GeoConvHelper.h:56
NIXMLNodesHandler(NBNodeCont &nc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc, OptionsCont &options)
Constructor.
Encapsulated SAX-Attributes.
NBEdgeCont & myEdgeCont
The node container to add built nodes to.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
void deleteNode(const SUMOSAXAttributes &attrs)
Parameterised * myLastParameterised
last item the could receive parameters
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
An upper class for objects with additional parameters.
Definition: Parameterised.h:43
OptionsCont & myOptions
A reference to the program&#39;s options.
static void processTrafficLightDefinitions(const SUMOSAXAttributes &attrs, NBNode *currentNode, NBTrafficLightLogicCont &tlc)
Builds the defined traffic light or adds a node to it.
void addJoinExclusion(const SUMOSAXAttributes &attrs)
void addJoinCluster(const SUMOSAXAttributes &attrs)
A storage for options typed value containers)
Definition: OptionsCont.h:90
Represents a single node (junction) during network building.
Definition: NBNode.h:68
void myEndElement(int element)
Called when a closing tag occurs.
void addNode(const SUMOSAXAttributes &attrs)
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:60
NIXMLNodesHandler & operator=(const NIXMLNodesHandler &s)
invalid assignment operator
static NBNode * processNodeType(const SUMOSAXAttributes &attrs, NBNode *node, const std::string &nodeID, const Position &position, bool updateEdgeGeometries, NBNodeCont &nc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc)
parses node attributes (not related to positioning)