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 /****************************************************************************/
16 // Importer for network nodes stored in XML
17 /****************************************************************************/
18 #ifndef NIXMLNodesHandler_h
19 #define NIXMLNodesHandler_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
28 #include <utils/geom/Position.h>
29 
30 
31 // ===========================================================================
32 // class declarations
33 // ===========================================================================
34 class OptionsCont;
35 class GeoConvHelper;
36 class NBNode;
37 class NBNodeCont;
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
53 
54 public:
64  OptionsCont& options);
65 
66 
69 
72  static NBNode* processNodeType(const SUMOSAXAttributes& attrs, NBNode* node, const std::string& nodeID, const Position& position,
73  bool updateEdgeGeometries,
74  NBNodeCont& nc, NBEdgeCont& ec,
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 
161 
162 private:
165 
168 
169 };
170 
171 
172 #endif
173 
174 /****************************************************************************/
175 
NIXMLNodesHandler
Importer for network nodes stored in XML.
Definition: NIXMLNodesHandler.h:52
Parameterised
An upper class for objects with additional parameters.
Definition: Parameterised.h:42
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:60
SUMOSAXHandler
SAX-handler base for SUMO-files.
Definition: SUMOSAXHandler.h:41
NBTrafficLightLogicCont
A container for traffic light definitions and built programs.
Definition: NBTrafficLightLogicCont.h:57
NIXMLNodesHandler::myEdgeCont
NBEdgeCont & myEdgeCont
The node container to add built nodes to.
Definition: NIXMLNodesHandler.h:151
NIXMLNodesHandler::myPosition
Position myPosition
The position of the currently parsed node.
Definition: NIXMLNodesHandler.h:145
SUMOSAXHandler.h
NIXMLNodesHandler::deleteNode
void deleteNode(const SUMOSAXAttributes &attrs)
Definition: NIXMLNodesHandler.cpp:244
NIXMLNodesHandler::myEndElement
void myEndElement(int element)
Called when a closing tag occurs.
Definition: NIXMLNodesHandler.cpp:103
GeoConvHelper
static methods for processing the coordinates conversion for the current net
Definition: GeoConvHelper.h:55
NIXMLNodesHandler::addJoinExclusion
void addJoinExclusion(const SUMOSAXAttributes &attrs)
Definition: NIXMLNodesHandler.cpp:290
NIXMLNodesHandler::operator=
NIXMLNodesHandler & operator=(const NIXMLNodesHandler &s)
invalid assignment operator
NBNodeCont
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:59
NIXMLNodesHandler::myTLLogicCont
NBTrafficLightLogicCont & myTLLogicCont
The traffic lights container to add built tls to.
Definition: NIXMLNodesHandler.h:154
NIXMLNodesHandler::myLastParameterised
Parameterised * myLastParameterised
last item the could receive parameters
Definition: NIXMLNodesHandler.h:160
NIXMLNodesHandler::~NIXMLNodesHandler
~NIXMLNodesHandler()
Destructor.
Definition: NIXMLNodesHandler.cpp:64
NIXMLNodesHandler::myID
std::string myID
The id of the currently parsed node.
Definition: NIXMLNodesHandler.h:142
NIXMLNodesHandler::NIXMLNodesHandler
NIXMLNodesHandler(const NIXMLNodesHandler &s)
invalid copy constructor
NIXMLNodesHandler::addNode
void addNode(const SUMOSAXAttributes &attrs)
Definition: NIXMLNodesHandler.cpp:115
NIXMLNodesHandler::processTrafficLightDefinitions
static void processTrafficLightDefinitions(const SUMOSAXAttributes &attrs, NBNode *currentNode, NBTrafficLightLogicCont &tlc)
Builds the defined traffic light or adds a node to it.
Definition: NIXMLNodesHandler.cpp:301
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
NIXMLNodesHandler::myStartElement
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Definition: NIXMLNodesHandler.cpp:70
NIXMLNodesHandler::addJoinCluster
void addJoinCluster(const SUMOSAXAttributes &attrs)
Definition: NIXMLNodesHandler.cpp:263
NIXMLNodesHandler::NIXMLNodesHandler
NIXMLNodesHandler(NBNodeCont &nc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc, OptionsCont &options)
Constructor.
Definition: NIXMLNodesHandler.cpp:51
NIXMLNodesHandler::myNodeCont
NBNodeCont & myNodeCont
The node container to add built nodes to.
Definition: NIXMLNodesHandler.h:148
Position.h
config.h
NBNode
Represents a single node (junction) during network building.
Definition: NBNode.h:67
SUMOSAXAttributes
Encapsulated SAX-Attributes.
Definition: SUMOSAXAttributes.h:56
NIXMLNodesHandler::processNodeType
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)
Definition: NIXMLNodesHandler.cpp:165
NIXMLNodesHandler::myLocation
GeoConvHelper * myLocation
The coordinate transformation which was used compute the node coordinates.
Definition: NIXMLNodesHandler.h:157
NIXMLNodesHandler::myOptions
OptionsCont & myOptions
A reference to the program's options.
Definition: NIXMLNodesHandler.h:139