RenderingRule Class

  • RenderingRule
  • class Esri::ArcGISRuntime::RenderingRule

    Represents a rendering rule created from JSON or a pre-defined one on server. More...

    Header: #include <RenderingRule.h>
    Since: Esri::ArcGISRuntime 100.1
    Inherits: Esri::ArcGISRuntime::Object

    This class was introduced in Esri::ArcGISRuntime 100.1.

    Public Functions

    RenderingRule(const Esri::ArcGISRuntime::RenderingRuleInfo &renderingRuleInfo, QObject *parent = nullptr)
    RenderingRule(const QString &renderingRuleJson, QObject *parent = nullptr)
    virtual ~RenderingRule() override
    Esri::ArcGISRuntime::RenderingRuleInfo renderingRuleInfo() const
    QString renderingRuleJson() const

    Detailed Description

    A rendering rule defines the processing that is to be done to the ArcGIS image service. An instance of this class can be created from a RenderingRuleInfo or a JSON string that specifies a service-defined or client-defined rendering rule. See {https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm}{Raster function objects} for a list of functions and the syntax for rendering rules.

    Create a RenderingRule:

    // get the rendering rule info from the service info
    RenderingRuleInfo renderingRuleInfo = m_imageServiceRaster->serviceInfo().renderingRuleInfos().at(index);
    // create a new rendering rule with the rendering rule info
    RenderingRule* renderingRule = new RenderingRule(renderingRuleInfo, this);
    // create an image service raster
    ImageServiceRaster* isr = new ImageServiceRaster(m_url, this);
    // set the rendering rule
    isr->setRenderingRule(renderingRule);

    You can see the complete code in the C++ sample Raster Rendering Rule.

    Member Function Documentation

    RenderingRule::RenderingRule(const Esri::ArcGISRuntime::RenderingRuleInfo &renderingRuleInfo, QObject *parent = nullptr)

    Constructs a RenderingRule from renderingRuleInfo

    RenderingRule::RenderingRule(const QString &renderingRuleJson, QObject *parent = nullptr)

    Constructs a RenderingRule from the raster function JSON renderingRuleJson with an optional parent.

    This is a server side raster function JSON and is different from the JSON returned by RasterFunction.

    [override virtual] RenderingRule::~RenderingRule()

    Destructor.

    Esri::ArcGISRuntime::RenderingRuleInfo RenderingRule::renderingRuleInfo() const

    Returns the RenderingRuleInfo with which this object is constructed.

    QString RenderingRule::renderingRuleJson() const

    Returns the raster function template JSON used to create this RenderingRule.

    Empty string is returned if this RenderingRule was created from a RenderingRuleInfo. This is a server side raster function JSON and not a client side RasterFunction JSON.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.