libosmscout 0.1
Loading...
Searching...
No Matches
osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob Struct Reference

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

#include <LabelLayouter.h>

Public Member Functions

ScreenMask * GetCanvas (LabelData data)
double GetLabelPadding (const LabelData &labelData) const
 LayoutJob ()=default
 LayoutJob (const LayoutJob &)=delete
 LayoutJob (LayoutJob &&)=delete
LayoutJob & operator= (const LayoutJob &)=delete
LayoutJob & operator= (LayoutJob &&)=delete
void PrepareFrame (std::vector< LabelInstanceType > &newLabelInstances, std::vector< ContourLabelType > &newContourLabelInstances)
 Take the registered labels of the frame and prepare the output stores of the frame: the registered labels move into the job, the output stores are cleared but keep their capacity, because the resolution is expected to add the resolved labels to them.
void ProcessLabelContourLabel (const ContourLabelType &currentContourLabel, std::vector< ContourLabelType > &contourLabelInstances)
void ProcessLabelInstance (const LabelInstanceType &currentLabel, std::vector< LabelInstanceType > &labelInstances)
void ProcessLabels (std::vector< LabelInstanceType > &labelInstances, std::vector< ContourLabelType > &contourLabelInstances)
void Reset (const ScreenVectorRectangle &newLayoutViewport, const Projection &projection, const MapParameter &parameter)
 Prepare the job for a frame: adopt the layout viewport, recompute the paddings and reset the canvases in place, so that a repeated frame of the same size does not allocate the canvases again.
void SortLabels ()
 ~LayoutJob ()=default

Public Attributes

std::vector< ContourLabelType > allSortedContourLabels
std::vector< LabelInstanceType > allSortedLabels
double contourLabelPadding =0.0
std::vector< ScreenRectMask > contourMasks
 Reused masks of the path label in flight.
ScreenMask iconCanvas
double iconPadding =0.0
std::vector< ScreenMask * > instanceCanvases
 Reused canvas of each element of the instance.
std::vector< ScreenRectMask > instanceMasks
 Reused masks of the label instance in flight.
ScreenMask labelCanvas
double labelPadding =0.0
ScreenVectorRectangle layoutViewport
ScreenMask overlayCanvas
double overlayLabelPadding =0.0
double shieldLabelPadding =0.0

Detailed Description

template<class NativeGlyph, class NativeLabel, class TextLayouter>
struct osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob

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

Then takes all registered labels and contour labels and sort them by priority. Note that labels includes standard labels, icons/symbols and overlay labels. As final step process labels and contour labels (from highest priority) and check its visual rectangle in corresponding canvas. When pixels are not occupied yet, it is added and pixels on canvas mark.

Constructor & Destructor Documentation

◆ LayoutJob() [1/3]

template<class NativeGlyph, class NativeLabel, class TextLayouter>
osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::LayoutJob ( )
default

◆ LayoutJob() [2/3]

template<class NativeGlyph, class NativeLabel, class TextLayouter>
osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::LayoutJob ( const LayoutJob & )
delete

References LayoutJob().

◆ LayoutJob() [3/3]

template<class NativeGlyph, class NativeLabel, class TextLayouter>
osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::LayoutJob ( LayoutJob && )
delete

References LayoutJob().

◆ ~LayoutJob()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::~LayoutJob ( )
default

Member Function Documentation

◆ GetCanvas()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
ScreenMask * osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::GetCanvas ( LabelData data)
inline

◆ GetLabelPadding()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::GetLabelPadding ( const LabelData & labelData) const
inline

◆ operator=() [1/2]

template<class NativeGlyph, class NativeLabel, class TextLayouter>
LayoutJob & osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::operator= ( const LayoutJob & )
delete

References LayoutJob().

◆ operator=() [2/2]

template<class NativeGlyph, class NativeLabel, class TextLayouter>
LayoutJob & osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::operator= ( LayoutJob && )
delete

References LayoutJob().

◆ PrepareFrame()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::PrepareFrame ( std::vector< LabelInstanceType > & newLabelInstances,
std::vector< ContourLabelType > & newContourLabelInstances )
inline

Take the registered labels of the frame and prepare the output stores of the frame: the registered labels move into the job, the output stores are cleared but keep their capacity, because the resolution is expected to add the resolved labels to them.

References allSortedContourLabels, and allSortedLabels.

◆ ProcessLabelContourLabel()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabelContourLabel ( const ContourLabelType & currentContourLabel,
std::vector< ContourLabelType > & contourLabelInstances )
inline

◆ ProcessLabelInstance()

◆ ProcessLabels()

template<class NativeGlyph, class NativeLabel, class TextLayouter>
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabels ( std::vector< LabelInstanceType > & labelInstances,
std::vector< ContourLabelType > & contourLabelInstances )
inline

◆ Reset()

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

◆ SortLabels()

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

Member Data Documentation

◆ allSortedContourLabels

template<class NativeGlyph, class NativeLabel, class TextLayouter>
std::vector<ContourLabelType> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::allSortedContourLabels

◆ allSortedLabels

template<class NativeGlyph, class NativeLabel, class TextLayouter>
std::vector<LabelInstanceType> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::allSortedLabels

◆ contourLabelPadding

template<class NativeGlyph, class NativeLabel, class TextLayouter>
double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::contourLabelPadding =0.0

Referenced by ProcessLabelContourLabel(), and Reset().

◆ contourMasks

template<class NativeGlyph, class NativeLabel, class TextLayouter>
std::vector<ScreenRectMask> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::contourMasks

Reused masks of the path label in flight.

Referenced by ProcessLabelContourLabel().

◆ iconCanvas

template<class NativeGlyph, class NativeLabel, class TextLayouter>
ScreenMask osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::iconCanvas

Referenced by GetCanvas(), and Reset().

◆ iconPadding

template<class NativeGlyph, class NativeLabel, class TextLayouter>
double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::iconPadding =0.0

Referenced by GetLabelPadding(), and Reset().

◆ instanceCanvases

template<class NativeGlyph, class NativeLabel, class TextLayouter>
std::vector<ScreenMask*> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::instanceCanvases

Reused canvas of each element of the instance.

Referenced by ProcessLabelInstance().

◆ instanceMasks

template<class NativeGlyph, class NativeLabel, class TextLayouter>
std::vector<ScreenRectMask> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::instanceMasks

Reused masks of the label instance in flight.

Referenced by ProcessLabelInstance().

◆ labelCanvas

template<class NativeGlyph, class NativeLabel, class TextLayouter>
ScreenMask osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::labelCanvas

◆ labelPadding

template<class NativeGlyph, class NativeLabel, class TextLayouter>
double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::labelPadding =0.0

Referenced by GetLabelPadding(), and Reset().

◆ layoutViewport

template<class NativeGlyph, class NativeLabel, class TextLayouter>
ScreenVectorRectangle osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::layoutViewport

◆ overlayCanvas

template<class NativeGlyph, class NativeLabel, class TextLayouter>
ScreenMask osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::overlayCanvas

Referenced by GetCanvas(), and Reset().

◆ overlayLabelPadding

template<class NativeGlyph, class NativeLabel, class TextLayouter>
double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::overlayLabelPadding =0.0

Referenced by GetLabelPadding(), and Reset().

◆ shieldLabelPadding

template<class NativeGlyph, class NativeLabel, class TextLayouter>
double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::shieldLabelPadding =0.0

Referenced by GetLabelPadding(), and Reset().


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