libosmscout  0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules
osmscout::LabelPath Class Reference

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 ()
 

Detailed Description

Helper for rendering labels following some path.

TODO: implement Bezier curves ?

Constructor & Destructor Documentation

◆ LabelPath()

osmscout::LabelPath::LabelPath ( double  minSegmentLength = 5)
explicit

◆ ~LabelPath()

osmscout::LabelPath::~LabelPath ( )
virtual

Member Function Documentation

◆ AddPoint()

◆ AngleAtLength()

double osmscout::LabelPath::AngleAtLength ( double  offset) const

◆ AngleAtLengthDeg()

double osmscout::LabelPath::AngleAtLengthDeg ( double  offset) const

◆ GetLength()

double osmscout::LabelPath::GetLength ( ) const
inline

◆ PointAtLength()

◆ TestAngleVariance()

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.

Parameters
startOffset
endOffset
maximumAnglein radians
Returns
true if angle between first and following segments (between given offsets) is lesser than maximumAngle

References osmscout::Segment::angle, osmscout::AngleDiff(), osmscout::Segment::length, and osmscout::Segment::offset.

Referenced by osmscout::LabelLayouter< QGlyphRun, QTextLayout, MapPainterQt >::RegisterContourLabel().


The documentation for this class was generated from the following files: