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
GeoConvHelper.h
Go to the documentation of this file.
1
/****************************************************************************/
9
// static methods for processing the coordinates conversion for the current net
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12
// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
13
/****************************************************************************/
14
//
15
// This file is part of SUMO.
16
// SUMO is free software: you can redistribute it and/or modify
17
// it under the terms of the GNU General Public License as published by
18
// the Free Software Foundation, either version 3 of the License, or
19
// (at your option) any later version.
20
//
21
/****************************************************************************/
22
#ifndef GeoConvHelper_h
23
#define GeoConvHelper_h
24
25
26
// ===========================================================================
27
// included modules
28
// ===========================================================================
29
#ifdef _MSC_VER
30
#include <
windows_config.h
>
31
#else
32
#include <
config.h
>
33
#endif
34
35
#include <map>
36
#include <string>
37
#include <
utils/geom/Position.h
>
38
#include <
utils/geom/Boundary.h
>
39
40
#ifdef HAVE_PROJ
41
#include <proj_api.h>
42
#endif
43
44
45
// ===========================================================================
46
// class declarations
47
// ===========================================================================
48
class
OptionsCont
;
49
class
PositionVector
;
50
51
52
// ===========================================================================
53
// class definitions
54
// ===========================================================================
59
class
GeoConvHelper
{
60
public
:
61
65
GeoConvHelper
(
OptionsCont
& oc);
66
69
GeoConvHelper
(
const
std::string& proj,
const
Position
& offset,
70
const
Boundary
& orig,
const
Boundary
& conv,
int
shift = 0,
bool
inverse =
false
);
71
72
74
~GeoConvHelper
();
75
76
82
static
void
addProjectionOptions
(
OptionsCont
& oc);
83
85
static
bool
init
(
OptionsCont
& oc);
86
88
static
void
init
(
const
std::string& proj,
89
const
Position
& offset,
90
const
Boundary
& orig,
91
const
Boundary
& conv,
92
int
shift = 0);
93
97
static
GeoConvHelper
&
getProcessing
() {
98
return
myProcessing
;
99
}
100
103
static
GeoConvHelper
&
getLoaded
() {
104
return
myLoaded
;
105
}
106
110
static
void
computeFinal
();
111
112
116
static
const
GeoConvHelper
&
getFinal
() {
117
return
myFinal
;
118
}
119
120
123
static
void
setLoaded
(
const
GeoConvHelper
& loaded);
124
125
128
static
void
resetLoaded
();
129
131
void
cartesian2geo
(
Position
& cartesian)
const
;
132
137
bool
x2cartesian
(
Position
& from,
bool
includeInBoundary =
true
);
138
140
bool
x2cartesian_const
(
Position
& from)
const
;
141
143
bool
usingGeoProjection
()
const
;
144
146
bool
usingInverseGeoProjection
()
const
;
147
149
void
moveConvertedBy
(
SUMOReal
x,
SUMOReal
y);
150
152
const
Boundary
&
getOrigBoundary
()
const
;
153
155
const
Boundary
&
getConvBoundary
()
const
;
156
158
void
setConvBoundary
(
const
Boundary
& boundary) {
159
myConvBoundary
= boundary;
160
}
161
163
const
Position
getOffset
()
const
;
164
166
const
Position
getOffsetBase
()
const
;
167
169
const
std::string&
getProjString
()
const
;
170
171
private
:
172
enum
ProjectionMethod
{
173
NONE
,
174
SIMPLE
,
175
UTM
,
176
DHDN
,
177
DHDN_UTM
,
178
PROJ
179
};
180
182
std::string
myProjString
;
183
184
#ifdef HAVE_PROJ
185
186
projPJ myProjection;
187
189
projPJ myInverseProjection;
190
192
projPJ myGeoProjection;
193
#endif
194
196
Position
myOffset
;
197
199
double
myGeoScale
;
200
202
ProjectionMethod
myProjectionMethod
;
203
205
bool
myUseInverseProjection
;
206
208
Boundary
myOrigBoundary
;
209
211
Boundary
myConvBoundary
;
212
214
static
GeoConvHelper
myProcessing
;
215
217
static
GeoConvHelper
myLoaded
;
218
220
static
GeoConvHelper
myFinal
;
221
223
static
int
myNumLoaded
;
224
226
GeoConvHelper
&
operator=
(
const
GeoConvHelper
&);
227
229
GeoConvHelper
(
const
GeoConvHelper
&);
230
231
};
232
233
234
#endif
235
236
/****************************************************************************/
237
tmp
buildd
sumo-0.21.0+dfsg
src
utils
geom
GeoConvHelper.h
Generated on Thu Nov 20 2014 19:49:53 for SUMO - Simulation of Urban MObility by
1.8.1.2