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.dev/sumo
3 // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // Importer for network nodes stored in XML
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
26 #include <utils/geom/Position.h>
27 
28 
29 // ===========================================================================
30 // class declarations
31 // ===========================================================================
32 class OptionsCont;
33 class GeoConvHelper;
34 class NBNode;
35 class NBNodeCont;
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
51 
52 public:
62  OptionsCont& options);
63 
64 
67 
70  static NBNode* processNodeType(const SUMOSAXAttributes& attrs, NBNode* node, const std::string& nodeID, const Position& position,
71  bool updateEdgeGeometries,
72  NBNodeCont& nc, NBEdgeCont& ec,
74 
75 protected:
77 
78 
89  void myStartElement(int element,
90  const SUMOSAXAttributes& attrs);
97  void myEndElement(int element);
99 
100 
101 private:
102  /*
103  * @brief Parses node information
104  * Tries to parse a node. If the node can be parsed, it is stored within
105  * "myNodeCont". Otherwise an error is generated. Then, if given
106  * the tls information is parsed and inserted into "myTLLogicCont".
107  */
108  void addNode(const SUMOSAXAttributes& attrs);
109 
110  /*
111  * @brief Parses node deletion information
112  */
113  void deleteNode(const SUMOSAXAttributes& attrs);
114 
115  /*
116  * @brief Parses a cluster of nodes to be joined
117  */
118  void addJoinCluster(const SUMOSAXAttributes& attrs);
119 
120  /*
121  * @brief Parses a list of nodes to be excluded from joining
122  */
123  void addJoinExclusion(const SUMOSAXAttributes& attrs);
124 
125 
131  static void processTrafficLightDefinitions(const SUMOSAXAttributes& attrs,
132  NBNode* currentNode, NBTrafficLightLogicCont& tlc);
133 
134 
135 private:
138 
140  std::string myID;
141 
144 
147 
150 
153 
156 
159 
160 private:
163 
166 
167 };
static methods for processing the coordinates conversion for the current net
Definition: GeoConvHelper.h:53
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:59
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:57
Represents a single node (junction) during network building.
Definition: NBNode.h:66
A container for traffic light definitions and built programs.
Importer for network nodes stored in XML.
NIXMLNodesHandler & operator=(const NIXMLNodesHandler &s)
invalid assignment operator
~NIXMLNodesHandler()
Destructor.
std::string myID
The id of the currently parsed node.
void addJoinCluster(const SUMOSAXAttributes &attrs)
NIXMLNodesHandler(const NIXMLNodesHandler &s)
invalid copy constructor
GeoConvHelper * myLocation
The coordinate transformation which was used compute the node coordinates.
Position myPosition
The position of the currently parsed node.
NBNodeCont & myNodeCont
The node container to add built nodes to.
void deleteNode(const SUMOSAXAttributes &attrs)
NBTrafficLightLogicCont & myTLLogicCont
The traffic lights container to add built tls to.
static void processTrafficLightDefinitions(const SUMOSAXAttributes &attrs, NBNode *currentNode, NBTrafficLightLogicCont &tlc)
Builds the defined traffic light or adds a node to it.
NBEdgeCont & myEdgeCont
The node container to add built nodes to.
Parameterised * myLastParameterised
last item the could receive parameters
void myEndElement(int element)
Called when a closing tag occurs.
OptionsCont & myOptions
A reference to the program's options.
void addNode(const SUMOSAXAttributes &attrs)
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
NIXMLNodesHandler(NBNodeCont &nc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc, OptionsCont &options)
Constructor.
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)
void addJoinExclusion(const SUMOSAXAttributes &attrs)
A storage for options typed value containers)
Definition: OptionsCont.h:89
An upper class for objects with additional parameters.
Definition: Parameterised.h:41
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
Encapsulated SAX-Attributes.
SAX-handler base for SUMO-files.