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-2012 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
bool
intersects
(
const
Line
& l)
const
;
73
Position
intersectsAt
(
const
Line
& l)
const
;
74
SUMOReal
length
()
const
;
75
SUMOReal
length2D
()
const
;
76
void
add
(
SUMOReal
x,
SUMOReal
y);
77
void
add
(
const
Position
& p);
78
void
sub
(
SUMOReal
x,
SUMOReal
y);
79
Line
&
reverse
();
80
void
rotateAtP1
(
SUMOReal
rot);
81
82
private
:
83
Position
myP1
,
myP2
;
84
};
85
86
87
#endif
88
89
/****************************************************************************/
90
tmp
buildd
sumo-0.15.0~dfsg
src
utils
geom
Line.h
Generated on Sun May 27 2012 14:52:05 for SUMO - Simulation of Urban MObility by
1.8.1