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-2018 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,
76 
77 protected:
79 
80 
91  void myStartElement(int element,
92  const SUMOSAXAttributes& attrs);
99  void myEndElement(int element);
101 
102 
103 private:
104  /*
105  * @brief Parses node information
106  * Tries to parse a node. If the node can be parsed, it is stored within
107  * "myNodeCont". Otherwise an error is generated. Then, if given
108  * the tls information is parsed and inserted into "myTLLogicCont".
109  */
110  void addNode(const SUMOSAXAttributes& attrs);
111 
112  /*
113  * @brief Parses node deletion information
114  */
115  void deleteNode(const SUMOSAXAttributes& attrs);
116 
117  /*
118  * @brief Parses a cluster of nodes to be joined
119  */
120  void addJoinCluster(const SUMOSAXAttributes& attrs);
121 
122  /*
123  * @brief Parses a list of nodes to be excluded from joining
124  */
125  void addJoinExclusion(const SUMOSAXAttributes& attrs);
126 
127 
133  static void processTrafficLightDefinitions(const SUMOSAXAttributes& attrs,
134  NBNode* currentNode, NBTrafficLightLogicCont& tlc);
135 
136 
137 private:
140 
142  std::string myID;
143 
146 
149 
152 
155 
158 
159 private:
162 
165 
166 };
167 
168 
169 #endif
170 
171 /****************************************************************************/
172 
GeoConvHelper * myLocation
The coordinate transformation which was used compute the node coordinates.
std::string myID
The id of the currently parsed node.
static NBNode * processNodeType(const SUMOSAXAttributes &attrs, NBNode *node, const std::string &nodeID, const Position &position, bool updateEdgeGeometries, NBNodeCont &nc, NBTrafficLightLogicCont &tlc)
parses node attributes (not related to positioning)
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:53
Encapsulated SAX-Attributes.
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
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:44
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:92
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
NIXMLNodesHandler(NBNodeCont &nc, NBTrafficLightLogicCont &tlc, OptionsCont &options)
Constructor.