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  GeoConvHelper* from_srs = nullptr);
75 
76 protected:
78 
79 
90  void myStartElement(int element,
91  const SUMOSAXAttributes& attrs);
98  void myEndElement(int element);
100 
101 
102 private:
103  /*
104  * @brief Parses node information
105  * Tries to parse a node. If the node can be parsed, it is stored within
106  * "myNodeCont". Otherwise an error is generated. Then, if given
107  * the tls information is parsed and inserted into "myTLLogicCont".
108  */
109  void addNode(const SUMOSAXAttributes& attrs);
110 
111  /*
112  * @brief Parses node deletion information
113  */
114  void deleteNode(const SUMOSAXAttributes& attrs);
115 
116  /*
117  * @brief Parses a cluster of nodes to be joined
118  */
119  void addJoinCluster(const SUMOSAXAttributes& attrs);
120 
121  /*
122  * @brief Parses a list of nodes to be excluded from joining
123  */
124  void addJoinExclusion(const SUMOSAXAttributes& attrs);
125 
126 
132  static void processTrafficLightDefinitions(const SUMOSAXAttributes& attrs,
133  NBNode* currentNode, NBTrafficLightLogicCont& tlc);
134 
135 
136 private:
139 
141  std::string myID;
142 
145 
148 
151 
154 
157 
160 
161 private:
164 
167 
168 };
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 NBNode * processNodeType(const SUMOSAXAttributes &attrs, NBNode *node, const std::string &nodeID, const Position &position, bool updateEdgeGeometries, NBNodeCont &nc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc, GeoConvHelper *from_srs=nullptr)
parses node attributes (not related to positioning)
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.
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.