Symbol Class
Base type for symbols used to display a graphic or a feature. More...
Header: | #include <Symbol> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::JsonSerializable |
Inherited By: | Esri::ArcGISRuntime::CompositeSymbol, Esri::ArcGISRuntime::DistanceCompositeSceneSymbol, Esri::ArcGISRuntime::FillSymbol, Esri::ArcGISRuntime::LineSymbol, Esri::ArcGISRuntime::MarkerSceneSymbol, Esri::ArcGISRuntime::MarkerSymbol, and Esri::ArcGISRuntime::MultilayerSymbol |
This class was introduced in Esri::ArcGISRuntime 100.0.
Public Functions
virtual | ~Symbol() override |
Esri::ArcGISRuntime::TaskWatcher | createSwatch(const Esri::ArcGISRuntime::Geometry &geometry, float width, float height, const QColor &backgroundColor = QColor()) |
Esri::ArcGISRuntime::TaskWatcher | createSwatch(const Esri::ArcGISRuntime::Geometry &geometry, float width, float height, float screenScale, const QColor &backgroundColor = QColor()) |
Esri::ArcGISRuntime::TaskWatcher | createSwatch(float width, float height, float screenScale, const QColor &backgroundColor = QColor()) |
Esri::ArcGISRuntime::TaskWatcher | createSwatch(const QColor &backgroundColor = QColor()) |
Esri::ArcGISRuntime::TaskWatcher | createSwatch(float screenScale, const QColor &backgroundColor = QColor()) |
Esri::ArcGISRuntime::SymbolType | symbolType() const |
bool | operator==(const Esri::ArcGISRuntime::Symbol *other) const |
Reimplemented Public Functions
virtual QString | toJson() const override |
virtual QJsonObject | unknownJson() const override |
virtual QJsonObject | unsupportedJson() const override |
Signals
void | createSwatchCompleted(QUuid taskId, QImage image) |
Static Public Members
Esri::ArcGISRuntime::Symbol * | fromJson(const QString &json, QObject *parent = nullptr) |
Protected Functions
Symbol(QObject *parent = nullptr) |
Detailed Description
Symbols describe how graphics and features look on the map. Different symbols are used with different geometry types: marker symbols for point and multipoint geometries, fill symbols for polygon geometries, and line symbols for polyline geometries. Other types of 2D and 3D symbols inherit from Symbol and its subtypes to implement capabilities such as composite and dynamic symbols.
Member Function Documentation
[protected]
Symbol::Symbol(QObject *parent = nullptr)
Default constructor with an optional parent.
[signal]
void Symbol::createSwatchCompleted(QUuid taskId, QImage image)
Emitted when create swatch image operation completes successfully.
- taskId - The ID of the create swatch task.
- image - The swatch image.
[override virtual]
Symbol::~Symbol()
Destructor.
Esri::ArcGISRuntime::TaskWatcher Symbol::createSwatch(const Esri::ArcGISRuntime::Geometry &geometry, float width, float height, const QColor &backgroundColor = QColor())
Creates a swatch image using the provided geometry, width, height, and optional backgroundColor.
The background color defaults to transparent when the backgroundColor is not provided. The width, height, and geometry coordinate values are measured in device independent pixels (DIPs). This operation will determine the primary screen scale factor for scaling the image size.
Emits the createSwatchCompleted(QUuid, QImage) signal when the swatch image operation completes.
Note: The specified geometry is in DIPs, with the point {0,0} located at the centerpoint of the swatch image. The x-axis increases towards the right-hand side of the swatch image. The y-axis increases towards the top of the swatch image. For example, when creating a swatch for a MarkerSymbol, specifying a geometry of {10,10} will draw the marker 10 DIPs up and to the right of the center of the swatch. The geometry type should correspond to the symbol type. The geometry's spatial reference is ignored.
Esri::ArcGISRuntime::TaskWatcher Symbol::createSwatch(const Esri::ArcGISRuntime::Geometry &geometry, float width, float height, float screenScale, const QColor &backgroundColor = QColor())
Creates a swatch image using the provided geometry, width, height, screenScale, and optional backgroundColor.
The background color defaults to transparent when the backgroundColor is not provided. The width, height, and geometry coordinate values are measured in device independent pixels (DIPs). This operation will use the provided screenScale parameter to scale the image size.
Emits the createSwatchCompleted(QUuid, QImage) signal when the swatch image operation completes.
Note: The specified geometry is in DIPs, with the point {0,0} located at the centerpoint of the swatch image. The x-axis increases towards the right-hand side of the swatch image. The y-axis increases towards the top of the swatch image. for example, when creating a swatch for a MarkerSymbol, specifying a geometry of {10,10} will draw the marker 10 DIPs up and to the right of the center of the swatch. The geometry type should correspond to the symbol type. The geometry's spatial reference is ignored.
Esri::ArcGISRuntime::TaskWatcher Symbol::createSwatch(float width, float height, float screenScale, const QColor &backgroundColor = QColor())
Creates a swatch image using the provided width, height, screenScale, and optional backgroundColor.
The background color defaults to transparent when the backgroundColor is not provided. The width, and height are measured in device independent pixels (DIPs). This operation will use the provided screenScale parameter to scale the image size.
Emits the createSwatchCompleted(QUuid, QImage) signal when the swatch image operation completes.
This function was introduced in Esri::ArcGISRuntime 100.3.
Esri::ArcGISRuntime::TaskWatcher Symbol::createSwatch(const QColor &backgroundColor = QColor())
Creates a swatch image using the optional backgroundColor.
The background color defaults to transparent when the backgroundColor is not provided. This operation will determine the primary screen scale factor for scaling the image size.
Emits the createSwatchCompleted(QUuid, QImage) signal when the swatch image operation completes.
Esri::ArcGISRuntime::TaskWatcher Symbol::createSwatch(float screenScale, const QColor &backgroundColor = QColor())
Creates a swatch image using the provided screenScale, and optional backgroundColor.
The background color defaults to transparent when the backgroundColor is not provided. This operation will use the provided screenScale parameter to scale the image size.
Emits the createSwatchCompleted(QUuid, QImage) signal when the swatch image operation completes.
[static]
Esri::ArcGISRuntime::Symbol *Symbol::fromJson(const QString &json, QObject *parent = nullptr)
Creates and returns a new Symbol from the provided json, with an optional parent.
Sizes of symbols in JSON are represented in points (not pixels).
Symbol layers in a multilayer symbol are in reverse order of how they appear in the JSON representation.
For Symbols of type MarkerSymbol, an angle set from JSON will be inverted (e.g. an angle of 20 will become -20).
See also JsonSerializable.
Esri::ArcGISRuntime::SymbolType Symbol::symbolType() const
Returns the symbol type.
[override virtual]
QString Symbol::toJson() const
Reimplements: JsonSerializable::toJson() const.
Returns this Symbol as a JSON representation.
Sizes of symbols in JSON are represented in points (not pixels).
Symbol layers in a multilayer symbol are in reverse order of how they appear in the JSON representation.
See also JsonSerializable.
[override virtual]
QJsonObject Symbol::unknownJson() const
Reimplements: JsonSerializable::unknownJson() const.
Gets the unknown JSON of this object.
See also JsonSerializable.
[override virtual]
QJsonObject Symbol::unsupportedJson() const
Reimplements: JsonSerializable::unsupportedJson() const.
Gets the unsupported JSON of this object.
See also JsonSerializable.
bool Symbol::operator==(const Esri::ArcGISRuntime::Symbol *other) const
Equivalency operator.
Returns whether this object and other are equal.