Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.h
169684 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 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
/****************************************************************************/
14
/// @file NIVissimAbstractEdge.h
15
/// @author Daniel Krajzewicz
16
/// @author Michael Behrisch
17
/// @date Sept 2002
18
///
19
// -------------------
20
/****************************************************************************/
21
#pragma once
22
#include <config.h>
23
24
#include <map>
25
#include <utils/geom/PositionVector.h>
26
27
28
// ===========================================================================
29
// class definitions
30
// ===========================================================================
31
/**
32
*
33
*/
34
class NIVissimAbstractEdge {
35
public:
36
NIVissimAbstractEdge(int id, const PositionVector& geom);
37
virtual ~NIVissimAbstractEdge();
38
Position getGeomPosition(double pos) const;
39
void splitAssigning();
40
bool crossesEdge(NIVissimAbstractEdge* c) const;
41
Position crossesEdgeAtPoint(NIVissimAbstractEdge* c) const;
42
bool overlapsWith(const AbstractPoly& p, double offset = 0.0) const;
43
virtual void setNodeCluster(int nodeid) = 0;
44
bool hasNodeCluster() const;
45
46
virtual void buildGeom() = 0;
47
int getID() const;
48
const PositionVector& getGeometry() const;
49
50
void addDisturbance(int disturbance);
51
52
const std::vector<int>& getDisturbances() const;
53
54
public:
55
static bool dictionary(int id, NIVissimAbstractEdge* e);
56
static NIVissimAbstractEdge* dictionary(int id);
57
static void splitAndAssignToNodes();
58
static std::vector<int> getWithin(const AbstractPoly& p, double offset = 0.0);
59
static void clearDict();
60
61
62
protected:
63
int myID;
64
PositionVector myGeom;
65
std::vector<int> myDisturbances;
66
int myNode;
67
68
private:
69
typedef std::map<int, NIVissimAbstractEdge*> DictType;
70
static DictType myDict;
71
};
72
73