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-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 /****************************************************************************/
19 // Importer for network nodes stored in XML
20 /****************************************************************************/
21 #ifndef NIXMLNodesHandler_h
22 #define NIXMLNodesHandler_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 
35 #include <utils/geom/Position.h>
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class OptionsCont;
42 class GeoConvHelper;
43 class NBNode;
44 class NBNodeCont;
46 
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
60 
61 public:
71  OptionsCont& options);
72 
73 
76 
79  static NBNode* processNodeType(const SUMOSAXAttributes& attrs, NBNode* node, const std::string& nodeID, const Position& position,
80  bool updateEdgeGeometries,
82 
83 protected:
85 
86 
97  void myStartElement(int element,
98  const SUMOSAXAttributes& attrs);
105  void myEndElement(int element);
107 
108 
109 private:
110  /*
111  * @brief Parses node information
112  * Tries to parse a node. If the node can be parsed, it is stored within
113  * "myNodeCont". Otherwise an error is generated. Then, if given
114  * the tls information is parsed and inserted into "myTLLogicCont".
115  */
116  void addNode(const SUMOSAXAttributes& attrs);
117 
118  /*
119  * @brief Parses node deletion information
120  */
121  void deleteNode(const SUMOSAXAttributes& attrs);
122 
123  /*
124  * @brief Parses a cluster of nodes to be joined
125  */
126  void addJoinCluster(const SUMOSAXAttributes& attrs);
127 
128  /*
129  * @brief Parses a list of nodes to be excluded from joining
130  */
131  void addJoinExclusion(const SUMOSAXAttributes& attrs);
132 
133 
139  static void processTrafficLightDefinitions(const SUMOSAXAttributes& attrs,
140  NBNode* currentNode, NBTrafficLightLogicCont& tlc);
141 
142 
143 private:
146 
148  std::string myID;
149 
152 
155 
158 
161 
164 
165 private:
168 
171 
172 };
173 
174 
175 #endif
176 
177 /****************************************************************************/
178 
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:59
Encapsulated SAX-Attributes.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
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:50
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:98
Represents a single node (junction) during network building.
Definition: NBNode.h:74
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:66
NIXMLNodesHandler & operator=(const NIXMLNodesHandler &s)
invalid assignment operator
NIXMLNodesHandler(NBNodeCont &nc, NBTrafficLightLogicCont &tlc, OptionsCont &options)
Constructor.