Path: blob/main/src/netimport/vissim/tempstructs/NIVissimConnection.h
169684 views
/****************************************************************************/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 NIVissimConnection.h14/// @author Daniel Krajzewicz15/// @author Michael Behrisch16/// @date Sept 200217///18// -------------------19/****************************************************************************/20#pragma once21#include <config.h>2223#include <string>24#include <map>25#include "NIVissimExtendedEdgePoint.h"26#include <utils/geom/Position.h>27#include <utils/geom/AbstractPoly.h>28#include "NIVissimAbstractEdge.h"29#include "NIVissimClosedLanesVector.h"30#include "NIVissimBoundedClusterObject.h"313233// ===========================================================================34// class declarations35// ===========================================================================36class NBEdgeCont;373839// ===========================================================================40// class definitions41// ===========================================================================42class NIVissimConnection43: public NIVissimBoundedClusterObject,44public NIVissimAbstractEdge {45public:46/* enum Direction {47NIVC_DIR_RIGHT,48NIVC_DIR_LEFT,49NIVC_DIR_ALL50}; */5152NIVissimConnection(int id, const std::string& name,53const NIVissimExtendedEdgePoint& from_def,54const NIVissimExtendedEdgePoint& to_def,55const PositionVector& geom,56const std::vector<int>& assignedVehicles,57const NIVissimClosedLanesVector& clv);58virtual ~NIVissimConnection();59void computeBounding();60int getFromEdgeID() const;61int getToEdgeID() const;62double getFromPosition() const;63double getToPosition() const;64Position getFromGeomPosition() const;65Position getToGeomPosition() const;66void setNodeCluster(int nodeid);67const Boundary& getBoundingBox() const;6869int buildEdgeConnections(NBEdgeCont& ec);7071void buildGeom();727374/** @brief Resets lane numbers if all lanes shall be used75*76* Calls "NIVissimExtendedEdgePoint::recheckLanes" for both used77* edges.78*79* @param[in] The built from-edge80* @param[in] The built to-edge81*/82void recheckLanes(const NBEdge* const fromEdge, const NBEdge* const toEdge);8384public:85const std::vector<int>& getFromLanes() const;86const std::vector<int>& getToLanes() const;87888990static bool dictionary(int id, NIVissimConnection* o);91static NIVissimConnection* dictionary(int id);92static std::vector<int> getWithin(const AbstractPoly& poly);93static void buildNodeClusters();94static std::vector<int> getForEdge(int edgeid, bool omitNodeAssigned = true);95static void dict_buildNBEdgeConnections(NBEdgeCont& ec);96static void dict_assignToEdges();97static int getMaxID();9899private:100std::string myName;101NIVissimExtendedEdgePoint myFromDef, myToDef;102std::vector<int> myAssignedVehicles;103NIVissimClosedLanesVector myClosedLanes;104private:105typedef std::map<int, NIVissimConnection*> DictType;106static DictType myDict;107static int myMaxID;108};109110111