selectedElement property

GeometryEditorElement? selectedElement

The element that is currently selected in the GeometryEditor, or null if nothing is selected.

Clicking or tapping on the different visible elements of a GeometryEditor.geometry in a view allows you to select and unselect them. This property returns a different type of GeometryEditorElement depending on what is selected - a vertex (GeometryEditorVertex), a mid-vertex (GeometryEditorMidVertex), a part of a polygon or polyline (GeometryEditorPart), or the entire geometry (GeometryEditorGeometry). You can change which selection interactions are allowed by using the InteractionConfiguration of the GeometryEditor.tool.

You can also programmatically select specific vertices (GeometryEditor.selectVertex), mid-vertices (GeometryEditor.selectMidVertex), parts of polygons or polylines (GeometryEditor.selectPart), or the entire geometry (GeometryEditor.selectGeometry). You can clear the selection using GeometryEditor.clearSelection.

The value of GeometryEditor.selectedElement changes, raising the GeometryEditor.onSelectedElementChanged event, when:

  • performing programmatic selection - for example using GeometryEditor.selectGeometry or GeometryEditor.selectVertex
  • performing interactive selection - for example selecting or unselecting a GeometryEditorElement
  • the location of the selected element changes - for example moving the selected element programmatically or interactively
  • performing edits - for example inserting a vertex interactively or deleting the selected element programmatically

It may also change when:

Implementation

GeometryEditorElement? get selectedElement {
  final objectHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_GeometryEditor_getSelectedElement(
      _handle,
      errorHandler,
    );
  });
  return GeometryEditorElement._fromHandle(
    objectHandle,
  );
}