Skip To Content ArcGIS for Developers Sign In Dashboard

DashGeometricEffect Class

class Esri::ArcGISRuntime::DashGeometricEffect

A Geometric effect object that transforms the symbolization of a line using a pattern of dashes and gaps. More...

Header: #include <DashGeometricEffect>
Since: Esri::ArcGISRuntime 100.5
Inherits: Esri::ArcGISRuntime::GeometricEffect

This class was introduced in Esri::ArcGISRuntime 100.5.

Public Functions

DashGeometricEffect(const QList<double> &dashTemplate, QObject *parent = nullptr)
DashGeometricEffect(QObject *parent = nullptr)
virtual ~DashGeometricEffect() override
QList<double> dashTemplate() const
void setDashTemplate(const QList<double> &dashTemplate)

Detailed Description

Dashes are the symbolized (visible) portion of the stroke and gaps are the unsymbolized portion.

Defining dash and gap distances

A list of dash and gap distances (DIP values, all greater than 0) provides a template to be repeated throughout the line. A basic template consists of two distance values: the first defines the length of each dash and the second defines the length of each gap. More complex effects can be created by defining a template of multiple dashes and gaps.

Template values are read as dash distance followed by gap distance throughout the pattern. Templates that contain an odd number of values will maintain the dash-gap pattern by restarting at the beginning of the template. A template of '3 2 1', for example will be rendered as '3(dash) 2(gap) 1(dash) 3(gap) 2(dash) 1(gap) ...'. The default template is an empty list, which renders a solid line.

The gaps in a dash effect can be lost when a small gap is defined while a round or square cap style is applied. Because the cap style is applied to both ends of a dash, they can overlap over short distances and fill the gap. A butt style cap ends the stroke abruptly, so will not exhibit the issue. (This behavior is consistent with ArcGIS Pro.)

Member Function Documentation

DashGeometricEffect::DashGeometricEffect(const QList<double> &dashTemplate, QObject *parent = nullptr)

Constructor that takes a dashTemplate with an optional parent.

DashGeometricEffect::DashGeometricEffect(QObject *parent = nullptr)

Default constructor with an optional parent.

[override virtual] DashGeometricEffect::~DashGeometricEffect()

Destructor.

QList<double> DashGeometricEffect::dashTemplate() const

Returns the template that defines dashes and gaps for the geometric effect.

See also setDashTemplate() and Defining dash and gap distances.

void DashGeometricEffect::setDashTemplate(const QList<double> &dashTemplate)

Sets the template that defines dashes and gaps for the geometric effect.

  • dashTemplate - QList of DIP values that define the dash-gap pattern.

See also dashTemplate() and Defining dash and gap distances.


Feedback on this topic?