libosmscout
0.1
|
Helper for rendering labels following some path. More...
#include <LabelPath.h>
Public Member Functions | |
void | AddPoint (const Vertex2D &point) |
double | AngleAtLength (double offset) const |
double | AngleAtLengthDeg (double offset) const |
double | GetLength () const |
LabelPath (double minSegmentLength=5) | |
Vertex2D | PointAtLength (double offset) const |
bool | TestAngleVariance (double startOffset, double endOffset, double maximumAngle) const |
Test how squiggly is path in given offsets. More... | |
virtual | ~LabelPath () |
Helper for rendering labels following some path.
TODO: implement Bezier curves ?
|
explicit |
|
virtual |
void osmscout::LabelPath::AddPoint | ( | const Vertex2D & | point | ) |
double osmscout::LabelPath::AngleAtLength | ( | double | offset | ) | const |
References osmscout::Segment::angle.
Referenced by AngleAtLengthDeg(), and osmscout::LabelLayouter< QGlyphRun, QTextLayout, MapPainterQt >::RegisterContourLabel().
double osmscout::LabelPath::AngleAtLengthDeg | ( | double | offset | ) | const |
References AngleAtLength().
Referenced by osmscout::LabelLayouter< QGlyphRun, QTextLayout, MapPainterQt >::RegisterContourLabel().
|
inline |
Vertex2D osmscout::LabelPath::PointAtLength | ( | double | offset | ) | const |
bool osmscout::LabelPath::TestAngleVariance | ( | double | startOffset, |
double | endOffset, | ||
double | maximumAngle | ||
) | const |
Test how squiggly is path in given offsets.
It return true if angle between first path segment (on startOffset) and any following (until endOffset) is lesser than required maximum.
startOffset | |
endOffset | |
maximumAngle | in radians |
References osmscout::Segment::angle, osmscout::AngleDiff(), osmscout::Segment::length, and osmscout::Segment::offset.
Referenced by osmscout::LabelLayouter< QGlyphRun, QTextLayout, MapPainterQt >::RegisterContourLabel().