8#ifndef META_OCEAN_RENDERING_GLES_TEXT_H
9#define META_OCEAN_RENDERING_GLES_TEXT_H
106 using FontPair = std::pair<std::string, std::string>;
154 std::string
text()
const override;
166 std::string
fontFamily(std::string* styleName =
nullptr)
const override;
208 void setFont(
const std::string&
fontFamily,
const std::string& styleName = std::string())
override;
244 bool isFontAvailable(
const std::string& familyName,
const std::string& styleName = std::string())
const override;
This class is the base class for all font implementations.
Definition Font.h:43
std::shared_ptr< Characters > SharedCharacters
Definition of a shared pointers holding characters.
Definition Font.h:170
This class implements a recursive lock object.
Definition Lock.h:31
This class implements a 2D lookup object with values at the bins' corners defining the individual loo...
Definition Lookup2.h:636
This class is the base class for all rendering engines like.
Definition Engine.h:46
This class implements a GLESceneGraph attribute set object.
Definition GLESAttributeSet.h:40
This class implements a base for all GLESceneGraph framebuffers.
Definition rendering/glescenegraph/GLESFramebuffer.h:34
GLESShape()
Creates a new GLESceneGraph shape object.
This class stores the relevant information necessary to render the text using one specific font.
Definition GLESText.h:59
CV::Fonts::SharedFont font_
The font of this object.
Definition GLESText.h:86
CV::Fonts::Font::SharedCharacters characters_
The layout information for all characters.
Definition GLESText.h:92
unsigned int textureWidth_
The width of the texture, in pixel, with range [1, infinity), 0 if this object is invalid.
Definition GLESText.h:95
FontData()=default
Default constructor creating an invalid object.
bool isValid() const
Returns whether this object hold valid information.
Definition GLESText.h:377
unsigned int textureHeight_
The height of the texture, in pixel, with range [1, infinity), 0 if this object is invalid.
Definition GLESText.h:98
TexturesRef textures_
The textures object holding the texture with the font's characters.
Definition GLESText.h:89
The manager providing access to the texture containing the font's characters and some associated info...
Definition GLESText.h:50
std::map< FontPair, FontData > FontMap
Definition of a map mapping the font's name pair to FontData objects.
Definition GLESText.h:111
FontData fontData(Rendering::Engine &engine, const std::string &fontFamily, const std::string &styleName=std::string())
Returns the relevant information necessary to render the text using a specific font.
std::pair< std::string, std::string > FontPair
Definition of a pair combining the font's family name and style name.
Definition GLESText.h:106
CV::Fonts::SharedFont font(const std::string &fontFamily, const std::string &styleName=std::string())
Returns the font (with correct font size) which is used to create the relevant information for the ma...
FontMap fontMap_
The map mapping font names to FontData objects.
Definition GLESText.h:142
void release()
Releases all text texture resources.
Lock lock_
The manager's lock.
Definition GLESText.h:145
friend class GLESFactory
Definition GLESText.h:42
void rebuildPrimitives() override
Rebuilds the primitive vertex, normals and face sets.
TexturesRef textures_
The textures object holding the texture with the font's characters.
Definition GLESText.h:358
Scalar fixedLineHeight_
The fixed height of each text line; 0 to use 'fixedWidthHeight_'.
Definition GLESText.h:334
std::string fontFamily_
The font family to be used.
Definition GLESText.h:340
std::string styleName_
The font's style name to be used, empty to use the default style.
Definition GLESText.h:343
std::string text_
The text which is actually rendered.
Definition GLESText.h:328
ObjectType type() const override
Returns the type of this object.
HorizontalAnchor horizontalAnchor() const override
Returns the horizontal anchor of the text.
void setAlignmentMode(const AlignmentMode alignmentMode) override
Sets the alignment mode of the text.
Vector2 size() const override
Returns the actual width and height of the text.
std::string text() const override
Returns the text to be rendered.
Vector2 resultingSize_
The actual resulting size of the rendered text; (0, 0) until known.
Definition GLESText.h:337
VerticalAnchor verticalAnchor() const override
Returns the vertical anchor of the text.
void setVerticalAnchor(const VerticalAnchor verticalAnchor) override
Sets the vertical anchor of the text.
bool isFontAvailable(const std::string &familyName, const std::string &styleName=std::string()) const override
Returns whether a specific font is currently available.
void setGeometryLookupTable(const LookupCorner2< Vector3 > &lookupTable) override
Sets an explicit lookup table which will be used to determine the text geometry (the vertices of the ...
AlignmentMode alignmentMode() const override
Returns the alignment mode of the text.
std::string availableDefaultFont(std::string *styleName=nullptr) const override
Returns the default front currently available.
bool calculateTextSize(const CV::Fonts::Font &font, CV::PixelBoundingBoxesI &linePixelBoundingBoxes, unsigned int &textWidthPixels, unsigned int &textHeightPixels, Scalar &textWidth, Scalar &textHeight) const
Calculates the size of the reulting text block.
void render(const GLESFramebuffer &framebuffer, const SquareMatrix4 &projectionMatrix, const HomogenousMatrix4 &camera_T_object, const HomogenousMatrix4 &camera_T_world, const SquareMatrix3 &normalMatrix, GLESAttributeSet &attributeSet, const Lights &lights) override
Renders the triangles defined by the associated vertex set and the defined triangle faces.
MaterialRef backgroundMaterial() const override
Returns the material which is used to render the background of the text.
AlignmentMode alignmentMode_
The text's alignment mode.
Definition GLESText.h:346
Vector2 fixedWidthHeight_
The fixed size of the text; (0, 0) to use the.
Definition GLESText.h:331
bool setSize(const Scalar fixedWidth, const Scalar fixedHeight, const Scalar fixedLineHeight) override
Sets the size of the text.
VerticalAnchor verticalAnchor_
The text's vertical anchor.
Definition GLESText.h:352
GLESText()
Creates a new GLESceneGraph box object.
std::string fontFamily(std::string *styleName=nullptr) const override
Returns the font which is used to render the text.
Strings availableStyleNames(const std::string &familyName) const override
Returns the style names of all available fonts with specified family name.
HorizontalAnchor horizontalAnchor_
The text's horizontal anchor.
Definition GLESText.h:349
void setHorizontalAnchor(const HorizontalAnchor horizontalAnchor) override
Sets the horizontal anchor of the text.
~GLESText() override
Destructs a GLESceneGraph box object.
bool needsRebuild_
True, if the text premitives need to be rebuilt.
Definition GLESText.h:355
Strings availableFamilyNames() const override
Returns all available family names.
void updateBoundingBox() override
Updates the bounding box of this primitive.
std::string descriptiveInformation() const override
Returns descriptive information about the object as string.
MaterialRef backgroundMaterial_
The background material to be used.
Definition GLESText.h:361
LookupCorner2< Vector3 > lookupTable_
The optional lookup table for the text geometry.
Definition GLESText.h:364
static void release()
Releases all text texture resources.
void setBackgroundMaterial(const MaterialRef &material) override
Returns the material which is used to render the background of the text.
void setFont(const std::string &fontFamily, const std::string &styleName=std::string()) override
Sets the font to be used when rendering the text.
void setText(const std::string &text) override
Sets the text to be rendred.
GLESTriangles()
Creates a new GLESceneGraph triangles object.
Engine & engine() const
Returns the render engine which is owner of this object.
ObjectType
Definition of different object type.
Definition Object.h:62
HorizontalAnchor
Definition of individual horizontal anchor points for the entire text block.
Definition rendering/Text.h:94
@ HA_LEFT
The text block is anchored at the left edge.
Definition rendering/Text.h:106
AlignmentMode
Definition of individual alignment modes within the text block.
Definition rendering/Text.h:46
@ AM_LEFT
The text is aligned to the left of the text block.
Definition rendering/Text.h:59
Text()
Creates a new text object.
VerticalAnchor
Definition of individual vertical anchor points for the entire text block.
Definition rendering/Text.h:139
@ VA_TOP
The text block is anchored at the top edge.
Definition rendering/Text.h:141
std::vector< std::string > Strings
Definition of a vector holding strings.
Definition Base.h:162
std::vector< PixelBoundingBoxI > PixelBoundingBoxesI
Definition of a vector holding bounding box objects with positive and negative coordinate values.
Definition PixelBoundingBox.h:49
std::shared_ptr< Font > SharedFont
Definition of a shared font pointer.
Definition Font.h:34
HomogenousMatrixT4< Scalar > HomogenousMatrix4
Definition of the HomogenousMatrix4 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION flag eit...
Definition HomogenousMatrix4.h:44
VectorT2< Scalar > Vector2
Definition of a 2D vector.
Definition Vector2.h:28
SquareMatrixT3< Scalar > SquareMatrix3
Definition of the SquareMatrix3 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with ...
Definition SquareMatrix3.h:43
SquareMatrixT4< Scalar > SquareMatrix4
Definition of the SquareMatrix4 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with ...
Definition SquareMatrix4.h:39
float Scalar
Definition of a scalar type.
Definition Math.h:129
SmartObjectRef< Material > MaterialRef
Definition of a smart object reference holding a material.
Definition rendering/Material.h:30
SmartObjectRef< Textures > TexturesRef
Definition of a smart object reference holding a textures.
Definition Textures.h:32
std::vector< LightPair > Lights
Definition of a set holding light sources.
Definition GLESLightSource.h:44
Namespace of the Rendering GLESceneGraph library.
Definition rendering/glescenegraph/android/Android.h:20
Namespace of the Rendering library.
Definition AbsoluteTransform.h:18
The namespace covering the entire Ocean framework.
Definition Accessor.h:15