libosmscout 1.1.1
Loading...
Searching...
No Matches
osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter > Class Template Reference

#include <libosmscout-map/include/osmscoutmap/LabelLayouter.h>

Classes

struct  LayoutJob

Public Types

using ContourLabelType = ContourLabel<NativeGlyph>
using LabelType = Label<NativeGlyph, NativeLabel>
using LabelPtr = std::shared_ptr<LabelType>
using LabelInstanceType = LabelInstance<NativeGlyph, NativeLabel>

Public Member Functions

 LabelLayouter (TextLayouter *textLayouter)
void SetViewport (const ScreenVectorRectangle &v)
void SetLayoutOverlap (uint32_t overlap)
void Reset ()
void Layout (const Projection &projection, const MapParameter &parameter)
template<class Painter>
void DrawTextLabels (const Projection &, const MapParameter &, Painter *) const
template<class Painter>
void DrawLabels (const Projection &projection, const MapParameter &parameter, Painter *p)
void ProcessLabel (const Projection &projection, const MapParameter &parameter, const Vertex2D &point, LabelInstanceType &instance, double &offset, const LabelData &data, double objectWidth)
void RegisterLabel (const Projection &projection, const MapParameter &parameter, const ObjectFileRef &ref, const Vertex2D &point, const LabelData &data, double objectWidth=10.0)
void RegisterLabel (const Projection &projection, const MapParameter &parameter, const ObjectFileRef &ref, const Vertex2D &point, const std::vector< LabelData > &data, double objectWidth=10.0)
void RegisterContourLabel (const Projection &projection, const MapParameter &parameter, const ObjectFileRef &ref, const PathLabelData &labelData, const LabelPath &labelPath)
const std::vector< LabelInstanceType > & Labels () const
const std::vector< ContourLabelType > & ContourLabels () const

Static Public Member Functions

static bool IsOverlay (const LabelData &labelData)

Detailed Description

template<class NativeGlyph, class NativeLabel, class TextLayouter>
class osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >
Template Parameters
NativeGlyph
NativeLabel
TextLayouter- class providing low level text layouting required methods:

// glyph bounding box relative to its base point DoubleScreenRectangle GlyphBoundingBox(const NativeGlyph &) const

// layout text for label std::shared_ptr<Label<NativeGlyph, NativeLabel>> Layout( const Projection& projection, const MapParameter& parameter, const std::string& text, double fontSize, double objectWidth, bool enableWrapping = false, bool contourLabel = false);

Member Typedef Documentation

◆ ContourLabelType

template<class NativeGlyph, class NativeLabel, class TextLayouter>
using osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::ContourLabelType = ContourLabel<NativeGlyph>

◆ LabelInstanceType

template<class NativeGlyph, class NativeLabel, class TextLayouter>
using osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LabelInstanceType = LabelInstance<NativeGlyph, NativeLabel>

◆ LabelPtr

template<class NativeGlyph, class NativeLabel, class TextLayouter>
using osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LabelPtr = std::shared_ptr<LabelType>

◆ LabelType

template<class NativeGlyph, class NativeLabel, class TextLayouter>
using osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LabelType = Label<NativeGlyph, NativeLabel>

Constructor & Destructor Documentation

◆ LabelLayouter()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LabelLayouter ( TextLayouter * textLayouter)
inlineexplicit

Member Function Documentation

◆ ContourLabels()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
const std::vector< ContourLabelType > & osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::ContourLabels ( ) const
inline

◆ DrawLabels()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
template<class Painter>
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::DrawLabels ( const Projection & projection,
const MapParameter & parameter,
Painter * p )
inline
Template Parameters
Painterrequired methods:
void DrawSymbol(const Projection& projection,
                const MapParameter& parameter,
                onst Symbol& symbol,
                double x, double y) override;

void DrawIcon(const IconStyle* style,
              double centerX, double centerY,
              double width, double height) override;

void DrawLabel(const Projection& projection,
               const MapParameter& parameter,
               const DoubleScreenRectangle& labelRectangle,
               const LabelData& label,
               const std::shared_ptr<NativeLabel>& layout);

void DrawGlyphs(const Projection &projection,
                const MapParameter &parameter,
                const osmscout::PathTextStyleRef style,
                const std::vector<Glyph<NativeGlyph>> &glyphs);
Parameters
projection
parameter
p- painter pointer

◆ DrawTextLabels()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
template<class Painter>
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::DrawTextLabels ( const Projection & ,
const MapParameter & ,
Painter *  ) const
inline

◆ IsOverlay()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
bool osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::IsOverlay ( const LabelData & labelData)
inlinestatic

◆ Labels()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
const std::vector< LabelInstanceType > & osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::Labels ( ) const
inline

◆ Layout()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::Layout ( const Projection & projection,
const MapParameter & parameter )
inline

◆ ProcessLabel()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::ProcessLabel ( const Projection & projection,
const MapParameter & parameter,
const Vertex2D & point,
LabelInstanceType & instance,
double & offset,
const LabelData & data,
double objectWidth )
inline

◆ RegisterContourLabel()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::RegisterContourLabel ( const Projection & projection,
const MapParameter & parameter,
const ObjectFileRef & ref,
const PathLabelData & labelData,
const LabelPath & labelPath )
inline

◆ RegisterLabel() [1/2]

template<class NativeGlyph, class NativeLabel, class TextLayouter>
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::RegisterLabel ( const Projection & projection,
const MapParameter & parameter,
const ObjectFileRef & ref,
const Vertex2D & point,
const LabelData & data,
double objectWidth = 10.0 )
inline

◆ RegisterLabel() [2/2]

template<class NativeGlyph, class NativeLabel, class TextLayouter>
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::RegisterLabel ( const Projection & projection,
const MapParameter & parameter,
const ObjectFileRef & ref,
const Vertex2D & point,
const std::vector< LabelData > & data,
double objectWidth = 10.0 )
inline

◆ Reset()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::Reset ( )
inline

◆ SetLayoutOverlap()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::SetLayoutOverlap ( uint32_t overlap)
inline

◆ SetViewport()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::SetViewport ( const ScreenVectorRectangle & v)
inline

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