LuciadCPillar 2023.1.02
luciad::FeatureCanvas::IconDrawCommand Class Referenceabstract

Command to specify drawing an icon for a geometry. More...

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

Public Member Functions

virtual ~IconDrawCommand ()=default
 
virtual IconDrawCommandanchor (std::shared_ptr< Geometry > anchor)=0
 Sets the anchor of the icon. More...
 
virtual IconDrawCommanddraped (bool draped)=0
 Indicates whether or not the icon should be draped on top of the terrain. More...
 
virtual IconDrawCommandicon (std::shared_ptr< IIcon > icon)=0
 Specifies the icon to draw. More...
 
virtual IconDrawCommandinMeters ()=0
 Interpret the icon size and offset properties as meters instead of pixels. More...
 
virtual IconDrawCommandocclusionMode (OcclusionMode occlusionMode)=0
 Determines when this icon should be painted in 3D in relation to other 3D data. More...
 
virtual IconDrawCommandorientation (Azimuth orientation)=0
 Sets the azimuth towards which the top side of the icon should be oriented. More...
 
virtual IconDrawCommandposition (RelativePosition position)=0
 Determines the positioning of the icon, relative to the anchor. More...
 
virtual IconDrawCommandqueryable (bool queryable)=0
 Indicates whether or not the icon should be considered when a Map::queryFeatures is requested. More...
 
virtual IconDrawCommandscale (double scaleFactor)=0
 Applies a scale factor to the icon's size and offsets. More...
 
virtual IconDrawCommandsize (double width, double height)=0
 This method overrides the size of the specified icon. More...
 
virtual void submit ()=0
 Submits this draw command. More...
 
virtual IconDrawCommandzOrder (ZOrder zOrder)=0
 The Z-order of the icon. More...
 

Detailed Description

Command to specify drawing an icon for a geometry.

Constructor & Destructor Documentation

◆ ~IconDrawCommand()

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

Member Function Documentation

◆ anchor()

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

Sets the anchor of the icon.

This property is mandatory. the anchor must be a luciad::Point.

Parameters
anchorthe anchor of the icon, cannot be nullptr.
Returns
this IconDrawCommand.
Exceptions
InvalidArgumentExceptionif another geometry than a Point is used as anchor.
NullArgumentExceptionif anchor is nullptr.

◆ draped()

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

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

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

By default, an icon is draped if the geometry has a zero Z value. Otherwise it will not be draped. You can override the default behaviour by setting this flag true or false. If you explicitly drape for a 3D point with height, its height is discarded.

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

Parameters
drapedtrue if the icon should be draped over terrain.
Returns
this IconDrawCommand.

◆ icon()

virtual IconDrawCommand & luciad::FeatureCanvas::IconDrawCommand::icon ( std::shared_ptr< IIcon icon)
pure virtual

Specifies the icon to draw.

For the best performance, reuse the same IIcon instance when calling this function multiple times.

Parameters
iconthe icon to draw, cannot be nullptr.
Returns
this IconDrawCommand.
Exceptions
luciad::NullArgumentExceptionwhen the icon is nullptr.

◆ inMeters()

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

Interpret the icon 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 icon size and position on the map is determined using the following methods:

  • icon: the icon has a natural size
  • position: contains offsets and alignments
  • size: the icon's size can be overridden
  • scale: the scale is applied on either the icon size, or the overridden size
  • inMeters: the resulting size is interpreted as meters instead of pixels
Returns
this IconDrawCommand
Since
2022.1

◆ occlusionMode()

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

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

Details and limitations:

  • Mode OcclusionMode::VisibleOnly shows only the part of the icon that is not obscured by other 3D data. This is the default.
  • Mode OcclusionMode::AlwaysVisible shows the entire icon even if behind other 3D data. The icon will appear in front of other objects.
  • Mode OcclusionMode::OccludedOnly shows only the part of the icon that is behind other 3D data. You typically use this to display obscured icons 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 icons.

The default is OcclusionMode::VisibleOnly.

Parameters
occlusionModethe occlusion mode to use
Returns
this IconDrawCommand
Since
2023.1.01

◆ orientation()

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

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

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

If no orientation is specified, the icon 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 icon's rotation in view space, use position.

Parameters
orientationthe orientation of the icon.
Returns
this IconDrawCommand.
Since
2020.1

◆ position()

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

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

The offset properties will be interpreted as 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 IconDrawCommand & luciad::FeatureCanvas::IconDrawCommand::queryable ( bool  queryable)
pure virtual

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

The default is true.

Parameters
queryabletrue if the icon should be considered.
Returns
this IconDrawCommand.
Since
2020.1

◆ scale()

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

Applies a scale factor to the icon's 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 icon size and position on the map is determined using the following methods:

  • icon: the icon has a natural size
  • position: contains offsets and alignments
  • size: the icon's size can be overridden
  • scale: the scale is applied on either the icon size, or the overridden size
  • inMeters: the resulting size is interpreted as meters instead of pixels
Parameters
scaleFactorthe scale factor to apply to the icon's size and offset properties.
Returns
this IconDrawCommand
Exceptions
InvalidArgumentExceptionif a value equal to or smaller than 0 is provided
Since
2022.1

◆ size()

virtual IconDrawCommand & luciad::FeatureCanvas::IconDrawCommand::size ( double  width,
double  height 
)
pure virtual

This method overrides the size of the specified icon.

This method is optional. If it is not called, the icon's natural size is used.

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

  • icon: the icon has a natural size
  • position: contains offsets and alignments
  • size: the icon's size can be overridden
  • scale: the scale is applied on either the icon size, or the overridden size
  • inMeters: the resulting size is interpreted as meters instead of pixels
Parameters
widththe width of the icon, defined in device independent pixels or meters.
heightthe height of the icon, defined in device independent pixels or meters.
Returns
this IconDrawCommand
Exceptions
InvalidArgumentExceptionif a value equal to or smaller than 0 is provided
Since
2022.1

◆ submit()

virtual void luciad::FeatureCanvas::IconDrawCommand::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.

◆ zOrder()

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

The Z-order of the icon.

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 icon.
Returns
this IconDrawCommand.
Since
2020.1