16#ifndef QGSADVANCEDDIGITIZINGDOCK
17#define QGSADVANCEDDIGITIZINGDOCK
19#include "ui_qgsadvanceddigitizingdockwidgetbase.h"
110 CadConstraint( QLineEdit *
lineEdit, QToolButton *lockerButton, QToolButton *relativeButton =
nullptr, QToolButton *repeatingLockButton =
nullptr )
112 , mLockerButton( lockerButton )
113 , mRelativeButton( relativeButton )
114 , mRepeatingLockButton( repeatingLockButton )
143 double value()
const {
return mValue; }
153 void setLockMode( LockMode mode );
161 void setRepeatingLock(
bool repeating );
166 void setRelative(
bool relative );
173 void setValue(
double value,
bool updateWidget =
true );
179 QString displayValue()
const;
189 void toggleRelative();
205 void setPrecision(
int precision );
233 QLineEdit *mLineEdit =
nullptr;
234 QToolButton *mLockerButton =
nullptr;
235 QToolButton *mRelativeButton =
nullptr;
236 QToolButton *mRepeatingLockButton =
nullptr;
237 LockMode mLockMode = NoLock;
238 bool mRepeatingLock =
false;
239 bool mRelative =
false;
261 bool canvasKeyPressEventFilter( QKeyEvent *e );
306 void releaseLocks(
bool releaseRepeatingLocks =
true );
313 void keyPressEvent( QKeyEvent *e )
override;
328 void setEnabledZ(
bool enable );
334 void setEnabledM(
bool enable );
352 bool showConstructionGuides()
const;
358 bool snapToConstructionGuides()
const;
364 bool recordConstructionGuides()
const;
413 void toggleConstraintDistance();
432 void clearLockedSnapVertices(
bool force =
true );
448 void removePreviousPoint();
454 void updateCurrentPoint(
const QgsPoint &point );
462 void setPoints(
const QList<QgsPointXY> &points );
471 QgsPoint currentPointV2(
bool *exists =
nullptr )
const;
493 QgsPoint previousPointV2(
bool *exists =
nullptr )
const;
508 QgsPoint penultimatePointV2(
bool *exists =
nullptr )
const;
526 inline bool snappedToVertex()
const {
return ( mSnapMatch.isValid() && ( mSnapMatch.hasVertex() || mSnapMatch.hasLineEndpoint() ) ); }
552 void updateCadPaintItem();
562 void setX(
const QString &value, WidgetSetMode mode );
572 void setY(
const QString &value, WidgetSetMode mode );
582 void setZ(
const QString &value, WidgetSetMode mode );
592 void setM(
const QString &value, WidgetSetMode mode );
602 void setAngle(
const QString &value, WidgetSetMode mode );
612 void setDistance(
const QString &value, WidgetSetMode mode );
618 double getLineZ()
const;
624 double getLineM()
const;
636 QString formatCommonAngleSnapping(
double angle );
981 void betweenLineConstraintClicked(
bool activated );
984 void lockConstraint(
bool activate =
true );
987 void lockParameterlessConstraint(
bool activate =
true );
993 void constraintTextEdited(
const QString &textValue );
999 void constraintFocusOut();
1002 void setConstraintRelative(
bool activate );
1005 void setConstraintRepeatingLock(
bool activate );
1011 void activateCad(
bool enabled );
1014 void setConstructionMode(
bool enabled );
1017 void settingsButtonTriggered( QAction *action );
1026 void setCadEnabled(
bool enabled );
1032 void updateCapacity(
bool updateUIwithoutChange =
false );
1042 QList<QgsPointXY> snapSegmentToAllLayers(
const QgsPointXY &originalMapPoint,
bool *snapped =
nullptr )
const;
1048 bool filterKeyPress( QKeyEvent *e );
1054 bool eventFilter( QObject *obj, QEvent *event )
override SIP_SKIP;
1057 void triggerMouseMoveEvent();
1060 CadConstraint *objectToConstraint(
const QObject *obj )
const;
1071 void updateConstraintValue(
CadConstraint *constraint,
const QString &textValue,
bool convertExpression =
false );
1074 void updateUnlockedConstraintValues(
const QgsPoint &point );
1086 void resetConstructionGuides();
1092 void updateConstructionGuidesCrs();
1099 std::unique_ptr<QgsSnapIndicator> mSnapIndicator;
1103 bool mCurrentMapToolSupportsCad =
false;
1110 bool mCadEnabled =
false;
1111 bool mConstructionMode =
false;
1114 std::unique_ptr<CadConstraint> mAngleConstraint;
1115 std::unique_ptr<CadConstraint> mDistanceConstraint;
1116 std::unique_ptr<CadConstraint> mXConstraint;
1117 std::unique_ptr<CadConstraint> mYConstraint;
1118 std::unique_ptr<CadConstraint> mZConstraint;
1119 std::unique_ptr<CadConstraint> mMConstraint;
1120 std::unique_ptr<CadConstraint> mLineExtensionConstraint;
1121 std::unique_ptr<CadConstraint> mXyVertexConstraint;
1123 double mCommonAngleConstraint;
1126 bool mSnappingPrioritizeFeatures =
false;
1129 QList<QgsPoint> mCadPointList;
1130 QList<QgsPointXY> mSnappedSegment;
1132 bool mSessionActive =
false;
1135 std::unique_ptr<QgsVectorLayer> mConstructionGuidesLayer;
1138 bool mDeferredUpdateConstructionGuidesCrs =
false;
1141 std::unique_ptr<QgsMessageBarItem> mErrorMessage;
1144 QMap<double, QAction *> mCommonAngleActions;
1145 QAction *mLineExtensionAction =
nullptr;
1146 QAction *mXyVertexAction =
nullptr;
1147 QAction *mRecordConstructionGuides =
nullptr;
1148 QAction *mShowConstructionGuides =
nullptr;
1149 QAction *mSnapToConstructionGuides =
nullptr;
1150 QAction *mClearConstructionGuides =
nullptr;
1160 QQueue<QgsPointLocator::Match> mLockedSnapVertices;
1163 QPointer<QgsAdvancedDigitizingTool> mCurrentTool;
1167 bool eventFilter( QObject *obj, QEvent *event );
1172 QMenu *mCommonAngleActionsMenu =
nullptr;
1173 QMenu *mFloaterActionsMenu =
nullptr;
1177 bool mTargetLayerSupportsZ =
false;
1178 bool mTargetLayerSupportsM =
false;
CadConstraintType
Advanced digitizing constraint type.
BetweenLineConstraint
Between line constraints which can be enabled.
LineExtensionSide
Designates whether the line extension constraint is currently soft locked with the previous or next v...
Draws the graphical elements of the CAD tools (.
A widget that floats next to the mouse pointer, and allows interaction with the AdvancedDigitizing fe...
Line string geometry type, with support for z-dimension and m-values.
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
A mouse event which is the result of a user interaction with a QgsMapCanvas.
Point geometry type, with support for z-dimension and m-values.
A boolean settings entry.
Represents a vector layer which manages a vector based dataset.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference).
#define SIP_ENUM_BASETYPE(type)
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features