libosmscout  0.1
osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter > Class Template Reference

#include <LabelLayouter.h>

Classes

struct  LayoutJob
 Layout job initializes separate canvases for icons/symbols, labels and overlay labels. More...
 

Public Types

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

Public Member Functions

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

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 DoubleRectangle 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 DoubleRectangle& 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

Referenced by osmscout::MapPainterCairo::DrawLabels(), osmscout::MapPainterAgg::DrawLabels(), osmscout::MapPainterSVG::DrawLabels(), and osmscout::MapPainterQt::DrawLabels().

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

◆ 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 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 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 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 DoubleRectangle v)
inline

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