Ocean
|
This class is the base class for all texts. More...
Public Member Functions | |
virtual std::string | text () const |
Returns the text to be rendered. More... | |
virtual Vector2 | size () const |
Returns the actual width and height of the text. More... | |
virtual std::string | fontFamily (std::string *styleName=nullptr) const |
Returns the font which is used to render the text. More... | |
virtual MaterialRef | backgroundMaterial () const |
Returns the material which is used to render the background of the text. More... | |
virtual AlignmentMode | alignmentMode () const |
Returns the alignment mode of the text. More... | |
virtual HorizontalAnchor | horizontalAnchor () const |
Returns the horizontal anchor of the text. More... | |
virtual VerticalAnchor | verticalAnchor () const |
Returns the vertical anchor of the text. More... | |
virtual void | setText (const std::string &text) |
Sets the text to be rendred. More... | |
virtual bool | setSize (const Scalar fixedWidth, const Scalar fixedHeight, const Scalar fixedLineHeight) |
Sets the size of the text. More... | |
virtual void | setFont (const std::string &fontFamily, const std::string &styleName=std::string()) |
Sets the font to be used when rendering the text. More... | |
virtual void | setBackgroundMaterial (const MaterialRef &material) |
Returns the material which is used to render the background of the text. More... | |
virtual void | setAlignmentMode (const AlignmentMode alignmentMode) |
Sets the alignment mode of the text. More... | |
virtual void | setHorizontalAnchor (const HorizontalAnchor horizontalAnchor) |
Sets the horizontal anchor of the text. More... | |
virtual void | setVerticalAnchor (const VerticalAnchor verticalAnchor) |
Sets the vertical anchor of the text. More... | |
virtual void | setGeometryLookupTable (const LookupCorner2< Vector3 > &lookupTable) |
Sets an explicit lookup table which will be used to determine the text geometry (the vertices of the text). More... | |
virtual bool | isFontAvailable (const std::string &familyName, const std::string &styleName=std::string()) const |
Returns whether a specific font is currently available. More... | |
virtual std::string | availableDefaultFont (std::string *styleName=nullptr) const |
Returns the default front currently available. More... | |
virtual std::vector< std::string > | availableFamilyNames () const |
Returns all available family names. More... | |
virtual std::vector< std::string > | availableStyleNames (const std::string &familyName) const |
Returns the style names of all available fonts with specified family name. More... | |
ObjectType | type () const override |
Returns the type of this object. More... | |
Public Member Functions inherited from Ocean::Rendering::Object | |
ObjectId | id () const |
Returns the unique object id of this object. More... | |
const std::string & | name () const |
Returns the name of this object. More... | |
virtual void | setName (const std::string &name) |
Sets or changes the name of this object. More... | |
virtual const std::string & | engineName () const =0 |
Returns the name of the owner engine. More... | |
ObjectRefs | parentObjects () const |
Returns all parent objects. More... | |
ObjectRefSet | parentNodes () const |
Returns all parent nodes. More... | |
virtual std::string | descriptiveInformation () const |
Returns descriptive information about the object as string. More... | |
Protected Member Functions | |
Text () | |
Creates a new text object. More... | |
~Text () override | |
Destructs the text object. More... | |
Protected Member Functions inherited from Ocean::Rendering::Shape | |
Shape () | |
Creates a new shape node. More... | |
~Shape () override | |
Destructs a shape node. More... | |
Protected Member Functions inherited from Ocean::Rendering::Renderable | |
Renderable () | |
Creates a new renderable object. More... | |
~Renderable () override | |
Destructs a renderable object. More... | |
Protected Member Functions inherited from Ocean::Rendering::Object | |
Object () | |
Creates a new object. More... | |
Object (const Object &object)=delete | |
Disabled copy constructor. More... | |
virtual | ~Object () |
Destructs an object. More... | |
Engine & | engine () const |
Returns the render engine which is owner of this object. More... | |
void | registerParent (const ObjectId parentId) |
Registers a parent node for this (child) node. More... | |
void | unregisterParent (const ObjectId parentId) |
Unregisters a parent node for this (child) node. More... | |
void | registerThisObjectAsParent (const ObjectRef &child) |
Registers this object at a child as parent object. More... | |
void | unregisterThisObjectAsParent (const ObjectRef &child) |
Unregisters this object from a child as parent. More... | |
Object & | operator= (const Object &object)=delete |
Disabled copy operator. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Ocean::Rendering::Object | |
static std::string | translateObjectType (const ObjectType objectType) |
Translates an object type to a readable string. More... | |
Protected Attributes inherited from Ocean::Rendering::Object | |
Lock | objectLock |
Lock for the object. More... | |
This class is the base class for all texts.
Definition of individual alignment modes within the text block.
Definition of individual horizontal anchor points for the entire text block.
|
protected |
Creates a new text object.
|
overrideprotected |
Destructs the text object.
|
virtual |
Returns the alignment mode of the text.
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Returns the default front currently available.
styleName | Optional resulting style name of the resulting font, nullptr if not of interest |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Returns all available family names.
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Returns the style names of all available fonts with specified family name.
familyName | The family name of the fonts for which all available style names will be returned |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Returns the material which is used to render the background of the text.
By default, the text will be rendered with a black opaque background.
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Returns the font which is used to render the text.
styleName | Optional resulting style name of the font |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Returns the horizontal anchor of the text.
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Returns whether a specific font is currently available.
familyName | The name of the font family to check |
styleName | Optional explicit font style to check |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Sets the alignment mode of the text.
alignmentMode | The alignment node to be set |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Returns the material which is used to render the background of the text.
By default, the text will be rendered with a black opaque background.
The background can be fully customized by e.g., setting a different diffuse color or the transparency of the background.
To render the text without background, the material must be entirely transparent and a BlendAttribute must be attached to the corresponding AttributeSet:
To render the text with partially transparent background, the material must be translucent and a BlendAttribute must be attached to the corresponding AttributeSet:
To render the text with opaque background, the material must be opaque:
material | The background material to be set |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Sets the font to be used when rendering the text.
fontFamily | The family identifying the font, must be valid |
styleName | The optional style name of the font, empty to use the default style |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Sets an explicit lookup table which will be used to determine the text geometry (the vertices of the text).
In case a lookup table is set, the horizontal and vertical anchor do not have any meaning anymore.
The width and height of the lookup table must be identical to the number of horizontal and vertical bins.
lookupTable | The lookup table to be set, an invalid lookup table to remove a previously set table |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Sets the horizontal anchor of the text.
horizontalAnchor | The horizontal anchor to be set |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Sets the size of the text.
Four different size modes are supported:
1) The text block has a fixed width and the height is automatically determined by preserving the aspect ratio.
2) The text block has a fixed height and the width is automatically determined by preserving the aspect ratio.
3) The text block has a fixed width and fixed height the text's aspect ratio is not preserved.
4) The width and height of the text block is automatically determined by ensuring that each text line has a specified height while the aspect ratio is preserved.
fixedWidth | The fixed width of the text block, with range (0, infinity), 0 to define the width indirect via 'fixedHeight' or 'fixedLineHeight' |
fixedHeight | The fixed height of the text block, with range (0, infinity), 0 to define the height indirect via 'fixedWidth' or 'fixedLineHeight' |
fixedLineHeight | The height of each line in the text block, with range (0, infinity), 0 to define the size via 'fixedWidth' and/or 'fixedHeight' |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Sets the text to be rendred.
Multiple lines can be rendered by adding a line feed character ('
') at the end of a line.
text | The text to be rendered |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Sets the vertical anchor of the text.
verticalAnchor | The vertical anchor to be set |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Returns the actual width and height of the text.
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
virtual |
Returns the text to be rendered.
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.
|
overridevirtual |
Returns the type of this object.
Reimplemented from Ocean::Rendering::Shape.
|
virtual |
Returns the vertical anchor of the text.
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESText.