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

◆ LayoutJob() [3/3]

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

◆ ~LayoutJob()

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

Member Function Documentation

◆ GetCanvas()

◆ GetLabelPadding()

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ 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 osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::allSortedContourLabels, and osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::allSortedLabels.

Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::Layout().

◆ ProcessLabelContourLabel()

◆ ProcessLabelInstance()

template<class NativeGlyph , class NativeLabel , class TextLayouter >
void osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabelInstance ( const LabelInstanceType &  currentLabel,
std::vector< LabelInstanceType > &  labelInstances 
)
inline

◆ ProcessLabels()

◆ 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

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.

References osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::contourLabelPadding, osmscout::Projection::ConvertWidthToPixel(), osmscout::MapParameter::GetContourLabelPadding(), osmscout::MapParameter::GetIconPadding(), osmscout::MapParameter::GetLabelPadding(), osmscout::MapParameter::GetOverlayLabelPadding(), osmscout::MapParameter::GetPlateLabelPadding(), osmscout::ScreenVectorRectangle::height, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::iconCanvas, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::iconPadding, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::labelCanvas, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::labelPadding, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::layoutViewport, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::overlayCanvas, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::overlayLabelPadding, osmscout::ScreenMask::Reset(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::shieldLabelPadding, and osmscout::ScreenVectorRectangle::width.

Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::Layout().

◆ SortLabels()

Member Data Documentation

◆ allSortedContourLabels

◆ allSortedLabels

◆ contourLabelPadding

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

◆ contourMasks

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

◆ iconCanvas

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

◆ iconPadding

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

◆ instanceCanvases

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

◆ instanceMasks

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

◆ labelCanvas

◆ labelPadding

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

◆ layoutViewport

◆ overlayCanvas

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

◆ overlayLabelPadding

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

◆ shieldLabelPadding

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

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