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-2013 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
101
105
static
void
computeFinal
();
106
107
111
static
const
GeoConvHelper
&
getFinal
() {
112
return
myFinal
;
113
}
114
115
118
static
void
setLoaded
(
const
GeoConvHelper
& loaded);
119
120
123
static
void
resetLoaded
();
124
126
void
cartesian2geo
(
Position
& cartesian)
const
;
127
132
bool
x2cartesian
(
Position
& from,
bool
includeInBoundary =
true
);
133
135
bool
x2cartesian_const
(
Position
& from)
const
;
136
138
bool
usingGeoProjection
()
const
;
139
141
bool
usingInverseGeoProjection
()
const
;
142
144
void
moveConvertedBy
(
SUMOReal
x,
SUMOReal
y);
145
147
const
Boundary
&
getOrigBoundary
()
const
;
148
150
const
Boundary
&
getConvBoundary
()
const
;
151
153
void
setConvBoundary
(
const
Boundary
& boundary) {
154
myConvBoundary
= boundary;
155
}
156
158
const
Position
getOffset
()
const
;
159
161
const
Position
getOffsetBase
()
const
;
162
164
const
std::string&
getProjString
()
const
;
165
166
private
:
167
enum
ProjectionMethod
{
168
NONE
,
169
SIMPLE
,
170
UTM
,
171
DHDN
,
172
PROJ
173
};
174
176
std::string
myProjString
;
177
178
#ifdef HAVE_PROJ
179
projPJ myProjection;
181
#endif
182
184
Position
myOffset
;
185
187
double
myGeoScale
;
188
190
ProjectionMethod
myProjectionMethod
;
191
193
bool
myUseInverseProjection
;
194
196
Boundary
myOrigBoundary
;
197
199
Boundary
myConvBoundary
;
200
202
static
GeoConvHelper
myProcessing
;
203
205
static
GeoConvHelper
myLoaded
;
206
208
static
GeoConvHelper
myFinal
;
209
211
static
int
myNumLoaded
;
212
214
GeoConvHelper
&
operator=
(
const
GeoConvHelper
&);
215
217
GeoConvHelper
(
const
GeoConvHelper
&);
218
219
};
220
221
222
#endif
223
224
/****************************************************************************/
225
build
buildd
sumo-0.18~dfsg
src
utils
geom
GeoConvHelper.h
Generated on Wed Oct 23 2013 01:15:07 for SUMO - Simulation of Urban MObility by
1.8.4