Maria GDK 5.0.0.738
Documentation of native code in develop branch
Loading...
Searching...
No Matches
Maria::LabelRenderItem Class Reference

#include <MLabelRenderItem.h>

Classes

struct  Background
 
struct  LabelInstance
 
struct  RenderBatch
 
struct  VertexData
 

Public Member Functions

void setGlyphsPoint (const STK::Vector2f &position, const GlyphRun &glyphs, bool outline, const double offsetX=0.0, const double offsetY=0.0, double angle=0.0, bool allowOverlap=false, bool drawBackground=false)
 
void setGlyphsPath (const std::vector< STK::Vector2f > &line, bool continuedLine, const GlyphRun &glyphs, double stretch, bool allowOverlap)
 
void setFont (const std::shared_ptr< STK::Font > &font)
 
void addGlyphsPath (const std::vector< STK::Vector2f > &line, bool continuedLine, const GlyphRun &glyphs, bool allowOverlap)
 
void addGlyphsPoint (const STK::Vector2f &position, const GlyphRun &glyphs, double offsetX, double offsetY, double angle, bool allowOverlap, bool drawBackground)
 
int numGlyphs ()
 The total number of glyphs in this item.
 
void setColor (const Maria::RGBA &color)
 
void setOutlineColor (const Maria::RGBA &color)
 
void setBackgroundColor (const Maria::RGBA &color)
 
bool fixedRotation () const
 
void setFixedRotation (bool fixedRotation)
 
void preRender (const std::shared_ptr< RasterProjector > &vp)
 
void renderLabels (const std::shared_ptr< STK::ShaderProgram > &shader, float opacity)
 
void renderBackgrounds (STK::ShaderProgram &shader)
 
void projectAnchors (const std::shared_ptr< RasterProjector > &tileRp, const std::shared_ptr< RasterProjector > &vp)
 
void getPlacedCollisionFeatures (float xMin, float xMax, float yMin, float yMax, std::vector< PlacedCollisionFeature > &pcf)
 
void updateCollisionGrid (std::shared_ptr< CollisionGrid > collisionGrid)
 
std::shared_ptr< STK::EllipseRender2DgetDebugGraphics (const double pixelSize)
 
void setGeoRect (const BasicGeoTypes::GeoRect &grc)
 
const BasicGeoTypes::GeoRectgetGeoRect () const
 
bool shouldRenderBackground () const
 

Static Public Attributes

static const int MaxNumGlyphs = 65536/6
 

Detailed Description

LabelRenderItem - OpenGL vertex buffer data for a collection of labels. This collection of labels usually corresponds to one rendering batch and contains all labels with the same font and color parameters.

Member Function Documentation

◆ addGlyphsPath()

void LabelRenderItem::addGlyphsPath ( const std::vector< STK::Vector2f > &  line,
bool  continuedLine,
const GlyphRun glyphs,
bool  allowOverlap 
)

Add glyphs along a path. Add glyphs along the given path.

◆ addGlyphsPoint()

void LabelRenderItem::addGlyphsPoint ( const STK::Vector2f position,
const GlyphRun glyphs,
double  offsetX,
double  offsetY,
double  angle,
bool  allowOverlap,
bool  drawBackground 
)

Add glyphs at anchor point. Add glyphs at the given anchor point. A valid font cache must be set with the setFont() method first.

◆ getPlacedCollisionFeatures()

void LabelRenderItem::getPlacedCollisionFeatures ( float  xMin,
float  xMax,
float  yMin,
float  yMax,
std::vector< PlacedCollisionFeature > &  pcf 
)

Get all label collision boxes with placement scale within the given bounding box.

◆ setFont()

void Maria::LabelRenderItem::setFont ( const std::shared_ptr< STK::Font > &  font)
inline

Set font for this label item node. All labels in the node will use this font. All glyphs must be registered in the corresponding font glyph cache, so this method must be called before adding any glyphs.

◆ setGlyphsPath()

void Maria::LabelRenderItem::setGlyphsPath ( const std::vector< STK::Vector2f > &  line,
bool  continuedLine,
const GlyphRun glyphs,
double  stretch,
bool  allowOverlap 
)
inline

Add glyphs along a path. Set glyphs along the given path. This method also sets the font according to the glyph run. The stretch parameter is a horizontal scale factor, default should be 1.0

◆ setGlyphsPoint()

void Maria::LabelRenderItem::setGlyphsPoint ( const STK::Vector2f position,
const GlyphRun glyphs,
bool  outline,
const double  offsetX = 0.0,
const double  offsetY = 0.0,
double  angle = 0.0,
bool  allowOverlap = false,
bool  drawBackground = false 
)
inline

Add glyphs at anchor point. Set glyphs at the given anchor point. This method also sets the font according to the glyph run.


The documentation for this class was generated from the following files: