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