Class QfCoordinateLocator
ClassList > QfCoordinateLocator
Inherits the following classes: QtQuick::Item
Inherited by the following classes: CoordinateLocator
Public Properties
| Type | Name |
|---|---|
| property bool | averagedPosition |
| property int | averagedPositionCount |
| property real | crossHalfLength |
| property variant | currentCoordinate |
| property alias | currentLayer |
| property color | cursorFillColor |
| property color | cursorOutlineColor |
| property real | cursorSizeScale |
| property point | displayPosition |
| property color | highlightColor |
| property color | mainColor |
| property QgsQuickMapSettings | mapSettings |
| property variant | overrideLocation |
| property var | positionInformation |
| property bool | positionLocked |
| property variant | rubberbandModel |
| property bool | snapToCommonAngles |
| property alias | snappedCoordinate |
| property alias | snappedPoint |
| property real | snappingAngleDegrees |
| property bool | snappingIsRelative |
| property real | snappingTolerance |
| property variant | sourceLocation |
| property alias | topSnappingResult |
Public Functions
| Type | Name |
|---|---|
| void | calculateSnapToAngleLineEndCoords (currentPoint, angleDegrees, isRelativeAngle, screenSize, forwardMode=false) |
| void | flash () |
| void | getCommonAngleInDegrees (currentPoint, rubberbandModel, commonAngleStepDeg, isRelativeAngle, forwardMode=false) |
| void | getToleranceMultiplier () |
| void | snapPointToCommonAngle (currentPoint, rubberbandModel, commonAngleDegrees, isRelativeAngle, forwardMode=false) |
Public Properties Documentation
property averagedPosition
bool QfCoordinateLocator::averagedPosition;
property averagedPositionCount
int QfCoordinateLocator::averagedPositionCount;
property crossHalfLength
real QfCoordinateLocator::crossHalfLength;
Remark:
This property is read-only
property currentCoordinate
variant QfCoordinateLocator::currentCoordinate;
Remark:
This property is read-only
property currentLayer
alias QfCoordinateLocator::currentLayer;
Set the current layer on which snapping should be performed.
property cursorFillColor
color QfCoordinateLocator::cursorFillColor;
property cursorOutlineColor
color QfCoordinateLocator::cursorOutlineColor;
property cursorSizeScale
real QfCoordinateLocator::cursorSizeScale;
property displayPosition
point QfCoordinateLocator::displayPosition;
Remark:
This property is read-only
property highlightColor
color QfCoordinateLocator::highlightColor;
property mainColor
color QfCoordinateLocator::mainColor;
property mapSettings
QgsQuickMapSettings QfCoordinateLocator::mapSettings;
property overrideLocation
variant QfCoordinateLocator::overrideLocation;
Overrides any possibility for the user to modify the coordinate. There will be no user interaction or snapping if this is set to a QgsPoint. Set this to undefined to revert to the user and snapping controlled behavior.
property positionInformation
var QfCoordinateLocator::positionInformation;
Position-related information
property positionLocked
bool QfCoordinateLocator::positionLocked;
property rubberbandModel
variant QfCoordinateLocator::rubberbandModel;
property snapToCommonAngles
bool QfCoordinateLocator::snapToCommonAngles;
Snapping-related information
property snappedCoordinate
alias QfCoordinateLocator::snappedCoordinate;
Remark:
This property is read-only
property snappedPoint
alias QfCoordinateLocator::snappedPoint;
Remark:
This property is read-only
property snappingAngleDegrees
real QfCoordinateLocator::snappingAngleDegrees;
property snappingIsRelative
bool QfCoordinateLocator::snappingIsRelative;
property snappingTolerance
real QfCoordinateLocator::snappingTolerance;
property sourceLocation
variant QfCoordinateLocator::sourceLocation;
Source location for snapping. If this is set to undefined, the center of the screen will be used. Overwritten by stylus / hoverHandler.
property topSnappingResult
alias QfCoordinateLocator::topSnappingResult;
Remark:
This property is read-only
Public Functions Documentation
function calculateSnapToAngleLineEndCoords
void QfCoordinateLocator::calculateSnapToAngleLineEndCoords (
currentPoint,
angleDegrees,
isRelativeAngle,
screenSize,
forwardMode=false
)
Calculates snap to angle guide line end coordinate.
Parameters:
{QPointF}currentPoint - the current point being proposed{number}angleDegrees - angle of the line in degrees.{boolean}isRelativeAngle - whether the angle should be calculated relative to the last geometry segment{number}screenSize - size of the screen. Used to make sure the end of the line is outside the screen.{number}forwardMode - true: aimed towards first point and false: snap to previous point
function flash
void QfCoordinateLocator::flash ()
function getCommonAngleInDegrees
void QfCoordinateLocator::getCommonAngleInDegrees (
currentPoint,
rubberbandModel,
commonAngleStepDeg,
isRelativeAngle,
forwardMode=false
)
Computes the possible common angle
Parameters:
{QPointF}currentPoint - the current point being proposed{QfRubberband}rubberbandModel - holds all previously added points in the current digitizing session{number}commonAngleStepDeg - the common angle in degrees we are trying to snap to{boolean}isRelativeAngle - whether the angle should be calculated relative to the last geometry segment
Returns:
{number|undefined} - the closest common angle. Returnsundefined if there is no nearby point that forms a common angle.
Parameters:
{boolean}forwardMode - true: snap to firstPoint and false: snap to previousPoint
function getToleranceMultiplier
void QfCoordinateLocator::getToleranceMultiplier ()
Function to get the multiplier based on the selected tolerance
- Narrow tolerance (index 0) divides by 2.
- Normal tolerance (index 1) keeps unchanged.
- Large tolerance (index 2) multiplies by 4.
function snapPointToCommonAngle
void QfCoordinateLocator::snapPointToCommonAngle (
currentPoint,
rubberbandModel,
commonAngleDegrees,
isRelativeAngle,
forwardMode=false
)
Computes a new point that forms a common angle
Parameters:
{QPointF}currentPoint - the current point being proposed{QfRubberband}rubberbandModel - holds all previously added points in the current digitizing session{number}commonAngleDegrees - the common angle in degrees we are snapping to{boolean}isRelativeAngle - whether the angle should be calculated relative to the last geometry segment{boolean}forwardMode - true: snap to firstPoint and false: snap to previousPoint
Returns:
{QPointF} - the resulting snapped to common angle point. If no snapping was possible, then currentPoint is returned.
The documentation for this class was generated from the following file src/app/qml/QfCoordinateLocator.qml