Allows you to edit geometries in a GeometryEditor using a GeometryEditorReticle, ideal for precise editing with snapping on a touch screen with a fully customizable user experience. More...
| Header | #include <Programmatic |
| Since | Esri |
| Inherits | Esri |
Public Functions
| Programmatic | |
| bool | is |
| void | pick |
| void | place |
| bool | select |
| void | set |
Detailed Description
The ProgrammaticReticleTool provides precise, vertex-based geometry editing on touch devices using the GeometryEditor with a fully customizable user experience. Unlike the ReticleVertexTool, the ProgrammaticReticleTool has no Esri::ArcGISRuntime::ReticleInteractionConfigurationåå {ReticleInteractionConfiguration} to define the effect of tap interactions. Tap interactions have no effect and are not handled by this tool. Instead, the programmatic methods can be called when required to give granular control for custom workflows such as those using buttons or other triggers.
For a geometry with curve segments (Geometry::hasCurves is true), pickUpSelectedElement and placeElementAtReticle can be used to move start or end vertices of curve segments to reshape them. Using placeElementAtReticle to create new segments always creates line segments. Use GeometryEditor::replaceGeometry(const Esri::ArcGISRuntime::Geometry&) instead to make specific curve segment edits.
To provide the ability to programmatically move, resize, and rotate whole geometries, or parts of multipart geometries, you can use the programmatic calls on the GeometryEditor such as GeometryEditor::rotateSelectedElement(double, const Esri::ArcGISRuntime::Point&), GeometryEditor::moveSelectedElement(const Esri::ArcGISRuntime::Point&) and GeometryEditor::scaleSelectedElement(double, double, const Esri::ArcGISRuntime::Point&).
Relevant samples:
- Edit geometries with programmatic reticle tool: Use the Programmatic Reticle Tool to edit and create geometries with programmatic operations to facilitate customized workflows such as those using buttons rather than tap interactions.
Member Function Documentation
[explicit] ProgrammaticReticleTool::ProgrammaticReticleTool (QObject *parent = nullptr)
Create a new ProgrammaticReticleTool.
- parent - The optional parent QObject.
bool ProgrammaticReticleTool::isVertexCreationPreviewEnabled () const
Returns true if the vertex feedback under reticle and snap feedback is visible when creating a new vertex, false otherwise.
The default value is true. When false, vertex feedback under the reticle, visual snap feedback, snap haptics and GeometryEditor::snapChanged events will be disabled when GeometryEditor::pickedUpElement is empty. Feedback will still occur when inserting a new vertex by picking up an existing mid-vertex.
See also GeometryEditor::snapSettings and SnapSettings::isHapticFeedbackEnabled.
void ProgrammaticReticleTool::pickUpSelectedElement ()
Picks up the currently selected element if the element is a GeometryEditorVertex or GeometryEditorMidVertex.
A picked up element can be moved by panning the map underneath the ReticleTool::reticle, with optional snapping, and placed using placeElementAtReticle.
void ProgrammaticReticleTool::placeElementAtReticle ()
Inserts a new GeometryEditorVertex or drops the currently picked up element at the position of the reticle.
When the GeometryEditor::pickedUpElement is not empty, this will drop the picked up element at the reticle position. When the GeometryEditor::pickedUpElement is empty, this will insert a new vertex at the reticle position.
When GeometryEditor::pickedUpElement is not empty and adjacent segment(s) are curve segments (Segment::isCurve = true), this will move the vertex and reshape the curve segments. When GeometryEditor::pickedUpElement is empty and this method inserts a new vertex, the adjacent segments will always be line segments (LineSegment).
bool ProgrammaticReticleTool::selectElementAtReticle ()
Returns selects an element at the current position of the reticle.
If called when the reticle is not over a vertex or mid-vertex this will return false even if a GeometryEditor::selectedElement already exists. Selection will not be cleared.
If called when a GeometryEditor::pickedUpElement exists this will return false and the selection will not be changed.
If called when the reticle is over a geometry segment or fill, this will return false and not select anything and existing selections will not be cleared.
void ProgrammaticReticleTool::setVertexCreationPreviewEnabled (bool vertexCreationPreviewEnabled )
Sets the vertexCreationPreviewEnabled to vertexCreationPreviewEnabled.
See also isVertexCreationPreviewEnabled.