A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-snaprules.html below:

SnapRules Class | ArcGIS Maps SDK for Qt

Detailed Description

When using the GeometryEditor to edit the geometry of features that participate in a utility network, rule-based snapping can be configured on SnapSettings. Utility networks rely on geometric coincident-based connectivity to provide pathways for resources, and snapping can be a useful tool to help maintain those pathways. A utility network contains rules for connectivity, and using rule-based snapping respects the rules for the specific feature type being edited, based on its asset type and asset group, helping maintain network connectivity.

To use rule-based snapping to edit a specific UtilityAssetType:

  1. Connect a GeometryEditor to the map view, and ensure the MapView::map is set and contains the pertinent utility network(s).
  2. Get the UtilityNetwork that you will be working with.
  3. Create a SnapRules object appropriate for use with the utility network and asset type you will edit:
  4. Get the GeometryEditor::snapSettings, and ensure SnapSettings::isEnabled and SnapSettings::isFeatureSnappingEnabled are true.
  5. Call SnapSettings::syncSourceSettings(SnapRules*, SnapSourceEnablingBehavior), passing in the snap rules you created previously, and SnapSourceEnablingBehavior::SetFromRules.
  6. Call GeometryEditor::start(const Geometry&) passing in the GeoElement::geometry of the feature you wish to edit, or GeometryEditor::start(GeometryType) if you have no initial geometry.
  7. When edits are complete, set the feature geometry with the result of GeometryEditor::stop.

After calling SnapSettings::syncSourceSettings(Esri::ArcGISRuntime::SnapRules*, Esri::ArcGISRuntime::SnapSourceEnablingBehavior), each SnapSourceSettings in SnapSettings::sourceSettings is configured with the appropriate SnapSourceSettings::ruleBehavior based on the connectivity rules specified in the utility network. For details, see SnapRuleBehavior.

Ensure that your UtilityNetwork and the layers in the map that you will snap to use the same feature tables. For more information, see createAsync(Esri::ArcGISRuntime::UtilityNetwork*, Esri::ArcGISRuntime::UtilityAssetType*, QObject*).

Utility network features are z-aware - each feature geometry includes z-values (Geometry::hasZ is true). Two points, or vertices, are geometrically coincident when the x, y, and z-values of the points or vertices are equal. When you configure rule-based snapping, by calling SnapSettings::syncSourceSettings(Esri::ArcGISRuntime::SnapRules*, Esri::ArcGISRuntime::SnapSourceEnablingBehavior), any edits made using snapping will use the z-value of the feature geometry from the SnapSource, if that snap source geometry is z-aware. If multiple snap candidates exist at the same location, then the default z-value is used instead.

{SnapSettings::syncSourceSettings(Esri::ArcGISRuntime::SnapRules*, Esri::ArcGISRuntime::SnapSourceEnablingBehavior)}, {Esri::ArcGISRuntime::SnapSettings} {SnapSettings}, {Esri::ArcGISRuntime::SnapSource} {SnapSource}, {Esri::ArcGISRuntime::UtilityNetwork} {UtilityNetwork}, {Esri::ArcGISRuntime::UtilityAssetType} {UtilityAssetType}, {https://pro.arcgis.com/en/pro-app/latest/help/data/utility-network/network-rules.htm} {Network Rules ArcGIS Pro help topic}.

Member Function Documentation [override virtual noexcept] SnapRules::~SnapRules()

Destructor.

[static] QFuture<Esri::ArcGISRuntime::SnapRules *> SnapRules::createAsync(Esri::ArcGISRuntime::UtilityNetwork *utilityNetwork, Esri::ArcGISRuntime::UtilityAssetType *assetType, QObject *parent = nullptr)

Analyzes a UtilityNetwork for the rules which allow or limit the snapping of the given UtilityAssetType to other features, and returns a SnapRules which can be used to configure interactive snapping behavior in a GeometryEditor.

To configure rule-based snapping, use this method to create a SnapRules that you can then pass to SnapSettings::syncSourceSettings(Esri::ArcGISRuntime::SnapRules*, Esri::ArcGISRuntime::SnapSourceEnablingBehavior). This method is ideal for creating SnapRules when you have a reference to the UtilityAssetType, for example if you have identified an existing feature to be edited, you can call UtilityNetwork::createElementWithArcGISFeature(ArcGISFeature*, UtilityTerminal*, QObject*), then get UtilityElement::assetType to pass in.

Ensure that the feature tables underlying the given UtilityNetwork are the same used by operational layers in the map, so that the SnapRules are based on the same underlying data sets.

If your map view displays a web map, or is set from a MobileMapPackage, the Map::utilityNetworks collection may already contain the relevant utility network object to use. Alternatively you may get the utility network from the same Geodatabase that backs your operational layers, or call UtilityNetwork::UtilityNetwork(const QUrl&, Esri::ArcGISRuntime::Map*, QObject*) to create the network from a feature service URL and associate it with your Map.

Ensure that the UtilityAssetType is from the given UtilityNetwork.

This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

See Working with QFuture for further details.

{SnapSettings::syncSourceSettings(Esri::ArcGISRuntime::SnapRules*, Esri::ArcGISRuntime::SnapSourceEnablingBehavior)}, {Esri::ArcGISRuntime::UtilityConnectivityPolicy} {UtilityConnectivityPolicy}

See also Esri::ArcGISRuntime::SnapSettings::syncSourceSettings(Esri::ArcGISRuntime::SnapRules*, Esri::ArcGISRuntime::SnapSourceEnablingBehavior).

[static] QFuture<Esri::ArcGISRuntime::SnapRules *> SnapRules::createAsync(Esri::ArcGISRuntime::UtilityNetwork *utilityNetwork, Esri::ArcGISRuntime::FeatureTable *featureTable, const QVariantMap &attributes, QObject *parent = nullptr)

Analyzes a UtilityNetwork for the rules which allow or limit the snapping of a feature in the given featureTable with the given attributes, and returns a SnapRules which can be used to configure interactive snapping behavior in a GeometryEditor.

To configure rule-based snapping, use this method to create a SnapRules that you can then pass to SnapSettings::syncSourceSettings(Esri::ArcGISRuntime::SnapRules*, Esri::ArcGISRuntime::SnapSourceEnablingBehavior). This method is ideal for creating SnapRules where you have a set of attributes, for example, if you are creating a new feature from a FeatureTemplate. Connectivity rules involving the UtilityAssetType of the feature are described by those attributes are included in the resulting rules.

Ensure that the feature tables underlying the given UtilityNetwork are the same used by operational layers in the map, so that the SnapRules are based on the same underlying data sets.

If your map view displays a web map, or is set from a MobileMapPackage, the Map::utilityNetworks collection may already contain the relevant utility network object to use. Alternatively you may get the utility network from the same Geodatabase that backs your operational layers, or call UtilityNetwork::UtilityNetwork(const QUrl&, Esri::ArcGISRuntime::Map*, QObject*) to create the network from a feature service URL and associate it with your Map.

This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

See Working with QFuture for further details.

Note: The keys of the attributes dictionary will be treated as case-insensitive.

See Internal data structures with case-insensitive string keys for further details.

See also SnapSettings::syncSourceSettings(Esri::ArcGISRuntime::SnapRules*, Esri::ArcGISRuntime::SnapSourceEnablingBehavior) and UtilityConnectivityPolicy.

Esri::ArcGISRuntime::SnapRuleBehavior SnapRules::ruleBehavior(Esri::ArcGISRuntime::SnapSource *source) const

Returns the applicable SnapRuleBehavior for the given SnapSource.

This method can be used to check SnapRuleBehavior of a valid SnapSource directly, without needing to synchronize the SnapSettings::sourceSettings collection on SnapSettings and get SnapSourceSettings::ruleBehavior.

See also SnapSourceSettings::ruleBehavior.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4