libosmscout  1.1.1
Public Types | Public Member Functions | List of all members
osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter > Class Template Reference

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

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 DoubleRectangle &v)
 
void SetLayoutOverlap (uint32_t overlap)
 
void Reset ()
 
bool CheckLabelCollision (const std::vector< uint64_t > &canvas, const Mask &mask, int64_t viewportHeight) const
 
void MarkLabelPlace (std::vector< uint64_t > &canvas, const Mask &mask, int viewportHeight) const
 
bool IsOverlay (const LabelData &labelData) const
 
void Layout (const Projection &projection, const MapParameter &parameter)
 
template<class Painter >
void DrawLabels (const Projection &projection, const MapParameter &parameter, Painter *p)
 
void RegisterLabel (const Projection &projection, const MapParameter &parameter, const Vertex2D &point, const std::vector< LabelData > &data, double objectWidth=10.0)
 
void RegisterContourLabel (const Projection &projection, const MapParameter &parameter, const PathLabelData &labelData, const LabelPath &labelPath)
 
const std::vector< LabelInstanceType > & Labels () const
 
const std::vector< ContourLabelType > & ContourLabels () const
 

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

◆ CheckLabelCollision()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
bool osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::CheckLabelCollision ( const std::vector< uint64_t > &  canvas,
const Mask mask,
int64_t  viewportHeight 
) const
inline

◆ 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

◆ IsOverlay()

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

◆ 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

◆ MarkLabelPlace()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::MarkLabelPlace ( std::vector< uint64_t > &  canvas,
const Mask mask,
int  viewportHeight 
) const
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()

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: