A base class for renderers that use a collection of one or more symbols to display features in a Layer or graphics in a GraphicsOverlay. More...
Header: | #include <Renderer.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::JsonSerializable |
Inherited By: | Esri::ArcGISRuntime::ClassBreaksRenderer, Esri::ArcGISRuntime::DictionaryRenderer, Esri::ArcGISRuntime::HeatmapRenderer, Esri::ArcGISRuntime::SimpleRenderer, and Esri::ArcGISRuntime::UniqueValueRenderer |
Public Functions
virtual | ~Renderer() override |
Esri::ArcGISRuntime::Renderer * | clone(QObject *parent = nullptr) const |
Esri::ArcGISRuntime::RendererType | rendererType() const |
QString | rotationExpression() const |
Esri::ArcGISRuntime::RotationType | rotationType() const |
Esri::ArcGISRuntime::RendererSceneProperties | sceneProperties() const |
void | setRotationExpression(const QString &expression) |
void | setRotationType(Esri::ArcGISRuntime::RotationType type) |
void | setSceneProperties(const Esri::ArcGISRuntime::RendererSceneProperties &sceneProperties) |
Esri::ArcGISRuntime::Symbol * | symbol(Esri::ArcGISRuntime::DynamicEntity *dynamicEntity) const |
Esri::ArcGISRuntime::Symbol * | symbol(Esri::ArcGISRuntime::DynamicEntity *dynamicEntity, bool applyAttributeOverrides) const |
Esri::ArcGISRuntime::Symbol * | symbol(Esri::ArcGISRuntime::DynamicEntityObservation *dynamicEntityObservation) const |
Esri::ArcGISRuntime::Symbol * | symbol(Esri::ArcGISRuntime::DynamicEntityObservation *dynamicEntityObservation, bool applyAttributeOverrides) const |
Esri::ArcGISRuntime::Symbol * | symbol(Esri::ArcGISRuntime::Feature *feature) const |
Esri::ArcGISRuntime::Symbol * | symbol(Esri::ArcGISRuntime::Feature *feature, bool applyAttributeOverrides) const |
Esri::ArcGISRuntime::Symbol * | symbol(Esri::ArcGISRuntime::Graphic *graphic) const |
Esri::ArcGISRuntime::Symbol * | symbol(Esri::ArcGISRuntime::Graphic *graphic, bool applyAttributeOverrides) const |
virtual bool | operator!=(const Esri::ArcGISRuntime::Renderer *other) const |
virtual bool | operator==(const Esri::ArcGISRuntime::Renderer *other) const |
Reimplemented Public Functions
virtual QString | toJson() const override |
virtual QJsonObject | unknownJson() const override |
virtual QJsonObject | unsupportedJson() const override |
Static Public Members
Esri::ArcGISRuntime::Renderer * | fromJson(const QString &json, QObject *parent = nullptr) |
Detailed Description
If the renderer contains more than a single symbol, it uses the rules to determine the symbol to apply to each geoelement, based on one or several attribute values. There are three basic types of renderers:
- SimpleRenderer - simple renderers use a single symbol for all geoelements.
- UniqueValueRenderer - unique value renders define a different symbol for each unique value of an attribute.
- ClassBreaksRenderer - class break renderers define a different symbol for each range of numeric values.
To symbolize and display the geoelements, apply the renderer to the FeatureLayer::renderer or the GraphicsOverlay::renderer.
A GraphicsOverlay can contain graphics with different geometry dimensions, such as a Point and Polygon. A Renderer, however, can only provide symbols with one geometry dimension. Therefore, if you apply a renderer to a graphics overlay, only graphics with the specified geometry dimension are displayed. All other graphics are not visible.
If you apply a Symbol directly to a graphic, the symbol displays in preference to the GraphicsOverlay::renderer.
For raster data, rendering is handled by a RasterRenderer.
Relevant samples:
- Add dynamic entity layer: Display data from an ArcGIS stream service using a dynamic entity layer.
- Animate 3D symbols: Demonstrates how to animate a graphic's position and rotation and follow it using a `OrbitGeoElementCameraController`.
- RGB renderer: Apply an RGB renderer to a raster layer to enhance feature visibility.
Member Function Documentation
[override virtual]
Renderer::~Renderer()
Destructor.
Esri::ArcGISRuntime::Renderer *Renderer::clone(QObject *parent = nullptr) const
Clones the renderer to a new instance with an optional parent.
Returns a new instance of the current renderer.
[static]
Esri::ArcGISRuntime::Renderer *Renderer::fromJson (const QString &json, QObject *parent = nullptr)
Creates and returns a new renderer from the provided json, with an optional parent.
See also JsonSerializable.
Esri::ArcGISRuntime::RendererType Renderer::rendererType () const
Returns the renderer type.
QString Renderer::rotationExpression () const
Returns the expression describing how attributes values are translated into a rotation to be applied to the GeoElement.
When an attribute name is specified in the rotation expression, it is enclosed in square brackets, for example: [Rotation].
See also setRotationExpression.
Esri::ArcGISRuntime::RotationType Renderer::rotationType () const
Returns a bool
that determines whether the rotation calculated from the rotationExpression is interpreted as arithmetic or geographic.
The options are:
- RotationType::Arithmetic - rotation is along the x-axis, with positive rotation being counter-clockwise.
- RotationType::Geographic - rotation is along the y-axis, with positive rotation being clockwise.
RotationType::Arithmetic if an error occurs.
See also setRotationType.
Esri::ArcGISRuntime::RendererSceneProperties Renderer::sceneProperties () const
Returns the scene view properties for the renderer.
This can be used to make changes to how a GeoElement is displayed in a SceneView.
See also setSceneProperties().
void Renderer::setRotationExpression (const QString &expression)
Sets the rotationExpression to expression.
See also rotationExpression.
void Renderer::setRotationType (Esri::ArcGISRuntime::RotationType type)
Sets the rotationType to type.
See also rotationType.
void Renderer::setSceneProperties (const Esri::ArcGISRuntime::RendererSceneProperties &sceneProperties )
Sets the sceneProperties to sceneProperties.
See also sceneProperties.
[since Esri::ArcGISRuntime 200.1]
Esri::ArcGISRuntime::Symbol *Renderer::symbol(Esri::ArcGISRuntime::DynamicEntity *dynamicEntity ) const
Returns the symbol that is used to visualize the given dynamic entity.
- dynamicEntity - The dynamic entity.
If the renderer is a DictionaryRenderer and its associated DictionarySymbolStyle references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns nullptr
. If the layer has rendered and the symbol is already drawn on the view, this method returns a valid MultilayerSymbol. If you want to get the symbol before the layer is rendered, use DictionarySymbolStyle::fetchSymbolAsync.
This function was introduced in Esri::ArcGISRuntime 200.1.
[since Esri::ArcGISRuntime 200.1]
Esri::ArcGISRuntime::Symbol *Renderer::symbol(Esri::ArcGISRuntime::DynamicEntity *dynamicEntity , bool applyAttributeOverrides ) const
Returns the symbol that is used to visualize the given dynamic entity with override attributes from the renderer.
- dynamicEntity - The dynamic entity.
- applyAttributeOverrides - If set to
true
, this applies the override attributes from the renderer to the symbol.
If applyAttributeOverrides is set to true
, this method will get the symbol from the renderer and override the symbol properties with the overrides available on the renderer. These include visual variable size, color, opacity and rotation. If the override expression or attributes contain any information not known to either the renderer or dynamic entity (such as "scale"), that override will not be applied. If the override attributes are applied successfully, a symbol with overridden properties will be returned else the original symbol will be returned.
If the renderer is a DictionaryRenderer and its associated DictionarySymbolStyle references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns nullptr
. If the layer has rendered and the symbol is already drawn on the view, this method returns a valid MultilayerSymbol. If you want to get the symbol before the layer is rendered, use DictionarySymbolStyle::fetchSymbolAsync.
This function was introduced in Esri::ArcGISRuntime 200.1.
[since Esri::ArcGISRuntime 200.1]
Esri::ArcGISRuntime::Symbol *Renderer::symbol(Esri::ArcGISRuntime::DynamicEntityObservation *dynamicEntityObservation ) const
Returns the symbol that is used to visualize the given dynamic entity observation.
- dynamicEntityObservation - The dynamic entity observation.
If the renderer is a DictionaryRenderer and its associated DictionarySymbolStyle references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns nullptr
. If the layer has rendered and the symbol is already drawn on the view, this method returns a valid MultilayerSymbol. If you want to get the symbol before the layer is rendered, use DictionarySymbolStyle::fetchSymbolAsync.
This function was introduced in Esri::ArcGISRuntime 200.1.
[since Esri::ArcGISRuntime 200.1]
Esri::ArcGISRuntime::Symbol *Renderer::symbol(Esri::ArcGISRuntime::DynamicEntityObservation *dynamicEntityObservation , bool applyAttributeOverrides ) const
Returns the symbol that is used to visualize the given dynamic entity observation with override attributes from the renderer.
- dynamicEntityObservation - The dynamic entity observation.
- applyAttributeOverrides - If set to
true
, this applies the override attributes from the renderer to the symbol.
If applyAttributeOverrides is set to true
, this method will get the symbol from the renderer and override the symbol properties with the overrides available on the renderer. These include visual variable size, color, opacity and rotation. If the override expression or attributes contain any information not known to either the renderer or observation (such as "scale"), that override will not be applied. If the override attributes are applied successfully, a symbol with overridden properties will be returned else the original symbol will be returned.
If the renderer is a DictionaryRenderer and its associated DictionarySymbolStyle references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns nullptr
. If the layer has rendered and the symbol is already drawn on the view, this method returns a valid MultilayerSymbol. If you want to get the symbol before the layer is rendered, use DictionarySymbolStyle::fetchSymbolAsync.
This function was introduced in Esri::ArcGISRuntime 200.1.
Esri::ArcGISRuntime::Symbol *Renderer::symbol(Esri::ArcGISRuntime::Feature *feature) const
Returns the symbol that is used to visualize the given feature.
- feature - The feature.
If the renderer is a DictionaryRenderer and it's associated DictionarySymbolStyle references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns nullptr
. If the layer has rendered and the symbol is already drawn on the view, this method returns a valid MultilayerSymbol. If you want to get the symbol before the layer is rendered, use DictionarySymbolStyle::fetchSymbolAsync.
[since Esri::ArcGISRuntime 100.5]
Esri::ArcGISRuntime::Symbol *Renderer::symbol(Esri::ArcGISRuntime::Feature *feature, bool applyAttributeOverrides ) const
Returns the symbol that is used to visualize the given feature with override attributes from the renderer.
- feature - The feature.
- applyAttributeOverrides - boolean value if set to
true
applies the override attributes from the renderer.
If applyAttributeOverrides is set to true
, this method will get the symbol from the renderer and override the symbol properties with the overrides available on the renderer. These include visual variable size, color, opacity and rotation. If the override expression or attributes contain any information not known to either the renderer or observation (such as "scale"), that override will not be applied. If the override attributes are applied successfully, a symbol with overridden properties will be returned otherwise the original symbol will be returned.
If the renderer is a DictionaryRenderer and its associated DictionarySymbolStyle references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns nullptr
. If the layer has rendered and the symbol is already drawn on the view, this method returns a valid MultilayerSymbol. If you want to get the symbol before the layer is rendered, use DictionarySymbolStyle::fetchSymbolAsync.
This function was introduced in Esri::ArcGISRuntime 100.5.
Esri::ArcGISRuntime::Symbol *Renderer::symbol(Esri::ArcGISRuntime::Graphic *graphic) const
Returns the symbol that is used to visualize the given graphic.
- graphic - The graphic.
If the renderer is a DictionaryRenderer and its associated DictionarySymbolStyle references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns nullptr
. If the layer has rendered and the symbol is already drawn on the view, this method returns a valid MultilayerSymbol. If you want to get the symbol before the layer is rendered, use DictionarySymbolStyle::fetchSymbolAsync.
[since Esri::ArcGISRuntime 100.5]
Esri::ArcGISRuntime::Symbol *Renderer::symbol(Esri::ArcGISRuntime::Graphic *graphic, bool applyAttributeOverrides ) const
Returns the symbol that is used to visualize the given graphic with override attributes from the renderer.
- graphic - The graphic.
- applyAttributeOverrides - Boolean value if set to
true
applies the override attributes from the renderer.
If applyAttributeOverrides is set to true
, this method will get the symbol from the renderer and override the symbol properties with the overrides available on the renderer. These include visual variable size, color, opacity and rotation. If the override expression or attributes contain any information not known to either the renderer or observation (such as "scale"), that override will not be applied. If the override attributes are applied successfully, a symbol with overridden properties will be returned otherwise the original symbol will be returned.
If the renderer is a DictionaryRenderer and its associated DictionarySymbolStyle references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns nullptr
. If the layer has rendered and the symbol is already drawn on the view, this method returns a valid MultilayerSymbol. If you want to get the symbol before the layer is rendered, use DictionarySymbolStyle::fetchSymbolAsync.
This function was introduced in Esri::ArcGISRuntime 100.5.
[override virtual]
QString Renderer::toJson () const
Reimplements: JsonSerializable::toJson() const.
Returns this renderer as a JSON representation.
See also JsonSerializable.
[override virtual]
QJsonObject Renderer::unknownJson () const
Reimplements: JsonSerializable::unknownJson() const.
Returns the unknown data from the source JSON.
Unknown JSON is a QJsonObject of values not defined in the ArcGIS specification used to create this object but found in the source JSON. If the object is written back to JSON, any unknown JSON data is not persisted. The ArcGIS specification may be for a web map, web scene, REST API, and so on.
See also JsonSerializable.
[override virtual]
QJsonObject Renderer::unsupportedJson () const
Reimplements: JsonSerializable::unsupportedJson() const.
Returns the unsupported data from the source JSON.
Unsupported JSON is a QJsonObject of values defined in the ArcGIS specification used to create this object but not currently used in this API. If the object is written back to JSON, any unsupported JSON data is persisted. The ArcGIS specification may be from a web map, web scene, REST API, and so on.
[virtual, since Esri::ArcGISRuntime 200.2]
bool Renderer::operator!=(const Esri::ArcGISRuntime::Renderer *other) const
Inequality operator. Returns true
if this object and other are not equal.
This function was introduced in Esri::ArcGISRuntime 200.2.
See also Renderer::operator==.
[virtual]
bool Renderer::operator==(const Esri::ArcGISRuntime::Renderer *other) const
Returns a bool
that tests if this object is equal to a second Renderer object.
- other - The right.