|
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 |
|
delete |
|
delete |
|
default |
|
inline |
References osmscout::LabelData::Icon, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::iconCanvas, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::IsOverlay(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::labelCanvas, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::overlayCanvas, osmscout::LabelData::Symbol, and osmscout::LabelData::type.
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabelInstance().
|
inline |
References osmscout::LabelData::Icon, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::iconPadding, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::IsOverlay(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::labelPadding, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::overlayLabelPadding, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::shieldLabelPadding, osmscout::LabelData::style, osmscout::LabelData::Symbol, and osmscout::LabelData::type.
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabelInstance().
|
delete |
|
delete |
|
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().
|
inline |
References osmscout::ScreenMask::AddMask(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::contourLabelPadding, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::contourMasks, osmscout::debugLabelLayouter, osmscout::ScreenMask::HasCollision(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::labelCanvas, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::layoutViewport, osmscout::ScreenVectorRectangle::width, osmscout::ScreenVectorRectangle::x, and osmscout::ScreenVectorRectangle::y.
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabels().
|
inline |
References osmscout::ScreenMask::AddMask(), osmscout::debugLabelLayouter, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::GetCanvas(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::GetLabelPadding(), osmscout::ScreenMask::HasCollision(), osmscout::LabelData::Icon, osmscout::LabelData::iconHeight, osmscout::LabelData::iconStyle, osmscout::LabelData::iconWidth, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::instanceCanvases, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::instanceMasks, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::IsOverlay(), osmscout::LabelInstance< NativeGlyph, NativeLabel >::Element::label, osmscout::LabelInstance< NativeGlyph, NativeLabel >::Element::labelData, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::layoutViewport, osmscout::ScreenRectMask::Reset(), osmscout::LabelData::Symbol, osmscout::LabelData::text, osmscout::LabelData::type, osmscout::ScreenPixelRectangle::width, osmscout::ScreenVectorRectangle::width, osmscout::LabelInstance< NativeGlyph, NativeLabel >::Element::x, osmscout::ScreenVectorRectangle::x, osmscout::LabelInstance< NativeGlyph, NativeLabel >::Element::y, and osmscout::ScreenVectorRectangle::y.
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabels().
|
inline |
References osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::allSortedContourLabels, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::allSortedLabels, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabelContourLabel(), and osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabelInstance().
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::Layout().
|
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().
|
inline |
References osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::allSortedContourLabels, and osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::allSortedLabels.
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::Layout().
| std::vector<ContourLabelType> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::allSortedContourLabels |
| std::vector<LabelInstanceType> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::allSortedLabels |
| double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::contourLabelPadding =0.0 |
| std::vector<ScreenRectMask> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::contourMasks |
Reused masks of the path label in flight.
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabelContourLabel().
| ScreenMask osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::iconCanvas |
| double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::iconPadding =0.0 |
| std::vector<ScreenMask*> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::instanceCanvases |
Reused canvas of each element of the instance.
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabelInstance().
| std::vector<ScreenRectMask> osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::instanceMasks |
Reused masks of the label instance in flight.
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabelInstance().
| ScreenMask osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::labelCanvas |
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::GetCanvas(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabelContourLabel(), and osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::Reset().
| double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::labelPadding =0.0 |
| ScreenVectorRectangle osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::layoutViewport |
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabelContourLabel(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabelInstance(), and osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::Reset().
| ScreenMask osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::overlayCanvas |
| double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::overlayLabelPadding =0.0 |
| double osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::shieldLabelPadding =0.0 |