|
| void | AssertElementsInsideReach (const Projection &projection, const MapParameter ¶meter, const Vertex2D &point, const std::vector< LabelData > &data, const LabelInstanceType &instance) const |
| | Debug check of the conservative bound the early decision uses: the rectangle of every element a label built has to stay inside the anchor plus the reach of the label.
|
| |
| bool | CannotReachViewport (const Projection &projection, const MapParameter ¶meter, const Vertex2D &point, const LabelData &data) const |
| |
| bool | CannotReachViewport (const Projection &projection, const MapParameter ¶meter, const Vertex2D &point, const std::vector< LabelData > &data) const |
| | Returns true when no element of the label can intersect the layout viewport and when the label cannot suppress a label inside it, i.e.
|
| |
| const std::vector< ContourLabelType > & | ContourLabels () const |
| |
| template<class Painter > |
| void | DrawLabels (const Projection &projection, const MapParameter ¶meter, Painter *p) |
| |
| template<class Painter > |
| void | DrawTextLabels (const Projection &, const MapParameter &, Painter *) const |
| |
| | LabelLayouter (TextLayouter *textLayouter) |
| |
| double | LabelReach (const Projection &projection, const MapParameter ¶meter, const std::vector< LabelData > &data) const |
| | Upper bound [pixels] of the distance the elements of a label can reach from the anchor position of that label: the measured rectangle of an element stays inside the anchor plus this distance, and the overlap canvases of the layout mark an element with the widest padding of the frame around that rectangle.
|
| |
| const std::vector< LabelInstanceType > & | Labels () const |
| |
| void | Layout (const Projection &projection, const MapParameter ¶meter) |
| |
| void | ProcessLabel (const Projection &projection, const MapParameter ¶meter, const Vertex2D &point, LabelInstanceType &instance, double &offset, const LabelData &data, double objectWidth) |
| |
| void | RegisterContourLabel (const Projection &projection, const MapParameter ¶meter, bool basemap, const ObjectFileRef &ref, const PathLabelData &labelData, const LabelPath &labelPath) |
| |
| void | RegisterLabel (const Projection &projection, const MapParameter ¶meter, bool basemap, const ObjectFileRef &ref, const Vertex2D &point, const LabelData &data, double objectWidth=10.0) |
| |
| void | RegisterLabel (const Projection &projection, const MapParameter ¶meter, bool basemap, const ObjectFileRef &ref, const Vertex2D &point, const std::vector< LabelData > &data, double objectWidth=10.0) |
| |
| void | Reset () |
| |
| void | SetLayoutOverlap (uint32_t overlap) |
| |
| void | SetViewport (const ScreenVectorRectangle &v) |
| |
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 DoubleScreenRectangle 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);
template<class NativeGlyph , class NativeLabel , class TextLayouter >
Debug check of the conservative bound the early decision uses: the rectangle of every element a label built has to stay inside the anchor plus the reach of the label.
If an element could leave that box, the early decision could drop a label that the drawing path of the label stage would draw, which would change the rendered output.
References osmscout::Vertex2D::GetX(), osmscout::Vertex2D::GetY(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LabelReach(), and osmscout::LabelData::Text.
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::RegisterLabel(), and osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::RegisterLabel().
template<class NativeGlyph , class NativeLabel , class TextLayouter >
Returns true when no element of the label can intersect the layout viewport and when the label cannot suppress a label inside it, i.e.
when the label provably has no effect on the frame and does not have to be measured, stored or laid out.
References osmscout::Vertex2D::GetX(), osmscout::Vertex2D::GetY(), osmscout::ScreenVectorRectangle::Intersects(), and osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LabelReach().
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::CannotReachViewport(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::RegisterLabel(), and osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::RegisterLabel().
template<class NativeGlyph , class NativeLabel , class TextLayouter >
template<class Painter >
- Template Parameters
-
| Painter | required 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 DoubleScreenRectangle& labelRectangle,
const LabelData& label,
const std::shared_ptr<NativeLabel>& layout);
void DrawGlyphs(const Projection &projection,
const MapParameter ¶meter,
const osmscout::PathTextStyleRef style,
const std::vector<Glyph<NativeGlyph>> &glyphs);
|
- Parameters
-
| projection | |
| parameter | |
| p | - painter pointer |
References osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::ContourLabels(), osmscout::LabelData::Icon, osmscout::ScreenVectorRectangle::Intersects(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::IsOverlay(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::Labels(), osmscout::ScreenVectorRectangle::Set(), osmscout::LabelData::Symbol, and osmscout::LabelData::Text.
Referenced by osmscout::MapPainterAgg::DrawLabels(), osmscout::MapPainterCairo::DrawLabels(), osmscout::MapPainterQt::DrawLabels(), and osmscout::MapPainterSVG::DrawLabels().
template<class NativeGlyph , class NativeLabel , class TextLayouter >
Upper bound [pixels] of the distance the elements of a label can reach from the anchor position of that label: the measured rectangle of an element stays inside the anchor plus this distance, and the overlap canvases of the layout mark an element with the widest padding of the frame around that rectangle.
A label that is farther away from the layout viewport than this bound can therefore be dropped before it is measured, without changing which labels the drawing path draws and which labels the layout suppresses.
The bound is summed over the elements, because the elements of a label are stacked at its anchor, and it uses the conservative label extent bound of the label helper for text elements.
References osmscout::Projection::ConvertWidthToPixel(), osmscout::CountLabelWords(), osmscout::MapParameter::GetFontSize(), osmscout::GetLabelExtentBound(), osmscout::GetMaxLabelPaddingPixel(), and osmscout::LabelData::Text.
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::AssertElementsInsideReach(), and osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::CannotReachViewport().