Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netimport/vissim/tempstructs/NIVissimDisturbance.h
169684 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2002-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 NIVissimDisturbance.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 <string>
26
#include <utils/geom/AbstractPoly.h>
27
#include <netbuild/NBConnection.h>
28
#include "NIVissimExtendedEdgePoint.h"
29
#include "NIVissimBoundedClusterObject.h"
30
#include "NIVissimNodeParticipatingEdgeVector.h"
31
32
33
// ===========================================================================
34
// class declarations
35
// ===========================================================================
36
class NBNode;
37
class NBEdge;
38
class NBDistrictCont;
39
40
class NIVissimDisturbance
41
: public NIVissimBoundedClusterObject {
42
public:
43
NIVissimDisturbance(int id, const std::string& name,
44
const NIVissimExtendedEdgePoint& edge,
45
const NIVissimExtendedEdgePoint& by);
46
virtual ~NIVissimDisturbance();
47
void computeBounding();
48
bool addToNode(NBNode* node, NBDistrictCont& dc,
49
NBNodeCont& nc, NBEdgeCont& ec);
50
int getEdgeID() const {
51
return myEdge.getEdgeID();
52
}
53
int getDisturbanceID() const {
54
return myDisturbance.getEdgeID();
55
}
56
NBConnection getConnection(NBNode* node, int aedgeid);
57
58
public:
59
static bool dictionary(const std::string& name,
60
const NIVissimExtendedEdgePoint& edge,
61
const NIVissimExtendedEdgePoint& by);
62
static bool dictionary(int id, NIVissimDisturbance* o);
63
static NIVissimDisturbance* dictionary(int id);
64
static std::vector<int> getWithin(const AbstractPoly& poly);
65
static void clearDict();
66
static void dict_SetDisturbances();
67
static void reportRefused();
68
69
private:
70
int myID;
71
int myNode;
72
std::string myName;
73
NIVissimExtendedEdgePoint myEdge;
74
NIVissimExtendedEdgePoint myDisturbance;
75
76
typedef std::map<int, NIVissimDisturbance*> DictType;
77
static DictType myDict;
78
static int myRunningID;
79
static int refusedProhibits;
80
};
81
82