|
libosmscout 0.1
|
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 ¤tContourLabel, std::vector< ContourLabelType > &contourLabelInstances) |
| void | ProcessLabelInstance (const LabelInstanceType ¤tLabel, std::vector< LabelInstanceType > &labelInstances) |
| void | ProcessLabels (std::vector< LabelInstanceType > &labelInstances, std::vector< ContourLabelType > &contourLabelInstances) |
| void | Reset (const ScreenVectorRectangle &newLayoutViewport, const Projection &projection, const MapParameter ¶meter) |
| 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 |
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.
|
default |
Referenced by LayoutJob(), LayoutJob(), operator=(), and operator=().
|
delete |
References LayoutJob().
|
delete |
References LayoutJob().
|
default |
|
inline |
|
inline |
References osmscout::LabelData::Icon, iconPadding, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::IsOverlay(), labelPadding, overlayLabelPadding, shieldLabelPadding, osmscout::LabelData::style, osmscout::LabelData::Symbol, and osmscout::LabelData::type.
Referenced by ProcessLabelInstance().
|
delete |
References LayoutJob().
|
delete |
References LayoutJob().
|
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.
|
inline |
|
inline |
References osmscout::debugLabelLayouter, osmscout::LabelInstance< NativeGlyph, NativeLabel >::elements, GetCanvas(), GetLabelPadding(), osmscout::ScreenMask::HasCollision(), osmscout::ScreenPixelRectangle::height, osmscout::LabelData::Icon, osmscout::LabelData::iconHeight, osmscout::LabelData::iconStyle, osmscout::LabelData::iconWidth, instanceCanvases, instanceMasks, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::IsOverlay(), osmscout::LabelInstance< NativeGlyph, NativeLabel >::Element::label, osmscout::LabelInstance< NativeGlyph, NativeLabel >::Element::labelData, layoutViewport, osmscout::LabelInstance< NativeGlyph, NativeLabel >::priority, osmscout::ScreenRectMask::Reset(), osmscout::LabelData::Symbol, osmscout::LabelData::text, osmscout::LabelData::type, osmscout::ScreenPixelRectangle::width, osmscout::LabelInstance< NativeGlyph, NativeLabel >::Element::x, and osmscout::LabelInstance< NativeGlyph, NativeLabel >::Element::y.
Referenced by ProcessLabels().
|
inline |
References allSortedContourLabels, allSortedLabels, ProcessLabelContourLabel(), and ProcessLabelInstance().
|
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 contourLabelPadding, osmscout::Projection::ConvertWidthToPixel(), osmscout::MapParameter::GetContourLabelPadding(), osmscout::MapParameter::GetIconPadding(), osmscout::MapParameter::GetLabelPadding(), osmscout::MapParameter::GetOverlayLabelPadding(), osmscout::MapParameter::GetPlateLabelPadding(), iconCanvas, iconPadding, labelCanvas, labelPadding, layoutViewport, overlayCanvas, overlayLabelPadding, and shieldLabelPadding.
|
inline |
| std::vector<ContourLabelType> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::allSortedContourLabels |
Referenced by PrepareFrame(), ProcessLabels(), and SortLabels().
| std::vector<LabelInstanceType> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::allSortedLabels |
Referenced by PrepareFrame(), ProcessLabels(), and SortLabels().
| double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::contourLabelPadding =0.0 |
Referenced by ProcessLabelContourLabel(), and Reset().
| std::vector<ScreenRectMask> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::contourMasks |
Reused masks of the path label in flight.
Referenced by ProcessLabelContourLabel().
| ScreenMask osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::iconCanvas |
Referenced by GetCanvas(), and Reset().
| double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::iconPadding =0.0 |
Referenced by GetLabelPadding(), and Reset().
| std::vector<ScreenMask*> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::instanceCanvases |
Reused canvas of each element of the instance.
Referenced by ProcessLabelInstance().
| std::vector<ScreenRectMask> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::instanceMasks |
Reused masks of the label instance in flight.
Referenced by ProcessLabelInstance().
| ScreenMask osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::labelCanvas |
Referenced by GetCanvas(), ProcessLabelContourLabel(), and Reset().
| double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::labelPadding =0.0 |
Referenced by GetLabelPadding(), and Reset().
| ScreenVectorRectangle osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::layoutViewport |
Referenced by ProcessLabelContourLabel(), ProcessLabelInstance(), and Reset().
| ScreenMask osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::overlayCanvas |
Referenced by GetCanvas(), and Reset().
| double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::overlayLabelPadding =0.0 |
Referenced by GetLabelPadding(), and Reset().
| double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::shieldLabelPadding =0.0 |
Referenced by GetLabelPadding(), and Reset().