SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
NIVissimNodeDef.cpp
Go to the documentation of this file.
1
/****************************************************************************/
8
// -------------------
9
/****************************************************************************/
10
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11
// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors
12
/****************************************************************************/
13
//
14
// This file is part of SUMO.
15
// SUMO is free software: you can redistribute it and/or modify
16
// it under the terms of the GNU General Public License as published by
17
// the Free Software Foundation, either version 3 of the License, or
18
// (at your option) any later version.
19
//
20
/****************************************************************************/
21
22
23
// ===========================================================================
24
// included modules
25
// ===========================================================================
26
#ifdef _MSC_VER
27
#include <
windows_config.h
>
28
#else
29
#include <
config.h
>
30
#endif
31
32
33
#include <iostream>
// !!! debug
34
#include <cassert>
35
#include "
NIVissimNodeDef.h
"
36
#include "
NIVissimConnection.h
"
37
#include "
NIVissimDisturbance.h
"
38
#include "
NIVissimTL.h
"
39
40
#ifdef CHECK_MEMORY_LEAKS
41
#include <
foreign/nvwa/debug_new.h
>
42
#endif // CHECK_MEMORY_LEAKS
43
44
45
// ===========================================================================
46
// static member variables
47
// ===========================================================================
48
NIVissimNodeDef::DictType
NIVissimNodeDef::myDict
;
49
int
NIVissimNodeDef::myMaxID
= 0;
50
51
52
// ===========================================================================
53
// method definitions
54
// ===========================================================================
55
NIVissimNodeDef::NIVissimNodeDef
(
int
id
,
const
std::string& name)
56
: myID(id), myName(name) {}
57
58
59
NIVissimNodeDef::~NIVissimNodeDef
() {}
60
61
62
bool
63
NIVissimNodeDef::dictionary
(
int
id
,
NIVissimNodeDef
* o) {
64
DictType::iterator i =
myDict
.find(
id
);
65
if
(i ==
myDict
.end()) {
66
myDict
[id] = o;
67
myMaxID
=
myMaxID
>
id
68
?
myMaxID
69
: id;
70
// o->computeBounding();
71
return
true
;
72
}
73
return
false
;
74
}
75
76
77
NIVissimNodeDef
*
78
NIVissimNodeDef::dictionary
(
int
id
) {
79
DictType::iterator i =
myDict
.find(
id
);
80
if
(i ==
myDict
.end()) {
81
return
0;
82
}
83
return
(*i).second;
84
}
85
86
/*
87
void
88
NIVissimNodeDef::buildNodeClusters()
89
{
90
for(DictType::iterator i=myDict.begin(); i!=myDict.end(); i++) {
91
int cluster = (*i).second->buildNodeCluster();
92
}
93
}
94
*/
95
96
97
/*
98
99
std::vector<int>
100
NIVissimNodeDef::getWithin(const AbstractPoly &p, SUMOReal off)
101
{
102
std::vector<int> ret;
103
for(DictType::iterator i=myDict.begin(); i!=myDict.end(); i++) {
104
NIVissimNodeDef *d = (*i).second;
105
if(d->partialWithin(p, off)) {
106
ret.push_back((*i).first);
107
}
108
}
109
return ret;
110
}
111
112
bool
113
NIVissimNodeDef::partialWithin(const AbstractPoly &p, SUMOReal off) const
114
{
115
assert(myBoundary!=0&&myBoundary->xmax()>=myBoundary->xmin());
116
return myBoundary->partialWithin(p, off);
117
}
118
*/
119
120
void
121
NIVissimNodeDef::dict_assignConnectionsToNodes
() {
122
for
(DictType::iterator i =
myDict
.begin(); i !=
myDict
.end(); i++) {
123
(*i).second->searchAndSetConnections();
124
}
125
}
126
127
128
size_t
129
NIVissimNodeDef::dictSize
() {
130
return
myDict
.size();
131
}
132
133
134
135
void
136
NIVissimNodeDef::clearDict
() {
137
for
(DictType::iterator i =
myDict
.begin(); i !=
myDict
.end(); i++) {
138
delete
(*i).second;
139
}
140
myDict
.clear();
141
}
142
143
144
int
145
NIVissimNodeDef::getMaxID
() {
146
return
myMaxID
;
147
}
148
149
150
151
/****************************************************************************/
152
tmp
buildd
sumo-0.21.0+dfsg
src
netimport
vissim
tempstructs
NIVissimNodeDef.cpp
Generated on Thu Nov 20 2014 19:49:57 for SUMO - Simulation of Urban MObility by
1.8.1.2