libosmscout 0.1
|
#include <LabelLayouter.h>
Classes | |
struct | LayoutJob |
Layout job initializes separate canvases for icons/symbols, labels and overlay labels. More... | |
Public Types | |
using | ContourLabelType = ContourLabel< NativeGlyph > |
using | LabelInstanceType = LabelInstance< NativeGlyph, NativeLabel > |
using | LabelPtr = std::shared_ptr< LabelType > |
using | LabelType = Label< NativeGlyph, NativeLabel > |
Public Member Functions | |
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) | |
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, const ObjectFileRef &ref, const PathLabelData &labelData, const LabelPath &labelPath) |
void | RegisterLabel (const Projection &projection, const MapParameter ¶meter, const ObjectFileRef &ref, const Vertex2D &point, const LabelData &data, double objectWidth=10.0) |
void | RegisterLabel (const Projection &projection, const MapParameter ¶meter, 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) |
Static Public Member Functions | |
static bool | IsOverlay (const LabelData &labelData) |
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);
using osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::ContourLabelType = ContourLabel<NativeGlyph> |
using osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LabelInstanceType = LabelInstance<NativeGlyph, NativeLabel> |
using osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LabelPtr = std::shared_ptr<LabelType> |
using osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LabelType = Label<NativeGlyph, NativeLabel> |
|
inlineexplicit |
|
inline |
|
inline |
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); |
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().
|
inline |
|
inlinestatic |
References osmscout::LabelData::alpha.
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::DrawLabels(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::GetCanvas(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::GetLabelPadding(), and osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabelInstance().
|
inline |
|
inline |
References osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::ProcessLabels(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::SortLabels(), and osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::Swap().
Referenced by osmscout::MapPainterAgg::DrawLabels(), osmscout::MapPainterCairo::DrawLabels(), osmscout::MapPainterQt::DrawLabels(), and osmscout::MapPainterSVG::DrawLabels().
|
inline |
References osmscout::LabelData::fontSize, osmscout::Vertex2D::GetX(), osmscout::Vertex2D::GetY(), osmscout::LabelData::Icon, osmscout::LabelData::iconHeight, osmscout::LabelData::iconWidth, osmscout::LabelInstance< NativeGlyph, NativeLabel >::Element::label, osmscout::LabelInstance< NativeGlyph, NativeLabel >::Element::labelData, osmscout::LabelData::priority, osmscout::LabelData::Symbol, osmscout::LabelData::text, osmscout::LabelData::type, osmscout::LabelInstance< NativeGlyph, NativeLabel >::Element::x, and osmscout::LabelInstance< NativeGlyph, NativeLabel >::Element::y.
Referenced by osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::RegisterLabel(), and osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::RegisterLabel().
|
inline |
References osmscout::Glyph< NativeGlyph >::angle, osmscout::LabelPath::AngleAtLength(), osmscout::LabelPath::AngleAtLengthDeg(), osmscout::ContourLabelPositioner::calculatePositions(), osmscout::debugLabelLayouter, osmscout::LabelPath::GetLength(), osmscout::Vertex2D::GetX(), osmscout::Vertex2D::GetY(), osmscout::PathLabelData::height, osmscout::ScreenVectorRectangle::height, osmscout::ScreenVectorRectangle::Intersects(), osmscout::ContourLabelPositioner::Position::labelCount, osmscout::ContourLabelPositioner::Position::labelSpace, osmscout::ContourLabelPositioner::Position::offset, osmscout::LabelPath::PointAtLength(), osmscout::Glyph< NativeGlyph >::position, osmscout::PathLabelData::priority, osmscout::PathLabelData::style, osmscout::LabelPath::TestAngleVariance(), osmscout::PathLabelData::text, osmscout::Glyph< NativeGlyph >::trHeight, osmscout::Glyph< NativeGlyph >::trPosition, osmscout::Glyph< NativeGlyph >::trWidth, osmscout::ScreenVectorRectangle::width, osmscout::ScreenVectorRectangle::x, and osmscout::ScreenVectorRectangle::y.
Referenced by osmscout::MapPainterAgg::RegisterContourLabel(), osmscout::MapPainterCairo::RegisterContourLabel(), osmscout::MapPainterQt::RegisterContourLabel(), and osmscout::MapPainterSVG::RegisterContourLabel().
|
inline |
References osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::ProcessLabel().
Referenced by osmscout::MapPainterAgg::RegisterRegularLabel(), osmscout::MapPainterCairo::RegisterRegularLabel(), osmscout::MapPainterQt::RegisterRegularLabel(), and osmscout::MapPainterSVG::RegisterRegularLabel().
|
inline |
|
inline |
|
inline |
References osmscout::ScreenVectorRectangle::height, osmscout::ScreenVectorRectangle::width, osmscout::ScreenVectorRectangle::x, and osmscout::ScreenVectorRectangle::y.
Referenced by osmscout::MapPainterAgg::BeforeDrawing(), osmscout::MapPainterCairo::BeforeDrawing(), osmscout::MapPainterQt::BeforeDrawing(), osmscout::MapPainterSVG::BeforeDrawing(), and osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::SetViewport().
|
inline |