/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file NLNetShapeHandler.h14/// @author Jakob Erdmann15/// @date Sept 202216///17// The XML-Handler for loading secondary network shapes18/****************************************************************************/19#pragma once20#include <config.h>2122#include <utils/xml/SUMOSAXHandler.h>2324// ===========================================================================25// class declarations26// ===========================================================================272829// ===========================================================================30// class definitions31// ===========================================================================323334/**35* @class NLNetShapeHandler36* @brief The XML-Handler for network loading37*38* The SAX2-handler responsible for parsing networks and routes to load.39* This is an extension of the MSRouteHandler as routes and vehicles may also40* be loaded from network descriptions.41*/42class NLNetShapeHandler : public SUMOSAXHandler {4344public:45/** @brief Constructor46*47* @param[in] file Name of the parsed file48* @param[in, out] net The network to fill49*/50NLNetShapeHandler(const std::string& file, MSNet& net);515253/// @brief Destructor54virtual ~NLNetShapeHandler();5556/// @brief resolve mismatch between internal lane ids of both networks57void sortInternalShapes();5859protected:60/// @name inherited from GenericSAXHandler61//@{6263/** @brief Called on the opening of a tag;64*65* @param[in] element ID of the currently opened element66* @param[in] attrs Attributes within the currently opened element67* @exception ProcessError If something fails68* @see GenericSAXHandler::myStartElement69* @todo Refactor/describe70*/71virtual void myStartElement(int element,72const SUMOSAXAttributes& attrs);7374//@}757677private:7879/// adds a secondary lane shape80void addLane(const SUMOSAXAttributes& attrs);8182/// adds a junction position83void addJunction(const SUMOSAXAttributes& attrs);8485/// records connection topology for later resorting86void addConnection(const SUMOSAXAttributes& attrs);8788protected:89/// @brief The net to fill (preinitialised)90MSNet& myNet;9192/// @brief mapping between primary internal lane and corresponding secondary internal lane93std::map<const MSJunction*, std::map<MSLane*, MSLane*> > myShuffledJunctions;9495/// @brief lanes of the primary network that should receive a secondary shape96std::set<const MSEdge*> myPrimaryEdges;9798private:99/** invalid copy constructor */100NLNetShapeHandler(const NLNetShapeHandler& s);101102/** invalid assignment operator */103NLNetShapeHandler& operator=(const NLNetShapeHandler& s);104105};106107108