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
NIVissimEdgePosMap.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 <map>
33
#include "
NIVissimEdgePosMap.h
"
34
35
#ifdef CHECK_MEMORY_LEAKS
36
#include <
foreign/nvwa/debug_new.h
>
37
#endif // CHECK_MEMORY_LEAKS
38
39
40
NIVissimEdgePosMap::NIVissimEdgePosMap
() {}
41
42
43
NIVissimEdgePosMap::~NIVissimEdgePosMap
() {}
44
45
46
void
47
NIVissimEdgePosMap::add
(
int
edgeid,
SUMOReal
pos) {
48
add
(edgeid, pos, pos);
49
}
50
51
52
void
53
NIVissimEdgePosMap::add
(
int
edgeid,
SUMOReal
from,
SUMOReal
to) {
54
if
(from > to) {
55
SUMOReal
tmp = from;
56
from = to;
57
to = tmp;
58
}
59
ContType::iterator i =
myCont
.find(edgeid);
60
if
(i ==
myCont
.end()) {
61
myCont
[edgeid] =
Range
(from, to);
62
}
else
{
63
SUMOReal
pfrom = (*i).second.first;
64
SUMOReal
pto = (*i).second.second;
65
if
(pfrom < from) {
66
from = pfrom;
67
}
68
if
(pto > to) {
69
to = pto;
70
}
71
myCont
[edgeid] =
Range
(from, to);
72
}
73
}
74
75
76
void
77
NIVissimEdgePosMap::join
(
NIVissimEdgePosMap
& with) {
78
for
(ContType::iterator i = with.
myCont
.begin(); i != with.
myCont
.end(); i++) {
79
add
((*i).first, (*i).second.first, (*i).second.second);
80
}
81
}
82
83
84
85
/****************************************************************************/
86
tmp
buildd
sumo-0.15.0~dfsg
src
netimport
vissim
tempstructs
NIVissimEdgePosMap.cpp
Generated on Sun May 27 2012 14:52:08 for SUMO - Simulation of Urban MObility by
1.8.1