libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout-map
include
osmscoutmap
LabelPath.h
Go to the documentation of this file.
1
#ifndef OSMSCOUT_MAP_SIMPLIFIEDPATH_H
2
#define OSMSCOUT_MAP_SIMPLIFIEDPATH_H
3
4
/*
5
This source is part of the libosmscout-map library
6
Copyright (C) 2017 Lukas Karas
7
8
This library is free software; you can redistribute it and/or
9
modify it under the terms of the GNU Lesser General Public
10
License as published by the Free Software Foundation; either
11
version 2.1 of the License, or (at your option) any later version.
12
13
This library is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
Lesser General Public License for more details.
17
18
You should have received a copy of the GNU Lesser General Public
19
License along with this library; if not, write to the Free Software
20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
*/
22
23
#include <
osmscoutmap/MapImportExport.h
>
24
25
#include <vector>
26
27
#include <
osmscout/Pixel.h
>
28
29
namespace
osmscout
{
30
struct
Segment
31
{
32
Vertex2D
start
;
33
double
offset
;
34
double
length
;
35
double
angle
;
36
};
37
43
class
OSMSCOUT_MAP_API
LabelPath
44
{
45
private
:
46
double
length;
47
std::vector<Segment> segments;
48
std::vector<size_t> offsetIndex;
// segment offset by length 100
49
double
minSegmentLength;
50
Vertex2D end;
51
double
endDistance;
52
53
public
:
54
explicit
LabelPath
(
double
minSegmentLength=5);
55
virtual
~LabelPath
();
56
void
AddPoint
(
const
Vertex2D& point);
57
double
GetLength
()
const
{
58
return
length+endDistance;
59
}
60
Vertex2D
PointAtLength
(
double
offset)
const
;
61
double
AngleAtLength
(
double
offset)
const
;
62
double
AngleAtLengthDeg
(
double
offset)
const
;
63
75
bool
TestAngleVariance
(
double
startOffset,
double
endOffset,
double
maximumAngle)
const
;
76
77
private
:
78
const
Segment
& SegmentBefore(
double
offset)
const
;
79
};
80
}
81
82
#endif
/* OSMSCOUT_MAP_SIMPLIFIEDPATH_H */
MapImportExport.h
OSMSCOUT_MAP_API
#define OSMSCOUT_MAP_API
Definition
MapImportExport.h:45
Pixel.h
osmscout::LabelPath::AngleAtLength
double AngleAtLength(double offset) const
osmscout::LabelPath::~LabelPath
virtual ~LabelPath()
osmscout::LabelPath::TestAngleVariance
bool TestAngleVariance(double startOffset, double endOffset, double maximumAngle) const
osmscout::LabelPath::PointAtLength
Vertex2D PointAtLength(double offset) const
osmscout::LabelPath::AddPoint
void AddPoint(const Vertex2D &point)
osmscout::LabelPath::LabelPath
LabelPath(double minSegmentLength=5)
osmscout::LabelPath::GetLength
double GetLength() const
Definition
LabelPath.h:57
osmscout::LabelPath::AngleAtLengthDeg
double AngleAtLengthDeg(double offset) const
osmscout
Definition
Area.h:39
osmscout::Segment
Definition
LabelPath.h:31
osmscout::Segment::offset
double offset
Definition
LabelPath.h:33
osmscout::Segment::length
double length
Definition
LabelPath.h:34
osmscout::Segment::angle
double angle
Definition
LabelPath.h:35
osmscout::Segment::start
Vertex2D start
Definition
LabelPath.h:32
Generated by
1.17.0