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
Line.h
Go to the documentation of this file.
1
/****************************************************************************/
9
//
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
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 Line_h
23
#define Line_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 "
Position.h
"
36
#include <
utils/common/VectorHelper.h
>
37
38
39
// ===========================================================================
40
// class declarations
41
// ===========================================================================
42
class
PositionVector
;
43
44
45
// ===========================================================================
46
// class definitions
47
// ===========================================================================
51
class
Line
{
52
public
:
53
Line
();
54
Line
(
const
Position
&
p1
,
const
Position
&
p2
);
55
~Line
();
56
void
extrapolateBy
(
SUMOReal
length
);
57
void
extrapolateFirstBy
(
SUMOReal
length);
58
void
extrapolateSecondBy
(
SUMOReal
length);
59
const
Position
&
p1
()
const
;
60
const
Position
&
p2
()
const
;
61
Position
getPositionAtDistance
(
SUMOReal
offset)
const
;
62
Position
getPositionAtDistance2D
(
SUMOReal
offset)
const
;
63
void
move2side
(
SUMOReal
amount);
64
std::vector<SUMOReal>
intersectsAtLengths2D
(
const
PositionVector
& v);
65
67
SUMOReal
intersectsAtLength2D
(
const
Line
& v);
68
69
SUMOReal
atan2Angle
()
const
;
70
SUMOReal
atan2DegreeAngle
()
const
;
71
SUMOReal
atan2PositiveAngle
()
const
;
72
SUMOReal
atan2DegreeSlope
()
const
;
73
bool
intersects
(
const
Line
& l)
const
;
74
Position
intersectsAt
(
const
Line
& l)
const
;
75
SUMOReal
length
()
const
;
76
SUMOReal
length2D
()
const
;
77
void
add
(
SUMOReal
x,
SUMOReal
y);
78
void
add
(
const
Position
& p);
79
void
sub
(
SUMOReal
x,
SUMOReal
y);
80
Line
&
reverse
();
81
void
rotateAtP1
(
SUMOReal
rot);
82
83
private
:
84
Position
myP1
,
myP2
;
85
};
86
87
88
#endif
89
90
/****************************************************************************/
91
home
gladk
tmp
05
sumo-0.17.1~dfsg
src
utils
geom
Line.h
Generated on Sun Jun 16 2013 07:07:24 for SUMO - Simulation of Urban MObility by
1.8.1.2