LuciadCPillar 2023.1.04
luciad::FeatureCanvas::TextDrawCommand Class Referenceabstract

Command to specify drawing text for a geometry. More...

#include <luciad/layers/features/FeatureCanvas.h>

Public Member Functions

virtual ~TextDrawCommand ()=default
 
virtual TextDrawCommandanchor (std::shared_ptr< Geometry > anchor)=0
 Sets the anchor of the text. More...
 
virtual TextDrawCommanddraped (bool draped)=0
 Indicates whether or not the text should be draped on top of the terrain. More...
 
virtual TextDrawCommandinMeters ()=0
 Interpret the text size and offset properties as meters instead of pixels. More...
 
virtual TextDrawCommandocclusionMode (OcclusionMode occlusionMode)=0
 Determines when this text should be painted in 3D in relation to other 3D data. More...
 
virtual TextDrawCommandorientation (Azimuth orientation)=0
 Sets the azimuth towards which the top side of the text should be oriented. More...
 
virtual TextDrawCommandposition (RelativePosition position)=0
 Determines the positioning of the text, relative to the anchor. More...
 
virtual TextDrawCommandqueryable (bool queryable)=0
 Indicates whether or not the text should be considered when a Map::queryFeatures is requested. More...
 
virtual TextDrawCommandscale (double scaleFactor)=0
 Applies a scale factor to the text size and offsets. More...
 
virtual void submit ()=0
 Submits this draw command. More...
 
virtual TextDrawCommandtext (std::string text)=0
 Sets the text to draw. More...
 
virtual TextDrawCommandtext (std::vector< std::string > text, HorizontalAlignment alignment=HorizontalAlignment::Left)=0
 Sets the text to draw. More...
 
virtual TextDrawCommandtextStyle (TextStyle textStyle)=0
 Sets the styling for the text. More...
 
virtual TextDrawCommandzOrder (ZOrder zOrder)=0
 The Z-order of the text. More...
 

Detailed Description

Command to specify drawing text for a geometry.

Constructor & Destructor Documentation

◆ ~TextDrawCommand()

virtual luciad::FeatureCanvas::TextDrawCommand::~TextDrawCommand ( )
virtualdefault

Member Function Documentation

◆ anchor()

virtual TextDrawCommand & luciad::FeatureCanvas::TextDrawCommand::anchor ( std::shared_ptr< Geometry anchor)
pure virtual

Sets the anchor of the text.

This property is mandatory.

Parameters
anchorthe anchor of the text, cannot be nullptr. The anchor must be a luciad::Point.
Returns
this TextDrawCommand.
Exceptions
InvalidArgumentExceptionif another geometry than a Point is used as anchor.
NullArgumentExceptionif anchor is nullptr.

◆ draped()

virtual TextDrawCommand & luciad::FeatureCanvas::TextDrawCommand::draped ( bool  draped)
pure virtual

Indicates whether or not the text should be draped on top of the terrain.

Draping means that the text is painted directly on top of the terrain’s surface relief.

By default, text is not draped.

This setting is only relevant for 3D maps and is ignored for 2D maps.

Parameters
drapedtrue if the text should be draped over terrain.
Returns
this TextDrawCommand.
Since
2022.1.04

◆ inMeters()

virtual TextDrawCommand & luciad::FeatureCanvas::TextDrawCommand::inMeters ( )
pure virtual

Interpret the text size and offset properties as meters instead of pixels.

This method is optional. By default, the size and offsets are interpreted as device independent pixels.

The text size and position on the map is determined using the following methods:

  • textStyle: the font size.
  • position: contains offsets and alignments.
  • inMeters: the resulting size is interpreted as meters instead of pixels.
Returns
this TextDrawCommand
Since
2022.1

◆ occlusionMode()

virtual TextDrawCommand & luciad::FeatureCanvas::TextDrawCommand::occlusionMode ( OcclusionMode  occlusionMode)
pure virtual

Determines when this text should be painted in 3D in relation to other 3D data.

Details and limitations:

  • Mode OcclusionMode::VisibleOnly shows only the part of the text that is not obscured by other 3D data. This is the default.
  • Mode OcclusionMode::AlwaysVisible shows the entire text even if behind other 3D data. The text will appear in front of other objects.
  • Mode OcclusionMode::OccludedOnly shows only the part of the text that is behind other 3D data. You typically use this to display obscured text in combination with another style that uses OcclusionMode::VisibleOnly mode.
  • This parameter is only relevant in 3D. It is ignored on a 2D map.
  • This parameter is only applied on non-draped text.

The default is OcclusionMode::VisibleOnly.

Parameters
occlusionModethe occlusion mode to use
Returns
this TextDrawCommand
Since
2023.1.01

◆ orientation()

virtual TextDrawCommand & luciad::FeatureCanvas::TextDrawCommand::orientation ( Azimuth  orientation)
pure virtual

Sets the azimuth towards which the top side of the text should be oriented.

For example, an azimuth of 0 means that the text will be painted upright when the North arrow points upwards, but the text will rotate along when the map is rotated. The anchor point serves as the center of this rotation.

If no orientation is specified, the text will not be oriented and always be displayed with the same angle in view space, independent of how the map is oriented. In order to set the text's rotation in view space, use position.

Parameters
orientationthe orientation of the text.
Returns
this TextDrawCommand.
Since
2020.1

◆ position()

virtual TextDrawCommand & luciad::FeatureCanvas::TextDrawCommand::position ( RelativePosition  position)
pure virtual

Determines the positioning of the text, relative to the anchor.

The offset properties will be interpreted as device independent pixels or meters.

This method is optional: if not specified, the default position as defined in RelativePosition will be used.

Parameters
positionthe positioning of the icon, relative to the anchor.
Returns
this IconDrawCommand.

◆ queryable()

virtual TextDrawCommand & luciad::FeatureCanvas::TextDrawCommand::queryable ( bool  queryable)
pure virtual

Indicates whether or not the text should be considered when a Map::queryFeatures is requested.

The default is true.

Parameters
queryabletrue if the text should be considered.
Returns
this TextDrawCommand.
Since
2020.1

◆ scale()

virtual TextDrawCommand & luciad::FeatureCanvas::TextDrawCommand::scale ( double  scaleFactor)
pure virtual

Applies a scale factor to the text size and offsets.

This method is optional. If it is not called, no scaling will be performed (i.e. a scale of 1.0 is used).

The text size and position on the map is determined using the following methods:

  • textStyle: the font size.
  • position: contains offsets and alignments.
  • inMeters: the resulting size is interpreted as meters instead of pixels.
Parameters
scaleFactorthe scale factor to apply to the text size and offset properties.
Returns
this TextDrawCommand
Exceptions
InvalidArgumentExceptionif a value equal to or smaller than 0 is provided
Since
2022.1

◆ submit()

virtual void luciad::FeatureCanvas::TextDrawCommand::submit ( )
pure virtual

Submits this draw command.

Nothing will be painted if the draw command is not submitted.

Exceptions
luciad::LogicExceptionwhen there are missing icon command calls or the command is already submitted.

◆ text() [1/2]

virtual TextDrawCommand & luciad::FeatureCanvas::TextDrawCommand::text ( std::string  text)
pure virtual

Sets the text to draw.

This property is mandatory.

Parameters
textthe text to draw.
Returns
this TextDrawCommand.

◆ text() [2/2]

virtual TextDrawCommand & luciad::FeatureCanvas::TextDrawCommand::text ( std::vector< std::string >  text,
HorizontalAlignment  alignment = HorizontalAlignment::Left 
)
pure virtual

Sets the text to draw.

Each element of the vector represents a new line of text to draw.

This property is mandatory.

Parameters
textthe text to draw. Each element of the vector represents a new line of text to draw.
alignmentside where text is aligned. By default text is aligned on the left.
Returns
this TextDrawCommand.

◆ textStyle()

virtual TextDrawCommand & luciad::FeatureCanvas::TextDrawCommand::textStyle ( TextStyle  textStyle)
pure virtual

Sets the styling for the text.

This property is optional. See the text style builder for the default values.

Parameters
textStylethe styling for the text, cannot be nullptr.
Returns
this

◆ zOrder()

virtual TextDrawCommand & luciad::FeatureCanvas::TextDrawCommand::zOrder ( ZOrder  zOrder)
pure virtual

The Z-order of the text.

DrawCommands are painted from lowest to highest Z-order, so DrawCommands with a higher Z-order are painted on top of DrawCommands with a lower Z-order. Note that the Z-order only affects the ordering of features within the same layer. A feature from a certain layer will always get painted above any other feature from a layer that comes lower in the map's layer order, regardless of what Z-order they may have. The default value is 0.

Parameters
zOrderthe Z-order of this text.
Returns
this TextDrawCommand.
Since
2020.1