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
Boundary.h
Go to the documentation of this file.
1
/****************************************************************************/
9
// A class that stores a 2D geometrical boundary
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 Boundary_h
23
#define Boundary_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 <iostream>
36
#include <utility>
37
#include "
AbstractPoly.h
"
38
#include "
Position.h
"
39
40
41
// ===========================================================================
42
// class definitions
43
// ===========================================================================
48
class
Boundary
49
:
public
AbstractPoly
{
50
public
:
52
Boundary
();
53
55
Boundary
(
SUMOReal
x1,
SUMOReal
y1,
SUMOReal
x2,
SUMOReal
y2);
56
58
~Boundary
();
59
61
void
reset
();
62
64
void
add
(
SUMOReal
x,
SUMOReal
y);
65
67
void
add
(
const
Position
& p);
68
70
void
add
(
const
Boundary
& p);
71
73
Position
getCenter
()
const
;
74
76
SUMOReal
xmin
()
const
;
77
79
SUMOReal
xmax
()
const
;
80
82
SUMOReal
ymin
()
const
;
83
85
SUMOReal
ymax
()
const
;
86
88
SUMOReal
getWidth
()
const
;
89
91
SUMOReal
getHeight
()
const
;
92
94
bool
around
(
const
Position
& p,
SUMOReal
offset = 0)
const
;
95
97
bool
overlapsWith
(
const
AbstractPoly
& poly,
SUMOReal
offset = 0)
const
;
98
100
bool
partialWithin
(
const
AbstractPoly
& poly,
SUMOReal
offset = 0)
const
;
101
103
bool
crosses
(
const
Position
& p1,
const
Position
& p2)
const
;
104
105
109
Boundary
&
grow
(
SUMOReal
by);
110
111
void
growWidth
(
SUMOReal
by);
112
113
void
growHeight
(
SUMOReal
by);
114
116
void
flipY
();
117
119
void
set
(
SUMOReal
xmin
,
SUMOReal
ymin
,
SUMOReal
xmax
,
SUMOReal
ymax
);
120
122
void
moveby
(
SUMOReal
x,
SUMOReal
y);
123
125
friend
std::ostream&
operator<<
(std::ostream& os,
const
Boundary
& b);
126
127
private
:
129
SUMOReal
myXmin
,
myXmax
,
myYmin
,
myYmax
;
130
132
bool
myWasInitialised
;
133
134
};
135
136
137
#endif
138
139
/****************************************************************************/
140
tmp
buildd
sumo-0.21.0+dfsg
src
utils
geom
Boundary.h
Generated on Thu Nov 20 2014 19:49:52 for SUMO - Simulation of Urban MObility by
1.8.1.2